Skip to article frontmatterSkip to article content

2.4 The Gambler’s Ruin Problem

Overview

Consider two gamblers with finite resources who repeatedly play the same game against each other. Using the tools of conditional probability, we can calculate the probability that each of the gamblers will eventually lose all of his money to the opponent.

2.4.1 Statement of the Problem

Suppose that two gamblers AA and BB are playing a game against each other. Let pp be a given number (0<p<10 < p < 1), and suppose that on each play of the game, the probability that gambler AA will win one dollar from gambler BB is pp and the probability that gambler BB will win one dollar from gambler AA is 1p1 − p. Suppose also that the initial fortune of gambler AA is ii dollars and the initial fortune of gambler BB is kik − i dollars, where ii and kik − i are given positive integers. Thus, the total fortune of the two gamblers is kk dollars. Finally, suppose that the gamblers play the game repeatedly and independently until the fortune of one of them has been reduced to 0 dollars. Another way to think about this problem is that BB is a casino and AA is a gambler who is determined to quit as soon he wins kik − i dollars from the casino or when he goes broke, whichever comes first.

We shall now consider this game from the point of view of gambler AA. His initial fortune is ii dollars and on each play of the game his fortune will either increase by one dollar with a probability of pp or decrease by one dollar with a probability of 1p1 − p. If p>1/2p > 1/2, the game is favorable to him; if p<1/2p < 1/2, the game is unfavorable to him; and if p=1/2p = 1/2, the game is equally favorable to both gamblers. The game ends either when the fortune of gambler AA reaches kk dollars, in which case gambler BB will have no money left, or when the fortune of gambler AA reaches 0 dollars. The problem is to determine the probability that the fortune of gambler AA will reach kk dollars before it reaches 0 dollars. Because one of the gamblers will have no money left at the end of the game, this problem is called the Gambler’s Ruin problem.

Solution of the Problem

We shall continue to assume that the total fortune of the gamblers AA and BB is kk dollars, and we shall let aia_i denote the probability that the fortune of gambler AA will reach kk dollars before it reaches 0 dollars, given that his initial fortune is ii dollars. We assume that the game is the same each time it is played and the plays are independent of each other. It follows that, after each play, the Gambler’s Ruin problem essentially starts over with the only change being that the initial fortunes of the two gamblers have changed. In particular, for each j=0,,kj = 0, \ldots, k, each time that we observe a sequence of plays that lead to gambler AA’s fortune being jj dollars, the conditional probability, given such a sequence, that gambler AA wins is aja_j. If gambler AA’s fortune ever reaches 0, then gambler AA is ruined, hence a0=0a_0 = 0. Similarly, if his fortune ever reaches kk, then gambler AA has won, hence ak=1a_k = 1. We shall now determine the value of aia_i for i=1,,k1i = 1, \ldots, k-1.

Let A1A_1 denote the event that gambler AA wins one dollar on the first play of the game, let B1B_1 denote the event that gambler AA loses one dollar on the first play of the game, and let WW denote the event that the fortune of gambler AA ultimately reaches kk dollars before it reaches 0 dollars. Then

$$

Pr(W)=Pr(A1)Pr(WA1)+Pr(B1)Pr(WB1)=pPr(WA1)+(1p)Pr(WB1).\begin{align*} \Pr(W) &= \Pr(A_1)\Pr(W \mid A_1) + \Pr(B_1)\Pr(W \mid B_1) \\ &= p \Pr(W \mid A_1) + (1-p)\Pr(W \mid B_1). \end{align*}

$$ {#eq-2-4-1}

Since the initial fortune of gambler AA is ii dollars (i=1,,k1i = 1, \ldots, k-1), then Pr(W)=ai\Pr(W) = a_i. Furthermore, if gambler AA wins one dollar on the first play of the game, then his fortune becomes i+1i + 1 dollars and the conditional probability Pr(WA1)\Pr(W \mid A_1) that his fortune will ultimately reach kk dollars is therefore ai+1a_{i+1}. If AA loses one dollar on the first play of the game, then his fortune becomes i1i − 1 dollars and the conditional probability Pr(WB1)\Pr(W \mid B_1) that his fortune will ultimately reach kk dollars is therefore $a_{i−1}. Hence, by eq-2-4-1,

ai=pai+1+(1p)ai1.a_i = pa_{i+1} + (1-p)a_{i-1}.

{#eq-2-4-2}

We shall let i=1,,k1i = 1, \ldots, k-1 in eq-2-4-2. Then, since a0=0a_0 = 0 and ak=1a_k = 1, we obtain the following k1k − 1 equations:

$$

a1=pa2,a2=pa3+(1p)a1,a3=pa4+(1p)a2,ak2=pak1+(1p)ak3,ak1=p+(1p)ak2.\begin{align*} a_1 &= pa_2, \\ a_2 &= pa_3 + (1-p)a_1, \\ a_3 &= pa_4 + (1-p)a_2, \\ &\vdots \\ a_{k-2} &= pa_{k-1} + (1-p)a_{k-3}, \\ a_{k-1} &= p + (1-p)a_{k-2}. \end{align*}

$$ {#eq-2-4-3}

If the value of aia_i on the left side of the iith equation is rewritten in the form pai+(1p)aip a_i + (1 − p)a_i and some elementary algebra is performed, then these k1k − 1 equations can be rewritten as follows:

$$

a2a1=1ppa1,a3a2=1pp(a2a1)=(1pp)2a1,a4a3=1pp(a3a2)=(frac1pp)3a1,ak1ak2=1pp(ak2ak3)=(1pp)k2a1,1ak1=1pp(ak1ak2)=(1pp)k1a1.\begin{align*} a_2 - a_1 &= \frac{1-p}{p}a_1, \\ a_3 - a_2 &= \frac{1-p}{p}(a_2 - a_1) = \left(\frac{1-p}{p}\right)^2a_1, \\ a_4 - a_3 &= \frac{1-p}{p}(a_3 - a_2) = \left(frac{1-p}{p}\right)^3a_1, \\ &\vdots \\ a_{k-1} - a_{k-2} &= \frac{1-p}{p}(a_{k-2} - a_{k-3}) = \left(\frac{1-p}{p}\right)^{k-2}a_1, \\ 1 - a_{k-1} &= \frac{1-p}{p}(a_{k-1} - a_{k-2}) = \left(\frac{1-p}{p}\right)^{k-1}a_1. \end{align*}

$$ {#eq-2-4-4}

By equating the sum of the left sides of these k1k − 1 equations with the sum of the right sides, we obtain the relation

1a1=a1i=1k1(1pp)i1 - a_1 = a_1 \sum_{i=1}^{k-1} \left(\frac{1-p}{p}\right)^i

{#eq-2-4-5}

Solution for a Fair Game: Suppose first that p=1/2p = 1/2. Then (1p)/p=1(1 − p)/p = 1, and it follows from eq-2-4-5 that 1a1=(k1)a11 − a_1 = (k − 1)a_1, from which a1=1/ka_1= 1/k. In turn, it follows from the first equation in eq-2-4-4 that a2=2/ka_2 = 2/k, it follows from the second equation in eq-2-4-4 that a3=3/ka_3 = 3/k, and so on. In this way, we obtain the following complete solution when p=1/2p = 1/2:

ai=ik   for i=1,,k1.a_i = \frac{i}{k} \; \text{ for }i = 1, \ldots, k-1.

{#eq-2-4-6}

Example 2.4.1: The Probability of Winning in a Fair Game

Suppose that p=1/2p = 1/2, in which case the game is equally favorable to both gamblers; and suppose that the initial fortune of gambler AA is 98 dollars and the initial fortune of gambler BB is just two dollars. In this example, i=98i = 98 and k=100k = 100. Therefore, it follows from eq-2-4-6 that there is a probability of 0.98 that gambler AA will win two dollars from gambler BB before gambler BB wins 98 dollars from gambler AA.

Solution for an Unfair Game: Suppose now that p 1/2p \neq 1/2. Then eq-2-4-5 can be rewritten in the form

1a1=a1(1pp)k(1pp)(1pp)1.1 - a_1 = a_1 \frac{ \left(\frac{1-p}{p}\right)^k - \left(\frac{1-p}{p}\right) }{ \left(\frac{1-p}{p}\right) - 1 }.

{#eq-2-4-7}

Hence,

a1=(1pp)1(1pp)k1.a_1 = \frac{ \left(\frac{1-p}{p}\right) - 1 }{ \left(\frac{1-p}{p}\right)^k - 1 }.

{#eq-2-4-8}

Each of the other values of aia_i for i=2,,k1i = 2, \ldots, k-1 can now be determined in turn from the equations in eq-2-4-4. In this way, we obtain the following complete solution:

ai=(1pp)i1(1pp)k1   for i=1,,k1.a_i = \frac{ \left(\frac{1-p}{p}\right)^i - 1 }{ \left(\frac{1-p}{p}\right)^k - 1 } \; \text{ for }i = 1, \ldots, k-1.

{#eq-2-4-9}

Example 2.4.2: The Probability of Winning in an Unfavorable Game

Suppose that p=0.4p = 0.4, in which case the probability that gambler AA will win one dollar on any given play is smaller than the probability that he will lose one dollar. Suppose also that the initial fortune of gambler AA is 99 dollars and the initial fortune of gambler BB is just one dollar. We shall determine the probability that gambler AA will win one dollar from gambler BB before gambler BB wins 99 dollars from gambler AA.

In this example, the required probability aia_i is given by eq-2-4-9, in which (1p)/p=3/2(1-p)/p = 3/2, i=99i = 99, and k=100k = 100. Therefore,

ai=(32)991(32)100113/2=23.a_i = \frac{ \left(\frac{3}{2}\right)^{99} - 1 }{ \left(\frac{3}{2}\right)^{100} - 1 } \approx \frac{1}{3/2} = \frac{2}{3}.

Hence, although the probability that gambler AA will win one dollar on any given play is only 0.4, the probability that he will win one dollar before he loses 99 dollars is approximately 2/32/3.

Summary

We considered a gambler and an opponent who each start with finite amounts of money. The two then play a sequence of games against each other until one of them runs out of money. We were able to calculate the probability that each of them would be the first to run out as a function of the probability of winning the game and of how much money each has at the start.

Exercises

Exercise 2.4.1

Consider the unfavorable game in Div. This time, suppose that the initial fortune of gambler AA is ii dollars with i98i \leq 98. Suppose that the initial fortune of gambler BB is 100i100 − i dollars. Show that the probability is greater than 1/21/2 that gambler AA loses ii dollars before winning 100i100 − i dollars.

Exercise 2.4.2

Consider the following three different possible conditions in the gambler’s ruin problem:

a. The initial fortune of gambler AA is two dollars, and the initial fortune of gambler BB is one dollar. b. The initial fortune of gambler AA is 20 dollars, and the initial fortune of gambler BB is 10 dollars. c. The initial fortune of gambler AA is 200 dollars, and the initial fortune of gambler BB is 100 dollars.

Suppose that p=1/2p = 1/2. For which of these three conditions is there the greatest probability that gambler AA will win the initial fortune of gambler BB before he loses his own initial fortune?

Exercise 2.4.3

Consider again the three different conditions (a), (b), and (c) given in Div, but suppose now that p<1/2p < 1/2. For which of these three conditions is there the greatest probability that gambler AA will win the initial fortune of gambler BB before he loses his own initial fortune?

Exercise 2.4.4

Consider again the three different conditions (a), (b), and (c) given in Div, but suppose now that p>1/2p > 1/2. For which of these three conditions is there the greatest probability that gambler AA will win the initial fortune of gambler BB before he loses his own initial fortune?

Exercise 2.4.5

Suppose that on each play of a certain game, a person is equally likely to win one dollar or lose one dollar. Suppose also that the person’s goal is to win two dollars by playing this game. How large an initial fortune must the person have in order for the probability to be at least 0.99 that she will achieve her goal before she loses her initial fortune?

Exercie 2.4.6

Suppose that on each play of a certain game, a person will either win one dollar with probability 2/32/3 or lose one dollar with probability 1/31/3. Suppose also that the person’s goal is to win two dollars by playing this game. How large an initial fortune must the person have in order for the probability to be at least 0.99 that he will achieve his goal before he loses his initial fortune?

Exercise 2.4.7

Suppose that on each play of a certain game, a person will either win one dollar with probability 1/31/3 or lose one dollar with probability 2/32/3. Suppose also that the person’s goal is to win two dollars by playing this game. Show that no matter how large the person’s initial fortune might be, the probability that she will achieve her goal before she loses her initial fortune is less than 1/41/4.

Exercise 2.4.8

Suppose that the probability of a head on any toss of a certain coin is pp (0<p<10 < p < 1), and suppose that the coin is tossed repeatedly. Let XnX_n denote the total number of heads that have been obtained on the first nn tosses, and let Yn=nXnY_n = n − X_n denote the total number of tails on the first nn tosses. Suppose that the tosses are stopped as soon as a number nn is reached such that either Xn=Yn+3X_n = Y_n + 3 or Yn=Xn+3Y_n = X_n + 3. Determine the probability that Xn=Yn+3X_n = Y_n + 3 when the tosses are stopped.

Exercise 2.4.9

Suppose that a certain box AA contains five balls and another box BB contains 10 balls. One of these two boxes is selected at random, and one ball from the selected box is transferred to the other box. If this process of selecting a box at random and transferring one ball from that box to the other box is repeated indefinitely, what is the probability that box AA will become empty before box BB becomes empty?