This calculator estimates the probability that a gambler starting with i units of capital reaches a target fortune of N units before hitting 0 (ruin), under the classical “gambler’s ruin” model. Each round changes the fortune by exactly +1 (win) or −1 (loss). The probability of winning any single round is p (constant over time), and the probability of losing is q = 1 − p.
Let Xt be your fortune after t rounds. You start at X0 = i with two absorbing barriers: 0 (ruin) and N (target). On each round:
The key quantity is the success probability: P(success) = P(reach N before 0 | start at i). The ruin probability is simply P(ruin) = 1 − P(success).
The standard difference-equation solution yields a closed form. There are two cases: a fair game (p = 1/2) and a biased game (p ≠ 1/2).
When wins and losses are equally likely, the probability of reaching N before 0 is linear in the starting capital:
Let q = 1 − p. Define the ratio r = q/p. Then:
P(success) = (1 − ri) / (1 − rN).
Written directly in terms of p and q: P(success) = (1 − (q/p)i) / (1 − (q/p)N).
Once you have P(success): P(ruin) = 1 − P(success).
A useful intuition: for p ≠ 1/2, the expression depends on powers of q/p. Exponentials change quickly, so small differences between p and 0.5 can lead to large differences in the probability when N is large.
Suppose you start with i = 10 units and your goal is N = 50 units.
Here q = 0.51 and r = q/p = 0.51/0.49 ≈ 1.040816. Because r > 1, the powers ri and rN grow, and the success probability becomes small. Using the biased formula:
P(success) = (1 − r10) / (1 − r50).
Numerically this is only a modest chance of hitting 50 before ruin, despite starting at 10.
Now q = 0.49 and r = 0.49/0.51 ≈ 0.960784. Because r < 1, the powers decay with larger exponents, boosting success probability compared with the unfavorable case.
P(success) = (1 − r10) / (1 − r50), with a meaningfully higher result than in Example A.
The key takeaway is not the exact decimals in this write-up, but the sensitivity: moving p from 0.49 to 0.51 can dramatically change the outcome when the target N is far away.
| Situation | Condition | P(success) form | Practical implication |
|---|---|---|---|
| Fair game | p = 1/2 | i / N | Success probability scales linearly with starting capital. |
| Favorable game | p > 1/2 | (1 − (q/p)^i) / (1 − (q/p)^N) | Odds improve, but ruin can still occur before reaching a high target. |
| Unfavorable game | p < 1/2 | (1 − (q/p)^i) / (1 − (q/p)^N) | Success probability drops quickly as N increases. |