Probability & Statistics

The Optional Stopping Theorem: When You Can't Beat a Fair Game

No matter how clever your quitting strategy, you cannot turn a fair game into a favorable one β€” that is the Optional Stopping Theorem, the martingale-theory formalization of "there is no free lunch." Precisely: if (Xβ‚™)β‚™β‰₯β‚€ is a martingale with respect to a filtration (β„±β‚™), and Ο„ is a stopping time, then under any one of three standard hypotheses β€” Ο„ is bounded; Ο„ is finite and X is bounded up to Ο„; or 𝔼[Ο„] < ∞ and the increments are bounded β€” one has 𝔼[X_Ο„] = 𝔼[Xβ‚€].

The theorem is deceptively simple to state and famously easy to misapply: drop a single hypothesis and a gambler doubling his bets can "guarantee" a profit from a fair coin. Understanding exactly which condition rules out that paradox is the whole content of the result.

  • FieldProbability theory / martingale theory
  • Named afterJ. L. Doob (optional sampling, 1953)
  • Statement𝔼[X_Ο„] = 𝔼[Xβ‚€] for a martingale X and stopping time Ο„ (under a boundedness/integrability hypothesis)
  • Key hypothesisOne of: Ο„ bounded; X_{Ο„βˆ§n} uniformly integrable; or 𝔼[Ο„]<∞ with bounded increments
  • Proof techniqueStopped martingale X_{Ο„βˆ§n} + Dominated / Monotone convergence to pass n β†’ ∞
  • GeneralizesWald's identities, gambler's ruin, hitting-probability formulas, martingale CLT scaffolding

Interactive visualization

Press play, or step through manually. The visualization is yours to drive β€” try it before reading on.

Open visualization fullscreen β†—

Watch the 60-second explainer

A condensed visual walkthrough β€” narrated, captioned, under a minute.

Precise statement: martingales, stopping times, and the three hypotheses

Fix a probability space (Ξ©, β„±, β„™) with a filtration (β„±β‚™)β‚™β‰₯β‚€ β€” an increasing chain β„±β‚€ βŠ‚ ℱ₁ βŠ‚ … of Οƒ-algebras encoding information up to time n. A process (Xβ‚™) is a martingale if each Xβ‚™ is β„±β‚™-measurable, integrable (𝔼|Xβ‚™| < ∞), and satisfies the fair-game identity 𝔼[Xβ‚™β‚Šβ‚ | β„±β‚™] = Xβ‚™. A stopping time Ο„: Ξ© β†’ {0,1,…,∞} is a random time with {Ο„ ≀ n} ∈ β„±β‚™ for all n β€” you decide to stop using only information available so far, no peeking into the future.

The Optional Stopping (a.k.a. Optional Sampling) Theorem asserts 𝔼[X_Ο„] = 𝔼[Xβ‚€] provided at least one of the following holds: (A) Ο„ is bounded, Ο„ ≀ N a.s.; (B) Ο„ < ∞ a.s. and the stopped process is dominated, |X_{Ο„βˆ§n}| ≀ Y with 𝔼[Y] < ∞; or (C) 𝔼[Ο„] < ∞ and the conditional increments are bounded, 𝔼[|Xβ‚™ βˆ’ Xₙ₋₁| | ℱₙ₋₁] ≀ c. For a submartingale (𝔼[Xβ‚™β‚Šβ‚|β„±β‚™] β‰₯ Xβ‚™) the equality becomes 𝔼[X_Ο„] β‰₯ 𝔼[Xβ‚€]; for a supermartingale, ≀.

The picture: a fair game stays fair, whenever you quit

Imagine your fortune Xβ‚™ playing a fair game β€” each round adds a mean-zero, unpredictable increment. The martingale property says that on average, from where you stand now, you neither gain nor lose next round: 𝔼[Xβ‚™β‚Šβ‚ | β„±β‚™] = Xβ‚™. The seductive idea is that a smart exit rule could tilt the odds: quit while ahead, keep playing while behind. Optional stopping says this is an illusion β€” the exit rule Ο„, because it cannot see the future, is powerless to bias the expectation.

Geometrically, think of the martingale as a random path whose conditional slope is always zero. Stopping is choosing when to freeze the path, and the freezing decision is measurable with respect to the past. The stopped process Xβ‚™^Ο„ := X_{Ο„βˆ§n} is still a martingale β€” freezing preserves fairness at every finite horizon. The only subtlety is the limit n β†’ ∞: does 𝔼[X_{Ο„βˆ§n}] β†’ 𝔼[X_Ο„]? The three hypotheses are exactly the conditions that license this passage to the limit; without one, mass can 'escape to infinity' and the fair game appears beatable.

Key idea of the proof: stop early, then take the limit safely

The mechanism has two moves. Move 1 (finite horizon is free). For any stopping time Ο„, the stopped process Xβ‚™^Ο„ = X_{Ο„βˆ§n} is a martingale. The one-line reason: X_{Ο„βˆ§n} βˆ’ X_{Ο„βˆ§(nβˆ’1)} = 1_{Ο„ β‰₯ n}(Xβ‚™ βˆ’ Xₙ₋₁), and the indicator 1_{Ο„ β‰₯ n} = 1 βˆ’ 1_{Ο„ ≀ nβˆ’1} is ℱₙ₋₁-measurable (since {Ο„ ≀ nβˆ’1} ∈ ℱₙ₋₁). So 𝔼[X_{Ο„βˆ§n} βˆ’ X_{Ο„βˆ§(nβˆ’1)} | ℱₙ₋₁] = 1_{Ο„ β‰₯ n} Β· 𝔼[Xβ‚™ βˆ’ Xₙ₋₁ | ℱₙ₋₁] = 0. Telescoping gives 𝔼[X_{Ο„βˆ§n}] = 𝔼[Xβ‚€] for every finite n β€” this needs no extra hypothesis.

Move 2 (pass to the limit). Since Ο„ < ∞ a.s., X_{Ο„βˆ§n} β†’ X_Ο„ pointwise. We need 𝔼[X_{Ο„βˆ§n}] β†’ 𝔼[X_Ο„]. Under (A) the sequence is finite (Ο„βˆ§n = Ο„ for n β‰₯ N). Under (B), Dominated Convergence applies via the envelope Y. Under (C), a telescoping bound |X_{Ο„βˆ§n} βˆ’ Xβ‚€| ≀ Ξ£_{k=1}^{Ο„} |Dβ‚–| gives an integrable majorant (its expectation is ≀ c·𝔼[Ο„] by a conditional Wald bound), so DCT again applies. The unifying condition is uniform integrability of {X_{Ο„βˆ§n}}, which is precisely what makes LΒΉ-convergence follow from a.s. convergence.

Canonical example: gambler's ruin and Wald's identity

Let (ΞΎα΅’) be i.i.d. with β„™(ΞΎ = +1) = β„™(ΞΎ = βˆ’1) = Β½, and Sβ‚™ = ξ₁ + … + ΞΎβ‚™ the simple symmetric random walk, Sβ‚€ = 0. Then Sβ‚™ is a martingale. For 0 < a and start at position k with 0 < k < a, let Ο„ = inf{n : Sβ‚™ = 0 or Sβ‚™ = a} be the exit time of the interval. Here Ο„ has 𝔼[Ο„] < ∞ and increments are bounded (|Dβ‚™| = 1), so hypothesis (C) holds. Optional stopping gives 𝔼[S_Ο„] = Sβ‚€ = k. Since S_Ο„ ∈ {0, a}, writing p = β„™(hit a first): 0Β·(1βˆ’p) + aΒ·p = k, so β„™(hit a before 0) = k/a β€” the classic gambler's-ruin formula, extracted in one line.

To get the expected duration, use the companion martingale Mβ‚™ = Sβ‚™Β² βˆ’ n (a martingale because 𝔼[Sβ‚™β‚Šβ‚Β² | β„±β‚™] = Sβ‚™Β² + 1). Optional stopping yields 𝔼[S_τ²] βˆ’ 𝔼[Ο„] = kΒ², and since 𝔼[S_τ²] = aΒ²Β·(k/a) = ak, we get 𝔼[Ο„] = k(a βˆ’ k). The same two martingales, Sβ‚™ and Sβ‚™Β² βˆ’ n, deliver both hitting probabilities and expected hitting times.

Why the hypotheses matter: the doubling counterexample

Drop every integrability hypothesis and the theorem is false. Take Sβ‚™ the simple symmetric random walk from 0 and Ο„ = inf{n : Sβ‚™ = 1}, the first time you are one unit ahead. Because the walk is recurrent, Ο„ < ∞ almost surely, and X_Ο„ = 1 identically. Hence 𝔼[X_Ο„] = 1 β‰  0 = 𝔼[Xβ‚€] β€” the fair game looks beaten. What fails? Here 𝔼[Ο„] = ∞, so (C) is out; the stopped values X_{Ο„βˆ§n} are unbounded below (you can dip arbitrarily negative before hitting +1), so (A) and (B) fail too; and {X_{Ο„βˆ§n}} is not uniformly integrable. The martingale-doubling betting scheme is the same phenomenon dressed as a casino strategy: it 'guarantees' a $1 profit but requires an unbounded bankroll and unbounded time.

The moral connects to uniform integrability and Doob's convergence theorems: 𝔼[X_Ο„] = 𝔼[Xβ‚€] holds iff the family {X_{Ο„βˆ§n}} is uniformly integrable, the sharp necessary-and-sufficient refinement. This ties optional stopping to the Dominated Convergence Theorem and to martingale LΒΉ/Lα΅– convergence.

Why it matters: from random walks to the pricing of options

Optional stopping is the workhorse behind a startling range of results. In probability it yields Wald's identities (𝔼[S_Ο„] = 𝔼[Ο„]·𝔼[ΞΎ] for i.i.d. sums), exit-time and exit-position laws for random walks and Brownian motion, and hitting-probability formulas that solve discrete Dirichlet problems. Its continuous-time analogue (Doob's optional sampling for right-continuous martingales, with Ο„ a stopping time and X_{Ο„βˆ§t} uniformly integrable) underlies the strong Markov property and ItΓ΄-calculus arguments.

In mathematical finance, the fundamental theorem of asset pricing says a market is arbitrage-free iff a discounted-price martingale measure exists; optional stopping is precisely why no stopping-based trading strategy β€” including early exercise of an American option below its fair value β€” can produce risk-free profit. In analysis and PDE, martingale representations of harmonic functions use optional stopping to derive mean-value and maximum principles. In algorithms and statistics it certifies sequential-test validity (Wald's SPRT) and powers concentration bounds. It is, quite literally, the theorem that formalizes 'you can't beat a fair game.'

Sufficient hypotheses for 𝔼[X_Ο„] = 𝔼[Xβ‚€], and what each rules out. Here X is a martingale, Ο„ a stopping time, and increments are Dβ‚™ = Xβ‚™ βˆ’ Xₙ₋₁.
HypothesisConclusionWhat it forbids / typical use
(A) Ο„ ≀ N almost surely (bounded stopping time)𝔼[X_Ο„] = 𝔼[Xβ‚€] alwaysNo hypothesis on X needed; the cleanest case. Rules out 'wait arbitrarily long'.
(B) Ο„ < ∞ a.s. and |X_{Ο„βˆ§n}| ≀ Y with 𝔼[Y] < ∞ (dominated)𝔼[X_Ο„] = 𝔼[Xβ‚€]Bounded game payoffs. Rules out unbounded fortunes like the doubling martingale.
(C) 𝔼[Ο„] < ∞ and 𝔼[|Dβ‚™| | ℱₙ₋₁] ≀ c a.s. (bounded increments)𝔼[X_Ο„] = 𝔼[Xβ‚€]Random walks with fixed step size; underlies Wald's identity and gambler's ruin.
(D) X_{Ο„βˆ§n} uniformly integrable and Ο„ < ∞ a.s.𝔼[X_Ο„] = 𝔼[Xβ‚€]The sharpest single sufficient condition; (A)–(C) are special cases of it.
None (only Ο„ < ∞ a.s.)Can FAIL: 𝔼[X_Ο„] > 𝔼[Xβ‚€]Doubling strategy / simple random walk hitting +1: 𝔼[X_Ο„] = 1 β‰  0 = Xβ‚€.

Frequently asked questions

Why isn't Ο„ < ∞ almost surely enough on its own?

Because probability mass can escape to infinity in expectation even when the stopping time is finite pointwise. The simple random walk hitting +1 has Ο„ < ∞ a.s. yet 𝔼[X_Ο„] = 1 β‰  0 = 𝔼[Xβ‚€]. The failure is that {X_{Ο„βˆ§n}} is not uniformly integrable: the walk can dip arbitrarily far negative before hitting +1, and 𝔼[Ο„] = ∞. You always have 𝔼[X_{Ο„βˆ§n}] = 𝔼[Xβ‚€] for finite n, but the limit n β†’ ∞ does not commute with expectation without an integrability control.

What is the single sharpest sufficient condition?

Uniform integrability of the stopped family {X_{Ο„βˆ§n} : n β‰₯ 0}, together with Ο„ < ∞ a.s. This is condition (D) and it implies conclusions (A), (B), and (C) as special cases: bounded Ο„, a dominating integrable envelope, or 𝔼[Ο„] < ∞ with bounded increments each force uniform integrability. In fact 𝔼[X_Ο„] = 𝔼[Xβ‚€] holds if and only if the martingale converges in LΒΉ along the stopped sequence, which is exactly uniform integrability by the Vitali/Dunford–Pettis characterization.

How does optional stopping give the gambler's-ruin probabilities?

For the symmetric walk started at k in (0, a) with exit time Ο„, hypothesis (C) holds (bounded Β±1 increments, 𝔼[Ο„] < ∞), so 𝔼[S_Ο„] = k. Since S_Ο„ ∈ {0, a}, solving aΒ·β„™(hit a first) = k gives β„™ = k/a. Using the second martingale Sβ‚™Β² βˆ’ n and optional stopping gives 𝔼[Ο„] = k(a βˆ’ k). For a biased walk you instead use the exponential martingale (q/p)^{Sβ‚™}, which is a martingale precisely when the step law makes it one.

Does the theorem hold in continuous time?

Yes. For a right-continuous martingale (Xβ‚œ)β‚œβ‰₯β‚€ adapted to a filtration satisfying the usual conditions, and stopping times Οƒ ≀ Ο„, one has 𝔼[X_Ο„ | β„±_Οƒ] = X_Οƒ provided {X_{Ο„βˆ§t}} is uniformly integrable (Doob's optional sampling theorem). Bounded stopping times work with no extra hypothesis. This continuous version is central to ItΓ΄ calculus: it turns the local-martingale part of a stochastic integral into something with controlled expectation once you localize by a sequence of stopping times Ο„_n ↑ ∞.

What is the difference between a martingale and a submartingale version?

For a martingale the conclusion is the equality 𝔼[X_Ο„] = 𝔼[Xβ‚€]. For a submartingale (𝔼[Xβ‚™β‚Šβ‚|β„±β‚™] β‰₯ Xβ‚™, a 'favorable' game) it weakens to the inequality 𝔼[X_Ο„] β‰₯ 𝔼[Xβ‚€], and for a supermartingale to 𝔼[X_Ο„] ≀ 𝔼[Xβ‚€]. More generally, for two ordered stopping times Οƒ ≀ Ο„ satisfying the integrability hypothesis, 𝔼[X_Ο„ | β„±_Οƒ] equals X_Οƒ (martingale), is β‰₯ X_Οƒ (submartingale), or ≀ X_Οƒ (supermartingale). The Doob decomposition reduces the submartingale case to the martingale case plus a monotone predictable part.

Is the stopped process X_{Ο„βˆ§n} always a martingale?

Yes, and crucially with no extra hypotheses β€” this is the 'free' half of the proof. The increment X_{Ο„βˆ§n} βˆ’ X_{Ο„βˆ§(nβˆ’1)} = 1_{Ο„β‰₯n}(Xβ‚™ βˆ’ Xₙ₋₁), and 1_{Ο„β‰₯n} is ℱₙ₋₁-measurable because {Ο„ β‰₯ n} = {Ο„ ≀ nβˆ’1}ᢜ ∈ ℱₙ₋₁. Taking conditional expectation kills the martingale increment, so 𝔼[X_{Ο„βˆ§n} | ℱₙ₋₁] = X_{Ο„βˆ§(nβˆ’1)}. Hence 𝔼[X_{Ο„βˆ§n}] = 𝔼[Xβ‚€] for every finite n. All the work in optional stopping is justifying the limit n β†’ ∞; the finite-horizon identity is automatic.