We roll a die 10 times. What is the probability that any three consecutive rolls will be $1, 2, 3$?
Let $A_{i}$ represent the number of sequences of rolls in which the sequence $1,2,3$ appears exactly $i$ times consecutively. ( $0 \leq i \leq 3$, because in 10 rolls, this sequence can appear at most 4 times.)

The total number of all possible rolls - since each roll can result in 6 different outcomes -

$$
6^{10}=A_{0}+A_{1}+A_{2}+A_{3}
$$

Now consider a sequence of three consecutive rolls, and assume their values are $1,2,3$. The other 7 rolls can be anything, so the number of such sequences is $6^{7}$. The position of the three fixed rolls can be chosen in 8 different ways, because the first element can be any of the first eight rolls. The $8 \cdot 6^{7}$ sequences we have counted include each sequence exactly as many times as the sequence $1,2,3$ appears in it, so

$$
8 \cdot 6^{7}=A_{1}+2 A_{2}+3 A_{3}
$$

Now consider the sequences of rolls in which the sequence $1,2,3$ appears exactly twice at fixed positions. The remaining four rolls can be anything, so there are $6^{4}$ possibilities. To determine how many ways the two fixed sequences of $1,2,3$ can be placed, imagine combining each sequence of three into a single element. This way, we are determining the order of two combined sequences of three and four "normal" rolls. We need to choose 2 out of 6 positions for the combined sequences, which can be done in $\binom{6}{2}=15$ ways.

The $15 \cdot 6^{4}$ sequences include each sequence exactly once that contains the sequence $1,2,3$ exactly twice and three times as many that contain it three times, so

$$
15 \cdot 6^{4}=A_{2}+3 A_{3}
$$

Finally, consider the sequences of rolls in which the sequence $1,2,3$ appears exactly three times. Similarly to the previous cases, we find that the positions of the three sequences can be chosen in $\binom{4}{3}=4$ ways, and the remaining single roll can be any of 6 outcomes, so the number of such sequences is $4 \cdot 6$, or

$$
4 \cdot 6=A_{3}
$$

Based on equations (2), (3), and (4), the number of sequences in which the sequence $1,2,3$ appears consecutively is

$$
A_{1}+A_{2}+A_{3}=\left(A_{1}+2 A_{2}+3 A_{3}\right)-\left(A_{2}+3 A_{3}\right)+A_{3}=8 \cdot 6^{7}-15 \cdot 6^{4}+4 \cdot 6=2220072
$$

The desired probability is

$$
P=\frac{2220072}{6^{10}} \approx 0.0367
$$

Thus, on average, out of approximately 27 sequences of 10 rolls, one will contain the sequence $1,2,3$ consecutively.

$$
\text { Brezovich László (Szombathely, Nagy Lajos Gimn., III. o.t.) }
$$

Remarks. 1. In the solution, we have calculated a special case of the so-called logical sieve formula. One of its forms states that if $H_{1}, H_{2}, \ldots, H_{n}$ are finite sets, then

$$
\begin{gathered}
\left|H_{1} \cup \cdots \cup H_{n}\right|=\sum_{1 \leq i \leq n}\left|H_{i}\right|-\sum_{1 \leq i<j \leq n}\left|H_{i} \cap H_{j}\right|+\sum_{1 \leq i<j<k \leq n}\left|H_{i} \cap H_{j} \cap H_{k}\right|-+\ldots \\
\cdots+(-1)^{n-1}\left|H_{1} \cap H_{2} \cap \ldots H_{n}\right|
\end{gathered}
$$

Using this, it can be proven that the number of sequences of $n$ rolls in which some three consecutive rolls are $1,2,3$ is

$$
\sum_{k=1}^{[n / 3]}\binom{n-2 k}{k} 6^{n-3 k}
$$

2. Some contestants tried to calculate the number of sequences of rolls in which the sequence $1,2,3$ appears using the following - incorrect - method: "The position of the sequence can be 8 different ways, and each of the other 7 rolls can be 6 different ways, which totals $8 \cdot 6^{7}$ possibilities." This method is incorrect because it counts sequences multiple times where the sequence $1,2,3$ appears more than once. We did not award points for such solutions.