St. Petersburg Paradox — Why Expected Value Can Diverge
Play the St. Petersburg coin-flip game thousands of times per second: a 3D 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.
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 a real-time 3D histogram of payout frequencies and a running-average tracker that keeps climbing instead of settling, unlike the Law of Large Numbers examples elsewhere on this site. 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.
Play the classic St. Petersburg coin-flip game thousands of times per second and watch a live 3D payout histogram and running-average tracker reveal why its expected value is mathematically infinite, and how a flip-cap slider restores convergence.
3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install