19. Strict Backgammon (5 p. 10-11). A fair die is rolled many times. It is known that at some point the sum of the points became exactly 2010. Find the expected number of rolls made by this point.
Solution. First method. Let event $A_{n}$ be "the sum of points is $n$", and $X_{n}$ be the number of rolls made to achieve this. We consider event $A_{n}$ as already having occurred, and we are interested in the expectation $\mathrm{E} X_{n}$. Let, as before,

$$
I_{k}=\left\{\begin{array}{l}
1, \text { if the first roll gives } k \text { points, } \\
0 \text { otherwise. }
\end{array}\right.
$$

Now the probability of the event ( $\left.I_{k}=1\right)$ is conditional

$$
\mathrm{P}\left(I_{k}=1\right)=\mathrm{P}\left(B_{k} \mid A_{n}\right)=\frac{\mathrm{P}\left(B_{k} \cap A_{n}\right)}{\mathrm{P}\left(A_{n}\right)}=\frac{\mathrm{P}\left(B_{k} \cap A_{n-k}\right)}{\mathrm{P}\left(A_{n}\right)},
$$

where event $B_{k}$ is "the first roll gives $k$ points", and event $A_{n-k}$ is "the sum of points is $n-k$" (for all rolls except the first).

Events $B_{k}$ and $A_{n-k}$ relate to different rolls and are therefore independent:

$$
\mathrm{P}\left(I_{k}=1\right)=\frac{\mathrm{P}\left(B_{k}\right) \cdot \mathrm{P}\left(A_{n-k}\right)}{\mathrm{P}\left(A_{n}\right)}=\frac{\mathrm{P}\left(A_{n-k}\right)}{6 \mathrm{P}\left(A_{n}\right)} .
$$

Let the quantity $X_{n-k}$ be the number of rolls, starting from the second, that give a sum of $n-k$. As before,

$$
X_{n}=\sum_{k=1}^{6} X_{n-k} I_{k}+1
$$

Random variables $X_{n-k}$ and $I_{k}$ are still independent, as they relate to different series of rolls. Therefore, transitioning to expectations, we get:

$$
\mathrm{E} X_{n}=\sum_{k=1}^{6} \mathrm{E} X_{n-k} \cdot \mathrm{E} I_{k}+1=\sum_{k=1}^{6} \frac{\mathrm{E} X_{n-k} \mathrm{P}\left(A_{n-k}\right)}{6 \mathrm{P}\left(A_{n}\right)}+1 .
$$

Introducing the shorthand notations $E X_{k}=e_{k}$ and $\mathrm{P}\left(A_{n-k}\right)=p_{k}$, we obtain:

$$
e_{n}=\sum_{k=1}^{6} \frac{e_{n-k} p_{n-k}}{6 p_{n}}+1
$$

It remains to use the fact that $6 p_{n}=\sum_{k=1}^{6} p_{n-k}$. This follows, for example, from the fact that the sum of probabilities $\mathrm{P}\left(I_{k}=1\right)$ is one. This fact can be taken from the solution of problem 1 of the 2008 Correspondence Olympiad. Then

$$
e_{n}=\frac{\sum_{k=1.6} e_{n-k} \cdot p_{n-k}}{\sum_{k=1.6} p_{n-k}}+1
$$

Initial values: $p_{-5}=p_{-4}=\ldots=p_{-1}=0 ; p_{0}=1 ; \quad e_{-5}=e_{-4}=\ldots=e_{0}=0$. Sequential calculation gives

$$
\begin{aligned}
& e_{1}=1, p_{1}=\frac{1}{6} \\
& e_{2}=\frac{1 \cdot \frac{1}{6}+0 \cdot 1+0 \cdot 0+0 \cdot 0+0 \cdot 0+0 \cdot 0}{\frac{1}{6}+1+0+0+0+0}+1=\frac{8}{7}, \quad p_{2}=\frac{\frac{1}{6}+1}{6}=\frac{7}{36} ; \\
& e_{3}=\frac{\frac{8}{7} \cdot \frac{7}{36}+1 \cdot \frac{1}{6}+0 \cdot 1+0 \cdot 0+0 \cdot 0+0 \cdot 0}{\frac{7}{36}+\frac{1}{6}+1+0+0+0}+1=\frac{9}{7} \quad \text { and so on. }
\end{aligned}
$$

Using any computational tool, such as Excel, we easily obtain: $e_{2010}=574.5238095 \ldots$

Second method. It is known that the sum of points has equaled $n$. Let event $A_{k}$ be "at some point the sum is $k$". Then the subsequent rolls must lead to event $A_{n-k}$. Therefore,

$$
\mathrm{P}\left(A_{k} \mid A_{n}\right)=\frac{\mathrm{P}\left(A_{k} \cap A_{n}\right)}{\mathrm{P}\left(A_{n}\right)}=\frac{\mathrm{P}\left(A_{k} \cap A_{n-k}\right)}{\mathrm{P}\left(A_{n}\right)} .
$$

Events $A_{n-k}$ and $A_{k}$ relate to different series of rolls and are therefore independent: $\mathrm{P}\left(A_{k} \mid A_{n}\right)=\frac{\mathrm{P}\left(A_{k}\right) \cdot \mathrm{P}\left(A_{n-k}\right)}{\mathrm{P}\left(A_{n}\right)}$.

Consider the quantity $I_{k}=\left\{\begin{array}{l}1, \text { if the sum at some point is } k, \\ 0, \text { otherwise. }\end{array}\right.$ Clearly, the random variable "number of obtained sums"

$$
X_{n}=I_{1}+I_{2}+I_{3}+\ldots+I_{n}
$$

is equal to the number of rolls made.

Introduce the shorthand notations $\mathrm{E} X_{k}=e_{k} ; \mathrm{P}\left(A_{k}\right)=p_{k}$. The expectation $\mathrm{E}_{k}$ is $0 \cdot\left(1-\mathrm{P}\left(A_{k} \mid A_{n}\right)\right)+1 \cdot \mathrm{P}\left(A_{k} \mid A_{n}\right)=\mathrm{P}\left(A_{k} \mid A_{n}\right)=\frac{p_{k} p_{n-k}}{p_{n}}$.

Transition to the expectation of the sum:

$$
\mathrm{E} X_{n}=e_{n}=\sum_{k=1}^{n} \mathrm{E} I_{i}=\sum_{k=1}^{n} \frac{p_{k} p_{n-k}}{p_{n}}=\sum_{k=1}^{n-1} \frac{p_{k} p_{n-k}}{p_{n}}+1
$$

Using the relation $p_{n-k}=\frac{1}{6} \sum_{i=1}^{6} p_{n-k-i}$, write the expectation differently:

$$
e_{n}=\sum_{k=1}^{n-1} \frac{\sum_{i=1}^{6} p_{k} p_{n-k-i}}{6 p_{n}}+1=\sum_{k=1}^{n-1} \frac{\sum_{i=1}^{6} p_{k} p_{n-k-i}}{6 p_{n}}+1=\sum_{i=1}^{6} \frac{p_{n-i} \sum_{k=1}^{n-i} \frac{p_{k} p_{n-k-i}}{p_{n-i}}}{6 p_{n}}+1=\sum_{i=1}^{6} \frac{e_{n-i} p_{n-i}}{6 p_{n}} .
$$

The obtained relation coincides with (1).