Home▸Probability & Statistics▸Martingales & the Optional Stopping Theorem

Martingales & the Optional Stopping Theorem

Watch a bundle of fair-coin random walks race in 3D toward a stopping barrier and see the martingale property survive: the sample mean at the moment each path stops still hovers at its starting value, exactly as the optional stopping theorem predicts.

Probability & Statistics3DAdvanced60 FPS📱 Mobile-adapted
probability-theory-advanced ↗ Open standalone

This simulator races a bundle of independent fair-coin random walks in 3D, each one stopped the instant it first crosses a barrier ±B, and tracks the live sample mean against the theoretical value the optional stopping theorem predicts. It is a direct, hands-on view of a martingale property that underpins fair-game analysis, Wald's identity, and risk-neutral option pricing: no matter how the individual paths wander before they are stopped, their average outcome cannot drift away from the starting value as long as the underlying process stays fair.

⚙ Under the hood

Race a bundle of independent fair-coin random walks in 3D, each stopped the instant it crosses a barrier, and watch the live sample mean confirm the optional stopping theorem: it keeps hovering at the starting value as long as the process stays a martingale.

probabilitymartingalestochastic-processesrandom-walkmarkovmonte-carlo

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)