191. The following experiment is conducted. Two urns that look identical are placed in a room. The left one contains $a$ balls, and the right one contains $b$ balls. People enter the room one by one, and each person moves a ball from the left urn to the right or from the right urn to the left. It is assumed that the probability of a ball being moved from the left urn to the right is the same as the probability of a ball being moved from the right urn to the left, which is $\frac{1}{2}$. The experiment continues until one of the urns is empty. What is the probability that the left urn will be empty? What is the probability that the right urn will be empty? What is the probability that the experiment will never end?

![](https://cdn.mathpix.com/cropped/2024_05_21_a55bead9955e32b1e916g-133.jpg?height=323&width=306&top_left_y=1077&top_left_x=201)

Fig. 63.
191. We will represent the number of balls in the left urn using a chip placed on a number line. At the initial
1) A. P. Kiselev, Algebra, Part 2, 23rd edition, Uchpedgiz, M., 1946, p. 78.

18 Law. Zzya. E. Dynkin and V. Uspenskii
moment, the chip is located at point $a$ (Fig. 156). After each unit of time, it moves to the right with a probability of $\frac{1}{2}$ (a ball is moved from the right urn to the left, increasing the number of balls in the left urn by one) and to the left with a probability of $\frac{1}{2}$ (a ball is moved from the left urn to the right, decreasing the number of balls in the left urn by one), until it first reaches one of the points 0 or $a+b$. The arrival of the chip at point 0 means that the left urn is empty, and its arrival at point $a+b$ means that the right urn is empty. Let the probability of the chip reaching 0, given that it started from point $k$, be denoted by $p_{k}$ (we need to find $p_{a}$). Clearly, $p_{0}=1, p_{a+b}=0$.

Suppose the chip is at point $k$.

Consider two events:

$A$: "the chip moves to $k+1$ in one step,"

![](https://cdn.mathpix.com/cropped/2024_05_21_a55bead9955e32b1e916g-275.jpg?height=125&width=928&top_left_y=465&top_left_x=167)

Fig. 156.

By the condition, $\mathbf{P}(A)=\mathbb{P}(B)=1 / 2$. If event $A$ occurs, the probability of the chip reaching 0 is $p_{k+1}$, and if event $B$ occurs, the probability of the chip reaching 0 is $p_{k-1}$. By the formula for total probability, we have

$$
p_{k}=\frac{1}{2} p_{k+1}+\frac{1}{2} p_{k-1}
$$

or after transformation

$$
2 p_{k}=p_{k+1}+p_{k-1}, \quad p_{k+1}-p_{k}=p_{k}-p_{k-1}
$$

Denoting the constant difference $p_{k+1}-p_{k}$ by $d$, we write

$$
\begin{array}{r}
p_{k}-p_{k-1}=d_{2} \\
p_{k-1}-p_{k-2}=d \\
\cdots \cdot \cdot \cdot \\
p_{2}-p_{1}=d \\
p_{1}-p_{0}=d
\end{array}
$$

Adding these equations, we get

$$
\begin{aligned}
& p_{k}-p_{0}=k d, \\
& p_{k}-1=k d, \\
& p_{k}=1+k d
\end{aligned}
$$

or, setting $k=a+b$,

$$
\begin{gathered}
0=p_{a+b}=1+(a+b) d, \quad d=-\frac{1}{a+b} \\
p_{k}=1-\frac{k}{a+b}=\frac{a+b-k}{a+b}
\end{gathered}
$$

The probability we are interested in is

$$
p_{a}=\frac{b}{a+b}
$$

it is clear,

The probability that the right urn will be empty is

$$
p_{b}=\frac{a}{a+b}
$$

The probability that the experiment will end, i.e., that one of the urns will be empty, is, by property 2

$$
\frac{b}{a+b}+\frac{a}{a+b}=1
$$

The probability that the experiment will never end is $1-1=0$ (property 3).

Remark. This problem is known in the history of mathematics as the "ruin problem." The classical formulation of this problem is as follows:

Two players are playing. The probability of winning each game for each of them is $\frac{1}{2}$. The first player has $a$ rubles, and the second player has $b$ rubles. The game continues until one of the players is left with no money. What is the probability of ruin for each player?

In problem 191, the players are replaced by urns, and the money by balls.