
Patrick B. answered 04/01/20
Math and computer tutor/teacher
(1) 10/36 = 5/18
(2) 26^3/ 36^3 = (26/36)^3 = (13/18) ^3
(3) 1/36^6
Kim V.
asked 04/01/20In a password, there are 6 characters. The characters can be any 10 digits or 26 lowercase letters. Repetition is allowed, order does not matter.
1.) What is the probability that the first character is a digit?
2.) What is the probability that the first three characters are lowercase letters?
3.) What is the probability that the ID is "abcdef"
4.) What is the probability that the first two characters are 76 in that order but there is NOT a 7 or a 6 in the next four characters?
Patrick B. answered 04/01/20
Math and computer tutor/teacher
(1) 10/36 = 5/18
(2) 26^3/ 36^3 = (26/36)^3 = (13/18) ^3
(3) 1/36^6
Ryan S. answered 04/01/20
BS, Electrical Engineering/Computer Science, Mathematical Econ. (2020)
Let's define the password to be a joint set of discrete random variables:
c ≡ (c1, c2, c3, c4, c5, c6),
Where each ci is independent of all other cj variables (the value of one character doesn't affect the value of the other, since repetition is allowed). Then, assuming every character is equally likely to appear, let each ci be a uniform distribution over the 10 digits and 26 lowercase characters.
I. What is the probability that the first character is a digit? For this, since the distribution over c1 is uniform, this is the ratio of the number of digit values c1 can take on divided by the total number of values c1 can take on:
p(c1 = "digit") = 10 / (10 + 26) = 10 / 36 = 5 / 18.
II. What is the probability that the first three characters are lowercase letters? Since these variables are independent of each other, we can break this probability over all three characters into a product of probabilities of the individual characters:
p(c{1, 2, 3} = "all lowercase") = p(c1 = "lowercase") x p(c2 = "lowercase") x p(c3 = "lowercase")
= (1 / 36) x (1 / 36) x (1 / 36) = (1 / 36)3
*NOTE: We can only break this joint probability up into a product of marginal (single-variable) probabilities because the random variables are independent of one another. More generally, if you have N independent variables, we can write the joint probability of all these variables as:
p(x1, ..., xN) = p(x1) x p(x2) ... x p(xN)
III. What is the probability that the ID is "abcdef"? Note: Here I am assuming the order of the ID matters. Although we're trying to find the probability of an entire sequence, we can really think about the probability of this event occurring as the product of probabilities over each of the characters:
,,
p(x{1, 2, 3, 4, 5, 6} = "abcdef")order = p(x1 = "a") x p(x2 = "b") p(x3 = "c") x p(x4 = "d") x p(x5 = "e") x p(x6 = "f")
= (1 / 36) x (1 / 36) x (1 / 36) x (1 / 36) x (1 / 36) x (1 / 36)
= (1 / 36)6
If the order doesn't matter in the problem above, we can solve this by calculating all the possible combinations of letters that generate "abcdef". This means the first character can be any of these six lowercase letters, the second character can be any of the five lowercase characters that are in the original six characters that generate ("abcdef") but not equal to the first character, ..., and the last character must be the original character that the other five characters aren't equal to. This can be calculated as:
p(x{1, 2, 3, 4, 5, 6} = "abcdef")unorder = p(x1 = "any of 6") x p(x2 = "any of 5") p(x3 = "any of 4") x p(x4 = "any of 3") x p(x5 = "any of 2") x p(x6 = "any of 1")
= (6 / 36) x (5 / 36) x (4 / 36) x (3 / 36) x (2 / 36) x (1 / 36)
= (6 x 5 x 4 x 3 x 2 x 1 / (36)6)
Fun fact: This answer is equal to the probability of a combination (1 / 36)6 times the number of ways we can permute this sequence of numbers (6 x 5 x 4 x 3 x 2 x 1 = 720).
IV. What is the probability that the first two characters are 76 in that order but there is NOT a 7 or a 6 in the next four characters? Similarly, we can calculate this probability by breaking this joint probability into a product of marginal probabilities:
p(x{1, 2} = 76, x{3, 4, 5, 6} ≠ 6, x{3, 4, 5, 6} ≠ 7) = p(x1 = 7) x p(x2 = 6) x p(x3 ≠ 6, 7) x p(x4 ≠ 6, 7) x
p(x5 ≠ 6, 7) x p(x6 ≠ 6, 7)
= (1 / 36) x (1/ 36) x (34 / 36) x (34 / 36) x (34 / 36) x (34 / 36)
= (1 / 36)2 (34 / 36)4
Hope this helps!
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.