Contents
A martingale is not a kind of randomness. It is a kind of promise about randomness — the promise that, whatever has already happened, the next increment is worth nothing in conditional expectation. Stopping asks how far that promise extends when the time of reckoning is itself random.
The fair game
Work in discrete time on a probability space with a filtration: an increasing family of σ-algebras, where records the information available at time . A real-valued process adapted to this filtration, with for every , is a martingale when [1]
almost surely. The conditional expectation is the whole content of the definition. Given the available information, the conditional mean of tomorrow’s value is today’s value. Replace the equality with and the process is a submartingale; with , a supermartingale. These are statements about conditional means, not about the direction of every realised step.1
Iterating (1) and using the tower property of conditional expectation gives
and this is where the trouble starts. Equation (2) holds for every fixed time. The gambler, however, does not play until a fixed time. The gambler plays until something happens — until the money doubles, until the money is gone, until the mood turns. May a random time be substituted into (2), and what has to be true for the substitution to survive?
Stopping without foresight
A rule for quitting has to be executable with the information then available. “Sell at the highest price of the year” is easy to write after December. It is generally not a rule one can carry out in March.
At time the observer must be able to answer “have I stopped?” using alone. The first time an adapted price process crosses a level is a stopping time. The last crossing before a fixed horizon generally is not: identifying it may require later observations. [1]2
Given a stopping time, the natural object is the process frozen at the moment of stopping. Write for the smaller of the two and define the stopped process
The stopped process has increments . The event is the complement of , so the indicator is known at time : a stake placed before the coin lands. It is bounded, and the martingale increment is integrable with conditional mean zero. Thus is again an integrable martingale at every finite , even when can be infinite. [1]
That looks like victory, and it is the reason the theorem in the next section is so often misquoted. Equation (4) gives for each finite . What we want is the same statement with in place of . Between the two lies a limit, and limits and expectations do not commute for free.
The optional stopping theorem
There are several ways to justify that limit. Keeping them separate makes the theorem easier to use. [1] [2]
- (i) There is a deterministic finite with almost surely.
- (ii) The family is uniformly integrable. In particular, this holds if for all almost surely, for some integrable .
- (iii) and there is a deterministic such that almost surely for every .
Play independent fair coin tosses, doubling the stake after every loss, and stop at the first win. Start with net gain zero. Each finite-time stopped gain is integrable and is a martingale, but almost surely. Here and : finite mean duration alone does not rescue (5). The stakes are unbounded, the stopping time is not bounded by a deterministic horizon, and the stopped gains are not uniformly integrable. [1]4
Ruin, and what it costs
Let be a simple symmetric random walk started at zero, and let be the first time it reaches or , where are positive integers. To check finiteness, group the independent tosses into stretches of steps. From any interior site, a stretch of all upward steps forces exit; its probability is . Hence has a geometric tail bound over these stretches and . The stopped walk lies between and , so condition (ii) applies. If , (5) reads . [2]
The first half of (6) is one line of algebra. For the second, independence, mean zero and unit second moment of the increments make a martingale. Apply bounded optional stopping to : . The left side tends to by monotone convergence; the right side tends to by bounded convergence. Substituting the exit probabilities gives . We have not assumed the formula for the mean duration in order to prove it.
The table makes the tradeoff visible. Here is the initial bankroll and the desired net gain, not the final bankroll. With , reaching the upper barrier doubles the initial money. Increasing the target reduces the chance of success and increases the mean duration.
Checking it by simulation
Simulation can check the scale of both quantities in (6); it does not prove them. This example uses a fixed seed so that its output can be reproduced.
from random import Random
def ruin(a, b, trials=20_000, seed=2026):
"""Estimate P(hit +b before -a) and the mean exit time."""
if any(type(v) is not int or v <= 0 for v in (a, b, trials)):
raise ValueError("a, b and trials must be positive integers")
rng = Random(seed)
wins = steps = 0
for _ in range(trials):
x = t = 0
while -a < x < b:
x += rng.choice((-1, 1))
t += 1
wins += x == b
steps += t
return wins / trials, steps / trials
print(ruin(10, 40)) # compare with the exact values (0.2, 400)A cousin of the same argument gives Wald’s identity. Let be independent, identically distributed real random variables with , set and , and take . If is a stopping time for this filtration and , then [2]5
The assumptions in (7) do more than make a martingale. Since is independent of , Tonelli’s theorem gives . This random sum dominates every . Bounded optional stopping applied to at , followed by dominated and monotone convergence, proves the identity. No bound on individual increments is required; the integrable domination has been proved instead. [2]
How far a fair game wanders
Optional stopping controls the value at a moment. The next result controls the whole trajectory, and it does so by the same device: choose the right stopping time and let the theorem do the work.
The terminal expectation controls the chance of a large excursion. To obtain the bound, one needs a stronger estimate, not the square of (8). For a real square-integrable martingale , write . Apply bounded conditional optional sampling to the submartingale at its first crossing of , capped at . The crossing event belongs to the information at that time, so [2]
Almost-sure convergence under the weaker assumption is a separate theorem. Doob’s upcrossing inequality bounds the expected number of crossings of each interval with rational endpoints. There are almost surely only finitely many crossings of each such interval, which rules out distinct lower and upper limits; Fatou’s lemma makes the resulting limit finite and integrable. This is the martingale convergence theorem, not a consequence of an estimate. [2]
If , Cauchy–Schwarz first gives the bound, hence almost surely by that theorem. Now (10) makes integrable. Since , dominated convergence gives : convergence in . [2]6
The Snell envelope
Until now stopping has been something done to a process. Reverse the question. Given an adapted reward with for , which stopping time maximises ? The finite horizon matters: it guarantees that the following recursion reaches an attainable terminal reward. [6] [7]
The recursion in (11) is a dialogue with two lines. Take what is on the table, or hold and inherit the value of holding; take whichever is larger. Set . This is a stopping time and because . On the continuation value equals , so the stopped process is a martingale. Bounded optional stopping gives . For any stopping time , domination and bounded optional sampling give . Thus is optimal. [8]
The scope is broad, but specific: choose a stopping time for a given reward process and information flow. Sequential testing can lead to such a problem after specifying losses and observation costs. A bandit problem also chooses which observation to make next; that extra control is not supplied by (11). Shiryaev treats statistical stopping problems, and Peskir and Shiryaev develop the connection with free-boundary problems. [7] [8]
The market's martingale
A concrete financial example is a finite-horizon binomial market with a non-dividend-paying stock, a bank account , and constant stock multipliers satisfying . Assume frictionless trading, unrestricted borrowing and short selling, and positive physical probabilities for both branches at every node. The market is complete and has a unique equivalent risk-neutral measure , with up probability . Discounted stock prices are -martingales: [9]
In this complete model an American payoff is priced by the Snell envelope of under ; multiply the envelope by to recover the price at time . All variables are integrable on the finite tree, and exercise times satisfy . Replication connects this stopping value to the no-arbitrage price. See Shreve, Chapter 4, “American Derivative Securities,” pp. 89–117. [9]7
For a backtest, the useful question is which model and information set justify the calculation. The martingale property under a pricing measure does not assert zero expected returns under the physical measure. A claimed riskless gain also calls for checking trading costs, financing, position limits and whether decisions use information actually available at the time. Optional stopping addresses a stated stochastic model; it does not validate the data or the execution assumptions.
Coda
What makes the martingale useful is that drift can be separated from fluctuation. In discrete time, an adapted integrable process has a Doob decomposition , where and . Then is a martingale and is predictable; for a submartingale, is nondecreasing. Each inequality still needs its own integrability assumptions. [3] [2]
A stopping rule can react to what has happened. That is its purpose. Repeatedly inspecting a trial and stopping at a boundary may be a valid stopping time; it does not thereby preserve a test calibrated for a fixed sample size. Wald’s procedure builds the sequential decision into the design. Choosing the best historical window afterwards is a different operation. The useful discipline is to state the information, the rule and the result whose conditions it satisfies. [4]
References
- David Williams. Probability with Martingales (1991). DOI: 10.1017/CBO9780511813658 Cambridge University Press, Cambridge. Cambridge Mathematical Textbooks. ISBN 978-0-521-40605-5. Chapters 10–14: stopping, convergence, L² bounds and uniform integrability.
- Rick Durrett. Probability: Theory and Examples (2019). 5th ed., Cambridge University Press, Cambridge. Cambridge Series in Statistical and Probabilistic Mathematics 49. ISBN 978-1-108-47368-2. Theorems 2.6.2, 4.2.10–11, 4.4.1–4, 4.4.6; §4.8. Link: author’s January 11, 2019 PDF.
- Joseph L. Doob. Stochastic Processes (1953). John Wiley & Sons, New York. viii + 654 pp. Chapter VII, “Martingales.” Link: bibliographic record in Doob’s collected bibliography.
- Abraham Wald. Sequential Tests of Statistical Hypotheses (1945). DOI: 10.1214/aoms/1177731118 The Annals of Mathematical Statistics 16(2), 117–186. Institute of Mathematical Statistics.
- Abraham Wald. Sequential Analysis (1947). John Wiley & Sons, New York. xii + 212 pp. Original edition; link to the digitised volume’s bibliographic record.
- J. Laurie Snell. Applications of Martingale System Theorems (1952). DOI: 10.2307/1990670 Transactions of the American Mathematical Society 73(2), 293–312. Historical source; the finite-horizon proof is given in the text.
- Albert N. Shiryaev. Optimal Stopping Rules (2008). DOI: 10.1007/978-3-540-74011-7 Springer, Berlin and Heidelberg. Stochastic Modelling and Applied Probability 8. Reprint of the 1978 edition. Chapter II, “Optimal Stopping of Markov Sequences”; Chapter IV, statistical applications.
- Goran Peskir, Albert Shiryaev. Optimal Stopping and Free-Boundary Problems (2006). DOI: 10.1007/978-3-7643-7390-0 Birkhäuser, Basel. Lectures in Mathematics ETH Zürich. Part I, “Optimal stopping: General facts,” pp. 1–52; Part VII, mathematical finance, pp. 375–436.
- Steven E. Shreve. Stochastic Calculus for Finance I: The Binomial Asset Pricing Model (2004). DOI: 10.1007/978-0-387-22527-2 Springer, New York. Springer Finance. ISBN 978-0-387-40100-3. Chapters 1–3; Chapter 4, “American Derivative Securities,” pp. 89–117.
