A curiosity journal of math, physics, programming, astronomy, and more.

Probability of multiple numbers with doubled digits

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:

left-parenthesis four tenths right-parenthesis cubed equals StartFraction 64 Over 1000 EndFraction equals 6.4 percent-sign

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

left-parenthesis four tenths right-parenthesis cubed dot six tenths dot 4 equals StartFraction 1536 Over 10 Superscript 4 Baseline EndFraction equals 15.36 percent-sign

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:

StartBinomialOrMatrix n Choose k EndBinomialOrMatrix equals StartFraction n factorial Over k factorial left-parenthesis n minus k right-parenthesis factorial EndFraction

Therefore, to answer my original question of the probability of having 3 doubled-digit numbers out of 6,

StartLayout 1st Row 1st Column left-parenthesis four tenths right-parenthesis cubed left-parenthesis six tenths right-parenthesis cubed StartBinomialOrMatrix 6 Choose 3 EndBinomialOrMatrix 2nd Column equals left-parenthesis four tenths right-parenthesis cubed left-parenthesis six tenths right-parenthesis cubed dot 20 2nd Row 1st Column Blank 2nd Column equals StartFraction 276480 Over 10 Superscript 6 Baseline EndFraction 3rd Row 1st Column Blank 2nd Column equals 27.648 percent-sign EndLayout

Here's a table of some probabilities:

Doubled-digit
numbers (40%)
Non-doubled-digit numbers (60%)
%012345678910
0100.060.036.021.613.07.84.72.81.71.00.6
140.048.043.234.625.918.713.19.06.04.02.7
216.028.834.634.631.126.120.916.112.18.96.4
36.415.423.027.629.027.925.121.517.714.211.1
42.67.713.819.423.225.125.123.621.318.415.5
51.03.77.712.416.720.122.122.722.120.718.6
60.41.74.17.411.114.717.719.720.720.719.8
70.20.82.14.27.010.113.115.717.718.919.3
80.10.41.12.34.26.69.211.814.216.117.3
90.00.20.51.22.44.16.18.410.712.814.6
100.00.10.20.61.42.43.95.77.79.811.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
1060.0%
2148.0%
3143.2%
41, 234.6%
5234.6%
6231.1%
7329.0%
8327.9%
93, 425.1%
10425.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.