One of the most famous problems in probability theory is the “Gambler’s Ruin.” It poses a simple question: if a gambler starts with i units and plays until they either reach N units (success) or lose everything (ruin), what is the probability of each outcome?
Unlike bankroll calculators that use standard deviation approximations, our Gambler’s Ruin Calculator uses the exact discrete random walk formulas. It treats every bet as a distinct ±1 unit step, allowing you to model specific scenarios — including a Finite Horizon mode that limits the number of steps.
Gambler's Ruin Calculator
Discrete ModelP(success) = (1 − r^i) / (1 − r^N)
P(ruin) = 1 − P(success)
E[duration] = i/(q−p) − N·P(success)/(q−p)
P(ruin) = 1 − i/N
E[duration] = i × (N − i)
How to Use the Gambler’s Ruin Calculator
This tool models a Simple Random Walk with Absorbing Barriers. Each round, your balance moves up or down by exactly 1 unit. The game ends when you reach 0 (ruin) or N (target).
- Convert from $ (Optional): If you prefer to think in dollars, click the converter. Enter your bankroll, bet size, and target in dollars — the tool auto-fills the unit fields (e.g., $1,000 bankroll ÷ $25 bet = 40 starting units).
- Starting Units (i): Your bankroll in bet-sized units.
- Target Units (N): Your walk-away goal (e.g., 100 to double a 50-unit bankroll).
- Win Probability (p): The chance of winning a single unit bet. Common references: 0.500 for a fair coin, 0.4865 for European Roulette even-money bets (18/37).
- Finite Horizon (Optional): Check this box to limit the number of steps. In Finite Horizon mode, the calculator shows three outcomes: Ruin, Success, and Ongoing (neither absorbed — the session is still in play when the step limit is reached).
The Formulas
Infinite Horizon (Biased Game, p ≠ q)
Let r = q/p (the odds ratio per step).
P(Success from i) = (1 − ri) / (1 − rN)
P(Ruin) = 1 − P(Success)
E[Duration] = i / (q − p) − N × P(Success) / (q − p)
Fair Game (p = q = 0.5)
P(Success from i) = i / N
P(Ruin) = 1 − i / N
E[Duration] = i × (N − i)
Finite Horizon
Computed via dynamic programming over the state space {0, 1, …, N}. At each step, probability mass at non-boundary states splits between up and down. Mass reaching 0 or N is absorbed. After the maximum number of steps, any remaining mass is the “Ongoing” probability.
Model Assumptions
This calculator models a simple symmetric/asymmetric random walk with fixed step size. The key assumptions are:
- Fixed ±1 unit steps. Every round, you win exactly 1 unit or lose exactly 1 unit. No variable bets, no doubles, no partial wins.
- Constant probability. p does not change between rounds.
- Independent rounds. The outcome of one round does not affect the next.
- No pushes. Every round has a decisive outcome.
- Two absorbing barriers. The walk ends only at 0 (ruin) or N (target).
Games with complex payout structures — Blackjack (doubles, splits, 3:2 blackjack payout, pushes), parlays, or any variable-stake strategy — are only roughly approximated by this model. The ±1 random walk captures the directional drift (house edge) but not the payout variance of these games.
Real-World Examples
Example 1: The Fair Game (p = 0.5)
You start with 50 units and want to reach 100 units. The game is a fair coin flip (p = 0.5).
- P(Ruin): 50.00%.
- P(Success): 50.00%.
- Expected Duration: 2,500 steps.
- Interpretation: In a fair game, your probability of reaching the target is exactly proportional to your starting position (i/N = 50/100 = 50%). The expected duration of 2,500 steps is a mean — individual sessions can be much shorter or much longer.
Example 2: European Roulette (p = 0.4865)
Same setup: 50 starting units, target 100. But now p = 18/37 ≈ 0.4865 (Red/Black on a single-zero wheel).
- P(Ruin): ~93.7%.
- P(Success): ~6.3%.
- Interpretation: A 2.7% house edge per spin translates to overwhelming ruin probability over a 50-to-100 unit walk. You are roughly 15 times more likely to go bust than to double up. This is the power of compounded negative drift: even a small per-step disadvantage is devastating over many steps.
Example 3: Slight Player Advantage (p = 0.51)
You have a small edge (p = 0.51): 50 starting units, target 100.
- Infinite Horizon P(Success): ~73.1%.
- Infinite Horizon P(Ruin): ~26.9%.
- Expected Duration: ~2,450 steps.
- Finite Horizon (100 steps): P(Success) drops to roughly 3-5%, P(Ruin) roughly 3-5%, and the vast majority (~90%+) of sessions are still Ongoing — not yet absorbed at either barrier.
- Interpretation: Even with an edge, 100 steps is far too few to reliably reach a target of 100 units from 50. The edge pays off over thousands of steps — the expected duration is ~2,450 — but any single short session is dominated by variance.
The Casino’s Infinite Bankroll
If p < 0.5 and the casino’s bankroll is effectively unlimited (N → ∞), the ruin formula collapses to P(Ruin) = 1. In plain terms: if you play a negative-expectation game long enough without a fixed walk-away target, you will eventually lose everything with mathematical certainty. The target N is your only defense — it forces you to stop.
Frequently Asked Questions (FAQ)
What is an “Absorbing Barrier”?
In a random walk, an absorbing barrier is a state that, once reached, cannot be left. In this model, 0 (ruin) and N (target) are the two absorbing barriers. Once the walk reaches either, the game ends.
What is the difference between Infinite and Finite Horizon?
Infinite Horizon assumes unlimited play until absorption at 0 or N. Finite Horizon calculates the probabilities within a fixed number of steps. In Finite Horizon mode, a third outcome appears: “Ongoing” — the probability that neither barrier has been reached when the step limit expires.
Does bet sizing affect Gambler’s Ruin?
In this model, the “unit” is your fixed bet size. If you have $1,000 and bet $10 per round, you have 100 units. If you bet $100, you have 10 units. Fewer units means higher ruin probability but shorter expected duration. The model itself assumes the same ±1 unit step every round — it does not model variable staking (Martingale, Kelly, etc.).
Can I use this for Blackjack?
Only as a rough approximation. Blackjack has variable payouts (1.5× for blackjack, 2× for doubles), pushes, and split decisions that do not fit the ±1 unit model. The win probability p ≈ 0.493 sometimes cited for basic strategy reflects the fraction of decisive hands won, but the payoff per hand is not constant. For Blackjack-specific risk analysis, a simulation-based tool that accounts for the full payout distribution is more appropriate.
Why is Expected Duration important?
It tells you the average number of steps the walk lasts before absorption. For practical planning: if expected duration is 5,000 steps and you play 50 hands per hour, that is roughly 100 hours of play. Note that expected duration is a mean — actual stopping times have high variance, especially when p is near 0.5. Many individual sessions will end much sooner or much later than the average.
