Gamblers Ruin Calculator

The gambler's ruin problem asks: starting with a stake, betting one unit at a time, what is the chance of reaching a target before going broke? Enter your starting units, your target units, and your per-round win probability. The calculator returns the exact probability of reaching the target and the exact probability of ruin, using the classic boundary formula for a one-dimensional random walk. It shows starkly why even a small per-round disadvantage makes hitting an ambitious target almost hopeless, and why a fair game gives you exactly your stake-to-target ratio.

0.00
0.00
0.00
0.00

Gambler's ruin formulas

If p = 0.5: P(reach N) = i / N
If p != 0.5: let r = (1 - p) / p
P(reach N) = (1 - r^i) / (1 - r^N)
P(ruin) = 1 - P(reach N)

The ratio r captures the per-round disadvantage. When r is greater than 1 (an unfavourable game) the win probability collapses as the target N grows, because r raised to a large power dominates the denominator.

Key facts

  • In a fair game, doubling your stake (i = N/2 to N) is exactly a 50 percent proposition.
  • With p just below 0.5, the win probability falls well below the fair-game ratio.
  • Larger targets relative to your stake always lower your chance of success.
  • If your starting units equal the target, you have already won (probability 1).
  • If you start at 0 units, ruin is immediate (probability 1).

Gamblers ruin: frequently asked questions

What is the gambler's ruin problem?

A gambler starts with i units and bets one unit per round, winning with probability p and losing with probability 1 minus p. Play continues until they either reach a target of N units or drop to 0 (ruin). The gambler's ruin formula gives the exact probability of reaching N before hitting 0.

What is the formula for a fair game?

When p equals 0.5 the game is fair and the probability of reaching the target N starting from i is simply i divided by N. The probability of ruin is 1 minus i over N. So a gambler aiming to double a stake in a fair game has exactly a 50 percent chance.

What is the formula for an unfair game?

When p is not 0.5, let r equal (1 minus p) over p. The probability of reaching N from i is (1 minus r to the power i) divided by (1 minus r to the power N). Even a small house edge drives the win probability sharply down as the target grows.

Why does a small edge matter so much?

Because the win probability depends on r raised to powers of the stake and target, a tiny per-round disadvantage compounds. Trying to win a large amount against an unfavourable game makes ruin almost certain, which is the mathematical heart of why the house wins over time.

What inputs are required?

Enter the starting units i, the target units N, and the single-round win probability p between 0 and 1. The starting units must be between 0 and the target. The calculator returns the probability of reaching the target and the probability of ruin.

Official sources

Reviewed by the CalculatorHub team, edited by James Graham, 16 June 2026. See our methodology.