Introduction to Martingales
Suppose you play a sequence of fair bets. You can double down or hedge however cleverly you like. You may only use information available so far. Can you expect, on average, to come out ahead? The theory of martingales says no. Under remarkably general conditions, no strategy based on past information can create an expected edge from a fair game. This single insight is formalized through conditional expectation and filtrations. It turns out to organize an enormous swath of probability theory. This ranges from the fluctuations of Random Walks to option pricing in mathematical finance. Martingales matter because they isolate the essential structure behind "fairness" and "information." This structure is stripped of any assumption of independence or identical distributions. A martingale need not have independent increments. It only needs one property. Its best predicted future value, given everything known now, is its current value. This is a weaker and far more flexible hypothesis than independence. It turns out to be exactly the right hypothesis for a battery of powerful theorems. These include convergence theorems, maximal inequalities, and especially the optional stopping theorem. This theorem tells us when we may substitute a random time for a fixed one. It shows when this substitution won't upset the fair-game property. The big picture is this: filtrations formalize the flow of information through time. Martingales formalize "no expected drift given the past." Stopping times formalize "decisions made using only present and past information." The optional stopping theorem is the central engine connecting these three ideas. It lets us compute expectations at random, strategy-dependent times. This calculation uses only the martingale's initial value. This is how one proves gambler's-ruin formulas and Wald's identity. It ultimately builds the bridge to continuous-time objects like Introduction to Brownian Motion. Brownian motion is itself the archetypal continuous martingale. This article gives the rigorous discrete-time definition of a martingale via conditional expectation. It develops filtrations and stopping times carefully. It states and completely proves the optional stopping theorem under two different sufficient-condition regimes. It works through fully quantitative examples, including a biased random walk and an urn-based martingale. Finally, it shows exactly what goes wrong when the theorem's hypotheses are dropped.
- A martingale is a stochastic process whose conditional expected future value, given the past, equals its present value.
- Filtrations formalize "information available by time "; a martingale must be adapted to its filtration.
- Sub/supermartingales relax equality to / , modeling favorable/unfavorable games.
- Stopping times are random times whose occurrence is determined without peeking into the future.
- The optional stopping theorem gives conditions under which for a random time .
- Key idea: you cannot manufacture expected profit from a fair game using only past information, and the optional stopping theorem is the precise statement of why.
Where this lives today
Martingale theory underlies the martingale approach to option pricing in mathematical finance: the discounted price of a tradable asset under a risk-neutral measure is required to be a martingale, and the optional stopping theorem justifies pricing American-style options via optimal stopping. In statistics, martingale central limit theorems extend classical CLTs to dependent data (e.g., in sequential analysis and stochastic approximation). In computer science, martingale concentration inequalities (Azuma–Hoeffding, built on the martingale transform technique used in this article's Lemma) bound the fluctuations of randomized algorithms and are staples in the probabilistic analysis of algorithms and in differential privacy proofs. In branching processes and population genetics, martingales like the one in the Pólya urn example track the evolution of type frequencies. The theory is also the direct discrete-time precursor to Introduction to Brownian Motion, whose defining property (independent, stationary, Gaussian increments) makes it the canonical continuous-time martingale, and whose stopping-time theory (e.g. the reflection principle, hitting-time distributions) is proved using continuous analogues of exactly the optional stopping machinery developed here.
:::quiz[In the Pólya urn example, why does case (a) of the optional stopping theorem apply for computing ?]
- Because has independent increments
- Because is a fixed, deterministic, hence trivially bounded stopping time ✓
- Because the urn has infinitely many balls
- Because is Gaussian
:::faq[Can a submartingale ever have for a bounded stopping time ?] No. If is a submartingale and is a bounded stopping time, the same martingale-transform argument used to prove the Lemma shows is nondecreasing in (since has nonnegative conditional expectation), giving . So for bounded stopping times, submartingales can only gain value in expectation, never lose it — the natural asymmetric analogue of the martingale case proven in this article.
:::faq[Does the optional stopping theorem also apply to two different stopping times , giving ?] Yes, this is the strengthened "optional sampling" form, proved by the same stopped-martingale technique applied to the process restricted to , under analogous integrability hypotheses (e.g. bounded, or the analogues of conditions (b)/(c)). It reduces to the stated theorem when . The proof follows the identical stopped-martingale construction, replacing throughout by the -measurable random variable , and is the form most directly used to prove the strong Markov property connections exploited later in Introduction to Brownian Motion.
Ask the tutor: Can you show me how the optional stopping theorem is used to derive the expected duration of gambler's ruin, not just the ruin probability?
Let be a probability space. A filtration is a nondecreasing sequence of sub--algebras
interpreted as the information available by time . A stochastic process is adapted to if is -measurable for every . A sequence is a martingale with respect to if: 1. is adapted to ; 2. for all (integrability); 3. almost surely, for all . If instead a.s. for all , is a submartingale; if a.s. for all , it is a supermartingale. A random variable is a stopping time with respect to if for every — equivalently for every .
Intuition
Think of as the sealed folder of everything observable through time : past coin flips, stock prices, urn draws. Adaptedness says 's value is already determined once the folder is opened — no clairvoyance. The martingale property says that averaging over what happens next, using only what's in the folder, reproduces today's value exactly: the process has no built-in drift, up or down, conditional on the present. A stopping time is a rule for "when to quit" that only consults the folder as it is filled — you cannot decide to stop today because you know tomorrow's value will be high. The classic illegal move is "stop right before the price crashes"; that requires future information and is not a stopping time. The picture below shows one sample path of a symmetric random walk martingale, with a stopping time marked as the first time the path exits the strip . Because is defined by a condition checkable at each step using only the path so far, it is a genuine stopping time — unlike "the time of the last visit to 0 before step 20," which requires knowing the whole future path.
The central theorem
Let be a martingale with respect to a filtration , and let be a stopping time with respect to . Suppose any one of the following conditions holds:
(a) Bounded stopping time. almost surely for some fixed constant .
(b) Almost sure finiteness with bounded increments. , and there is a constant such that for all , and .
(c) Uniform integrability / boundedness. , and there exists such that almost surely for all . Then is integrable and
If is a martingale with respect to and is a stopping time, then the stopped process is also a martingale with respect to . In particular for every .
We use the martingale transform technique: write the stopped process as an initial value plus a discrete stochastic integral against a predictable, bounded strategy. Define the predictable process for . Since (as is a stopping time), is -measurable: it is predictable, meaning its value is known one step before it is used. Note . Observe the algebraic identity
Indeed, if then every term for and the sum telescopes to , giving , correct. If , then for and for , so the sum telescopes to , giving , again correct. Now check the martingale property for . We have
Since is -measurable and bounded (by ), and is integrable,
using the "pull-out" property of conditional expectation (since is -measurable and bounded) together with the martingale property . Hence . Also is -measurable (a finite sum/composition of -measurable pieces, since and hence the identity of which , , appears is -measurable), and . So is a martingale. Taking expectations, for all .
∎Proof of the Optional Stopping Theorem. By the Lemma, for every . The strategy in every case is to pass to the limit and show .
Case (a): a.s. Take directly: almost surely, so a.s., and
Integrability of follows since takes finitely many possible "time-indices" , and .
Case (b): a.s., increments bounded by , . Since a.s., almost surely as (the sequence is eventually constant, equal to , on the a.s. event ). We justify passing the limit inside the expectation via dominated convergence. Write
using the telescoping bound and the increment bound ; the right side does not depend on and dominates for all . Its expectation is by hypothesis, so it is an integrable dominating random variable. By the Dominated Convergence Theorem,
is integrable because it is dominated by the integrable variable .
Case (c): a.s., a.s. for all . Again a.s. since a.s. The constant is itself an integrable dominating random variable (it dominates for every , uniformly), so Dominated Convergence again gives
and is integrable since .
∎Let be i.i.d. with and , let (with ), and let be a stopping time (w.r.t. ) with . Then
The process is a martingale: it is adapted, integrable since , and
using independence of from . This has increments , not bounded in general, so we cannot always invoke case (b) of the Optional Stopping Theorem directly with a uniform constant ; instead one applies a standard extension (proved by the same dominated-convergence architecture, using together with to build an integrable dominating variable , whose expectation is finite by Wald's first identity for the auxiliary nonnegative walk ) to get , i.e. .
∎Worked examples
Example 1: Gambler's ruin with a biased coin, computed via a martingale. A gambler starts with fortune dollars. At each round she bets $1 on a coin with , , winning $1 on heads and losing $1 on tails, independently each round. She stops when her fortune hits (ruin) or (target). Let be her fortune after rounds, , and . Since , is not itself a martingale (it is a submartingale, drifting upward since ). Instead, the classical trick is to exponentially reweight: set , and define
Check the martingale property directly. Conditional on , w.p. and w.p. , so
Compute . So : is indeed a martingale. It is bounded: since always (fortune stops changing once absorbed, or more precisely for all ), , so case (c) of the Optional Stopping Theorem applies (with a.s. since a biased random walk absorbed at two finite barriers hits one a.s. — standard fact for random walks with nonzero drift and finite state space of the walk before absorption). Applying the theorem,
Let (probability of ruin) and . Then
Solve:
Numerically, , so , . Thus
So the probability the gambler is ruined before reaching $8, starting from $3 with , is approximately , and the probability of reaching $8 first is approximately . As a sanity check with the closed form for gambler's ruin, with , matches exactly what we derived, confirming the martingale computation reproduces the classical formula.
Example 2: A Pólya urn martingale — exact computation at a fixed finite time. An urn starts with red and blue ball. At each step, a ball is drawn uniformly at random and replaced together with one additional ball of the same color (so the urn grows by one ball each step). Let be the number of red balls after steps (so the urn has balls total after step , since it started with ), and let
be the fraction of red balls, with .
Claim: is a martingale. Given , with probability a red ball is drawn (and one more red is added), giving ; otherwise (probability ) . So
Then
So indeed , confirming the martingale property. Since always, integrability is automatic and in fact is a bounded martingale. Now let's use this concretely. Take : what is , and what is ? Since is a martingale started at , and is a (trivial, deterministic) bounded stopping time, case (a) of the theorem gives immediately
so, since the urn has balls after step ,
This matches the well-known exchangeability fact for Pólya urns (the color proportion process is a martingale converging to a Beta-distributed limit; here in distribution, whose mean is , consistent with for every , not just in the limit — a clean illustration of the martingale property holding exactly at each finite step, not merely asymptotically). This computation would have been considerably more painful by direct combinatorics (summing over all -type sequences of draws); the martingale property gives the answer in one line.
Let be i.i.d. with (symmetric simple random walk), , , and . Then is a martingale: adapted, integrable (), and
Let , the first time the walk reaches level . It is a classical fact (recurrence of simple symmetric random walk) that : the walk hits eventually almost surely. So is a well-defined, a.s.-finite stopping time, and by construction
But .
Which hypothesis of the <span class="wiki-link-missing">Optional Stopping Theorem</span> fails, and why does the conclusion break? Condition (a) fails: is not bounded — it can be arbitrarily large with positive probability, e.g. for every . Condition (b) fails: although increments are bounded (), (a standard computation shows the hitting time of level for symmetric simple random walk has infinite mean, since is (sub-)distributed like a first-passage time with heavy, non-integrable tails ). Condition (c) fails: is not uniformly bounded — before hitting , the walk can dip arbitrarily far into negative territory, so is a.s. finite pointwise (it equals the depth of the minimum before hitting ) but has no deterministic finite bound valid on the whole sample space, and indeed . This exhibits precisely how each hypothesis is doing real work: remove all three simultaneously (as here) and the "obvious" conclusion is false, even though is a perfectly legitimate, almost-surely-finite stopping time and is a genuine martingale.
Scope, edge cases & common traps
| Situation | What holds | What can fail |
|---|---|---|
| bounded by fixed | OST always applies (case a) | — |
| a.s., bounded increments, | OST applies (case b) | Fails if , even with bounded increments (see counterexample-style hitting times) |
| a.s., uniformly bounded | OST applies (case c) | Fails if only pointwise-finite, not uniformly bounded |
| finite a.s. but none of (a)-(c) hold | No general conclusion | possible, as shown above |
| Submartingale, bounded | Equality not guaranteed | |
| Supermartingale, bounded | Equality not guaranteed |
The mathematician behind it
Origins · 1 minJoseph Leo Doob and how this was discovered
Doob built the modern theory of martingales in the 1940s–1950s, formalizing what had been an informal notion from gambling theory (the word "martingale" itself comes from a betting strategy and, earlier, a piece of horse tack) into a rigorous framework grounded in measure-theoretic conditional expectation. His 1953 book Stochastic Processes established martingale convergence theorems, the optional stopping theorem, and maximal inequalities as central tools, influencing the subsequent development of stochastic calculus by Itô, Meyer, and others.
What exactly distinguishes a martingale from an i.i.d. sum with mean zero?
An i.i.d. mean-zero sum is a special case of a martingale, but martingales are far more general: increments need not be independent or identically distributed, only conditionally mean-preserving given the past. For instance, the Pólya urn fraction process in the worked example is a martingale whose increments are neither independent nor identically distributed, yet the defining property still holds exactly. This flexibility is precisely why martingale theory subsumes and extends classical results about Random Walks to much broader settings, including urn models, branching processes, and stochastic approximation algorithms.
Is every martingale bounded, or does it always converge?
No to both, in general. Martingales need not be bounded — the simple symmetric random walk is an unbounded martingale that does not converge (it oscillates and is recurrent). Boundedness (or, more generally, -boundedness: ) is precisely the extra hypothesis needed for the martingale convergence theorem to guarantee almost sure convergence to an integrable limit. The Pólya urn martingale is bounded (values in ) and does converge almost surely, to a Beta = Uniform random limit, illustrating the theorem; the random walk illustrates its necessity.
Why do we need the filtration explicitly, rather than just talking about the process alone?
The martingale property is not a property of the marginal distributions of alone; it is a property relative to a specified flow of information. The same process can be a martingale with respect to one filtration and fail to be one with respect to a coarser or finer filtration containing different information. Conventionally one takes the natural filtration , but the definition explicitly allows any filtration to which is adapted and for which the conditional expectation identity holds — this is essential in applications where encodes auxiliary information beyond itself, such as an entire vector of correlated observables.
How does this connect to concentration inequalities like Azuma-Hoeffding?
The martingale transform construction used in the Lemma's proof — writing as a sum of predictable, bounded multiples of martingale increments — is exactly the mechanism behind Azuma's inequality, which bounds for martingales with bounded increments via an exponential supermartingale argument. This makes martingale increment bounds (as in condition (b) of the theorem) doubly useful: they enable both optional stopping and sharp tail bounds, which is why martingale methods are ubiquitous in the probabilistic analysis of randomized algorithms.
What is the practical difference between condition (b) and condition (c) in the theorem, and when would I choose one over the other?
Condition (b) is convenient when increments are naturally bounded (e.g. steps, as in ruin problems) and you can bound directly, often via Wald-type identities or explicit tail estimates. Condition (c) is convenient when the process itself is confined to a bounded range by construction — for instance the exponential martingale in gambler's ruin, or the Pólya urn fraction — so uniform boundedness of is immediate without needing any control on at all. In problems with absorbing barriers, (c) is usually the cleaner route; in problems where the process is unbounded but increments are controlled, (b) is typically the tool of choice.