Skip to main content

Gambler's Ruin Problem Mathematical Proof

Gambler's ruin problem is a statistical concept that 2 people gamble $1 in each game, one of them will lose all his or her money if they keep gambling.

Problem Statement

Let A and B be gamblers who gamble 1$ in each game. A's probability of winning in each game is p while A’s probability of losing in each game is 1-p, Let 1-p be denoted as q. The sum of the probability of losing and the probability of wining is 1 because A either wins or loses a game. There are no other outcomes.

Let A have x amount of money and B have n-x amount of money. A and B have total amount of n dollars.

We want to find the probability of A wining all B's money if they keep gambling. Let it be Px.

After One Game

A and B gamble for one game. A either wins with the probability of p or loses with the probability of q.

If A wins this game, A will have x+1 dollars and A’s probability of wining all B's money become Px+1.

If A loses this game, A will have x-1 dollars and A’s probability of wining all B's money become Px-1.

So together, Px = p* Px+1 + q*Px-1.

P0 = 0, because A has lost all his or her money and the game has ended.

Pn = 1, because A has won all B's money and the game has ended.

Guess the Answer First

Assume Px = xi. Px = p* Px+1 + q*Px-1 becomes xi = p*xi+1 + q* xi-1, which is this quadratic equation: x = p*x2 + q.

Solving for x, we get x = 1 or x = q/p.

Testing the results

If x = 1, Px = xi = 1, which does not satisfy the fact that P0 = 0.

If x = q/p, for Pn to be 1, q will have to be p, then x will be 1 again.

Therefore, the solution will be some combination of the 2 roots of x, 1 and q/p .

Solving for this combination

Let Px = A*(1)x + B*(q/p)x, which is the linear combination of the two roots of x,1 and q/p plugging into Px = xi.

Applying the results of P0 = 0 and Pn = 1 to this linear combination, we get the following derivation:

P0 = 0 = A + B, A = -B

Pn = 1 = A + B* (q/p)n = -B + B*(q/p)n = B((q/p)n - 1).
B = 1 / ((q/p)n - 1)

A = -B, so A = -1 / ((q/p)n - 1)

Finally, Px = A*(1)x + B*(q/p)x = -1 / ((q/p)n - 1) + (q/p)x / ((q/p)n - 1)

= (q/p)x -1 / ((q/p)n - 1)

What If p = q?

If p = q, Px = (q/p)x -1 / ((q/p)n - 1) = 0/0 = 0, which doesn't make sense because Pn is 1 not 0 even if p = q.

As p approaches q, p/q goes to 1 then both (q/p)x -1 and (q/p)n -1 go to 0. Then this has become a "0 over 0" problem, which can be solved by applying the L'hopital's rule.

By taking the first derivative of both (q/p)x -1 and (q/p)n -1 with respect to (q/p), we get x(q/p)x-1 and n(q/p)n-1.

Plug back in Px = (q/p)x -1 / ((q/p)n - 1), we get

Px = x(q/p)x-1/ n(q/p)n-1 = x / n when p goes to q.

Suggested reading: Probability Calculator: Gambler’s Ruin Problem

Comments

Popular posts from this blog

Which Asset Class Had the Best Performance During the 2008 Financial Crisis?

In this article, I want to explore which asset, ETFs, MFs, Stocks, did best during the 2008 financial crisis. I will compare the investment results against the result of SPY, since it represents the overall market. The scenario is investing right at the highest point of S&P 500 index right before it crashed during the crisis. The date is Oct 9, 2007  when the index reached 1,565.15. I will compare the returns of each asset against SPY in the following order: Investing until the bottom of the crisis at 676.53 on Mar 09, 2009 in order to simulate downside risk. Investing until the S&P 500 index closed above the previous high at 1,568.61 on Apr 09, 2013 in order to simulate recover ability. Investing until the bottom of the Covid crisis at 2,304.92 on Mar 20, 2020 in order to simulate a series of market crashes. Performance By Ranks Oct 9, 2007 to Mar 09, 2009 SHY  return is 8.848% AGG  return is 7.390% LQD  return is -6.793% HYG  return i...