M Market Alerts financial.apicode.io
← Knowledge base

Mathematics · 12 min read · ~27 min study · intermediate

Random Walks and Brownian Motion

From a drunk stumbling home to Black-Scholes — the mathematical heartbeat of modern finance.

Random Walks and Brownian Motion

Every financial model that touches uncertainty — Black-Scholes, Heston, the Vasicek short-rate model, GARCH for volatility, Monte Carlo VaR — sits on top of one mathematical object: Brownian motion. Get a feel for it and most of quant finance becomes a series of variations on a theme. Skip this and the rest will always feel like memorisation.

This article walks from a one-dimensional random walk on a discrete grid to standard Brownian motion to the geometric Brownian motion used for stock prices. Then you can play with paths in the simulator below.

A drunk on a number line

Imagine a drunk on a number line who flips a fair coin every second. Heads, they step ; tails, . Let be their position after seconds, starting at :

Each step has mean and variance , and the steps are independent, so:

The standard deviation of position grows like . This is the central insight: uncertainty in a random walk grows with the square root of time, not linearly. After 100 steps the drunk is typically from the start, not .

Refining time and space

Now make the steps smaller and faster. Let each step occur every seconds and have size (so the variance per second stays at ). After total time the position is

The Central Limit Theorem says: as , converges to a normal random variable with mean and variance . The limiting object — a continuous-time process whose increments are normal — is standard Brownian motion, denoted or .

Standard Brownian motion: the formal definition

A stochastic process is a standard Brownian motion if:

  1. .
  2. Independent increments: for , is independent of the past .
  3. Stationary, normal increments: .
  4. Continuous paths: is continuous (almost surely).

[!insight] The fourth property is the surprising one. Brownian motion is continuous everywhere and yet differentiable nowhere. Its paths look like jagged saws no matter how far you zoom in. This is why in stochastic calculus is not a derivative in the usual sense — it's an integral against a process that has no derivative.

Properties you'll lean on constantly

Three identities show up in nearly every quant calculation:

  • Variance scales with time: and .
  • Covariance is the smaller time: .
  • Quadratic variation: . This is the famous fact that "" in Itô calculus.

These three together let you compute almost any second-moment quantity you'll meet in derivatives pricing.

From Brownian motion to stock prices

Stock prices can't be negative, and percentage moves matter more than dollar moves. The fix is geometric Brownian motion (GBM):

Itô's lemma gives the explicit solution:

Two things to notice:

  • is normally distributed with mean and variance . So is log-normal.
  • The mean drift in log-space is , not . This convexity adjustment trips people up. It is why a stock with and has expected log-return only per year.

Simulating GBM in Python

import numpy as np
import matplotlib.pyplot as plt

def simulate_gbm(S0, mu, sigma, T, steps, paths, seed=None):
 rng = np.random.default_rng(seed)
 dt = T / steps
 drift = (mu - 0.5 * sigma ** 2) * dt
 diff = sigma * np.sqrt(dt)
 Z = rng.standard_normal((paths, steps))
 log_returns = drift + diff * Z
 log_paths = np.concatenate(
 [np.full((paths, 1), np.log(S0)), np.log(S0) + np.cumsum(log_returns, axis=1)],
 axis=1,
 )
 return np.exp(log_paths)

S = simulate_gbm(S0=100, mu=0.06, sigma=0.2, T=1.0, steps=252, paths=20, seed=42)
ts = np.linspace(0, 1, S.shape[1])
plt.plot(ts, S.T, alpha=0.6)
plt.xlabel("Time (years)"); plt.ylabel("S")
plt.title("20 GBM paths under µ=6%, σ=20%")
plt.show

The fact that we can simulate paths directly from a closed-form solution is a luxury — most stochastic models you'll meet later require Euler–Maruyama discretization of the SDE.

Try the path generator

Drag up and watch the fan of paths spread. Move the drift negative and watch the median path bend down. Change the seed for a fresh draw. The bolded line is the empirical mean across the displayed paths.

[!note] Notice that turning steps per year up makes the paths look smoother but doesn't change the distribution at any fixed . Brownian motion's roughness is scale-invariant; resolution only affects what you can see, not what's there.

Why this is everywhere in finance

  • Black-Scholes assumes the underlying is GBM under the risk-neutral measure.
  • Heston, SABR, Bergomi all add a second SDE to capture stochastic volatility, but the building block is still .
  • Vasicek, Hull-White, CIR for short rates are all stochastic differential equations with Brownian innovations.
  • Monte Carlo pricing boils down to: simulate paths under the right measure, compute the discounted payoff, average.
  • Risk decomposition — VaR, expected shortfall, scenario testing — is overwhelmingly done by simulating Brownian-driven paths.

If you internalise just one of these, make it variance scales with . That single fact gives you an instinct for half of risk and pricing intuition without any further work.

  • Stochastic Calculus for Finance II — Steven Shreve. The textbook on the subject.
  • Brownian Motion and Stochastic Calculus — Karatzas & Shreve. More mathematical.
  • The article on Stochastic Calculus for Finance for the next step (Itô, SDEs, Girsanov).

What You Will Learn

  • Explain a drunk on a number line.
  • Build refining time and space.
  • Calibrate standard pn0 motion: the formal definition.
  • Compute properties you'll lean on constantly.
  • Design from pn0 motion to stock pr__pn1__s.
  • Implement simulating gbm in Python.

Prerequisites

Mental Model

The math here is the engine room behind every model. The goal is not to memorize identities but to develop intuition for how randomness, change, and constraint interact — so you can spot when a model is mis-specified before the market does. For Random Walks and Brownian Motion, frame the topic as the piece that from a drunk stumbling home to Black-Scholes — the mathematical heartbeat of modern finance — and ask what would break if you removed it from the workflow.

Why This Matters in US Markets

US MFE programs — CMU MSCF, Princeton MFin, NYU Courant, Columbia MFE, Berkeley Haas, UCLA Anderson, Cornell CFEM, Baruch MFE, Chicago Booth, Stanford ICME, MIT MFin — assume this material on day one. Quant interviews at Citadel, Two Sigma, Jane Street, HRT, and the major banks routinely test it.

In US markets, Random Walks and Brownian Motion tends to surface during onboarding, code review, and the first incident a junior quant gets pulled into. Questions on this material recur in interviews at Citadel, Two Sigma, Jane Street, HRT, Jump, DRW, IMC, Optiver, and the major bulge-bracket banks.

Common Mistakes

  • Confusing standard deviation with standard error and over-stating significance.
  • Annualizing a Sharpe by 12× instead of √12× when working with monthly returns.
  • Trusting a closed-form Black-Scholes price for a US-style early-exercise option.
  • Treating Random Walks and Brownian Motion as a one-off topic rather than the foundation it becomes once you ship code.
  • Skipping the US-market context — copying European or Asian conventions and getting bitten by US tick sizes, settlement, or regulator expectations.
  • Optimizing for elegance instead of auditability; trading regulators care about reproducibility, not cleverness.
  • Confusing model output with reality — the tape is the source of truth, the model is a hypothesis.

Practice Questions

  1. State Itô's lemma in one line, and explain its role in deriving the Black-Scholes PDE.
  2. Why is the covariance matrix of US equity returns usually low-rank in practice?
  3. Define a martingale and give a finance example.
  4. Why is the maximum likelihood estimator of σ² in a Gaussian biased downward, and how is it corrected?
  5. Explain in one sentence how the central limit theorem justifies bootstrapping a Sharpe ratio.

Answers and Explanations

  1. For f(t, X_t) with dX_t = μ dt + σ dW_t, df = (∂t f + μ ∂x f + ½ σ² ∂xx f) dt + σ ∂x f dW_t. Applying it to a portfolio short an option and long Δ shares cancels the dW term, leaving the deterministic Black-Scholes PDE.
  2. Because most of the variance is explained by a few common factors (market, sectors, size, value); the remaining idiosyncratic component is small and noisy. PCA captures this — a handful of eigenvalues explain ~70-80% of the variance.
  3. A process X_t is a martingale if E[X_{t+s} | F_t] = X_t for all s ≥ 0. Discounted asset prices under the risk-neutral measure are martingales — that property is the engine of derivatives pricing.
  4. The MLE divides by n, not (n-1); that under-counts variability when the mean is also estimated from the sample. Bessel's correction divides by (n-1) to remove the bias.
  5. The CLT tells you the distribution of a sufficiently large sample mean is approximately normal regardless of the parent distribution, so resampling produces an empirical sampling distribution for the Sharpe whose width is well-calibrated to the original data.

Glossary

  • Random variable — a measurable function from outcomes to numbers.
  • Expectation — the probability-weighted average of a random variable.
  • Variance — the expected squared deviation from the mean.
  • Stochastic process — a time-indexed family of random variables (Brownian motion, Poisson process).
  • Itô's lemma — chain rule for stochastic calculus; the workhorse of derivatives pricing.
  • Eigenvalue — a scalar λ for which Av = λv; powers PCA and risk model decomposition.
  • Convex — second derivative non-negative; convex problems have a unique global optimum.
  • Bayes' rule — P(A|B) = P(B|A)P(A) / P(B); foundation of probabilistic updating.

Further Study Path

Key Learning Outcomes

  • Explain a drunk on a number line.
  • Apply refining time and space.
  • Recognize standard pn0 motion: the formal definition.
  • Describe properties you'll lean on constantly.
  • Walk through from pn0 motion to stock pr__pn1__s.
  • Identify simulating gbm in Python.
  • Articulate try the path generator.
  • Trace maths as it applies to random walks and pn0 motion.
  • Map stochastic as it applies to random walks and pn0 motion.
  • Pinpoint pn0 as it applies to random walks and pn0 motion.
  • Explain how random walks and pn0 motion surfaces at Citadel, Two Sigma, Jane Street, or HRT.
  • Apply the US regulatory framing — SEC, CFTC, FINRA — relevant to random walks and pn0 motion.
  • Recognize a single-paragraph elevator pitch for random walks and pn0 motion suitable for an interviewer.
  • Describe one common production failure mode of the techniques in random walks and pn0 motion.
  • Walk through when random walks and pn0 motion is the wrong tool and what to use instead.
  • Identify how random walks and pn0 motion interacts with the order management and risk gates in a US trading stack.
  • Articulate a back-of-the-envelope sanity check that proves your implementation of random walks and pn0 motion is roughly right.
  • Trace which US firms publicly hire against the skills covered in random walks and pn0 motion.
  • Map a follow-up topic from this knowledge base that deepens random walks and pn0 motion.
  • Pinpoint how random walks and pn0 motion would appear on a phone screen or onsite interview at a US quant shop.