Skip to content
Finance Lessons

Stochastic Processes

Random Walks & Martingales

The simple random walk and its √t spread, drift versus no drift, the martingale (fair-game) property via conditional expectation, and why efficient markets behave like martingales.

9 min Updated Jun 7, 2026

You’ve met the idea that randomness can be modeled, step by step. Now we meet the two creatures that show up everywhere a price, a bankroll, or a forecast wanders through time: the random walk and the martingale. The first is the simplest possible model of accumulated chance — a running total of coin flips. The second is the precise mathematical statement of a fair game: a process with no predictable lean, where your best guess of tomorrow is exactly today. They are the skeleton under “stock prices look unpredictable,” and getting them exactly right — including what they do not say — is what separates a real understanding of market efficiency from a folk slogan.

Before you read — take a guess

A stock's daily moves look completely unpredictable — you can't forecast tomorrow's change from anything you know today. What does that imply about its long-run trend?

The simple random walk

Analogy. Picture a coin-flipping drunk on a sidewalk. Heads, he lurches one step right; tails, one step left. After many flips, where is he? Not nowhere in particular — but not drifting anywhere either. His position is the running sum of independent shoves, and that sum has a beautiful, predictable shape even though every step is pure chance.

Definition. A simple random walk is the running total Sn=X1+X2++Xn,S_n = X_1 + X_2 + \cdots + X_n, where each increment XiX_i is an independent, identically distributed step — say +1+1 or 1-1 with equal probability (or ±c\pm c for a step of size cc). S0=0S_0 = 0; each new position is just the last one plus a fresh independent shock: Sn=Sn1+XnS_n = S_{n-1} + X_n.

Two facts do all the work, and both come straight from arithmetic on the increments.

Fact 1 — the mean stays put. Each fair step has E[Xi]=12(+1)+12(1)=0E[X_i] = \tfrac{1}{2}(+1) + \tfrac{1}{2}(-1) = 0. Expectation adds, so E[Sn]=E[X1]++E[Xn]=0.E[S_n] = E[X_1] + \cdots + E[X_n] = 0. On average the walk goes nowhere. A symmetric walk has no built-in lean.

Fact 2 — the spread grows like √n. Independent variances add. For a ±c\pm c step, Var(Xi)=c2\mathrm{Var}(X_i) = c^2 (since the mean is 0 and the squared deviation is always c2c^2). So Var(Sn)=nc2,SD(Sn)=cn.\mathrm{Var}(S_n) = n\,c^2, \qquad \mathrm{SD}(S_n) = c\sqrt{n}. The variance grows linearly with the number of steps, but the standard deviation — the typical distance from the start — grows only like the square root of time. This is the famous √t spreading law, and it is why uncertainty piles up slower than you’d guess.

Worked example. Take 100 fair steps of $1 each (win or lose a dollar on each flip), so the step size is c=1c = 1.

  • Expected final position: E[S100]=0E[S_{100}] = 0 — you expect to break even.
  • Standard deviation: SD(S100)=1×100=10\mathrm{SD}(S_{100}) = 1 \times \sqrt{100} = 10, i.e. $10.
  • Because S100S_{100} is (by the central-limit theorem) roughly normal, about 95% of the time you land within ±2\pm 2 standard deviations — that is, between −$20 and +$20.

Notice the asymmetry of scale: 100 steps, each worth $1, could in principle leave you anywhere from −$100 to +$100 — but the typical outcome is only about $10 from zero. Cancellation is the rule; extreme runs are rare.

A spreading cloud of random-walk paths
14 sample paths±√t spread
-1.20.01.20200
Drift (μ)0.0

Every path starts at zero and is shoved by tiny independent shocks. Slide the drift to 0 and the cloud is a symmetric martingale — it goes nowhere on average — yet it keeps fanning out: the dashed ±√t funnel is the standard deviation widening like the square root of time, not linearly. Tilt the drift and the whole cloud leans. Resimulate to draw a fresh batch.

You take 400 fair ±1 steps. Roughly how far from the start should you typically expect to end up (one standard deviation)?

Adding drift

The fair walk is symmetric, but nothing forces a coin to be fair. Tilt it — make each step carry a small average push — and you get a biased random walk with drift.

Definition. Let each increment have mean E[Xi]=μ0E[X_i] = \mu \neq 0 while keeping a finite variance σ2\sigma^2. Then E[Sn]=nμ,SD(Sn)=σn.E[S_n] = n\mu, \qquad \mathrm{SD}(S_n) = \sigma\sqrt{n}. The expected position now grows linearly in nn (the drift nμn\mu), while the spread still grows only like n\sqrt{n}. That mismatch — linear signal versus square-root noise — is the whole story of telling skill from luck.

Worked example — a tiny edge. Suppose a trader (or a loaded coin) has a per-step edge of μ=+0.02\mu = +0.02 with step-scale σ=1\sigma = 1. Over n=100n = 100 steps:

  • Drift (signal): nμ=100×0.02=+2n\mu = 100 \times 0.02 = +2.
  • Noise (spread): σn=1×100=10\sigma\sqrt{n} = 1 \times \sqrt{100} = 10.

After 100 steps the expected gain is +2+2, but the noise is ±10\pm 10five times larger. The edge is real, yet it’s buried; a single 100-step sample could easily show a loss and tell you nothing. The drift is invisible short-term.

Now stretch the horizon. The drift nμn\mu scales with nn; the noise σn\sigma\sqrt{n} scales with n\sqrt{n}. So the signal-to-noise ratio is nμσn=μσn,\frac{n\mu}{\sigma\sqrt{n}} = \frac{\mu}{\sigma}\sqrt{n}, which grows without bound as nn increases. At n=100n = 100 it’s 0.02×10=0.20.02 \times 10 = 0.2 (drift is a fifth of the noise). At n=10,000n = 10{,}000 it’s 0.02×100=20.02 \times 100 = 2 (drift is double the noise). Eventually drift always wins — but “eventually” can be a very long time.

Warning:

Why short track records prove nothing

A manager with a genuine edge of μ and a manager with none both produce noisy curves that, over a few months, are statistically indistinguishable — the √n noise swamps the nμ signal. You need a sample long enough that (μ/σ)·√n is comfortably bigger than 1 before luck and skill separate. This is also why a lucky no-edge manager can look brilliant for years.

Signal versus noise in a drifting walk.

Pick the right option for each blank, then check.

In a biased random walk the expected position grows with the number of steps, while the spread grows only . So a small edge is .

The martingale: a fair game

Strip the drift back out and you get the single most important object in this lesson: a martingale. The word names a precise property — a fair game — and the precision matters.

Definition. A process X0,X1,X2,X_0, X_1, X_2, \dots is a martingale if, given everything known up to today (call that information set Ft\mathcal{F}_t), the conditional expectation of tomorrow’s value equals today’s: E[Xt+1Ft]=Xt.E[X_{t+1} \mid \mathcal{F}_t] = X_t. In words: your best forecast of tomorrow, using all the information you have right now, is exactly today’s value. No predictable push up, no predictable push down. The martingale property is about the conditional expectation — the forecast given the present — not about the variance.

That last point is the whole trap. A martingale is not a constant, and it is not low-variance. Tomorrow’s value is still uncertain and can swing wildly; the claim is only that the average of that swing, conditioned on today, is centered on today. A driftless random walk is the textbook example: E[Sn+1Fn]=Sn+E[Xn+1]=Sn+0=SnE[S_{n+1} \mid \mathcal{F}_n] = S_n + E[X_{n+1}] = S_n + 0 = S_n. It’s a martingale, yet (we just saw) its spread grows like n\sqrt{n} forever.

Examples.

  • A driftless random walk — fair coin flips — is a martingale.
  • A fair casino bankroll: each bet has expected change zero, so your expected bankroll tomorrow is your bankroll today. A martingale.
  • Any process with no predictable trend, where knowing the past gives you no edge on the next move’s average.

Two cousins capture biased games:

  • A submartingale satisfies E[Xt+1Ft]XtE[X_{t+1} \mid \mathcal{F}_t] \ge X_t — it tends to drift up. A stock earning a risk premium is a submartingale: on average it pays you to hold it.
  • A supermartingale satisfies E[Xt+1Ft]XtE[X_{t+1} \mid \mathcal{F}_t] \le X_t — it tends to drift down. A gambler’s bankroll at an unfair casino (house edge) is a supermartingale; so is a fee-draining fund.

A handy mnemonic: a supermartingale is bad luck for the holder (it leaks down), a submartingale is good luck (it builds up) — the names feel backwards because they’re named after the inequality on the expectation, not the direction of the money.

Match each term to its precise definition.

Pick a term, then click its definition.

Why efficient markets look like martingales

Here’s the payoff — the reason this abstract machinery is everywhere in finance.

The argument. Suppose a price already reflects all available information. Then the expected next change, beyond the baseline compensation for time and risk, must be zero. Why? Because if everyone could see that the price would predictably rise tomorrow, they’d buy today — pushing the price up now until the predictable gain vanished. Any forecastable excess move is free money, and free money gets competed away instantly. What survives is a process whose best forecast of the next (suitably adjusted) move is no move at all: a martingale.

More carefully: it’s the discounted, risk-adjusted price that behaves like a martingale. Strip out the risk-free growth and the risk premium, and what remains has expected change zero. (Pricing theory formalizes this as the existence of a martingale measure — a reweighting of probabilities under which discounted prices are exactly martingales. You’ll meet it properly later; for now, just hold the picture: efficiency = no predictable excess move.)

Pitfall 1 — “random walk” does not mean “no drift.” Real equity indices are submartingales, not martingales: they carry an upward drift, the equity risk premium, your reward for bearing risk. Efficiency kills predictable excess returns — the part you could arbitrage — not the risk premium, which is compensation, not a free lunch. Saying “the market is a random walk so it has no trend” fuses two different claims and gets the second one wrong.

Pitfall 2 — a martingale is not safe. “No predictable trend” says nothing about risk. A martingale’s variance still grows like t\sqrt{t} (or faster), so it can wander enormously far from where it started. Fair does not mean gentle. Confusing “you can’t forecast the direction” with “it won’t move much” is exactly the error the pretest flagged.

If markets carry an upward drift, why do quants so often model prices as martingales anyway?

Because for pricing derivatives, the real-world drift is a red herring. The whole insight of risk-neutral pricing is that you can switch to an artificial probability measure — the martingale measure — under which every discounted asset is a true martingale, drifting at exactly the risk-free rate and nothing more. Under that measure expected excess returns are zero by construction, so the price of a payoff is simply its discounted expected value. This isn’t a claim that stocks really have no risk premium (they do, under the real-world measure); it’s a computational trick that works precisely because no-arbitrage forces discounted prices to be martingales under some measure. The risk premium hasn’t vanished — it’s been absorbed into the change of measure. So “prices are martingales” is true under the pricing measure and false under the real-world one, and keeping those two straight is half of what a derivatives quant gets paid for.

A colleague says: 'The S&P 500 is a random walk, so over the long run you shouldn't expect it to go anywhere.' What's wrong?

Gambler’s ruin & optional stopping (intuition)

One last pair of ideas that follow from the martingale property and demolish a lot of wishful thinking.

Gambler’s ruin. Play a fair game (a martingale bankroll) with a finite purse against a house with effectively infinite money, and keep playing forever. You go broke with probability 1. The game is fair — your expected bankroll never drops — yet ruin is certain, because the t\sqrt{t} wandering will eventually touch zero, and zero is an absorbing wall (broke is broke; the house, with infinite reserves, has no such wall). You cannot out-wait variance. Fairness protects your average, not your survival.

Worked ruin probability. Suppose you start with stake aa and quit either at $0 (ruin) or at a target b>ab > a, playing a fair ±1\pm1 walk. The probability of ruin before hitting the target is P(ruin)=bab.P(\text{ruin}) = \frac{b - a}{b}. Start with $20 aiming for $100 (so a=20a = 20, b=100b = 100): ruin probability =(10020)/100=0.8= (100 - 20)/100 = 0.8. An 80% chance of going broke before you ever see $100 — in a perfectly fair game. (And against an infinite house, set bb \to \infty and the ruin probability 1\to 1.)

Optional stopping (intuition). You might hope to beat a martingale with a clever exit rule — quit the instant you’re ahead, double down when behind, and so on. The optional stopping theorem says: under reasonable conditions, no stopping strategy changes your expected payoff. For a fair martingale, your expected value when you stop equals your starting value, whatever rule you use. The “quit while you’re ahead” schemes (like the classic Martingale doubling system) don’t manufacture an edge — they just reshuffle a near-certain small win against a rare catastrophic loss, leaving the expectation exactly where it started. There is no free lunch hiding in the timing.

You start a fair ±1 game with 25 dollars and quit at either 0 or a 100 target. What's the probability of ruin first, and what does it reveal?

Putting it together

A simple random walk is a running sum of independent shocks: its mean stays at the start (for fair steps) while its spread widens like n\sqrt{n} — uncertainty piling up slower than the step count. Drift adds a per-step lean μ\mu, so the expected position grows linearly (nμn\mu) while noise still grows like n\sqrt{n} — which is why a small edge is invisible short-term but inevitable long-term. A martingale is the precise statement of a fair game: E[Xt+1Ft]=XtE[X_{t+1}\mid\mathcal{F}_t] = X_t, a forecast-equals-today property about the conditional expectation, not about variance — so it can still wander enormously. Submartingales drift up (a stock’s risk premium), supermartingales drift down (a house edge). Efficient markets look like martingales because any predictable excess move would be arbitraged away — but real indices are submartingales, carrying a risk premium, and a martingale is never “safe.” And gambler’s ruin plus optional stopping seal the deal: you can’t out-wait variance, and no clever exit rule beats a fair game.

Big picture

Random walks & martingales — the whole picture

  • Random walks & martingales
    • Simple random walk
      • Sn = sum of iid ±step increments
      • Fair steps: mean stays 0
      • Variance = n·step², so SD = step·√n
      • The √t spreading law
    • Adding drift
      • Each step has mean mu ≠ 0
      • Expected position grows linearly: n·mu
      • Spread still grows like √n
      • Signal-to-noise (mu/sigma)·√n grows with n
    • Martingale: a fair game
      • E[next | today] = today
      • About the conditional expectation, not variance
      • Driftless walk / fair bankroll
      • Submartingale ≥ up, supermartingale ≤ down
    • Efficient markets
      • Predictable excess move = free money, arbitraged away
      • Discounted prices ≈ martingales (martingale measure)
      • Real indices are submartingales (risk premium)
      • Pitfall: martingale ≠ safe, variance still grows
    • Ruin & optional stopping
      • Finite purse vs infinite house → ruin certain
      • Fair-walk ruin prob = (b − a)/b
      • No stopping rule beats a martingale
A running sum of shocks spreads like √t; drift adds a linear lean; a martingale is a fair game about the conditional expectation; efficient markets are (sub)martingales because predictable excess gets arbitraged away.

Recap: random walks & martingales

Question 1 of 40 correct

A fair ±1 random walk runs for 900 steps. What is the standard deviation of its final position, and what is its expected final position?

Check your answer to continue.

Next up — Brownian motion — we let the steps shrink to zero and arrive in a step at a time, taking the random walk’s √t spreading to its smooth, continuous limit. That continuous-time martingale is the raw material for every price model you’ll build from here: feed it a drift and a volatility, wrap it in an exponential, and you’ve reinvented the engine behind simulated asset prices.

Mark lesson as complete