In an earlier post I calculated the probability of a random five-digit number having two of the same digit next to each other. The odds were 40%. The question was inspired by our ticketing system at work, where I had three tickets with doubled digits in their numbers, so let's calculate the odds of that happening.
To find the odds of having three tickets out of three with doubled digits, we multiply the probability of getting one such ticket three times:
To calculate the odds of having three out of four such numbers, we have to take into account the order of events. For example, given we have one doubled-digit number and one non-doubled-digit number, there are two ways we could have arrived in that state: we got the doubled-digit number first, or we got it second. Thus, the probability of having one doubled-digit number out of two is 4/10 × 6/10 × 2 = 48/100 = 48%. When we have three out of four such numbers, there are four possible orders, one for each position the non-doubled-digit number could have been taken in. The probability is then
To have three of five such numbers, there are 10 possible orderings, and for three of six there are 20. You can write out permutations by hand and count them (I did), but it's easier and faster to use the binomial coefficient:
Therefore, to answer my original question of the probability of having 3 doubled-digit numbers out of 6,
Here's a table of some probabilities:
Doubled-digit numbers (40%) | Non-doubled-digit numbers (60%) | |||||||||||
% | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | |
0 | 100.0 | 60.0 | 36.0 | 21.6 | 13.0 | 7.8 | 4.7 | 2.8 | 1.7 | 1.0 | 0.6 | |
1 | 40.0 | 48.0 | 43.2 | 34.6 | 25.9 | 18.7 | 13.1 | 9.0 | 6.0 | 4.0 | 2.7 | |
2 | 16.0 | 28.8 | 34.6 | 34.6 | 31.1 | 26.1 | 20.9 | 16.1 | 12.1 | 8.9 | 6.4 | |
3 | 6.4 | 15.4 | 23.0 | 27.6 | 29.0 | 27.9 | 25.1 | 21.5 | 17.7 | 14.2 | 11.1 | |
4 | 2.6 | 7.7 | 13.8 | 19.4 | 23.2 | 25.1 | 25.1 | 23.6 | 21.3 | 18.4 | 15.5 | |
5 | 1.0 | 3.7 | 7.7 | 12.4 | 16.7 | 20.1 | 22.1 | 22.7 | 22.1 | 20.7 | 18.6 | |
6 | 0.4 | 1.7 | 4.1 | 7.4 | 11.1 | 14.7 | 17.7 | 19.7 | 20.7 | 20.7 | 19.8 | |
7 | 0.2 | 0.8 | 2.1 | 4.2 | 7.0 | 10.1 | 13.1 | 15.7 | 17.7 | 18.9 | 19.3 | |
8 | 0.1 | 0.4 | 1.1 | 2.3 | 4.2 | 6.6 | 9.2 | 11.8 | 14.2 | 16.1 | 17.3 | |
9 | 0.0 | 0.2 | 0.5 | 1.2 | 2.4 | 4.1 | 6.1 | 8.4 | 10.7 | 12.8 | 14.6 | |
10 | 0.0 | 0.1 | 0.2 | 0.6 | 1.4 | 2.4 | 3.9 | 5.7 | 7.7 | 9.8 | 11.7 |
Cells are shaded darker where outcomes are more probable. There's a diagonal trend, but it isn't on the diagonal of the table, rather it angles slightly toward having more non-doubled-digit numbers than doubled-digit numbers, due to the higher probability of getting a non-doubled-digit number. Since there are 4 in 10 odds of getting a non-doubled-digit number, the most likely outcomes are those that produce closest to 40% doubled-digit numbers. For some given counts of numbers, here are the most likely scenarios:
Total numbers | Most likely number of doubled-digit numbers | Probability |
---|---|---|
1 | 0 | 60.0% |
2 | 1 | 48.0% |
3 | 1 | 43.2% |
4 | 1, 2 | 34.6% |
5 | 2 | 34.6% |
6 | 2 | 31.1% |
7 | 3 | 29.0% |
8 | 3 | 27.9% |
9 | 3, 4 | 25.1% |
10 | 4 | 25.1% |
So when I had 3 of 6 tickets with doubled-digit numbers, I had the second most likely scenario (after 2 of 6), with a 27.6% likelihood.