Unit 12, lesson 75

Simple Random Walks

How a simple random walk adds independent unit steps, why its position is tied to a binomial count with a parity restriction, how drift sets its mean while its variance grows, and how path, endpoint and visit events differ.

  • Video 75
  • Bernoulli Processes and Random Walks

A marker starts at 00 on a number line, and at each step it moves one unit right with probability 0.60.6 or one unit left with probability 0.40.4. Where is it likely to be after four steps, and how far does it tend to stray from its average position? One step is easy to describe, but the position after many steps depends on the whole history of steps. This lesson builds the simple random walk from its steps, ties its position to a binomial count, finds its drift and variance, and separates events about paths, endpoints and visits.

Key terms

Simple random walk

Definition Let 0<p<10 < p < 1, and let Z1,Z2,…Z_1, Z_2, \dots be mutually independent random variables with

P(Zi=1)=p,P(Zi=−1)=1−p\begin{gathered} P(Z_i = 1) = p, \\[0.4em] P(Z_i = -1) = 1 - p \end{gathered}

for every ii. The variable ZiZ_i is the increment, or step, at time ii. Starting from a fixed integer S0S_0, the simple random walk is the process S0,S1,S2,…S_0, S_1, S_2, \dots given by

Sn=S0+Z1+⋯+Zn.S_n = S_0 + Z_1 + \cdots + Z_n.

Each step moves the walk to a neighboring integer. More generally, the increment of the walk from time mm to time n>mn > m is Sn−Sm=Zm+1+⋯+ZnS_n - S_m = Z_{m+1} + \cdots + Z_n, and increments over disjoint blocks of steps are independent. On this page the walk starts at S0=0S_0 = 0 unless a different start is named. When p=1/2p = 1/2 the walk is called symmetric, and some books reserve the name simple random walk for that case.

In plain words At each step the walk moves one unit right or one unit left, with the same chances every time and independently of all earlier steps. The position is the starting point plus the running total of the steps.

Example With p=0.6p = 0.6, the increments +1+1, −1-1, +1+1, +1+1 give the positions 11, 00, 11, 22 after steps 11 to 44. The increment over steps 33 and 44 is S4−S2=Z3+Z4=2S_4 - S_2 = Z_3 + Z_4 = 2.

Position

Definition The position after nn steps is SnS_n. For a walk started at 00, let KK be the number of right steps among the first nn. Then there are n−Kn - K left steps, K∼Bin⁡(n,p)K \sim \operatorname{Bin}(n, p), and Sn=K−(n−K)S_n = K - (n - K), that is,

Sn=2K−n.S_n = 2K - n.

Hence, for each integer kk with 0≤k≤n0 \le k \le n,

P(Sn=2k−n)=(nk)pk(1−p)n−k,\begin{aligned} &P(S_n = 2k - n) \\[0.4em] &\quad = \binom{n}{k} p^{k} (1 - p)^{n - k}, \end{aligned}

and every other value has probability 00. For 1≤m<n1 \le m < n the increment Sn−SmS_n - S_m depends only on Zm+1,…,ZnZ_{m+1}, \dots, Z_n, so it is independent of the earlier positions S1,…,SmS_1, \dots, S_m. The positions SmS_m and SnS_n themselves are dependent, because SnS_n contains SmS_m. A walk started at a fixed integer S0=s0S_0 = s_0 has every position shifted by s0s_0.

In plain words To find a position probability, translate the position into the number of right steps it needs, then use the binomial formula. The steps are independent, but the positions are not, since each position contains all earlier steps.

Example With p=0.6p = 0.6, the four-step positions and their probabilities are below. They add to 11.

Right steps kkPosition 2k−42k - 4Probability
00−4-40.02560.0256
11−2-20.15360.1536
22000.34560.3456
33220.34560.3456
44440.12960.1296

A return to 00 needs two right and two left steps, in one of (42)=6\binom{4}{2} = 6 orders, each with probability 0.62⋅0.42=0.05760.6^2 \cdot 0.4^2 = 0.0576. Dependence shows up quickly. The event S2=2S_2 = 2 has probability 0.360.36, and given it the first step must have gone right, so P(S1=1∣S2=2)=1P(S_1 = 1 \mid S_2 = 2) = 1, while P(S1=1)=0.6P(S_1 = 1) = 0.6.

Drift

Definition The drift of a simple random walk is the expected increment

E[Zi]=p−(1−p)=2p−1.\begin{aligned} E[Z_i] &= p - (1 - p) \\[0.4em] &= 2p - 1. \end{aligned}

By linearity of expectation, a walk with fixed start S0S_0 has E[Sn]=S0+n(2p−1)E[S_n] = S_0 + n(2p - 1). The drift is positive when p>1/2p > 1/2, zero when p=1/2p = 1/2 and negative when p<1/2p < 1/2.

In plain words The drift is the average movement per step, and nn steps move the mean position by nn times the drift. It describes the average over all possible walks, not the course of any one walk. A walk with positive drift can still end at or to the left of its start.

Example With p=0.6p = 0.6 the drift is 0.6−0.4=0.20.6 - 0.4 = 0.2, so a walk started at 00 has E[S10]=2E[S_{10}] = 2. Yet S10≤0S_{10} \le 0 happens exactly when at most five of the ten steps go right, which has probability about 0.3670.367. Starting at 55 instead of 00 moves the mean position after ten steps to 77.

Variance of a random walk

Definition Each increment satisfies Zi2=1Z_i^2 = 1, so

Var⁡(Zi)=1−(2p−1)2=4p(1−p).\begin{aligned} \operatorname{Var}(Z_i) &= 1 - (2p - 1)^2 \\[0.4em] &= 4p(1 - p). \end{aligned}

Because the increments are independent, their variances add, and a walk with fixed start S0S_0 has

Var⁡(Sn)=4np(1−p)\operatorname{Var}(S_n) = 4np(1 - p)

and SD⁡(Sn)=2np(1−p)\operatorname{SD}(S_n) = 2\sqrt{np(1 - p)}. The same result follows from Sn=S0+2K−nS_n = S_0 + 2K - n, since Var⁡(2K)=4np(1−p)\operatorname{Var}(2K) = 4np(1 - p). For 1≤m≤n1 \le m \le n the shared steps give Cov⁡(Sm,Sn)=Var⁡(Sm)=4mp(1−p)\operatorname{Cov}(S_m, S_n) = \operatorname{Var}(S_m) = 4mp(1 - p). Without independent increments the variance of the sum would also need covariance terms, and a random start would add its own variance and twice its covariance with the sum of the steps.

In plain words The spread of the position grows with the number of steps, and the standard deviation grows like n\sqrt{n}. Zero drift does not mean the walk stays near its start. It means the mean position stays at the start while the spread keeps growing. If every step were forced, with pp equal to 00 or 11, the formula would correctly give variance 00.

Example With p=0.6p = 0.6 and ten steps, Var⁡(S10)=40⋅0.6⋅0.4=9.6\operatorname{Var}(S_{10}) = 40 \cdot 0.6 \cdot 0.4 = 9.6 and SD⁡(S10)≈3.10\operatorname{SD}(S_{10}) \approx 3.10, which is large compared with the mean 22. Moving the start from 00 to 55 leaves the variance at 9.69.6. For the symmetric walk with four steps, the drift is 00 and Var⁡(S4)=4\operatorname{Var}(S_4) = 4. Its positions −4-4, −2-2, 00, 22 and 44 have probabilities 116\tfrac{1}{16}, 416\tfrac{4}{16}, 616\tfrac{6}{16}, 416\tfrac{4}{16} and 116\tfrac{1}{16}, so the walk is back at 00 with probability only 38\tfrac{3}{8}.

Parity restriction

Definition For a walk started at 00, the position Sn=2K−nS_n = 2K - n has the same parity as nn, which means that Sn−nS_n - n is even. Also ∣Sn∣≤n\lvert S_n \rvert \le n. So P(Sn=x)=0P(S_n = x) = 0 unless xx is an integer with ∣x∣≤n\lvert x \rvert \le n and x−nx - n even, and since 0<p<10 < p < 1, every such xx has positive probability. The support of SnS_n is {−n,−n+2,…,n−2,n}\{-n, -n + 2, \dots, n - 2, n\}. For a walk started at S0S_0, the same statements hold for the displacement Sn−S0S_n - S_0.

In plain words Every step changes the position by one, so the position switches between even and odd at each step. If solving 2k−n=x2k - n = x for the number of right steps gives a non-integer, or a value outside 00 to nn, the position is impossible, and the value of kk should not be rounded.

Example With p=0.6p = 0.6, returning to 00 after two steps needs one right and one left step in either order, with probability 2⋅0.6⋅0.4=0.482 \cdot 0.6 \cdot 0.4 = 0.48. A return to 00 after three steps would need k=1.5k = 1.5 right steps, so P(S3=0)=0P(S_3 = 0) = 0. Position 33 after five steps needs k=4k = 4, which gives

P(S5=3)=5⋅0.64⋅0.4=0.2592.\begin{aligned} P(S_5 = 3) &= 5 \cdot 0.6^{4} \cdot 0.4 \\[0.4em] &= 0.2592. \end{aligned}

Path probability

Definition A path of length nn is a sequence of steps (z1,…,zn)(z_1, \dots, z_n) with each ziz_i equal to 11 or −1-1, or equivalently the sequence of positions it produces. If the path has rr right steps, independence gives

P(Z1=z1,…,Zn=zn)=pr(1−p)n−r.\begin{aligned} &P(Z_1 = z_1, \dots, Z_n = z_n) \\[0.4em] &\quad = p^{r}(1 - p)^{n - r}. \end{aligned}

The endpoint event {Sn=x}\{S_n = x\} is the union of the disjoint events for the paths that end at xx, and all of those paths have the same number of right steps, so its probability is their number times this common probability. The event that Sj=xS_j = x for some jj with 1≤j≤n1 \le j \le n is a visit event. It contains the endpoint event, together with any paths that reach xx before step nn and end elsewhere.

In plain words A path records the whole history, while an endpoint keeps only the final position. Several paths can end at the same position, so an endpoint probability is a sum of path probabilities. Visiting a position during the first nn steps and ending there at step nn are in general different events, and the visit probability needs information about the whole path, not only its last position.

Example With p=0.6p = 0.6, the path RLRR, meaning right, left, right, right, has probability 0.6⋅0.4⋅0.6⋅0.6=0.08640.6 \cdot 0.4 \cdot 0.6 \cdot 0.6 = 0.0864 and ends at 22. The paths that end at 22 are RRRL, RRLR, RLRR and LRRR, each with exactly one left step, so P(S4=2)=4⋅0.0864=0.3456P(S_4 = 2) = 4 \cdot 0.0864 = 0.3456. The path RRLL visits 22 at step 22 and ends at 00, so it belongs to the visit event for position 22 but not to the endpoint event.

Check yourself

  1. For the walk with p=0.6p = 0.6 started at 00, find the mean and the variance of S6S_6 and the probability that the walk is at position 66 after six steps.
Show the answer

The drift is 0.20.2, so E[S6]=6⋅0.2=1.2E[S_6] = 6 \cdot 0.2 = 1.2. Each step has variance 4⋅0.6⋅0.4=0.964 \cdot 0.6 \cdot 0.4 = 0.96, so Var⁡(S6)=6⋅0.96=5.76\operatorname{Var}(S_6) = 6 \cdot 0.96 = 5.76. Position 66 after six steps needs all six steps to go right, which has probability 0.66=0.0466560.6^6 = 0.046656.

  1. For the same walk, find P(S6=0)P(S_6 = 0), and decide whether the walk can be at position 11 after six steps.
Show the answer

Position 00 needs 2k−6=02k - 6 = 0, so k=3k = 3 right steps. There are (63)=20\binom{6}{3} = 20 orders, each with probability 0.63⋅0.43=0.0138240.6^3 \cdot 0.4^3 = 0.013824, so

P(S6=0)=20⋅0.013824=0.27648.\begin{aligned} P(S_6 = 0) &= 20 \cdot 0.013824 \\[0.4em] &= 0.27648. \end{aligned}

Position 11 would need 2k−6=12k - 6 = 1, so k=3.5k = 3.5, which is not an integer. After an even number of steps the position is even, so P(S6=1)=0P(S_6 = 1) = 0. Rounding kk to 33 or 44 would answer a question about position 00 or 22 instead.

  1. For the same walk, a classmate claims that the probability of visiting position 22 at some time during the first four steps equals P(S4=2)=0.3456P(S_4 = 2) = 0.3456. Find the visit probability and explain the difference.
Show the answer

By parity the walk can be at 22 only at an even time, so within four steps it visits 22 exactly when S2=2S_2 = 2, or when S2=0S_2 = 0 and the next two steps both go right. A walk at −2-2 after two steps cannot reach 22 by step 44. The event S2=2S_2 = 2 has probability 0.62=0.360.6^2 = 0.36. The event S2=0S_2 = 0 has probability 0.480.48, and steps 33 and 44 are independent of it, so the second case has probability 0.48⋅0.36=0.17280.48 \cdot 0.36 = 0.1728. The two cases are disjoint, so the visit probability is

0.36+0.1728=0.5328.0.36 + 0.1728 = 0.5328.

Every path that ends at 22 visits 22, but the visit event also contains the paths RRLL and RRRR, which pass through 22 and end at 00 or 44. Their probabilities 0.05760.0576 and 0.12960.1296 account for the difference 0.18720.1872, so the classmate’s claim is wrong.

How this lesson connects