Random Walk Simulator
Simulate one-dimensional and two-dimensional random walks and see how far a walker typically travels as the square root of the number of steps.
🔒 This tool runs entirely in your browser. Your files are never uploaded to a server.
Math & Science
Random Walk Simulator
Frontend preview — no upload or external service.
Walk result
1,000 walks of 1,000 steps in 1D: mean distance from the origin 25.1 — close to √1000 ≈ 31.6 scaled by the expected factor, and 517 walks ended on the negative side.
How the Random Walk Simulator works
- Choose one or two dimensions and the number of steps.
- Run many walks at once to see the distribution rather than one anecdote.
- Compare the typical distance against the square root of the step count — the relationship is the whole point.
The method
Each step is independent, so displacements add but their variances add rather than their magnitudes, giving distance growing with the square root of steps.
E[distance] ∝ √N, not N
After 1,000 steps a walker is typically about 30 units away, not 1,000 — and after 4,000 steps only twice as far, not four times.
FAQ
Does a random walk return to the start?
In one and two dimensions it returns with probability one, given infinite time — Pólya's theorem. In three dimensions it does not, which is a genuinely surprising result.
Why does distance grow as the square root?
Because steps in opposite directions cancel. Only the imbalance survives, and the imbalance of N coin flips grows like √N.
Is this a good model for stock prices?
It is the basis of one, but real markets have fat tails and volatility clustering that a simple random walk does not produce. Treat it as an intuition, not a model.
How we compare
| Feature | Online Tool Store | A graphing calculator | A stats package |
|---|---|---|---|
| Many walks at once | ✓ | ✗ | ✓ |
| 1D and 2D | ✓ | ✗ | ✓ |
| Runs in the browser | ✓ | ✓ | ✗ |
| No install or licence | ✓ | ✓ | ✗ |
Random Walk Simulator is aimed at the √N intuition — the reason a thousand steps leaves you around thirty units from where you began.