Play a nearly fair game long enough against a rich opponent and you will almost surely go broke. The unforgiving math of gambler's ruin.
Gambler's RuinLive
the house always wins in the end
Controls
Presets
A gambler betting against a rich casino faces gambler's ruin: even a nearly fair game (49% odds) almost always ends in bankruptcy before hitting a big target, because the house has effectively unlimited funds. The tiny edge compounds relentlessly over many bets — which is exactly how casinos stay in business.
Reading this result: The house edge (p<0.5) makes ruin nearly certain — P(ruin) rises exponentially with the target, so aiming for $50 from $20 all but guarantees going broke first.
Runs locally in your browser — free forever. Scale to the cloud when reality gets heavy.
★ Sign in to save this setupSave your tuned setup, or drop this simulation into your own site, docs, or course page.
How it works
Gambler's ruin analyzes a random walk between zero and a target. Because the casino has effectively unlimited funds and holds a small edge on every bet, the walk drifts toward your ruin far more often than toward your goal. Even at 49% odds the tiny disadvantage compounds relentlessly across many bets — the reason the house always wins in the long run. Educational tool.
✦
Ask the AI about this model
The math, the assumptions, real-world uses, or a code translation — explained for this exact simulation.
Yes. Gambler's Ruin runs entirely in your browser using your device's own compute, so local use is free forever. You only pay Compute Tokens if you scale a job to the cloud.
Do I need to install anything?▾
No. Everything runs client-side in a modern browser — no downloads, no license, no account required to start.
Can I save or share my simulation?▾
Create a free account to save projects, and use a shareable embed or minted DOI to publish a live, interactive version anywhere.
How accurate are the results?▾
The solver uses established numerical methods, but results are for research and educational purposes and should be validated against experiment or professional review before you rely on them.