12. Ivan the Tsarevich's Arrows (from 8th grade. 3 points). Ivan the Tsarevich is learning to shoot a bow. He put 14 arrows in his quiver and went to shoot at pine cones in the forest. He knocks down a pine cone with a probability of 0.1, and for each pine cone he knocks down, the Frog-Princess gives him 3 more arrows. Ivan the Tsarevich shoots until he runs out of arrows. Find the expected number of shots Ivan the Tsarevich will make.
Solution. First method. Let Ivan have $n$ arrows at the present moment. Let $X_{0}$ be the random variable "the number of shots needed to reduce the number of arrows by one." Ivan makes a shot. Consider the random variable - the indicator $I$ of a successful shot. $I=0$, if the shot is unsuccessful (probability of this is 0.9), or $I=1$, if the pine cone is knocked down (probability 0.1). Then

$$
X_{0}=(1-I) \cdot 1+I \cdot\left(1+X_{1}+X_{2}+X_{3}\right)
$$

where $X_{1}, X_{2}$, and $X_{3}$ are the same random variables as $X_{0}$. Each of them equals the number of shots needed to reduce the number of arrows in reserve by one after receiving three new arrows from the Princess.

The variable $I$ is only related to the nearest shot, while the variables $X_{k}$ for $k=1,2,3$ are only related to subsequent shots. Therefore, the random variables $I$ and $X_{k}$ are independent. We will transition to expectations in the obtained equality:

$$
\mathrm{E} X_{0}=(1-\mathrm{E} I)+\mathrm{E} I \cdot\left(1+\mathrm{E} X_{1}+\mathrm{E} X_{2}+\mathrm{E} X_{3}\right)
$$

Since all variables from $X_{0}$ to $X_{3}$ are identically distributed, their expectations are equal. Let's denote them by $a$. In addition, $\mathrm{E} I=0.1$. Therefore,

$$
a=(1-0.1)+0.1 \cdot(1+3 a), \text { from which } a=\frac{10}{7}
$$

Thus, to get rid of one arrow, Ivan needs on average 10/7 shots. To get rid of all 14 arrows that were initially present, he needs on average $14 \cdot 10 / 7=20$ shots.

Second method. Determine how many fewer arrows Ivan has as a result of the $k$-th shot (taking into account the new ones given by the Princess). Let this random variable be $X_{k}$ ( $k=1,2,3, \ldots$ ). From the condition, it is clear that $X_{k}=1$, if Ivan did not knock down the pine cone, or $X_{k}=-2$ (the number of arrows increased by 2), if Ivan knocked down the pine cone. That is,

$$
X_{k} \sim\left(\begin{array}{cc}
1 & -2 \\
0.9 & 0.1
\end{array}\right)
$$

independently of $k$. Let's find the expectation: $\mathrm{E} X=0.9-0.2=0.7$ : with each shot, Ivan has on average 0.7 fewer arrows.

Introduce indicators of individual shots $I_{k}$, where $k=1,2,3, \ldots$ :

$$
I_{k}=\left\{\begin{array}{l}
0, \text { if there were not enough arrows for the } k \text {-th shot, } \\
1, \text { if the } k \text {-th shot was made. }
\end{array}\right.
$$

The total number of shots is

$$
S=I_{1}+I_{2}+I_{3}+\ldots+I_{k}+\ldots
$$

and the total change (decrease) in the number of arrows is

$$
I_{1} X_{1}+I_{2} X_{2}+\ldots+I_{k} X_{k}+\ldots
$$

By the time all the arrows are gone, this sum equals 14. We form the equation

$$
14=I_{1} X_{1}+I_{2} X_{2}+\ldots+I_{k} X_{k}+\ldots
$$

and transition to the expectation in the right part (the left part is a constant):

$$
14=\mathrm{E}\left(I_{1} X_{1}+I_{2} X_{2}+\ldots+I_{k} X_{k}+\ldots\right)
$$

The random variable $I_{k}$ depends only on how many arrows are left after $k-1$ shots, so the variables $I_{k}$ and $X_{k}$ are independent. Therefore,

$$
\begin{gathered}
14=\mathrm{E} I_{1} \cdot \mathrm{E} X_{1}+\mathrm{E} I_{2} \cdot \mathrm{E} X_{2}+\ldots+\mathrm{E} I_{k} \cdot \mathrm{E} X_{k}+\ldots= \\
=0.7\left(\mathrm{E} I_{1}+\mathrm{E} I_{2}+\ldots+\mathrm{E} I_{k}+\ldots\right)=0.7 \mathrm{E}\left(I_{1}+I_{2}+I_{3}+\ldots+I_{k}+\ldots\right)=0.7 \mathrm{E} S
\end{gathered}
$$

Therefore, $\mathrm{E} S=14: 0.7=20$.

Answer: 20.