Recurrence and transience of random walks
The question
A walker leaves home and keeps choosing a random direction. Does it eventually come back on a line, a square grid, or a cubic grid?
- 1 SeePredict, then simulate the walks.
- 2 TryCompare two return events.
- 3 ProveBuild the argument for each dimension.
- 4 ApplyCount returns and estimate visits.
Before you start · 3 quick checks on grid moves, independence, and parity
Two ideas before you start
2 ideasOne move changes one coordinate
On a square grid, neighboring sites lie directly beside, above, and below the start.
A move goes to a nearest neighbor. Each direction has the same chance, and each draw is independent of the previous draws.
Exact definition
Let \(X_n\) be the position after \(n\) steps on the integer lattice \(\mathbb Z^d\), the set of all integer coordinate vectors of dimension \(d\). The origin is the vector with every coordinate zero. The walk starts there at time zero, \(X_0=0\).
At each step choose a coordinate uniformly and independently choose a sign with equal chances. Add the signed unit to that coordinate. Thus each of the \(2d\) neighboring sites is equally likely. There are no walls, diagonal moves, or pauses.
A deadline cuts off what you can observe
The drawn path leaves home, returns, then leaves again. Choose a deadline to see how much of it you observe.
A return counts if it happens after the start. A deadline tells you how long to watch.
Exact definition
The first return time \(\tau\) is the smallest positive step \(n\) with \(X_n=0\). Set \(\tau=\infty\) if there is no such step. For a whole-number deadline \(N\), write \(F(N)=P(\tau\le N)\). The event includes a return on the deadline itself. The starting position does not count as a return.
Make a call for each lattice
- For each lattice, choose the probability that the walker eventually returns home: one, strictly between zero and one, or zero.
- Record all your predictions to run the walks. Use the deadline slider to inspect what the finite runs observed.
The line allows left and right. The square grid adds forward and back. The cubic grid adds up and down. Each walk starts at home, then makes independent, equally likely moves among its lattice’s nearest neighbors for as long as you watch.
Every row uses the same paths at the early and late deadlines. A path that returns early still counts at a later deadline. To simulate, the page stops recording a path at its first return or the run’s final deadline. A path still missing then might return later.
By a step or at a step?
- Move the deadline on the square grid and compare the two probabilities.
- Use the exact fractions to meet each goal. Try adjacent deadlines to test whether a threshold was crossed for the first time.
How the page counts paths
Write \(u_n=P(X_n=0)\), the probability of being at home at exactly step \(n\), and \(f_n=P(\tau=n)\), the probability of a first return at that step. At a positive step \(n\), a path at home has some first return step \(k\) no later than \(n\). After that first return the next moves are independent of the first \(k\) moves. To be home at \(n\) it must end the remaining \(n-k\) steps at home again.
\[u_n=\sum_{k=1}^n f_k u_{n-k}.\]Since the walk starts at home, \(u_0=1\). Only the term with \(k=n\) contains the unknown \(f_n\). Solve for it by subtracting the earlier terms. Then add the first-return probabilities up to the deadline to get \(F(N)\). The widget counts equally likely direction sequences with integers before it reduces each fraction.
What the sum of visit probabilities says
Start at the origin of \(\mathbb Z^d\), with \(d\) a positive integer. Take independent steps uniform among the \(2d\) nearest neighbors. An eventual return has probability one in dimensions one and two. In dimensions three and higher it has probability strictly between zero and one.
Write \(r=P(\tau\lt\infty)\). The origin is recurrent when \(r=1\) and transient when \(r\lt1\). The same classification holds if the walk starts at any other lattice site and asks about returns to that site. Translating all positions by the starting site preserves the step rule.
Let \(V\) count visits to the origin, including the start. Use \(u_n=P(X_n=0)\) for the probability of a visit at step \(n\). Write \(G=\sum_{n\ge0}u_n\), a sum that may be infinite. Reversing the first move on the next step has positive probability, so \(r\gt0\) in every dimension here.
Why a return gives the walk a fresh start
Fix a step \(t\) at which the first return occurs. The event \(\tau=t\) depends only on moves through \(t\), so future moves still have their original independent law. The position at \(t\) is the origin. The chance of another return is therefore \(r\) for each such \(t\), and it stays \(r\) when you combine the possible finite return times. The same argument works after any specified number of returns. This is the restart property at a return time for this walk.
There are two ways to count \(V\): add an indicator for a visit at each step, or add an indicator for each visit number that the walk reaches. Taking expectations of either nonnegative sum is valid even if \(V\) can be infinite, by first taking finite partial sums and then taking their increasing limit.
The estimates used in the dimension comparison
Each step changes the sum of the coordinates by a signed unit, so its parity flips. At an even step \(2k\) with \(k\ge1\), write \(b_k=\binom{2k}{k}/4^k\). A walk on a line is home exactly when its positive and negative steps balance. On the square grid write the two coordinates as \(x,y\). In the transformed coordinates \(x+y,x-y\), the four equally likely moves are the four possible sign pairs. The transformed coordinates are independent line walks, and both are zero exactly when \(x=y=0\).
Stirling’s approximation gives \(b_k\sim 1/\sqrt{\pi k}\), where \(\sim\) means the ratio tends to one. A series with terms comparable to \(k^{-a}\) for large \(k\) converges when \(a\gt1\) and diverges when \(a\le1\). This follows by comparing the sum with the area under \(x^{-a}\) for the positive exponents here.
For higher dimensions. For a vector of angles \(\theta=(\theta_1,\ldots,\theta_d)\), let
\[\phi(\theta)=\frac{1}{d}\sum_{j=1}^d\cos\theta_j.\]Average \(\phi(\theta)^{2k}\) over the cube of angles \([−\pi,\pi]^d\). The average is \(u_{2k}\). To see why, write each cosine as the average of its two complex exponentials. Expanding the power lists the equally likely walks. A walk ending at the integer vector \(m\) contributes the product of \(e^{i m_j\theta_j}\) over the coordinates, where \(i\) is the imaginary unit. Each factor averages to one when \(m_j=0\) and zero otherwise. Only endpoints at the origin survive.
Shifting every angle by \(\pi\) modulo \(2\pi\) changes the sign of \(\phi\) and preserves the average. It therefore suffices to bound the integral on \(\phi\ge0\) and double it. On that region, use \(1-x\le e^{-x}\) and \(1-\cos t\ge 2t^2/\pi^2\) for \(|t|\le\pi\). The cosine inequality follows from \(1-\cos t=2\sin^2(t/2)\) and the chord bound for sine on \([0,\pi/2]\).
On this region the first inequality gives
\[\phi(\theta)^{2k}\le e^{-2k(1-\phi(\theta))}.\]Applying the cosine bound to each coordinate then gives
\[\phi(\theta)^{2k}\le e^{-a_d k\sum_j\theta_j^2}.\]Here \(a_d=4/(d\pi^2)\). Extend the integral of the upper bound to all of \(\mathbb R^d\). The integral factors into \(d\) Gaussian integrals. In each, scaling the angle by \(\sqrt k\) gives a factor of \(k^{-1/2}\). Thus \(u_{2k}\le C_d k^{-d/2}\) for some finite constant \(C_d\) depending only on \(d\).
Read the complete proof
Compare with the eventual probabilities
For the cubic grid, evaluate the sum \(G\) using the simple-cubic lattice Green function, the angle average of \(1/(1-\phi(\theta))\). This is the average of \(1/(1-\phi(\theta)^2)\) by the same shift symmetry, so the series of even powers gives \(G\). The numerical evaluation uses the elliptic-integral form given in Guttmann’s article below. The theorem itself only needs the convergence bound.
The square-grid return share in See can look almost flat near the final deadline. Its visit probabilities fall like a constant times \(1/k\) at even steps. Their sum diverges slowly and still forces \(r=1\). A path that has not come home in the simulation still has time left in the mathematical walk.
When \(r=1\), the restart argument gives probability one of making at least any fixed finite number of returns. Taking the countable intersection shows the walk returns infinitely often with probability one. When \(r\lt1\), the chance of at least \(j\) returns is \(r^j\), which tends to zero, so the total is finite with probability one.
Count visits and returns
Decide whether each question counts a first return, a location at a fixed time, or visits over the whole run. Enter a decimal within the stated absolute error. Each problem has hints and a worked solution.
Further reading
- G. Pólya, Über eine Aufgabe der Wahrscheinlichkeitsrechnung betreffend die Irrfahrt im Straßennetz, Mathematische Annalen.
- A. J. Guttmann, Lattice Green’s functions in all dimensions, Journal of Physics A: Mathematical and Theoretical.
Related lesson: The reflection principle counts paths that hit a level by flipping part of a one-dimensional walk.