Quant Sandbox
DerivativesPortfolio & RiskFixed IncomeCorporate FinanceStochastic ModelsGuide
Guide
Derivatives pricing
01Forwards, calls and puts02Combining positions03Arbitrage and the forward price04Put–call parity05The one-step binomial model06Risk-neutral probabilities07Multi-step trees and backward induction08American options and early exercise09Delta and hedging10Geometric Brownian motion11The Black–Scholes formula12The Greeks: gamma, vega, theta and rho13Implied volatility and the volatility smile14Stochastic volatility and the Heston model15Static replication: Breeden–Litzenberger and Carr–Madan16Exotic options: barriers, Asians and digitals
Portfolio & risk
01Returns and volatility02Diversification and correlation03The efficient frontier and the capital market line04Risk aversion and the optimal complete portfolio05CAPM, beta and the security market line06Performance measures: Sharpe, Treynor, Jensen and information ratio07Factor models and systematic risk08Value at Risk and expected shortfall
Fixed income
01Bond prices and yields02Duration and convexity03Immunization and duration matching04Spot rates, forward rates and the yield curve05Bond futures and the cheapest-to-deliver06Interest rate swaps07Callable bonds and negative convexity08Credit risk: default probabilities and credit spreads
Corporate finance
01Interest, compounding and discounting02Annuities, perpetuities and loan amortization03Net present value and internal rate of return04The weighted average cost of capital05Capital structure and the Modigliani–Miller theorems06Discounted cash flow valuation07Relative valuation with multiples08Real options: the value of flexibility
Stochastic models
01Random walks and Brownian motion02Probability spaces, σ-algebras and random variables03Filtrations, adapted processes and stopping times04Conditional expectation and martingales05Properties of Brownian motion06The reflection principle and first passage times07The Brownian bridge08The Itô integral09Itô's lemma10Kolmogorov equations and the Feynman–Kac formula11Change of measure and Girsanov's theorem12Monte Carlo option pricing13Simulating SDEs: the Euler–Maruyama scheme14Mean reversion: Ornstein–Uhlenbeck and Vasicek15Jumps and the Merton jump-diffusion model
Knowledge graph

© 2026 Quant Sandbox · A study aid for quantitative finance

Privacy & dataNo cookies

This site does not use cookies and asks for no personal data. It keeps a few small settings in your browser's local storage — your chosen theme and language, the sidebar layout, and your progress and answers in the Guides — so it remembers them on your next visit. This data never leaves your device; clearing your browser storage removes it. Inputs you change can also be captured in the page URL, so you can share or bookmark a specific setup. The site uses Vercel Web Analytics, a privacy-friendly, cookieless service that records only anonymous, aggregated usage (such as page views) without identifying you or tracking you across other sites.

Guide/Stochastic models

Random walks and Brownian motion

Lesson 1 of 15 · 1 min read

The lesson "Returns and volatility" showed that, with independent returns, the standard deviation of the total log return grows like σT\sigma\sqrt{T}σT​. This lesson builds the random process behind that rule from the simplest possible ingredient, a fair coin, and takes a limit to arrive at Brownian motion, the source of randomness in every continuous-time model that follows.

The coin-flip walk

Toss a fair coin repeatedly. On heads move one unit up, on tails one unit down. Write the kkk-th move as XkX_kXk​, so Xk=+1X_k = +1Xk​=+1 or Xk=−1X_k = -1Xk​=−1, each with probability 12\tfrac1221​, and different tosses are independent. The position after nnn tosses, starting from zero, is

Wn=X1+X2+⋯+Xn.W_n = X_1 + X_2 + \cdots + X_n.Wn​=X1​+X2​+⋯+Xn​.

This is the symmetric random walk. Think of a person on a long corridor who takes one step forward or back each second depending on the coin. Nobody can say where they will be after 100 steps, but the spread of their likely positions can be computed exactly.

Mean and variance of the walk

Each step has mean zero and variance one:

E[Xk]=12(+1)+12(−1)=0,Var⁡(Xk)=E[Xk2]=1.\mathbb{E}[X_k] = \tfrac12(+1) + \tfrac12(-1) = 0, \qquad \operatorname{Var}(X_k) = \mathbb{E}[X_k^2] = 1.E[Xk​]=21​(+1)+21​(−1)=0,Var(Xk​)=E[Xk2​]=1.

Expectations always add. Variances add when the terms are independent, which they are here. So

E[Wn]=0,Var⁡(Wn)=n,sd⁡(Wn)=n.\mathbb{E}[W_n] = 0, \qquad \operatorname{Var}(W_n) = n, \qquad \operatorname{sd}(W_n) = \sqrt{n}.E[Wn​]=0,Var(Wn​)=n,sd(Wn​)=n​.

The variance grows linearly in the number of steps and the standard deviation grows like its square root. After 100 tosses the typical distance from the start is 100=10\sqrt{100} = 10100​=10 units, not 100. After 10000 tosses it is 100. Many steps partly cancel each other, which is why the spread grows much more slowly than the number of steps.

Scaling the steps

To describe a price that moves continuously, we want many small steps inside a fixed time interval rather than unit steps once a second. Fix the interval [0,1][0, 1][0,1], split it into nnn steps of length Δt=1/n\Delta t = 1/nΔt=1/n, and let each step have size ±a\pm a±a for some aaa still to be chosen. After kkk steps the time is t=k Δtt = k\,\Delta tt=kΔt and the variance of the position is ka2=(t/Δt) a2k a^2 = (t/\Delta t)\,a^2ka2=(t/Δt)a2.

Now let nnn grow, so Δt\Delta tΔt shrinks. There are three cases:

  • If a=1a = 1a=1, the variance t/Δtt/\Delta tt/Δt grows without bound. The walk flies off.
  • If a=Δta = \Delta ta=Δt, the variance t Δtt\,\Delta ttΔt goes to zero. The walk collapses to a flat line.
  • If a=Δta = \sqrt{\Delta t}a=Δt​, the variance is exactly ttt for every nnn. This is the only choice that gives a non-trivial limit.

So the step size must be proportional to the square root of the time step:

Wt+Δt=Wt±Δt,Var⁡(Wt)=tΔt⋅Δt=t.W_{t + \Delta t} = W_t \pm \sqrt{\Delta t}, \qquad \operatorname{Var}(W_t) = \frac{t}{\Delta t}\cdot \Delta t = t.Wt+Δt​=Wt​±Δt​,Var(Wt​)=Δtt​⋅Δt=t.

Example: with n=100n = 100n=100 steps on [0,1][0,1][0,1], each step is ±0.01=±0.1\pm\sqrt{0.01} = \pm 0.1±0.01​=±0.1. At t=0.25t = 0.25t=0.25 the walk has taken 25 steps, so its variance is 25×0.01=0.2525 \times 0.01 = 0.2525×0.01=0.25 and its standard deviation is 0.50.50.5. At t=1t = 1t=1 the standard deviation is 1.

The figure draws six sample paths of this scaled walk on [0,1][0,1][0,1] together with the curves ±t\pm\sqrt{t}±t​ and ±2t\pm 2\sqrt{t}±2t​. Switch between n=10n = 10n=10, 100100100 and 100010001000 steps and press "New paths" a few times. The paths get finer, but the envelope stays the same, and the readout of the endpoint variance over 2000 simulated paths stays close to 1 whatever nnn is.

Random walk with ±√(1/n) stepsOpen in Brownian Motion →
±√t±2√t
Step size √(1/n)
0.100
Sample variance of W₁ (2000 paths)
0.975

Brownian motion

As n→∞n \to \inftyn→∞, each WtW_tWt​ is a sum of more and more small independent steps, so by the central limit theorem its distribution becomes normal. The limiting process is Brownian motion (also called the Wiener process), written WtW_tWt​. It is defined by four properties:

  • W0=0W_0 = 0W0​=0.
  • For s<ts < ts<t, the increment Wt−WsW_t - W_sWt​−Ws​ is normally distributed with mean 0 and variance t−st - st−s.
  • Increments over non-overlapping intervals are independent.
  • The path t↦Wtt \mapsto W_tt↦Wt​ is continuous.

Taking s=0s = 0s=0 in the second property gives

Wt∼N(0, t).W_t \sim N(0,\ t).Wt​∼N(0, t).

Example: W1W_1W1​ is standard normal, so it lies between −1-1−1 and 111 with probability about 68%. The increment W1−W0.5W_1 - W_{0.5}W1​−W0.5​ has variance 0.50.50.5, regardless of what the path did before t=0.5t = 0.5t=0.5.

Brownian motion: W0=0W_0 = 0W0​=0, independent increments, Wt−Ws∼N(0,t−s)W_t - W_s \sim N(0, t-s)Wt​−Ws​∼N(0,t−s), continuous paths. In particular Var⁡(Wt)=t\operatorname{Var}(W_t) = tVar(Wt​)=t.

Continuous but jagged paths

Brownian paths have no jumps, yet they are extremely rough. Over a short interval Δt\Delta tΔt the typical move is Δt\sqrt{\Delta t}Δt​, so the typical slope is

ΔtΔt=1Δt⟶∞as Δt→0.\frac{\sqrt{\Delta t}}{\Delta t} = \frac{1}{\sqrt{\Delta t}} \longrightarrow \infty \quad \text{as } \Delta t \to 0.ΔtΔt​​=Δt​1​⟶∞as Δt→0.

Zooming in does not make the path look smoother, as it would for an ordinary smooth curve; it reveals more wiggles at every scale. The path has no well-defined slope at any point. This is why ordinary calculus does not apply directly to Brownian motion and later lessons need a correction term.

The link to the square-root-of-time rule

Combine this with "Returns and volatility". Model the log return over [0,T][0, T][0,T] as a straight-line drift plus a scaled Brownian motion:

ln⁡STS0=μT+σWT.\ln\frac{S_T}{S_0} = \mu T + \sigma W_T.lnS0​ST​​=μT+σWT​.

Since WT∼N(0,T)W_T \sim N(0, T)WT​∼N(0,T), the log return is normal with mean μT\mu TμT and standard deviation σT\sigma\sqrt{T}σT​, exactly the first model from "Returns and volatility". The T\sqrt{T}T​ in that rule is the t\sqrt{t}t​ envelope of the random walk in the figure.

Endpoints and the bell curve

A single walk says little; many walks show the distribution. In the figure each walker takes nnn steps of ±1\pm 1±1 and drops into the bin of its endpoint. Press Play, or add walkers by hand, and watch the histogram fill the normal curve with variance nnn. The sample variance settles near nnn whatever nnn you choose, and doubling nnn makes the spread grow by 2\sqrt{2}2​, not by 2.

Where random walkers end upOpen in Brownian Motion →
-20-18-16-14-12-10-8-6-4-202468101214161820
Walkers
500
Sample mean
-0.04
Sample variance
19.82 (n = 20)

Summary

  • A coin-flip walk of nnn independent ±1\pm 1±1 steps has mean 0 and variance nnn, so its spread grows like n\sqrt{n}n​.
  • To get a sensible limit in continuous time, steps of length Δt\Delta tΔt must have size ±Δt\pm\sqrt{\Delta t}±Δt​; then Var⁡(Wt)=t\operatorname{Var}(W_t) = tVar(Wt​)=t.
  • The limit is Brownian motion: W0=0W_0 = 0W0​=0, independent normal increments with variance equal to elapsed time, continuous paths.
  • Brownian paths are continuous but have no slope anywhere.
  • The log return model μT+σWT\mu T + \sigma W_TμT+σWT​ reproduces the square-root-of-time rule.
Try itSimulate and inspect Brownian paths in the Brownian Motion lab →
Next →Probability spaces, σ-algebras and random variables
Connections
Random walks and Brownian motion
Open the full graph →
Labs for this lesson
Brownian MotionMonte Carlo