Quant Sandbox
DerivativesPortfolio & RiskFixed IncomeCorporate FinanceProbability & MeasureStochastic ModelsMarket MicrostructureGuide
Guide
Derivatives pricing0 / 17
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 rho13Options on dividend-paying stocks, indices, currencies and futures14Implied volatility and the volatility smile15Stochastic volatility and the Heston model16Static replication: Breeden–Litzenberger and Carr–Madan17Exotic options: barriers, Asians and digitals
Portfolio & risk0 / 12
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 risk08The Fama–French factor models09Value at Risk and expected shortfall10Systemic risk and contagion11Portfolio constraints and the no-short-sales frontier12Estimating expected returns and covariances
Fixed income0 / 10
01Bond prices and yields02Duration and convexity03Immunization and duration matching04Spot rates, forward rates and the yield curve05Non-parallel curve moves and key-rate durations06Bond futures and the cheapest-to-deliver07Interest rate swaps08Callable bonds and negative convexity09Credit risk: default probabilities and credit spreads10Real rates, inflation and inflation-linked bonds
Corporate finance0 / 10
01Interest, compounding and discounting02Annuities, perpetuities and loan amortization03Net present value and internal rate of return04Project risk: sensitivity, scenarios and Monte Carlo NPV05The weighted average cost of capital06Capital structure and the Modigliani–Miller theorems07Dividends, payout policy and the dividend discount model08Discounted cash flow valuation09Relative valuation with multiples10Real options: the value of flexibility
Probability and measure0 / 13
01Measuring the size of sets02σ-algebras and Borel sets03Lebesgue measure and null sets04Measurable functions05The Lebesgue integral06Convergence theorems07Probability spaces and Kolmogorov's axioms08Random variables and their distributions09Expectation, variance and inequalities10Independence and product measures11Modes of convergence and the law of large numbers12Conditional probability and conditional expectation13Measure theory in option pricing
Stochastic models0 / 17
01Random walks and Brownian motion02The law of large numbers and the central limit theorem03Probability spaces, σ-algebras and random variables04Filtrations, adapted processes and stopping times05Conditional expectation and martingales06Properties of Brownian motion07The reflection principle and first passage times08The Brownian bridge09The Itô integral10Itô's lemma11Kolmogorov equations and the Feynman–Kac formula12Change of measure and Girsanov's theorem13Monte Carlo option pricing14Simulating SDEs: the Euler–Maruyama scheme15Correlated Brownian motions and multi-asset models16Mean reversion: Ornstein–Uhlenbeck and Vasicek17Jumps and the Merton jump-diffusion model
Market microstructure0 / 11
01Market makers and liquidity02The limit order book03Queue position and fill probability04Adverse selection and informed trading05The Glosten–Milgrom model06Measuring and decomposing the bid–ask spread07Informed trading and Kyle's lambda08Price impact and optimal execution09Inventory risk and quote skewing10Optimal quoting: the Avellaneda–Stoikov model11Market making profit and loss attribution
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.

Guides/Stochastic models/02

The law of large numbers and the central limit theorem

Lesson 2 of 17 · 1 min read

Almost every simulation in this course ends by averaging. A Monte Carlo price is an average of discounted payoffs, a sample volatility is an average of squared returns, and the Brownian motion of "Random walks and Brownian motion" is the limit of a rescaled sum of coin flips. Two theorems explain why averages are so well behaved: the law of large numbers says that an average settles down, and the central limit theorem says how it fluctuates around the value it settles on. This lesson states both with their hypotheses, proves the simpler one, and uses a figure to show how quickly the second takes hold. The sample means and variances of "Returns and volatility" are the first averages you met.

Averages of independent draws

Let X1,X2,…X_1, X_2, \dotsX1​,X2​,… be independent, identically distributed (i.i.d.) random variables with mean μ\muμ and a finite variance σ2\sigma^2σ2. The sample mean of the first nnn is Xˉn=(X1+⋯+Xn)/n\bar X_n = (X_1 + \cdots + X_n)/nXˉn​=(X1​+⋯+Xn​)/n. Linearity of expectation, and the fact that variances of independent variables add, give two facts that everything below rests on:

E[Xˉn]=μ,Var⁡(Xˉn)=σ2n.E[\bar X_n] = \mu, \qquad \operatorname{Var}(\bar X_n) = \frac{\sigma^2}{n}.E[Xˉn​]=μ,Var(Xˉn​)=nσ2​.

The average is right on average, and its standard deviation σ/n\sigma/\sqrt{n}σ/n​, called the standard error, shrinks like 1/n1/\sqrt{n}1/n​. Nothing more is assumed yet. The rest of the lesson asks what that shrinking implies.

The weak law of large numbers

Theorem (weak law). For every ε>0\varepsilon > 0ε>0, P(∣Xˉn−μ∣>ε)→0P(|\bar X_n - \mu| > \varepsilon) \to 0P(∣Xˉn​−μ∣>ε)→0 as n→∞n \to \inftyn→∞. One says that Xˉn\bar X_nXˉn​ converges to μ\muμ in probability. The proof is Chebyshev's inequality, P(∣Y−E[Y]∣≥ε)≤Var⁡(Y)/ε2P(|Y - E[Y]| \ge \varepsilon) \le \operatorname{Var}(Y)/\varepsilon^2P(∣Y−E[Y]∣≥ε)≤Var(Y)/ε2, applied to Y=XˉnY = \bar X_nY=Xˉn​:

P(∣Xˉn−μ∣≥ε)≤Var⁡(Xˉn)ε2=σ2n ε2→n→∞0.P(|\bar X_n - \mu| \ge \varepsilon) \le \frac{\operatorname{Var}(\bar X_n)}{\varepsilon^2} = \frac{\sigma^2}{n\,\varepsilon^2} \xrightarrow[n \to \infty]{} 0.P(∣Xˉn​−μ∣≥ε)≤ε2Var(Xˉn​)​=nε2σ2​n→∞​0.

Chebyshev's bound is crude, but it needs nothing beyond a finite variance, and the shrinking variance does all the work.

The strong law

Theorem (strong law). If E∣Xi∣<∞E|X_i| < \inftyE∣Xi​∣<∞, then P(Xˉn→μ)=1P(\bar X_n \to \mu) = 1P(Xˉn​→μ)=1. Here "with probability one", or almost surely, means that the sequences of draws for which the averages fail to settle form a set of probability zero. The weak law controls each fixed nnn separately. The strong law controls the whole path of running averages as nnn grows, and that is what a single long simulation relies on. It does not even need a finite variance, only a finite mean. We state it without proof.

The central limit theorem

The laws say where the average ends up, not how it is distributed around that value. To see the shape, standardise it, so that it has mean 0 and variance 1 for every nnn:

Zn=Xˉn−μσ/n=X1+⋯+Xn−nμσn.Z_n = \frac{\bar X_n - \mu}{\sigma/\sqrt{n}} = \frac{X_1 + \cdots + X_n - n\mu}{\sigma\sqrt{n}}.Zn​=σ/n​Xˉn​−μ​=σn​X1​+⋯+Xn​−nμ​.

Theorem (central limit theorem). If the XiX_iXi​ are i.i.d. with finite mean μ\muμ and finite, positive variance σ2\sigma^2σ2, then for every zzz

P(Zn≤z)→Φ(z)(n→∞),P(Z_n \le z) \to \Phi(z) \quad (n \to \infty),P(Zn​≤z)→Φ(z)(n→∞),

where Φ\PhiΦ is the standard normal distribution function. The hypotheses matter: independence, a common distribution, and a finite variance. The source distribution is otherwise arbitrary, which is why the walk of "Random walks and Brownian motion", rescaled by n\sqrt{n}n​, has a normal limit even though its steps are coin flips. In practice the theorem is used as the approximation Xˉn≈N(μ,σ2/n)\bar X_n \approx N(\mu, \sigma^2/n)Xˉn​≈N(μ,σ2/n) for large nnn.

How fast: the Berry–Esseen bound

The theorem is a statement about a limit. For a finite nnn it is an approximation, and Berry–Esseen measures its error. If ρ3=E∣Xi−μ∣3\rho_3 = E|X_i - \mu|^3ρ3​=E∣Xi​−μ∣3 is finite, then

sup⁡z∣P(Zn≤z)−Φ(z)∣≤C ρ3σ3n,C≤0.4748.\sup_z \left| P(Z_n \le z) - \Phi(z) \right| \le \frac{C\,\rho_3}{\sigma^3\sqrt{n}}, \qquad C \le 0.4748.zsup​∣P(Zn​≤z)−Φ(z)∣≤σ3n​Cρ3​​,C≤0.4748.

The error shrinks like 1/n1/\sqrt{n}1/n​ and is larger when ρ3/σ3\rho_3/\sigma^3ρ3​/σ3 is large, that is, for skewed or heavy-tailed sources. It equals about 1.30 for the uniform law and 12/e−2≈2.4112/e - 2 \approx 2.4112/e−2≈2.41 for the exponential law.

The figure averages nnn draws from the source you choose, 4,000 times, standardises each average and draws the histogram against the standard normal density. The first readout is the Kolmogorov distance, the largest gap between the two distribution functions. With the exponential source and n=10n = 10n=10 it is about 0.05, and at n=100n = 100n=100 about 0.02, which is close to the 0.014 that sampling noise alone produces with 4,000 averages. Switch to the Bernoulli source with p=0.1p = 0.1p=0.1, a very skewed coin: the distance is about 0.24 at n=10n = 10n=10 and still about 0.09 at n=100n = 100n=100. Berry–Esseen is conservative, since for the exponential source at n=10n = 10n=10 it would allow 0.36, but its message is the one the figure shows: skewed sources converge more slowly. The second readout, the simulated standard deviation of the average, matches σ/n\sigma/\sqrt{n}σ/n​ at every nnn, which is the weak law at work.

Figure: The law of large numbers and the central limit theoremOpen in Random Walk
10
1100
Distance to the normal
0.054
Sd of the average (simulated)
0.312
σ/√n
0.316

Where the theorems are used

A Monte Carlo price is a sample mean Xˉn\bar X_nXˉn​ of discounted payoffs. The strong law says that it converges to the true price. The central limit theorem gives the error bar: the estimate lies within ±1.96 σ/n\pm 1.96\,\sigma/\sqrt{n}±1.96σ/n​ of the truth in about 95% of runs, which is the band that returns when the track prices options by simulation. Because the error falls like 1/n1/\sqrt{n}1/n​, every extra correct digit costs a hundred times as many draws.

Worked example

The error bar of a Monte Carlo estimate

  1. Payoffs with standard deviation 2, averaged over 10,000 draws: the standard error.

    σn=210 000\displaystyle \frac{\sigma}{\sqrt{n}} = \frac{2}{\sqrt{10\,000}}n​σ​=10000​2​=0.02
  2. The 95% half-width is 1.96 standard errors.

    1.96×0.02\displaystyle 1.96 \times 0.021.96×0.02=0.0392
  3. To halve the half-width the standard error must halve, so the draws must quadruple.

    nnew=4×10 000\displaystyle n_{\text{new}} = 4 \times 10\,000nnew​=4×10000=40,000

The same theorem is behind the Brownian limit. A random walk with steps of mean 0 and variance 1, observed after nnn steps and divided by n\sqrt{n}n​, is a standardised sum, so its distribution at a fixed time is approximately normal. Brownian motion is the continuous-time object whose every time slice has exactly that normal distribution.

Summary

  • The sample mean of i.i.d. draws has mean μ\muμ and standard error σ/n\sigma/\sqrt{n}σ/n​.
  • The weak law (by Chebyshev) says the average converges in probability; the strong law says the whole sequence of averages converges almost surely, needing only a finite mean.
  • The central limit theorem says the standardised average becomes normal, whatever the source, provided the variance is finite.
  • Berry–Esseen bounds the error by a constant times 1/n1/\sqrt{n}1/n​; skewed sources converge more slowly.

The next lesson, "Probability spaces, σ-algebras and random variables", makes precise what "with probability one" and "random variable" mean.

Try itWatch the central limit theorem emerge in the Random Walk lab
2 questions on this lesson at the end of the series
Previous · 01Random walks and Brownian motionNext · 03Probability spaces, σ-algebras and random variables
Connections

The law of large numbers and the central limit theorem

Open the full graph
Builds on
06.01Random walks and Brownian motion02.01Returns and volatility
Leads to
06.03Probability spaces, σ-algebras and random variables07.06Measuring and decomposing the bid–ask spread
See it in the knowledge graph
Labs for this lesson
Random WalkMonte CarloConvergence