Tutorials › Stochastic Processes › The Centered Square of a Simple Random Walk

Martingales: Definitions and Examples · Tutorial 704 of 994

The Centered Square of a Simple Random Walk

Learn to verify the centered-square martingale from one-step conditional moments and use its pathwise increment identity to check finite-time calculations.

Advanced 9 min read

What You'll Learn

  • Define the simple symmetric random walk and its natural filtration.
  • Derive the conditional second moment of the next walk position.
  • Prove that the centered square is an integrable martingale.
  • Rewrite its increments as twice the current position times the next step.
  • Check the result by exact finite-time calculations and identify a common conditioning error.

Why Center the Square?

A simple symmetric random walk has increments with mean zero, so its position itself is a martingale. Its square, however, increases on average: each new step contributes one unit to the conditional second moment. Subtracting the number of steps removes this predictable increase. The resulting process captures a useful idea: a nonlinear function of a process may need a time-dependent correction to have zero conditional drift.

Work on a probability space \((\Omega,\mathcal{F},\mathbb{P})\). Let \((\xi_n)_{n\ge1}\) be independent random variables with \(\mathbb{P}(\xi_n=1)=\mathbb{P}(\xi_n=-1)=\tfrac12\). Define the simple symmetric random walk by \(S_0=0\) and \(S_n=\sum_{k=1}^n \xi_k\), for \(n\ge1\). Its state space is the integers \(\mathbb{Z}\), and its time index is discrete, \(n\ge0\). Use the natural filtration \(\mathcal{F}_n=\sigma(\xi_1,\ldots,\xi_n)\), with \(\mathcal{F}_0=\{\varnothing,\Omega\}\) up to null sets. Thus \(\mathcal{F}_n\) records the steps observed through time \(n\).

Definition: The centered square of the walk is \(M_n=S_n^2-n\), for \(n\ge0\). A process \((M_n)\) is a martingale with respect to \((\mathcal{F}_n)\) if each \(M_n\) is \(\mathcal{F}_n\)-measurable and integrable, and \(\mathbb{E}[M_{n+1}\mid\mathcal{F}_n]=M_n\) almost surely for every \(n\ge0\).

The finite-time requirement is important: the martingale equality is a conditional expectation statement at each time, not a claim that \(M_n\) stays constant along every sample path. In fact, the centered square usually changes from one step to the next. We will show that its conditional average change, given the information already observed, is zero.

The One-Step Conditional Second Moment

At time \(n\), the position \(S_n\) is known given \(\mathcal{F}_n\), while \(\xi_{n+1}\) is an independent, equally likely sign. Since \(S_{n+1}=S_n+\xi_{n+1}\), expanding the square isolates the term whose conditional expectation vanishes.

$$ \begin{aligned} \mathbb{E}[S_{n+1}^2\mid\mathcal{F}_n] &=\mathbb{E}[(S_n+\xi_{n+1})^2\mid\mathcal{F}_n]\\ &=S_n^2+2S_n\mathbb{E}[\xi_{n+1}\mid\mathcal{F}_n] +\mathbb{E}[\xi_{n+1}^2\mid\mathcal{F}_n]\\ &=S_n^2+0+1\\ &=S_n^2+1. \end{aligned} $$

Here \(\mathbb{E}[\xi_{n+1}\mid\mathcal{F}_n]=0\) follows from independence and the equal probabilities of \(1\) and \(-1\); also, \(\xi_{n+1}^2=1\) for every outcome. Subtracting \(n+1\) from the conditional second moment gives \(S_n^2-n\). That calculation is the whole reason the time correction has exactly this form.

Theorem: For the simple symmetric random walk defined above, \(M_n=S_n^2-n\) is a martingale with respect to \((\mathcal{F}_n)_{n\ge0}\).

Proof. For each \(n\), \(S_n\) is \(\mathcal{F}_n\)-measurable, so \(M_n\) is adapted. Also, \(|S_n|\le n\), because \(S_n\) is a sum of \(n\) terms, each with absolute value \(1\). Therefore \(|M_n|\le n^2+n\), which is finite, and \(M_n\) is integrable. The conditional second-moment calculation above gives \(\mathbb{E}[M_{n+1}\mid\mathcal{F}_n]=\mathbb{E}[S_{n+1}^2-(n+1)\mid\mathcal{F}_n]=S_n^2+1-(n+1)=S_n^2-n=M_n\). The adaptedness, integrability, and conditional equality verify all parts of the martingale definition. \(\square\)

Worked Example: Checking the Conditional Step at Time One

Compute \(M_1\) and the conditional mean of \(M_2\) given \(\mathcal{F}_1\), for each possible value of \(S_1\). This checks the martingale equality separately on both events determined by the first step.

If \(S_1=1\), which has probability \(\tfrac12\), then \(S_2=2\) or \(S_2=0\), each with conditional probability \(\tfrac12\). Thus \(M_1=1^2-1=0\), while

$$ \mathbb{E}[M_2\mid S_1=1] =\tfrac12(2^2-2)+\tfrac12(0^2-2) =\tfrac12(2)+\tfrac12(-2) =0=M_1. $$

If \(S_1=-1\), also with probability \(\tfrac12\), then \(S_2=0\) or \(S_2=-2\), each with conditional probability \(\tfrac12\). In this case \(M_1=(-1)^2-1=0\), and

$$ \mathbb{E}[M_2\mid S_1=-1] =\tfrac12(0^2-2)+\tfrac12((-2)^2-2) =\tfrac12(-2)+\tfrac12(2) =0=M_1. $$

These two events exhaust the possible values of \(S_1\), and each has positive probability. The conditional mean agrees with \(M_1\) in both cases, as the theorem requires.

A Pathwise Increment Identity

The same calculation has a useful pathwise form. It separates the centered square into increments that are products of the position already observed and the next step. This is more information than the conditional expectation calculation alone: it shows exactly how the process changes on each outcome.

Proposition: For every \(n\ge0\), the simple symmetric random walk satisfies the identity \(S_n^2-n=2\sum_{k=1}^n S_{k-1}\xi_k\), where the sum is zero when \(n=0\).

Proof. For each \(k\ge1\), use \(S_k=S_{k-1}+\xi_k\) and \(\xi_k^2=1\) to compute \(S_k^2-S_{k-1}^2=2S_{k-1}\xi_k+1\). Rearranging gives \(S_k^2-S_{k-1}^2-1=2S_{k-1}\xi_k\). Sum this equality over \(k=1,\ldots,n\). The left side is \(\sum_{k=1}^n(S_k^2-S_{k-1}^2-1)=S_n^2-S_0^2-n=S_n^2-n\), because \(S_0=0\). The right side is \(2\sum_{k=1}^n S_{k-1}\xi_k\). For \(n=0\), both sides equal zero by the empty-sum convention. This proves the identity for every \(n\ge0\). \(\square\)

Each factor \(S_{k-1}\) is known at time \(k-1\), while the next step has conditional mean zero. Consequently, the increment \(2S_{k-1}\xi_k\) has conditional expectation zero given \(\mathcal{F}_{k-1}\). This is consistent with the martingale property: the identity describes the individual increments, and conditional symmetry makes their means vanish. The identity is not a claim that each increment is zero.

Worked Example: Checking the Identity Along a Sample Path

Consider the first three steps \((\xi_1,\xi_2,\xi_3)=(1,-1,1)\). This particular path has probability \((\tfrac12)^3=\tfrac18\), by independence. Its positions are \(S_0=0\), \(S_1=1\), \(S_2=0\), and \(S_3=1\). The centered squares are therefore \(M_0=0\), \(M_1=1^2-1=0\), \(M_2=0^2-2=-2\), and \(M_3=1^2-3=-2\).

Now compute the right side of the identity through time three. The three terms before multiplying by \(2\) are \(S_0\xi_1=0\cdot1=0\), \(S_1\xi_2=1\cdot(-1)=-1\), and \(S_2\xi_3=0\cdot1=0\). Hence \(2\sum_{k=1}^3S_{k-1}\xi_k=2(0-1+0)=-2\). The left side is \(S_3^2-3=1-3=-2\), so the two sides agree.

This path also shows why “martingale” does not mean “constant.” Here \(M_1=0\) and \(M_2=-2\); the process changes on this outcome. The martingale condition concerns conditional means over the possible next steps, not the value along one selected path.

A Second-Moment Consequence

The martingale result gives an immediate identity for the unconditional second moment. It is useful to establish this directly from the conditional calculation, rather than infer that the random variable \(S_n^2\) itself is constant or deterministic.

Corollary: For every integer \(n\ge0\), \(\mathbb{E}[S_n^2]=n\).

Proof. Since \(S_0=0\), \(\mathbb{E}[S_0^2]=0\). Taking expectations in the conditional second-moment equality gives \(\mathbb{E}[S_{n+1}^2]=\mathbb{E}[\mathbb{E}[S_{n+1}^2\mid\mathcal{F}_n]]=\mathbb{E}[S_n^2+1]=\mathbb{E}[S_n^2]+1\). The first equality is the defining averaging property of conditional expectation; all quantities are integrable because \(|S_n|\le n\). Starting from \(0\), this recurrence adds \(1\) at each step, so induction gives \(\mathbb{E}[S_n^2]=n\) for every \(n\ge0\). In particular, \(\mathbb{E}[M_n]=\mathbb{E}[S_n^2]-n=0\). \(\square\)

Worked Example: Verifying the Second Moment at Time Four

At time four, let \(H\) be the number of positive steps. Then \(H\) has probabilities \(\mathbb{P}(H=h)=\binom{4}{h}/16\), since each of the \(2^4=16\) sign sequences has probability \(1/16\). The position is \(S_4=H-(4-H)=2H-4\). Thus the possible positions and their probabilities are: \(-4\) with probability \(\tfrac1{16}\), \(-2\) with probability \(\tfrac4{16}\), \(0\) with probability \(\tfrac6{16}\), \(2\) with probability \(\tfrac4{16}\), and \(4\) with probability \(\tfrac1{16}\).

Compute the second moment directly from this distribution:

$$ \begin{aligned} \mathbb{E}[S_4^2] &=\tfrac1{16}(16)+\tfrac4{16}(4)+\tfrac6{16}(0)+\tfrac4{16}(4)+\tfrac1{16}(16)\\ &=\tfrac{16+16+0+16+16}{16}\\ &=\tfrac{64}{16}=4. \end{aligned} $$

Therefore \(\mathbb{E}[M_4]=\mathbb{E}[S_4^2-4]=4-4=0\), agreeing with the corollary. This unconditional check is consistent with the martingale property, although by itself it would not prove the required conditional equality at every time.

Why Symmetry and Correct Conditioning Matter

The cancellation depends on the next step having conditional mean zero. If the steps still take values \(1\) and \(-1\), but \(\mathbb{P}(\xi_{n+1}=1)=p\) and \(\mathbb{P}(\xi_{n+1}=-1)=1-p\), then \(\mathbb{E}[\xi_{n+1}]=2p-1\). Expanding the square gives conditional drift \(2S_n(2p-1)\) for \(S_n^2-n\), rather than zero in general. For example, if \(p=\tfrac34\), then \(\mathbb{E}[\xi_2]=\tfrac12\). On the event \(S_1=1\), which has probability \(\tfrac34\), the conditional expected change in \(S_n^2-n\) from time one to time two is \(2(1)(\tfrac12)=1\). Thus the centered-square formula established here relies on symmetry; it cannot be applied unchanged to that biased walk.

Common mistake: squaring a conditional mean. A frequent error is to replace \(\mathbb{E}[S_{n+1}^2\mid\mathcal{F}_n]\) by \(\mathbb{E}[S_{n+1}\mid\mathcal{F}_n]^2\). At time one, on the event \(S_1=1\), the conditional mean of \(S_2\) is \(\tfrac12(2)+\tfrac12(0)=1\). Squaring it and subtracting \(2\) gives \(1^2-2=-1\), which is not the conditional mean of \(M_2\). The correct computation keeps the square inside the expectation: \(\mathbb{E}[S_2^2\mid S_1=1]=\tfrac12(2^2)+\tfrac12(0^2)=2\), so \(\mathbb{E}[M_2\mid S_1=1]=2-2=0=M_1\). In general, averaging squares and squaring an average are different operations.

When checking a centered-square martingale, expand \((S_n+\xi_{n+1})^2\) before taking the conditional expectation. The known factor \(S_n\) can be taken outside that expectation; the cross term then vanishes because the next step has conditional mean zero, while its square contributes \(1\). Subtracting the elapsed time cancels precisely that contribution. This sequence of steps identifies both the correct correction and the assumptions that make it work.

Check Your Understanding

Use the one-step conditional calculation or the pathwise identity to justify your answers.

  1. Given \(S_n=3\), what is \(\mathbb{E}[S_{n+1}^2\mid\mathcal{F}_n]\), and what is \(\mathbb{E}[M_{n+1}\mid\mathcal{F}_n]\)?
  2. For the path \((\xi_1,\xi_2)=(1,1)\), compute \(S_2^2-2\) and \(2\sum_{k=1}^2S_{k-1}\xi_k\).
  3. Why does \(\mathbb{E}[S_n^2]=n\) not, by itself, establish the martingale property?
  4. If the probability of a positive step is \(p\), what is the conditional drift of \(S_n^2-n\) given \(\mathcal{F}_n\)?
  5. Which integrability bound ensures that \(M_n\) is integrable at each fixed time \(n\)?