Gambler's Ruin Calculator

Probability

Probability of reaching the goal40.13%
P(ruin)59.87%
Expected bets98.7
How this was calculated
  1. With win probability 49% per bet, the loss-to-win ratio is r = q/p = 1.0408.
  2. The closed form is P = (1 - r^start) / (1 - r^goal), the standard gambler's ruin solution.
  3. P(reach 20) = 40.13%, so P(ruin) = 59.87%.
  4. Expected number of bets before absorption = 98.7.

A gambler starts with i units, bets 1 unit at a time on an even-money wager, and stops only at ruin (0) or at a goal of N units. What is the chance of success? This is the gambler's ruin problem, one of the oldest questions in probability, and its answer is this calculator: with win probability p and loss probability q = 1 - p, writing r = q/p, the success probability is (1 - r^i) / (1 - r^N).

The numbers are sobering. In a fair game (p = 50%) success from 10 to 20 units is exactly 50% and the game lasts 100 bets on average. Give the house a 1% edge - p = 49%, roughly a roulette even-money bet - and success falls to 40.13%, with ruin at 59.87%. Favour the player at 60% and 5-to-10 succeeds 88.36% of the time. Enter your start, goal and win percentage above.

The expected duration is part of the answer because it is the hidden cost: even when the probability looks tolerable, the fair-game duration i x (N - i) shows how many bets the house edge gets to grind on. Duration, not just probability, is what makes small edges lethal over a long climb.

Worked examples

10 to 20 units at 49% (roulette-like)

(10 · 20 · 49)

Probability of reaching the goal40.13%
P(ruin)59.87%
Expected bets98.7

10 to 20 units in a fair game

(10 · 20 · 50)

Probability of reaching the goal50.00%
P(ruin)50.00%
Expected bets100.0

5 to 10 units at 60%

(5 · 10 · 60)

Probability of reaching the goal88.36%
P(ruin)11.64%
Expected bets19.2

The closed form and where it comes from

Let P(k) be the success probability starting from k units. Conditioning on the first bet gives P(k) = p P(k+1) + q P(k-1), with P(0) = 0 and P(N) = 1. This linear recurrence solves in closed form: when p ≠ q the solution is the ratio (1 - r^k) / (1 - r^N) with r = q/p; when p = q it degenerates to the straight line k/N.

The calculator evaluates the closed form directly, with a numerical guard for extreme cases: when r > 1 and N is large, r^N overflows ordinary floating point - mathematically the success probability is then effectively 0, and the calculator reports that limit rather than an error.

Fair versus unfair games

The fair case is the benchmark of intuition: probability i/N, duration i(N-i). Both are symmetric and gentle. Move p by a single point and the picture warps: at p = 49%, i = 10, N = 20, probability drops ten full points to 40.13% while duration barely moves (98.7 bets). The edge does its damage to the odds, not the clock.

This asymmetry is the mathematical core of casino economics. The house does not need to shorten your game or change its feel; it needs only to tilt each bet slightly, and the compounding over a hundred bets does the rest. The formula lets you watch the compounding happen as you slide p.

Expected duration

For p ≠ q the expected number of bets is (i - N x P(i)) / (q - p), where P(i) is the success probability; for the fair game it is i(N - i), maximised when starting halfway to the goal. Durations grow quadratically with the distance scale - doubling both i and N at fixed ratio quadruples the fair duration - which is why 'playing until I double up or bust' is a much longer commitment from 100 units than from 10.

Duration also explains a common gambler's fallacy: long losing sessions feel anomalous, but the expected session length at realistic parameters is already long, and the variance around it is large. The distribution has heavy tails - some games end in a handful of bets, others run ten times the mean.

Worked examples

Roulette-like: i = 10, N = 20, p = 49% (an even-money bet facing a single zero is actually 48.6%, close enough to see the effect): success 40.13%, ruin 59.87%, expected duration 98.7 bets. Fair: same stakes at p = 50%: 50.00%, 100.0 bets. Favoured: i = 5, N = 10, p = 60%: success 88.36%, because a strong per-bet edge compounds in the player's favour just as efficiently.

Try the extremes in the calculator: p = 51% from 10 to 20 lifts success only to about 59.9% - a small edge helps the player exactly as much as it hurt at 49%, symmetrically - while pushing the goal to 100 at p = 49% crushes success towards zero even though each bet is nearly fair.

Assumptions and their limits

The model assumes flat 1-unit bets, independent trials, a fixed p, and no quitting rule short of the two barriers. Real gamblers vary stakes (which changes everything - bold play and timid play have their own theories), face table limits, and stop for dinner. The calculator is the benchmark model, not a simulator of a real evening.

It also assumes the goal and ruin are the only exits. If the real question is 'what is the chance of being ahead after 200 bets', that is a different (random walk / binomial) computation, available through this site's probability pages. Naming the right model is most of applied probability.

Martingales and other mirages

Doubling after every loss (the martingale) does not change the ruin mathematics for the worse or better in expectation - it repackages many small wins against rare catastrophic losses, and with a finite bankroll and table maximum the ruin barrier is hit with the same overall probability the flat-betting formula family predicts for the equivalent game. The gambler's ruin framework is precisely the tool that exposes this: expected value is conserved, only the distribution's shape changes.

What does change the answer is changing p (game selection), changing the goal (ambition), or changing the stake sizing (a different stochastic process). The calculator quantifies the first two; the third is a warning label, not a feature.

A note on responsible use

This page exists because the mathematics is classical and beautiful - Pascal and Fermat corresponded about its ancestors, and Huygens published it in 1657. Its practical lesson runs one way: against a negative edge, the probability of climbing to a goal falls exponentially with the distance, and no staking plan repeals that.

If gambling has stopped being a mathematics problem for you or someone near you, treat that as the real result on the page and seek support - most jurisdictions run free, confidential helplines, and they exist precisely because these formulas are unforgiving.

The same mathematics outside the casino

Strip the gambling language and the ruin problem is the mathematics of any finite buffer against a biased random walk: an insurer's reserve against claim fluctuations, a startup's runway against monthly burn variance, a battery buffer against a variable load, a species' population against demographic noise. In each, the two questions repeat - what is the probability the buffer reaches its goal before it empties, and how long does the process run?

The insurance version is literally called ruin theory and is a branch of actuarial science; the ecological version informs minimum viable population estimates. The casino framing survives because it is the cleanest - fixed stakes, fixed probabilities, no strategy - but whenever you meet the structure elsewhere, this page's formulas are the first approximation to reach for.

FAQs

What is the gambler's ruin probability from 10 to 20 at 49%?

Success is 40.13%, so the ruin probability is 59.87%.

What is the formula for gambler's ruin?

P = (1 - r^i) / (1 - r^N), where r = q/p is the ratio of loss to win probability, i is the start and N the goal.

What happens in a fair game?

The success probability is i/N and the expected number of bets is i x (N - i) - 100 bets for 10 to 20.

Why does a small house edge matter so much?

It compounds over every bet: at 49% instead of 50%, the 10-to-20 success rate falls from 50% to 40.13%.

How long does a fair 10-to-20 game last on average?

100 bets in expectation - though individual games vary widely around that mean.

Does bet sizing change the result?

The classic formula assumes flat 1-unit bets. Other staking rules change the process and the probabilities - but never the sign of the edge.

Sources

Related calculators

Probability Calculator
Two independent events, every combination: both happen, at least one, exactly one, or neither — from the two individual probabilities.
Binomial Distribution Calculator
Exact, at-most and at-least probabilities for a run of independent yes/no trials — with the combination count, mean and standard deviation.
Expected Value Calculator
The expected value of a gamble, game or decision from up to four outcomes and their probabilities — with variance and standard deviation for the spread.