Gambler's Ruin

One player, one bankroll, one target: bet until you have nothing or reach it. Start with the rich opponent, then move the same evening to a roulette wheel and slide the stake from one chip to everything.

Loading interactive simulation...

Lesson

The theory โ€” Gambler's Ruin

Gambler's ruin is the problem of a player who starts with a chips and bets on independent trials, each won with probability p, until she has nothing or reaches a target N. With one chip a bet, the chance of reaching N is (1 โˆ’ ra)/(1 โˆ’ rN) with r = q/p, or a/N when p = ยฝ, and the expected number of bets is a/(q โˆ’ p) โˆ’ (N/(q โˆ’ p))ยทP(reach N), or a(N โˆ’ a) when p = ยฝ. Whatever the strategy, the expected loss is the edge q โˆ’ p times the expected total staked.

What each symbol means

a
the chips you bring
N
the target; your opponent holds N โˆ’ a
p
the chance of winning one even-money bet, with q = 1 โˆ’ p
T
the number of bets the evening lasts
S
the total staked over the evening, each bet's stake counted once
Assumes
Every bet pays even money and is independent of the last; a losing bet loses the whole stake, zero included; stakes are whole chips; and the player stops only at 0 or at N.

A fair game against a richer opponent ruins you, and stays fair 🖖

Press 10 chips against 1,000. Every toss is fair and nothing on the page tilts it. The average result over all players is exactly zero, which is why the dashed line holds at 10 chips while the crowd beneath it collapses onto the floor. Fairness is a statement about that average. Your own chance of taking the opponent's 1,000 is 10/1,010 = 0.9901%, and the 99.0099% who go broke pay for the few who win: one player in 101 coming back with 1,010 is what keeps the average at 10. The timing is as lopsided as the money. Half the players are finished by toss 220, yet the mean evening is 10 ร— 1,000 = 10,000 tosses, pulled up by the rare walks that wander far. No way of betting moves the 0.9901%: in a fair game every strategy reaches N with probability a/N, the right-hand column of the table, so going bold changes how long the evening lasts and how much is staked, never the chance or the average result. Against an opponent with no limit at all, ruin is certain. Grinstead and Snell get it by letting N grow in 1 โˆ’ a/N. And the chance of reaching N from x chips is the plain average of the chances from x โˆ’ 1 and x + 1, the same rule that sets the temperature of a plate in <a href="/math/laplace-equation">Laplace's equation</a>.

The house edge is charged on every chip you stake 🖖

Press Double 100, one chip a bet. Red on a European wheel pays even money and comes up 18 times in 37, so each chip staked loses 1/37 = 2.70% on average. It is natural to read that as "an evening costs me about 2.7% of what I bring", and the fainter dashed line marks where that would leave you: 97.30 chips. The average over all players finishes below one chip. An evening of one-chip bets aimed at 200 lasts 3,666.9 bets on average, each a chip staked, and 1/37 of 3,666.9 is 99.11. That is the expected loss, and it is exactly what the other route gives, 100 โˆ’ 200 ร— P(reach 200); the results table works it out both ways. Now press Double 100 in one spin. You stake 100 once, the edge takes 2.70, and you double with probability 18/37 = 48.6486%, where the one-chip player gets 0.4466%. When every bet is tilted against you, no way of betting reaches the target more often than bold play, staking everything you have or exactly what you need. Kyle Siegrist proves it in his open textbook Random, in a chapter he bases on Lester Dubins and Leonard Savage's 1965 book How to Gamble If You Must. What bold play costs is the evening: one spin instead of 3,666.9.

Betting one chip at a time, more chips make doubling less likely 🖖

Press Double 10, one chip a bet: 36.8031%. Then read down the table. With 50 chips the chance of doubling is 6.2775%, with 100 it is 0.4466%, with 1,000 it is 3.30ร—10โปยฒยฒ%, and bold play stays at 48.6486% at every size. More chips do buy more staying power, and staying is the trouble, because the edge is charged on every bet the longer evening contains. For doubling, the formula collapses to something exact and short: the odds against you are (19/18)a to 1, so each extra chip you bring, aiming at twice as many, multiplies them by 19/18. For 100 chips that is 222.9 to 1. Abraham de Moivre derived the general formula in 1711 with a trick Grinstead and Snell retell: give each counter a nominal value that grows by the factor q/p, and in those values the unfair game is a fair one. Press The second zero to see how sharp the dependence is. The American wheel's extra pocket nearly doubles the edge, 5.26% against 2.70%, and makes doubling 100 chips one at a time about 168 times rarer, 0.002656% against 0.4466%, while bold play only slips from 48.6486% to 47.3684%. The next rung, martingale betting, is a system built to escape exactly this: bet small, and double after every loss.

Problem solved in full

  1. One in a million 4 steps

    Betting one chip at a time on red, how many chips must you bring before doubling them becomes a one-in-a-million chance? Press Double 100, one chip a bet first: the page gives the chance for 100 chips.

    Open this problem in the tool

    1. From the page, for 100 chips on a European wheel:

    2. When the target is twice the start, N = 2a, the fraction simplifies, because 1 โˆ’ r2a = (1 โˆ’ ra)(1 + ra). For 100 chips r100 = 222.90:

    3. Set it equal to one in a million and solve for a:

    4. Chips come whole, so check the two either side:

    Answer

    256 chips on a European wheel. With 255 the chance is 1.03 in a million, with 256 it is 0.975 in a million. On an American wheel r = 20/18 and the same steps give 131.1, so 132 chips. Bold play doubles 48.65% of the time on a European wheel and 47.37% on an American one, at any of these sizes; set 256 and 512 on the page and move the stake to see both.

Learning path

Fair games that ruin you

References (3)