Gambler’s ruin probability calculator
Estimate the chance a unit-step random walk reaches a target bankroll before it reaches zero.
How to use this calculator
Estimate the chance a unit-step random walk reaches a target bankroll before it reaches zero.
- Enter Starting units i, Target units N, Win probability per step p. Match the units shown beside each field and review the result together with the assumptions below.
- Read the worked example below to check the expected input format and result.
- Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
How the Gambler’s ruin probability calculator works
Estimate the chance a unit-step random walk reaches a target bankroll before it reaches zero.
Inputs and units
- Starting units i: Starting units i is the current integer distance above the zero boundary.
- Target units N: Target units N is the positive integer bankroll at which the walk stops.
- Win probability per step p: Win probability p is the chance of a +1 step; 1−p is the chance of a −1 step.
Formula and method
For 0 < p < 1 and 0 < i < N: Pᵢ = [1−(q/p)ⁱ]/[1−(q/p)ᴺ], q=1−p; at p=0.5, Pᵢ=i/N.
Worked example
Starting at i = 3 with target N = 10 and p = 0.5 gives P = 3/10 = 0.30.
Interpreting the result
This is the probability of hitting the target before ruin under the stated walk. The complementary probability is the chance of hitting zero first when the walk is absorbed at either boundary.
Assumptions and limits
Each step changes the bankroll by exactly one unit; win probability is constant and steps are independent. It ignores stake size changes, stopping rules, fees, and external bankroll additions.
Sources and method
- Provides a Markov-chain treatment of the gambler’s-ruin random walk and its absorbing boundaries. Carnegie Mellon University: Markov chains and gambler’s ruin
Frequently asked questions
What does a 0.30 result mean?
Under the unit-step model, the target is hit before zero in 30% of repeated plays.
What happens when the starting bankroll equals a boundary?
At zero the target-first probability is 0; at the target it is 1.
How do I use the Gambler’s ruin probability calculator?
Enter Starting units i, Target units N, Win probability per step p. Match the units shown beside each field and review the result together with the assumptions below.
What is a worked example of Gambler’s ruin probability?
Starting at i = 3 with target N = 10 and p = 0.5 gives P = 3/10 = 0.30.
What does the Gambler’s ruin probability calculator calculate?
Estimate the chance a unit-step random walk reaches a target bankroll before it reaches zero.
See the calculation methodology.