Skip to content

Random Walk

The simple random walk is the simplest non-trivial martingale, and a rich object in its own right. This page collects three results about it, each illustrating a different theme: optional sampling cashed out as gambler’s ruin, the dimension-dependent recurrence discovered by Pólya, and the continuous-time scaling limit, Brownian motion.

A gambler starts with kk dollars and bets one dollar on a fair coin each round, quitting when broke or when the fortune first reaches a target mm, where 0<k<m0 < k < m. The fortune is the random walk

Sn=k+i=1nXi,P(Xi=+1)=P(Xi=1)=12,S_n = k + \sum_{i=1}^n X_i, \qquad \Pr(X_i = +1) = \Pr(X_i = -1) = \tfrac{1}{2},

started at S0=kS_0 = k, and the game ends at the exit time

T=inf{n:Sn=0 or Sn=m},T = \inf\{ n : S_n = 0 \text{ or } S_n = m \},

which is a stopping time, being the first hitting time of {0,m}\{0, m\}. Two questions: with what probability does the gambler reach the target rather than go broke, and how long does the game last on average?

Both answers rest on optional sampling. We may apply it because the stopped walk STnS_{T \wedge n} never leaves [0,m][0, m]: it is bounded, hence uniformly integrable, so the theorem applies through its second remark even though {Sn}\{S_n\} itself is not. The exit time is finite almost surely too: from any interior state, mm consecutive up-steps force an exit, an event of probability at least 2m2^{-m} in each block of mm steps, so P(T>km)(12m)k0\Pr(T > km) \le (1 - 2^{-m})^k \to 0, giving T<T < \infty almost surely.

The expected duration needs a second martingale, built from the square of the walk.

The two results read cleanly together. A fair game is fair in stakes: the chance of turning kk into mm is exactly the fraction k/mk/m of the target you begin with, so on average you neither gain nor lose. Fairness says nothing about patience, though: the expected number of rounds is k(mk)k(m-k), largest when the gambler sits midway between the boundaries. Against an infinitely rich house, mm \to \infty with kk fixed, the ruin probability (mk)/m1(m-k)/m \to 1 and the expected time to ruin k(mk)k(m-k) \to \infty. The gambler is certain to be ruined, but is made to wait arbitrarily long for it.

Gambler’s ruin lives inside a bounded interval, where the walk is forced to exit. Released on the whole lattice, does a random walk always come back to where it started? The answer depends, remarkably, only on the dimension. For one and two dimensions, the walk almost surely finds the way home. But say a bird flying through three-dimensional space, stepping in random directions, may never return: there is a positive probability of escaping to infinity.

“A drunk man will find his way home, but a drunk bird may get lost forever.” — Shizuo Kakutani

The dichotomy is visible by simulation. Below, three independent walks run continuously in 1D, 2D, and 3D; each restarts when it returns to the origin or after a step cap, and the counter tracks the empirical fraction that returned.

1D
returns: 0/0 ()
2D
returns: 0/0 ()
3D
returns: 0/0 ()
Each panel restarts on a return to the origin or after 3000 steps.

Watched for a while, the 1D and 2D rates climb toward 100%100\% (the step cap occasionally lets a wandering walk slip through before its certain eventual return), while the 3D rate settles well below, around the infinite-time limit 10.34050.661 - 0.3405 \approx 0.66 thinned further by the cap. The qualitative gap between the dimensions is the theorem.

Speed the walk up and shrink its steps at the same time, and a continuous process emerges in the limit. Take the symmetric walk Sn=X1++XnS_n = X_1 + \cdots + X_n with unit-variance steps and rescale space by n\sqrt{n} and time by nn:

Bt(n)=Sntn,t[0,1].B^{(n)}_t = \frac{S_{\lfloor n t \rfloor}}{\sqrt{n}}, \qquad t \in [0, 1].

The central limit theorem already says the marginal Bt(n)B^{(n)}_t is approximately N(0,t)\mathcal{N}(0, t); Donsker’s invariance principle upgrades this to convergence of the whole path to standard Brownian motion {Bt}\{B_t\}. Drag nn up, or hit animate, to watch the coarse walk refine into a Brownian path inside the limiting ±t\pm\sqrt{t} bands.

 
+√t+2√t00.250.50.751t = k / n
The walk S⌊nt⌋ / √n on [0, 1]. As n grows it refines toward a Brownian path; the dashed curves are the limiting ±√t and ±2√t standard-deviation bands.

The limit is the canonical continuous-time process.

Brownian motion is the continuous-time face of everything on the earlier pages. With Fs\cF_s the information up to time ss, the independent mean-zero increments make it a martingale: for s<ts < t,

E[BtFs]=Bs+E[BtBsFs]=Bs+E[BtBs]=Bs.\E[B_t \mid \cF_s] = B_s + \E[B_t - B_s \mid \cF_s] = B_s + \E[B_t - B_s] = B_s.

And exactly as the discrete walk needed the compensator nn to turn Wn2W_n^2 into the martingale Wn2nW_n^2 - n, Brownian motion needs the compensator tt:

E[Bt2tFs]=E[(Bs+(BtBs))2Fs]t=Bs2+(ts)t=Bs2s,\E[B_t^2 - t \mid \cF_s] = \E[(B_s + (B_t - B_s))^2 \mid \cF_s] - t = B_s^2 + (t - s) - t = B_s^2 - s,

so {Bt2t}\{B_t^2 - t\} is a martingale. The discrete Wn2nW_n^2 - n is its random-walk shadow; the continuous compensator tt is the quadratic variation of the path, the seed of stochastic calculus.

The paths themselves are continuous but nowhere differentiable, wandering within the same ±t\pm\sqrt{t} standard-deviation bands the rescaled walk approached.

paths: 4
Continuous Brownian paths from the origin; each bundle redraws so the ±√t and ±2√t bands fill in. Zero drift, variance growing linearly in time.