Home▸Probability & Statistics▸St. Petersburg Paradox — Probability Ladder Cascade

St. Petersburg Paradox (2D Cascade) — Why Expected Value Can Diverge

Watch the St. Petersburg coin-flip game cascade down a probability ladder thousands of times per second: a 2D falling-token diagram, a live payout histogram and a running-average tracker show why classical expected value E[X] can diverge to infinity even though every single game ends in finite time.

Probability & Statistics2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-probability-theory ↗ Open standalone

The St. Petersburg paradox is a genuinely counterintuitive result at the heart of probability theory: a simple fair-coin game whose expected payout is mathematically infinite, even though every individual game ends after a finite (usually tiny) number of flips. This simulator runs the game live — flip a coin until it lands heads, win 2ⁿ coins if heads first appears on flip n — thousands of times per second, rendering it as tokens cascading down a 2D probability ladder (each rung a fair coin flip, each exit a completed game) alongside a live payout histogram and a running-average tracker that keeps climbing instead of settling. A truncation slider caps the maximum number of flips per game, turning the divergent sum into the closed-form E[X] = C + 1 and letting you watch convergence reappear as soon as the tail is cut off.

⚙ Under the hood

Watch the St. Petersburg coin-flip game cascade down a 2D probability ladder thousands of times per second: each falling token is one live game, exiting at rung n with probability (1/2)^n. A linked payout histogram and running-average tracker reveal why the game's expected value is mathematically infinite, and how a flip-cap slider restores convergence.

probability theoryexpected valuelaw of large numberscoin flipparadoxstatistics

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)