Gambler ruin probability calculator

What is the chance of ruin starting 3 units from zero with a target of 10 units in a fair game?

With equal odds of winning or losing one unit per step, the probability of reaching zero before ten is 1 - 3/10 = 0.7. A small edge changes this through powers of the ratio of loss to win probabilities.

The model assumes unit-size wins and losses with constant odds and no time limit, which a trading account rarely satisfies.

Calculate exact eventual ruin probability in a finite fair-or-biased unit-step random walk. Two absorbing boundaries terminate the unit-step walk.

The fair three-to-ten walk

At p = 0.5, starting three units from ruin with an upper boundary at ten units, eventual ruin probability is exactly 1−3/10 = 0.7.

This classic first-passage result offers a transparent reference model for two absorbing barriers. Capital is an integer number of units. A winning step adds one, a losing step subtracts one, and the walk stops upon reaching either zero or the selected upper level. The fair case has a simple linear answer. With a biased step, the ratio of loss to win probabilities enters through powers; the implementation uses equivalent rearrangements to limit overflow when the bias is strong. At win probability zero the lower barrier is certain, and at one the upper barrier is certain. These boundary results are useful tests, but neither resembles a real strategy with varied trade sizes. The horizon is eventual absorption, so it can be much longer than a particular account evaluation. The challenge simulator includes daily limits and asymmetric payoffs; its process must be specified before comparing outputs.

Absorbing boundaries

Each step changes capital by exactly one unit. Win probability is constant, steps are independent, and the game stops at either zero or the upper boundary.

P(ruin) = (r^i−r^N)/(1−r^N), r=(1−p)/p; for p=0.5, P=1−i/N

An upper boundary turns the question into which barrier arrives first. The result is not the chance of ruin over a chosen number of trades, and changing the upper boundary changes the event.

Where this model stops

A trading account rarely has constant one-unit wins and losses. There is no time horizon, transaction cost, position sizing, gap risk or changing edge here. A probability of zero or one is handled as a deterministic walk.

Grinstead and Snell

Grinstead, C. M. and Snell, J. L. (1997), Introduction to Probability, second revised edition, American Mathematical Society, chapter 12, section 12.2 Gambler's Ruin. The result here has a finite upper barrier and unit-size steps. Original or institutional source.

Risk of ruin · All tools

Embed this calculator

Other sites can show the gambler ruin probability calculator in a frame served from /embed/gambler-ruin-probability-calculator: the same fields and results, computed in the visitor's browser, with a visible credit and a link to the full calculator. The code below places the gambler ruin probability calculator frame, a plain link to the full calculator under it, and a script that fits the frame height to its content.

The script applies a height message only when it comes from https://stochastly.com and from the gambler ruin probability calculator frame, with a height from 200 to 4000 pixels, and drops any other message. The gambler ruin probability calculator frame registers no message handler of its own, so a host page has no channel to change its inputs or its results.

<iframe id="stochastly-ruin" src="https://stochastly.com/embed/gambler-ruin-probability-calculator" title="Gambler ruin probability calculator by Stochastly" width="100%" height="700" style="border:0;max-width:720px" loading="lazy" sandbox="allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox" allow="clipboard-write"></iframe>
<p style="font-size:13px"><a href="https://stochastly.com/tools/gambler-ruin-probability-calculator">Gambler ruin probability calculator</a> by Stochastly</p>
<script>
(function () {
  var allowed = ["https://stochastly.com"];
  window.addEventListener("message", function (e) {
    var f = document.getElementById("stochastly-ruin");
    if (!f || allowed.indexOf(e.origin) < 0 || e.source !== f.contentWindow) return;
    var d = e.data;
    if (!d || d.type !== "stochastly-ruin-height" || typeof d.height !== "number") return;
    if (!(d.height >= 200 && d.height <= 4000)) return;
    f.style.height = Math.ceil(d.height) + "px";
  });
})();
</script>

Cite this calculator

To cite the gambler ruin probability calculator in a paper, a report or a post, copy the reference below. Its address is https://stochastly.com/tools/gambler-ruin-probability-calculator.

Stochastly (2026). Gambler ruin probability calculator [web calculator]. https://stochastly.com/tools/gambler-ruin-probability-calculator

The method behind the gambler ruin probability calculator comes from the paper below: cite that paper for the method, and the reference above for the gambler ruin probability calculator itself.

Grinstead, C. M. and Snell, J. L. (1997). Introduction to Probability, 2nd edition, chapter 12. American Mathematical Society.

Calculator

47.7464% probability of ruin

Source on GitHubstochastly-calculators · MIT