Quant Topics

Martingales and the Optional Stopping Theorem

NeetQuant Team · June 2026 · 6 min read

A martingale is a process whose expected next value, given everything observed so far, equals its current value — a mathematically "fair game." Formally,

E[Xt+1X0,,Xt]=Xt.\mathbb{E}[X_{t+1} \mid X_0, \dots, X_t] = X_t.

Your bankroll across a sequence of fair bets is the canonical example. The concept is one of the most useful tools in quant interviews because it turns hard-looking problems into one-line answers.

No system beats a fair game

The famous "martingale" betting strategy: bet 1; if you lose, bet 2, then 4, 8, and so on, doubling until you win — at which point you recover all losses plus 1. It feels like guaranteed profit. It is not.

The optional stopping theorem says that, under mild conditions, the expected value of a martingale at a stopping time equals its starting value. In plain terms: if the game is fair, no rule for when to stop can make it favourable.

Why the doubling system fails. It quietly assumes infinite wealth and no table limit. In reality a long losing streak — certain to happen eventually — bankrupts you before the recovering win arrives. The rare catastrophic loss exactly offsets the many small wins, and the game stays fair.

Why interviewers love it

Optional stopping cracks a whole class of "expected time" and "exit probability" questions.

Worked example: gambler's ruin. You start with kk dollars and bet 1 on fair coin flips until you reach 0 or NN. Your fortune is a martingale, so by optional stopping its expected final value equals its start, kk. The only outcomes are 0 and NN, so if PP is the probability of reaching NN first, then NP+0(1P)=kN \cdot P + 0 \cdot (1-P) = k, giving P=k/NP = k/N — no recursion required.

The same trick — pair the process with a cleverly chosen martingale, then apply optional stopping — reads off expected hitting times directly. When you see a fair random walk and a question about where or when it stops, reach for a martingale.

The subtlety that impresses interviewers

The theorem needs conditions — a bounded stopping time, or bounded increments. The doubling strategy is precisely the counterexample when they fail, since its stopping time is unbounded. Knowing when optional stopping applies, and when it does not, is what separates strong candidates.

Practise

Build intuition with stochastic processes and probability problems on random walks and fair games. The pattern recurs constantly in research-leaning interviews like Two Sigma and Citadel.

Keep practising

Practise quant interview questions free

Create a free account to attempt hundreds of questions with hints and answer checking, and to run the timed simulators.

Start practising free

Frequently asked questions

What exactly makes a process a martingale?
Its conditional expectation of the next value, given everything observed so far, equals the current value. Your bankroll under repeated fair bets is the standard example.
Why does the doubling (martingale) betting system fail?
Optional stopping says a fair game stays fair under any stopping rule. The doubling system only looks like a sure win because it assumes unlimited wealth and no bet cap; in reality a long-enough losing streak — which will happen — bankrupts you before the recovering win arrives.
Martingales and the Optional Stopping Theorem · NeetQuant