A random walk is a fundamental stochastic process that models the path of an object taking successive steps in random directions. This simulator visualizes both one-dimensional and two-dimensional random walks, where each step is of fixed length but its direction is chosen randomly (e.g., left/right in 1D or along a grid in 2D). The core mathematical principle is that the mean squared displacement, denoted ⟨r²⟩, grows linearly with the number of steps, N. Specifically, in an unbiased walk with step length L, ⟨r²⟩ = N L² in 1D, and ⟨r²⟩ = N L² in 2D for a square lattice. This linear relationship ⟨r²⟩ ∝ N is the signature of normal, or Fickian, diffusion. The simulator plots the running average of r² versus N, allowing users to observe how this linear trend emerges from the noise of individual random paths. Key simplifications include the fixed step length, the absence of external forces or biases, and the assumption that each step is independent of all previous steps (a Markov process). By interacting with the simulation, students learn to connect the microscopic random motion of individual steps to the emergent macroscopic behavior of diffusion, building intuition for phenomena like Brownian motion, heat conduction, and population dispersal.
Who it's for: High school and undergraduate students in physics, mathematics, or biology courses introducing probability, statistics, or diffusion processes.
Key terms
Random Walk
Mean Squared Displacement
Diffusion
Stochastic Process
Brownian Motion
Markov Process
Normal Distribution
Central Limit Theorem
How it works
Contrasts with the smooth Brownian path in thermodynamics: here each step is a clean coin flip or uniform angle, ideal for proving scaling laws.
Frequently asked questions
Why does the path look so messy, but the average ⟨r²⟩ plot is a straight line?
An individual random walk path is unpredictable and 'jagged' because each step is random. However, the mean squared displacement ⟨r²⟩ is a statistical average over many possible paths. The linear trend emerges from the law of large numbers, showing that while individual outcomes are random, their average behavior is predictable and follows the diffusion law ⟨r²⟩ ∝ N.
Is this how real particles like pollen grains in water actually move?
Yes, this is a simplified model of Brownian motion. Real particles are constantly bombarded by water molecules, resulting in a random, jittery path. The random walk model captures the essential statistical feature—the linear growth of mean squared displacement with time—which Albert Einstein used in 1905 to prove the atomic theory of matter.
What does the 'running mean' of ⟨r²⟩ show?
The running mean calculates the average of r² up to each step number N for the single walker you are watching. It starts very noisy for small N but converges toward the theoretical straight line (N L²) as N increases. This demonstrates how statistical predictability improves with more data, a key concept in probability.
What are the main limitations of this simple random walk model?
This model assumes fixed step lengths, instantaneous steps, and no interactions between walkers or with an environment. Real-world diffusion can involve variable step sizes, waiting times between steps, and external forces (leading to biased walks). It also models 'normal' diffusion; many complex systems like transport in cells exhibit 'anomalous' diffusion where ⟨r²⟩ ∝ N^α with α ≠ 1.