10. Pills for Forgetfulness (from 8th grade, 3 points). In January, the doctor gave the Forgetful Scientist a pack of 10 pills for forgetfulness. The Scientist keeps the pills in a cabinet. When the Scientist is overwhelmed by a bout of forgetfulness (which happens several times a week at random moments), he opens the cabinet, takes the pack from the shelf, takes a pill, and checks how many pills for forgetfulness are left. If the Scientist sees that only one pill is left, he immediately orders a new identical pack from the pharmacy with instant delivery and places it in the same cabinet on the same shelf.

If the Scientist sees that the current pack is empty, he immediately throws it in the trash.

What is the probability that at 10 AM on December 31, the Forgetful Scientist will have exactly two packs of pills for forgetfulness in the cabinet?
Answer: approximately $0.1998$.

Solution. The Scholar cannot have more than two packages at any moment. Indeed, he orders a new package only when there is only one pill left, which means he has one package at that moment. Therefore, at any moment, he either has one package or two packages, one of which contains one pill.

Let's assume that a new package contains $n$ pills. After buying a new package, the total number of pills stored in the packages gradually decreases from $n+1$ to 2 (by taking one of the last two pills, the Scholar immediately buys a new package, so the number of pills instantly increases to $n+1$).

After a long time, say, at 10 AM on December 31, the total number of pills can be any number from 2 to $n+1$, with equal probabilities, $p_{k}=\frac{1}{n}$ for $k=2, \ldots, n+1$, since absent-mindedness episodes occur at random times.

A situation where one package contains $k$ pills and the other contains 1 pill will be called state $k, 1$. There is also

![](https://cdn.mathpix.com/cropped/2024_05_06_142b35c881fc974fcd25g-07.jpg?height=620&width=442&top_left_y=227&top_left_x=1435)

Figure 4 state $u$, which occurs if the Scholar has only one package. On December 31, the probability of state $n, 1$ coincides with the probability that the Scholar has exactly $n+1$ pills: $\mathrm{P}(n, 1)=p_{n+1}=\frac{1}{n}$.

Starting from state $n, 1$, the Scholar "moves" between states according to the scheme shown in the graph (Figure 4). Using this graph, it is easy to find the probabilities of other states:

$$
\mathrm{P}(n-1,1)=\frac{1}{2} \mathrm{P}(n, 1)=\frac{1}{2 n}, \quad \mathrm{P}(n-2,1)=\frac{1}{2} \mathrm{P}(n-1,1)=\frac{1}{2^{2} n}, \ldots, \quad \mathrm{P}(1,1)=\frac{1}{2^{n-1} n}
$$

The probability of the event "the Scholar has two packages" is equal to the sum of the probabilities of states from $n, 1$ to 1,1:

$$
\mathrm{P}(n, 1)+\mathrm{P}(n-1,1)+\ldots+\mathrm{P}(1,1)=\frac{1}{n}+\frac{1}{2 n}+\ldots+\frac{1}{2^{n-1} n}=\frac{1}{n} \cdot \frac{1-1 / 2^{n}}{1-1 / 2}=\frac{2^{n}-1}{2^{n-1} n}
$$

The formula for the sum of the first terms of a geometric progression was used in the summation.

For $n=10$, the desired probability is $\frac{1023}{5120} \approx 0.1998$.