Lajcsi and Pali are discussing how often in lottery draws three numbers contain the same digit. After a brief calculation, Lajcsi says, "Out of 100 draws, on average, nearly 7 will have at least three numbers containing the digit 8." To this, Pali replies, "I once made a mistake in a similar calculation and I think you are also rushing, oversimplifying the thought process. The result will be fewer!" - What is the truth in this matter? How could Lajcsi have calculated:1 1[^0]

[^0]:    ${ }^{1}$ We recommend to the contestants the note attached to problem 1227, K. M. L. 27 (1963/12) p. 205.
In the lottery, the numbers 1, 2, ..., 90 contain the digit 8 in the tens place 10 times, and in the units place 9 times: $80, 81, \ldots, 89$, and $8, 18, 28, \ldots, 88$. The number 88 belongs to both groups, so the total number of lottery numbers containing the digit 8 is $10 + 9 - 1 = 18$.

Drawing at least three 8s means that out of the 5 drawn numbers, 3, 4, or all 5 contain the digit 8. We determine the number of such cases $N_{3}, N_{4}, N_{5}$ separately.

In the first case, 3 of the drawn numbers are from the 18 numbers mentioned, and the remaining 2 are from the 72 numbers that do not contain the digit 8. The first of these 3 can be chosen in 18 ways, the second in 17 ways from the remaining, and the third in 16 ways. The resulting $18 \cdot 17 \cdot 16$ triplets include each triplet in every possible order, but in the lottery draw, the order of drawing does not matter. Since 3 different elements can be arranged in $3 \cdot 2$ ways (choosing any one of the 3 as the first, and the remaining two in 2 ways), we get the number of distinct combinations by dividing:

$$
\frac{18 \cdot 17 \cdot 16}{3 \cdot 2}
$$

Similarly, the number of distinct pairs of numbers not containing the digit 8, and the total number of draws in this case:

$$
\frac{72 \cdot 71}{2}, \quad N_{3}=\frac{18 \cdot 17 \cdot 16}{3 \cdot 2} \cdot \frac{72 \cdot 71}{2}=2085696
$$

For the cases where 4 or 5 numbers contain the digit 8, we have:

$$
\begin{aligned}
& N_{4}=\frac{18 \cdot 17 \cdot 16 \cdot 15}{4 \cdot 3 \cdot 2} \cdot 72=220320, \quad \text { and } \\
& N_{5}=\frac{18 \cdot 17 \cdot 16 \cdot 15 \cdot 14}{5 \cdot 4 \cdot 3 \cdot 2}=8568
\end{aligned}
$$

Finally, the total number of 5-number draws from 90 numbers, regardless of the digit 8, is:

$$
N=\frac{90 \cdot 89 \cdot 88 \cdot 87 \cdot 86}{5 \cdot 4 \cdot 3 \cdot 2}=43949268
$$

Thus, the fraction of all possible draws where at least three numbers contain the digit 8 is $\left(N_{3}+N_{4}+N_{5}\right) / N$, and the average number of such draws out of 100 is:

$$
\frac{100\left(N_{3}+N_{4}+N_{5}\right)}{N}=\frac{231458400}{43949268} \approx 5.3
$$

Therefore, Pali's caution was justified.

Although Lajcsi's quick calculation could have been wrong in several ways, we can assume he thought as follows: after selecting 3 numbers containing the digit 8, the remaining 2 are chosen from the remaining 87 numbers, so the total number of such draws, and the average number out of 100, are:

$$
N_{3}^{*}=\frac{18 \cdot 17 \cdot 16}{3 \cdot 2} \cdot \frac{87 \cdot 86}{2}=3052656, \text { and } \frac{100 N_{3}^{*}}{N} \approx 6.9
$$

as Lajcsi claimed. This is incorrect because he counted some draws multiple times, where more than 3 numbers contain the digit 8. If the numbers $A, B, C, D, E$ contain the digit 8 and $X$ does not, then the draw $A, B, C, D, X$ was counted 4 times by Lajcsi, as $A, B, C$, and $D$ were each considered as the "fourth" number from the "other 87" numbers, and the draw $A, B, C, D, E$ was counted 10 times, because the 2 additional numbers from the 87 can be chosen in $5 \cdot 4 / 2$ ways. Indeed, $N_{3}+4 N_{4}+10 N_{5}=N_{3}^{*}$.

Deák István (Budapest, Vörösmarty M. g. IV. o. t.)

Note. In the 400 draws of the Hungarian lottery up to October 30, 1964, 13 draws were of the $N_{3}$ type and 6 were of the $N_{4}$ type, but no draw was of the $N_{5}$ type. Comparing these with the expected numbers $400 N_{3} / N \approx 19$, $400 N_{4} / N \approx 2$, and $400 N_{5} / N \approx 0.1$, the observed data shows a deviation of one downward and one upward, and for the "at least 3" case, there is a shortage of 2 compared to the expected $4 \cdot 5.3 \approx 21$, which is a good match considering the short length of the 400-draw sequence.