A martingale is one of the most central concepts in modern probability theory. The most intuitive explanation is: given everything known up to now, the conditional expectation of the future equals the present — often described as the mathematical expression of a “fair game.”

1. Filtrations and the Definition of a Martingale

1.1 Why we need a filtration

As a stochastic process runs to time tt, the information available keeps growing. Write Ft\mathcal F_t for “all information known up to time tt”; this family of information sets, increasing over time, F0F1\mathcal F_0\subseteq\mathcal F_1\subseteq\cdots, is called a filtration, and it describes exactly the accumulation of information over time.

1.2 The definition of a martingale: the mathematical expression of a fair game

If a stochastic process {Xt}\{X_t\} satisfies suitable integrability conditions and E[Xt+1Ft]=XtE[X_{t+1}\mid\mathcal F_t]=X_t, then XtX_t is called a martingale: given all currently available information, the best average prediction of the next step is the current value itself. Suppose a fair game wins or loses 1 unit each round with equal probability, and XtX_t is the wealth after round tt; then E[Xt+1Ft]=XtE[X_{t+1}\mid\mathcal F_t]=X_t holds, so the wealth process is a martingale. Note that being a martingale does not mean wealth never changes — the sample path can fluctuate wildly up and down; it simply has no positive or negative drift in the conditional-expectation sense.

2.1 The difference between martingale and Markov

The Markov property asks “how much history is needed to predict the future,” while a martingale asks “given the current information, what is the conditional expectation of the future” — these are different questions: a process can be Markov without being a martingale (for example, a random walk with an evident drift), and it can be a martingale while having a state structure more complex than a simple Markov chain.

2.2 Submartingales and supermartingales

If E[Xt+1Ft]XtE[X_{t+1}\mid\mathcal F_t]\ge X_t, the process is called a submartingale, intuitively having a nonnegative conditional-expectation trend; if E[Xt+1Ft]XtE[X_{t+1}\mid\mathcal F_t]\le X_t, it is called a supermartingale. A fair game is a martingale, a game favoring the player is a submartingale, and a game favoring the house is a supermartingale.

2.3 A symmetric random walk is the source of two martingales

The simple symmetric random walk Xt+1=Xt+ϵt+1X_{t+1}=X_t+\epsilon_{t+1} (with E[ϵt+1]=0E[\epsilon_{t+1}]=0) satisfies E[Xt+1Ft]=Xt+E[ϵt+1Ft]=XtE[X_{t+1}\mid\mathcal F_t]=X_t+E[\epsilon_{t+1}\mid\mathcal F_t]=X_t, making it the most classic martingale. Further, Mt=Xt2tM_t=X_t^2-t is also a martingale: using the fact that ϵt+1\epsilon_{t+1} is independent of Ft\mathcal F_t and E[ϵt+12]=1E[\epsilon_{t+1}^2]=1, we get E[Mt+1Ft]=E[Xt2+2Xtϵt+1+ϵt+12Ft](t+1)=Xt2+1(t+1)=MtE[M_{t+1}\mid\mathcal F_t]=E[X_t^2+2X_t\epsilon_{t+1}+\epsilon_{t+1}^2\mid\mathcal F_t]-(t+1)=X_t^2+1-(t+1)=M_t. These two martingales are exactly the tools Section 3 uses to derive the two formulas from Stochastic Processes 7 and Stochastic Processes 8.

3. The Optional Stopping Theorem: Deriving Two Gambler’s Ruin Formulas

3.1 Statement of the theorem

A famous question: if a fair game is stopped at some random time, is the expected wealth at stopping still the initial wealth? Under suitable conditions (for example, the stopping time is almost surely finite, the process is bounded, or the expected stopping time itself is finite), the optional stopping theorem gives E[Xτ]=E[X0]E[X_\tau]=E[X_0]. This conclusion requires conditions and should not be understood simply as “no stopping strategy can change the expectation” — Section 4 gives an example where the conclusion fails because a condition is not met.

3.2 Deriving two formulas

Continuing the k=30k=30, N=100N=100 Gambler’s Ruin example from the previous two articles, let τ=inf{t:Xt{0,N}}\tau=\inf\{t:X_t\in\{0,N\}\}. It can be verified that τ\tau satisfies the conditions of the optional stopping theorem (XtX_t is bounded before stopping, and Stochastic Processes 8 already computed that E[τ]E[\tau] is finite), so E[Xτ]=E[X0]E[X_\tau]=E[X_0] can safely be applied to both martingales.

Applying it to XtX_t itself: E[Xτ]=E[X0]=kE[X_\tau]=E[X_0]=k. Since XτX_\tau can only be 00 or NN, let p=P(Xτ=N)p=P(X_\tau=N), so E[Xτ]=NpE[X_\tau]=N\cdot p, giving Np=kNp=k and hence p=k/Np=k/N — this is exactly the formula k/Nk/N that Stochastic Processes 7 stated directly without proof, now with a complete derivation. Plugging in k=30k=30, N=100N=100: p=0.3p=0.3, matching the earlier result.

Applying it to Mt=Xt2tM_t=X_t^2-t: E[Mτ]=E[M0]=k2E[M_\tau]=E[M_0]=k^2. Since Mτ=Xτ2τM_\tau=X_\tau^2-\tau and E[Xτ2]=N2p=N2(k/N)=NkE[X_\tau^2]=N^2p=N^2(k/N)=Nk, we get NkE[τ]=k2Nk-E[\tau]=k^2, so E[τ]=Nkk2=k(Nk)E[\tau]=Nk-k^2=k(N-k) — exactly the mean-stopping-time formula from Stochastic Processes 8. Plugging in k=30k=30, N=100N=100: E[τ]=30×100302=3000900=2100E[\tau]=30\times100-30^2=3000-900=2100, exactly matching the 2100 rounds computed earlier. Two formulas that seemed to be derived independently are, in fact, both just the same theorem applied to two different martingales.

4. When Optional Stopping Fails

The conditions of the optional stopping theorem are not a mere formality. Consider a simple symmetric random walk with no boundary, and τ1=inf{t:Xt=1}\tau_1=\inf\{t:X_t=1\}: it can be shown that τ1\tau_1 is almost surely finite (a one-dimensional random walk is recurrent, see Stochastic Processes 7), yet E[Xτ1]=1E[X0]=0E[X_{\tau_1}]=1\neq E[X_0]=0 — the conclusion of the optional stopping theorem does not hold here, because E[τ1]E[\tau_1] itself is infinite, breaking the regularity condition the theorem requires. This is precisely the mathematical root of why “doubling your bet” gambling strategies appear to guarantee a profit: the strategy itself is not wrong, but it overlooks that the expected time needed to reach the goal (or even the expected capital needed) can be infinite, while real-world bankrolls and time are always finite.

5. Why Martingales Matter

A martingale is the basic language modern probability theory uses to handle “conditional expectation evolving with information,” appearing in stopping-time theory, concentration inequalities, stochastic calculus, financial pricing, Brownian motion, and sequential analysis. What is most worth remembering is not the introductory “fair gambling” example, but this: given the current information, the future has no predictable average drift — Section 3 showed how this seemingly abstract property directly derives two concrete formulas that would otherwise require entirely different methods to compute.