Home/Study Plan/Gambler's Ruin
🚶

Random Walks & Stochastic

Gambler's Ruin

Medium3–4 hrsRandom WalkGambler's RuinAbsorption

Overview

Gambler's Ruin is the canonical risk-of-ruin problem. The key insight: for a FAIR game, your probability of winning is just the fraction of the total range you start at. This means: if you start with 1tryingtoreach1 trying to reach 100 in a fair game, you have only a 1% chance. The lesson for trading: even with zero edge, if your opponent has more capital, you will almost certainly be driven to ruin before winning. This is why bankroll management matters.

How to Recognize

  • Start at position x, absorbing barriers at 0 and N
  • 'What is P(reaching N before 0)?'
  • Asymmetric coin flip walked between two walls
  • Risk of ruin with a fixed bankroll

Step-by-Step Approach

  1. 1.For fair coin (p=1/2): P(reach N | start x) = x/N — beautiful and simple
  2. 2.For biased coin (p≠1/2): use ratio r = q/p. P = (1−r^x)/(1−r^N)
  3. 3.Expected duration: E[T | start x, fair] = x(N−x)
  4. 4.Martingale method: find a martingale, use Optional Stopping to extract the result

Key Formulas

01P(reach Nx,fair)=xNP(\text{reach } N \mid x, \text{fair}) = \frac{x}{N}
02P(reach Nx,biased)=1(q/p)x1(q/p)NP(\text{reach } N \mid x, \text{biased}) = \frac{1-(q/p)^x}{1-(q/p)^N}
03E[Tx,p=12]=x(Nx)E[T \mid x, p=\tfrac{1}{2}] = x(N-x)
04E[Tx,p12]=xqpNqp1(q/p)x1(q/p)NE[T \mid x, p \neq \tfrac{1}{2}] = \frac{x}{q-p} - \frac{N}{q-p}\cdot\frac{1-(q/p)^x}{1-(q/p)^N}

Worked Examples

0Quick Example
Fair game, start at 50,ruinat50, ruin at 0, stop at 100.P(reach100. P(reach 100) = 50/100 = 50%. E[duration] = 50·50 = 2500 bets.

Problem

You have 100,tryingtoreach100, trying to reach 200 before going broke. The casino has a 51% edge on each bet. What is P(ruin)?

Solution

1

p = 0.49 (your win prob), q = 0.51 (loss prob), r = q/p = 51/49.

2

P(reach N=200 | start x=100) = (1−r^100)/(1−r^200).

3

r^100 = (51/49)^100. Use ln: 100·ln(51/49) = 100·ln(1.0408) ≈ 100·0.04 = 4. So r^100 ≈ e^4 ≈ 54.6.

4

r^200 ≈ e^8 ≈ 2981.

5

P(reach 200) = (1−54.6)/(1−2981) = (−53.6)/(−2980) ≈ 0.018 = 1.8%.

6

P(ruin) = 1 − 1.8% = 98.2%.

Answer

P(ruin)98.2%P(\text{ruin}) \approx 98.2\%. A tiny 1% house edge with equal bankrolls makes ruin almost certain. This is why casinos are profitable even with near-50/50 games.

Common Mistakes

  • !

    Using x/N for biased games. The formula x/N only holds when p = q = 1/2.

  • !

    Forgetting that 'ruin' means reaching 0, so P(ruin) = 1 − P(reaching N).

  • !

    Not using log to compute (q/p)^k for large k. Direct computation overflows; use k·ln(q/p).

  • !

    Confusing expected DURATION (steps until game ends) with expected OUTCOME.

Practice Problems

Click "Show Answer" to reveal
1

You start with 1,tryingtoreach1, trying to reach 10 before going broke. Fair game. What is P(success)?

Hint: Apply x/N formula.
2

A drunk man starts at lamp post 5 on a street from 0 to 10. He staggers left or right with equal probability. What is P(he reaches his home at 10 before falling in the river at 0)?

Hint: Fair random walk: P(reach N | start x) = x/N.
3

In a game with p=0.6, q=0.4 (biased in your favor), you start with 10tryingtoreach10 trying to reach 20. What is P(winning)?

Hint: r = q/p = 0.4/0.6 = 2/3. Formula: (1−r^10)/(1−r^20).

Only works in the Electron app

<webview> is an Electron-only tag. Run npm run electron:dev to use this.

25:00Focus
0

25 min focus · 5 min break · long break every 4 sessions

The Ultimate Grind