|q⟩ Bad Qubits

beginner · Physics · Math Foundations: Calculus, Probability & Statistics

The Law of Large Numbers

Frequencies and probabilities

Consider repeating an experiment nn times under identical conditions — say, flipping a coin or measuring the spin of a quantum particle prepared in the same state. Let nAn_A be the number of trials in which event AA occurs. The sample frequency (also called the relative frequency) is the ratio

fn(A)=nAn.f_n(A) = \frac{n_A}{n}.

For a single trial f1(A)f_1(A) is either 00 or 11. As nn grows, the sample frequency fluctuates less wildly and settles toward a stable value. The Law of Large Numbers (LLN) makes this precise.

Statement of the law

Let X1,X2,X_1, X_2, \ldots be independent, identically distributed random variables each with expectation value μ=E[X]\mu = E[X]. Define the sample mean after nn trials as

Xˉn=X1+X2++Xnn.\bar{X}_n = \frac{X_1 + X_2 + \cdots + X_n}{n}.

The weak law of large numbers states that for any tolerance ε>0\varepsilon > 0,

P ⁣(Xˉnμ>ε)n0.P\!\left(|\bar{X}_n - \mu| > \varepsilon\right) \xrightarrow{n \to \infty} 0.

In plain language: the sample mean converges in probability to the true mean as the number of trials grows without bound. The strong law strengthens this to almost-sure convergence, but for physics the weak form already captures everything we need.

Applied to an indicator variable (1 if AA occurs, 0 otherwise) the mean equals P(A)P(A), so the LLN says fn(A)P(A)f_n(A) \to P(A). This is the bridge between the abstract definition of probability and what we actually observe in a laboratory.

A concrete derivation via Chebyshev

To see why the LLN holds, recall Chebyshev's inequality: for any random variable YY with mean μ\mu and finite variance σ2\sigma^2,

P(Yμ>ε)σ2ε2.P(|Y - \mu| > \varepsilon) \leq \frac{\sigma^2}{\varepsilon^2}.

Apply this to Xˉn\bar{X}_n. If the individual XiX_i all have the same variance σ2\sigma^2, the variance of the sample mean is

Var(Xˉn)=σ2n,\operatorname{Var}(\bar{X}_n) = \frac{\sigma^2}{n},

because independent trials contribute independently. Chebyshev then gives

P(Xˉnμ>ε)σ2nε2.P(|\bar{X}_n - \mu| > \varepsilon) \leq \frac{\sigma^2}{n\,\varepsilon^2}.

The right-hand side goes to zero as nn \to \infty for any fixed ε\varepsilon and finite σ2\sigma^2. This is the core of the weak law.

Why this matters for quantum mechanics

In quantum mechanics, probability is not a frequency by definition — it enters through the Born rule: the probability of measuring outcome kk on a system in state ψ|\psi\rangle is pk=kψ2p_k = |\langle k | \psi \rangle|^2. The LLN is what connects that theoretical probability to what an experimentalist actually records in a table of shot outcomes.

Every quantum computing experiment reports measurement statistics — the fraction of shots landing in each basis state. Those fractions are sample frequencies. The LLN guarantees they converge to the true Born-rule probabilities as the shot count grows, which is why running more shots reduces statistical uncertainty in an experiment. Understanding this convergence is the foundation for reading any quantum measurement result.

Try it

This is a numerical exercise — your code should return a number, not a circuit. A fair coin is flipped 10001000 times and 520520 tosses land heads. Compute the sample frequency of heads.

Run your code to see the quantum state.

Sign in on the full site to ask questions and join the discussion.