Quant Memo
Core

Gambler's Ruin

You start with some money and bet a fixed amount each round until you either hit a target or go broke. The classic random-walk problem — and the cleanest lesson in how a tiny house edge becomes near-certain ruin.

Prerequisites: The Random Walk, Expected Value

Gambler's ruin is the little problem that hides a big truth. You walk into a casino with some money, say $100, and you want to run it up to $200 before you go broke. Each round you bet $1 on a coin-like wager. Your bankroll drifts up and down one dollar at a time until it hits one of two walls: $0 (you're ruined) or $200 (you've won). Two questions: what's the chance you reach the target before going bust, and how long will the whole thing take? The answers are exact, and they explain why casinos always win.

The setup: a walk between two walls

Your wealth is a The Random Walk that starts at some level ii, steps up by one with probability pp and down by one with probability q=1pq = 1 - p, and stops the instant it touches 00 or the target NN. The two ends are absorbing barriers: once you hit them, the game is over. Everything about the problem is captured by three numbers — where you start (ii), where the target sits (NN), and how the coin is tilted (pp).

N (target) 0 (ruin) start i one-dollar bet per step, up or down, until a wall is hit
Wealth takes a one-dollar step up or down each round and stops the moment it touches a barrier. Here the walk drifts into the lower wall and the gambler is ruined before reaching the target.

The fair-game answers

When the game is fair (p=q=12p = q = \tfrac12), the results are remarkably clean. The probability of reaching the target NN before going broke, starting from ii, is simply your fraction of the way there:

P(reach N from i)=iN.P(\text{reach } N \text{ from } i) = \frac{i}{N} .

And the expected number of rounds until the game ends — either way — is

E[duration]=i(Ni).E[\text{duration}] = i\,(N - i).

Both fall out of a one-line martingale argument, but the intuition is enough: in a fair game your expected wealth never changes, so the chance-weighted average of the two endpoints must equal where you started, which forces the target probability to be i/Ni/N.

In a fair game, the chance of reaching your target NN from a start of ii is exactly i/Ni/N, and the game lasts i(Ni)i(N-i) rounds on average. Doubling from $100 to $200 is a genuine coin flip — but it takes about ten thousand one-dollar bets to resolve.

Worked example: the doubling bet, fair and slightly unfair

Fair coin. You start at i=100i = 100, target N=200N = 200, even-odds $1 bets. Your chance of doubling is 100200=50%\tfrac{100}{200} = 50\% — a true coin flip. Expected rounds: 100×(200100)=10,000100 \times (200 - 100) = 10{,}000 bets. Fair, but slow.

Now tilt the coin against you. Real casino games aren't fair. Say each bet wins with probability p=0.49p = 0.49 instead of 0.500.50. For a biased walk the target probability becomes

P(reach N)=1ri1rN,r=qp=0.510.491.041.P(\text{reach } N) = \frac{1 - r^{\,i}}{1 - r^{\,N}}, \qquad r = \frac{q}{p} = \frac{0.51}{0.49} \approx 1.041 .

Plug in i=100i = 100, N=200N = 200: r100=e100ln1.041e454.6r^{100} = e^{100\ln 1.041} \approx e^{4} \approx 54.6 and r200e82981r^{200} \approx e^{8} \approx 2981, so

P(double)=154.612981=53.629800.018.P(\text{double}) = \frac{1 - 54.6}{1 - 2981} = \frac{-53.6}{-2980} \approx 0.018 .

A one-percentage-point edge against you collapses a 50%50\% coin flip into a 1.8%1.8\% shot. That is the entire business model of a casino: the per-bet edge looks trivial, but compounded over thousands of rounds it makes reaching a distant target almost impossible.

Against a house with a negative edge and deep pockets, ruin is essentially certain if you play long enough. The tiny per-round disadvantage doesn't stay tiny — it grows geometrically in the target probability, which is why "just keep playing to break even" is a fatal plan.

The one strategy that helps a losing game

If you must play a game with the odds against you, the math points to a counterintuitive rule: bet big, not small. Bold play — staking as much as you can toward the target in as few bets as possible — minimizes the number of rounds the house edge gets to act on you. Making many small bets just gives the negative drift more chances to grind you down. It's the opposite of what feels prudent, and it only makes a bad game less bad; against a fair game, bet sizing changes nothing about your chance of reaching a symmetric target.

Facing an unfavorable game, timid play (many small bets) maximizes your ruin probability, while bold play (few large bets) minimizes it. You can't beat a negative edge — but you can starve it of the repetition it needs.

Where it connects

Gambler's ruin is the archetype for every "does the walk hit this level before that one" question. It is solved most elegantly with the Optional Stopping Theorem applied to two martingales, set up directly with First-Step Analysis, and it generalizes to the boundary problems of Markov Chains. Its risk lesson — that a small edge compounds into near-certainty — is the same one that drives the The Kelly Criterion and the whole discipline of position sizing.

Related concepts

Practice in interviews

Further reading

  • Feller, An Introduction to Probability Theory and Its Applications, Vol. 1, ch. 14
  • Grimmett & Stirzaker, Probability and Random Processes, ch. 3
ShareTwitterLinkedIn