This page simulates simple symmetric random walks on the d-dimensional cubic latticeZ^d with nearest-neighbor steps (four directions in 2D, six in 3D), all of unit length. A synchronized ensemble of independent walkers starts at the origin; after each clock tick every walker takes one independent step, and the simulator records the sample mean of r² = x² + y² (+ z²), which tracks the exact identity E[r²] = t for unbiased NN walks (diffusion scaling). A reference liney = t is overlaid on the ⟨r²⟩ vs t plot. A histogram of r² across walkers at the current time illustrates the spread around the mean. Separately, Monte Carlo paths started at the origin estimate first-return statistics: time τ of the first visit to 0 after t > 0. In 2D the walk is recurrent (almost surely returns), while in 3D it is transient with a nonzero escape probability, so the empirical return probability before a large cutoff visibly drops when switching dimensions—pedagogy for Pólya’s theorem and Green’s function intuition without heavy analysis.
Who it's for: Undergraduates learning probability, diffusion, or statistical physics who already saw informal random walks and want lattice SRW, MSD scaling, and recurrence in one interactive view.
Key terms
Simple random walk
Lattice Z^d
Mean squared displacement
Diffusion
First return time
Pólya recurrence
Transience
How it works
Nearest-neighbor simple random walk on Z² or Z³: synchronized ensemble mean ⟨r²⟩ vs time with the identity line, histogram of squared radii across walkers, and Monte Carlo first-return statistics contrasting recurrent 2D with transient 3D walks.
Key equations
⟨S_t⟩ = 0, unit NN step: E[||S_t||²] = t; first return τ = inf{t>0 : S_t=0} (2D recurrent a.s., 3D finite prob per infinitely long walk).
Frequently asked questions
Why is the dashed reference line y = t, not 2t or 6t?
Each NN step has unit Euclidean length, so one step adds 1 in expectation to ||S||² for unbiased symmetric walks on Z^d in this normalization. If you doubled step length, both the walk and the identity would rescale accordingly.
What does “P(return) est.” mean with a finite cutoff?
Each Monte Carlo trial stops either at the first return time τ or after τ_max steps without returning. The displayed fraction counts returns before censorship; in 3D many long paths would need enormous τ_max to approximate the true return probability, so treat the readout as a finite-horizon Monte Carlo estimate.
How does this differ from the existing “Random Walk” math lab?
The older page emphasizes 1D coin flips and 2D fixed-length random-angle steps for visual trails. This lab uses integer lattice dynamics, an ensemble mean ⟨r²⟩, a histogram, and first-return Monte Carlo aimed at recurrence vs transience.