← All Labs
INTERACTIVE APPLET · PROBABILITY · DIFFUSION

Random Walks & the √n Law

Set a thousand drunkards loose from the same lamppost. Each takes a fresh random step every tick — no memory, no plan, no destination. Watch a single walker and you can predict nothing: it wanders left, right, forward, back with equal whim. Yet watch the whole swarm and something rigid appears. The cloud swells outward, but not steadily — it spreads as the square root of time. After 100 steps the typical walker sits about 10 step-lengths from home; to double that distance you need not 200 steps but 400. This is the √n law of diffusion, the reason ink blooms slowly in water and heat crawls rather than jumps. Choose the dimension, add a drift, and watch chaos in each path become law in the aggregate.

E[ R² ] = n  →  RMS distance = √n · (step length)

The drunkard's swarm — every path random, the spread inevitable

Each walker steps at random · the cloud grows · its radius traces √n
Three.js · live walker simulation

DRIVE IT

Walker (one random path) √n envelope (typical radius) Swarm centre of mass Origin (the lamppost)
Press Play. Each tick every walker takes one independent random step. The teal ring is the live root-mean-square distance; the plot below tracks it against the pure √n curve.
STEPS TAKEN · n
RMS radius should equal √n
0

DIMENSION

CLASSIC SETUPS

WALKTHROUGH

  1. Start on 2D plane and hit Play. Fix your eye on one lone walker — it staggers with no pattern. You genuinely cannot say where it will be next tick.
  2. Now zoom out to the whole cloud. It puffs outward smoothly and symmetrically. The teal √n ring hugs the bulk of the walkers — that ring is the typical distance from home.
  3. Read the plot below the scene. The measured RMS distance (teal dots) lands right on the dashed √n curve, not on a straight line. Doubling the steps only multiplies the spread by about 1.41.
  4. Switch 1D → 2D → 3D mid-run. The cloud changes shape, but the √n law is unchanged: the RMS distance still tracks √n in every dimension.
  5. Open mode and raise Drift. Now the centre of mass (purple) marches off in a straight line at rate ∝ n, while the cloud around it still only widens as √n. Signal grows linearly; noise grows like a square root — which is why averaging wins.

AHA

THE INSIGHT
Squared distance adds, distance does not. Each independent step contributes its own length-squared to the total, and the random cross-terms cancel on average — so mean-squared displacement grows like n, and the typical distance like √n. That is why a diffusing particle has no fixed speed yet a perfectly predictable scale, and why drift (growing like n) always eventually overwhelms diffusion (growing like √n).

RESEARCH NOTE

For unit steps drawn independently along random axes, \(E[\mathbf{R}_n]=\mathbf 0\) (no drift) yet \(E[|\mathbf{R}_n|^2]=n\), because cross-terms \(E[\mathbf{s}_i\!\cdot\!\mathbf{s}_j]=0\) for \(i\ne j\). Hence RMS \(=\sqrt n\), independent of dimension. Further reading: Einstein's 1905 Brownian-motion paper (\(\langle x^2\rangle = 2Dt\)); Pearson's 1905 Nature note coining "the random walk"; Pólya's recurrence theorem (a walk returns to the origin in 1D and 2D but escapes in 3D).

EXPLANATION

A random walk is the simplest model of aimless motion: start at the origin and, at each tick, take one step in a randomly chosen direction, independent of every step before. Karl Pearson posed it in 1905 as the problem of a wandering mosquito; Einstein, the same year, used the identical idea to explain the jittering of pollen grains in water — Brownian motion — and in doing so gave the first hard evidence that matter is made of atoms. The single walker is the picture of pure unpredictability. But randomness, aggregated, obeys iron laws, and this applet computes one of them live from thousands of genuine simulated walkers.

Write the walker's position after \(n\) steps as the vector sum \(\mathbf{R}_n=\mathbf{s}_1+\mathbf{s}_2+\dots+\mathbf{s}_n\), where each \(\mathbf{s}_i\) is a random unit step. Because the steps are symmetric, the average position is the origin: \(E[\mathbf{R}_n]=\mathbf 0\). So on average the walker goes nowhere — which is true, and useless, because no individual walker sits at the origin. The right question is not "where is it on average?" but "how far from home is it, typically?" To answer that we look at the squared distance and expand it: \(|\mathbf{R}_n|^2=\sum_i|\mathbf{s}_i|^2 + \sum_{i\ne j}\mathbf{s}_i\!\cdot\!\mathbf{s}_j\). Each step has unit length, so the first sum is just \(n\). The cross-terms are products of independent steps pointing every which way, so each averages to zero. Taking expectations, \(E[|\mathbf{R}_n|^2]=n\), and the root-mean-square distance is \(\sqrt n\).

That single line is the heart of diffusion. Distance does not add up — squared distance does, because the Pythagorean cross-terms cancel when directions are random. So spreading is sub-linear: to travel twice as far from the start, a diffusing walker needs four times as long, not twice. Notice too that the argument never used the dimension — the same \(\sqrt n\) governs a walk on a line, a plane, or in space (toggle the buttons and watch the plot stay put). Einstein sharpened it into \(\langle x^2\rangle = 2Dt\), tying the microscopic step size to the macroscopic diffusion constant \(D\); it is why a drop of ink takes minutes to blur across a glass rather than crossing it at molecular speeds, and why the same \(\sqrt{\text{time}}\) crawl appears in heat flow, in the settling of a stock price, and in the error of a Monte-Carlo estimate.

Adding a drift exposes the law's real punchline. Give each step a small consistent bias and the mean position now moves: \(E[\mathbf{R}_n]\) grows linearly in \(n\), a straight march. But the spread around that mean — the cloud's width — still grows only as \(\sqrt n\). Signal (the drift) scales like \(n\); noise (the diffusion) scales like \(\sqrt n\); so the signal-to-noise ratio improves like \(n/\sqrt n=\sqrt n\). This is the same \(\sqrt n\) that appears in the standard error of a sample mean and in the \(\sqrt n\) width of the Galton board's bell — average \(n\) noisy measurements and the uncertainty shrinks by \(\sqrt n\). One last subtlety, Pólya's 1921 theorem, is worth toggling for: a symmetric walk is recurrent in 1D and 2D — it returns to its start infinitely often — but transient in 3D, where it escapes to infinity and never surely comes home. "A drunk man will find his way home, but a drunk bird may get lost forever."