Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.The gambler’s dream that never works
A gambler bets on fair coin flips with a “foolproof” plan: bet 1; after every loss, double the bet. Eventually a win comes and recovers everything plus 1. What could go wrong? A long losing streak needs a bet bigger than all the gambler’s money, and they’re wiped out. On average, the plan wins exactly nothing.
The rule behind this: in a fair game, whatever you’ve seen so far, your expected future fortune equals your fortune now. No clever betting or stopping rule can change that average. A process with this property is a martingale.
Martingales tell you when an estimate is “honest”, meaning it doesn’t drift on average. They give exact answers to “will the robot reach the dock before the battery dies?” They also let you monitor a system continuously without fooling yourself with false alarms. Learning-theory bounds, stochastic approximation and filtering proofs all run on them.
- 1. In a fair game, your expected future fortune is…
- 2. The 'double after each loss' strategy, on average, wins…
- 3. Can a stopping rule turn a fair game into a winning one (bounded money and time)?
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.Definition
Let be the information at time (a filtration, A4.3-1). is a martingale if it is known at time (adapted), , and
If the condition is instead, it’s a supermartingale (an unfavourable game). If it’s , a submartingale. Taking expectations: for all .
Examples
- Symmetric random walk .
- Compensated square : .
- Exponential martingale .
- Products of iid mean-1 positive factors. Likelihood ratios under are an example.
- Doob martingale : your best guess of as information arrives.
- 1. For a martingale, E M₁₀₀ equals…
- 2. Which is a martingale for the simple random walk?
- 3. A game that's unfavourable to you is a…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.Optional stopping
A stopping time is a rule whose decision “stop now?” uses only the past. If is bounded, or with bounded increments, then
Gambler’s ruin in two lines. Stop the walk at 0 or , starting from .
- Apply it to : , so .
- Apply it to : , so .
The conditions matter. “Stop the first time ” gives . Here a.s. but , and the doubling strategy needs unbounded credit. With finite resources, no strategy beats a fair game.
Martingale transforms
If you bet (decided from the past) on each fair increment, your wealth is still a martingale. It’s the discrete version of the Itô integral (A4.4-5).
- 1. Fair walk from 4, stop at 0 or 10: P(hit 10)?
- 2. Same walk: E τ?
- 3. 'Stop when ahead by 1' fails optional stopping because…
Level 3: Advanced
★★★★☆ Advanced⏱ 45 minGraduate level, with full derivations and proofs.Proof of optional stopping (bounded τ)
Let . Write .
- Predictability. .
- Each term has mean zero. .
- Sum up. . ∎ For unbounded , apply this to and let under dominated convergence.
Convergence and maximal inequalities
- Martingale convergence theorem. An -bounded martingale converges a.s. Bounded or non-negative martingales always converge. Examples: the Pólya urn fraction, and posterior probabilities as data accumulate.
- Doob’s maximal inequality. .
- Ville’s inequality. A non-negative supermartingale with satisfies , uniformly over all time.
- Azuma–Hoeffding. If , then . This powers McDiarmid (A4.3-6).
Doob decomposition
Every adapted integrable process splits as : a martingale plus a predictable drift . For , . This is the discrete root of quadratic variation and of Itô’s lemma.
Exercise 3.1: Show the Pólya urn fraction is a martingale
With red balls out of , the next fraction is with probability , and otherwise. Its expectation is .
- 1. Ville's inequality bounds P(sup M_n ≥ 1/α) for a non-negative supermartingale starting at 1 by…
- 2. A bounded martingale…
- 3. In S_n² = M_n + A_n, the predictable part is…
Level 4: Expert
★★★★★ Expert⏱ 45 minResearchers: original papers and open problems.Monitoring a success rate without fooling yourself
A deployed grasping robot should succeed 95% of the time. Engineers want an alarm as soon as performance degrades. Re-running a standard 95% test after every trial (“peeking”) makes the false-alarm rate climb toward certainty as time goes on: about 30% within 1000 trials here. The fix is a martingale. The likelihood ratio has mean 1 under the healthy rate . By Ville’s inequality, alarming when keeps false alarms below no matter how often you look. That’s Wald’s SPRT, and the basis of modern anytime-valid confidence sequences and e-values (Wald, 1945; Howard et al., 2021; Ramdas et al., 2023).
Martingales in AI, robotics and aerospace
- Stochastic approximation and RL. Convergence proofs for SGD, TD and Q-learning decompose the error into a martingale-difference noise term plus a drift, then apply martingale convergence (Robbins and Siegmund, 1971; Bertsekas and Tsitsiklis, 1996).
- Bandit and RL confidence sets. Self-normalized martingale bounds give the confidence ellipsoids of LinUCB and optimism-based RL (Abbasi-Yadkori et al., 2011).
- Sequential testing and A/B monitoring. SPRT, e-processes and confidence sequences give anytime-valid inference for online experiments and safety monitors.
- Filtering consistency. The innovation sequence of a correct Kalman filter is a martingale-difference sequence. Checking this (“innovation whiteness tests”) is a standard filter-tuning diagnostic (Bar-Shalom et al., 2001).
- Stochastic stability. Supermartingale (Lyapunov-like) certificates prove that stochastic systems reach goals or stay safe with high probability (Kushner, 1967; Chakarov and Sankaranarayanan, 2013).
References
- D. Williams (1991). Probability with Martingales. Cambridge University Press.
- J. L. Doob (1953). Stochastic Processes. Wiley.
- J. Ville (1939). Étude critique de la notion de collectif. Gauthier-Villars.
- A. Wald (1945). “Sequential tests of statistical hypotheses.” Annals of Mathematical Statistics, 16(2).
- K. Azuma (1967). “Weighted sums of certain dependent random variables.” Tôhoku Mathematical Journal, 19(3).
- S. Howard, A. Ramdas, J. McAuliffe, J. Sekhon (2021). “Time-uniform, nonparametric, nonasymptotic confidence sequences.” Annals of Statistics, 49(2).
- A. Ramdas, P. Grünwald, V. Vovk, G. Shafer (2023). “Game-theoretic statistics and safe anytime-valid inference.” Statistical Science, 38(4).
- H. Robbins, D. Siegmund (1971). “A convergence theorem for non negative almost supermartingales and some applications.” Optimizing Methods in Statistics.
- D. Bertsekas, J. Tsitsiklis (1996). Neuro-Dynamic Programming. Athena Scientific.
- H. Kushner (1967). Stochastic Stability and Control. Academic Press.