Random Walks
A random walk accumulates random steps. In one dimension,
where the increments are often iid with mean and variance . Then
A simple symmetric random walk has with equal probability. It is also a Markov chain, because the next position depends on the current position and one new step.
Worked simulation
This simulation runs many symmetric random walks, checks that final-position variance is near the number of steps, and estimates the chance of hitting level 20.
import numpy as np
rng = np.random.default_rng(20260711)
steps = rng.choice([-1, 1], size=(20000, 200))
walk = steps.cumsum(axis=1)
final = walk[:, -1]
print("final_mean", round(final.mean(), 3),
"final_var", round(final.var(ddof=1), 3),
"theory_var", 200)
print("P(hit_20_by_200)", round((walk.max(axis=1) >= 20).mean(), 4))Observed output:
final_mean -0.061 final_var 197.853 theory_var 200
P(hit_20_by_200) 0.1576The mean final position is near zero at -0.061, but the final variance is 197.853, close to the theoretical value 200. The hit probability 0.1576 shows that individual paths can still reach level 20 even when the expected step is zero.
The paths keep crossing zero, but the vertical spread grows with time. The dashed guides mark the scale, matching the variance formula for a simple symmetric walk.
Connections and caveats
The law of large numbers says average step size converges; the central limit theorem explains why is approximately normal. Random walk baselines appear in time series, but real series can have mean reversion, seasonality, bounded states, and structural breaks.
References
Nav