Skip to content

The Law of Large Numbers and the Central Limit Theorem: Where the Sample Mean Goes, and How Fast

Prerequisite:Random Variables and Expectation: Measurable Functions and the Lebesgue Integral

Raw
  • There are at least four notions of “convergence” for a sequence of random variables. In decreasing order of strength we have almost sure convergence → convergence in probability → convergence in distribution, together with LpL^p convergence → convergence in probability; the reverse implications fail in general. In every case the counterexample can be written down as a one-line formula.
  • The law of large numbers asserts that the sample mean Xˉn\bar{X}_n approaches the expectation μ\mu. The weak law asserts convergence in probability, the strong law almost sure convergence. The difference between them is the difference between “the probability at each fixed nn” and “the probability attached to whole trajectories”, and it is the strong law that justifies simulation.
  • The central limit theorem says that if we magnify the error Xˉnμ\bar{X}_n - \mu left over by the law of large numbers by the correct factor n\sqrt{n}, the distribution must converge to the normal law N(0,σ2)N(0,\sigma^2). Its power lies in the fact that the limit is the same no matter what the original distribution was.
  • The tools of the proof are characteristic functions and Lévy’s continuity theorem. The expansion φ(t)=1t2/2+o(t2)\varphi(t) = 1 - t^2/2 + o(t^2) up to second order together with (1+cn/n)nec(1 + c_n/n)^n \to e^{c} is all that the limit requires.
  • The conclusion on the applied side is that accuracy improves only with the square root of the sample size. To divide the error by 1010 one needs 100100 times as much data. The convergence rates of confidence intervals, Monte Carlo methods and stochastic gradient descent are all governed by this 1/n1/\sqrt{n}.

If we toss a coin 1010 times and see 77 heads, we do not say the coin is biased. If we toss it 10,00010{,}000 times and see 7,0007{,}000 heads, we do. This intuition — the belief that relative frequencies approach the true probability as the number of trials grows — is what connects probability theory to reality. Yet it does not come free with the axioms. Probability spaces and Kolmogorov’s axioms says only that a probability is a measure of total mass 11; it says nothing about how that measure is tied to observed frequencies.

The first person to prove this bridge as a theorem was Jacob Bernoulli, and the result collected in his posthumous Ars Conjectandi (1713) is today called Bernoulli’s law of large numbers. He wrote that even the simplest person knows this by instinct, but that it must nevertheless be proved scientifically, and he worked on the proof for some twenty years. In the nineteenth century Chebyshev used his own inequality to extend the result to general random variables, and in the early twentieth century Borel and Kolmogorov established a much stronger form than “the probability is high for each nn”, namely “almost every trajectory converges” — the strong law.

The law of large numbers, on the other hand, tells us nothing about the size of the error. Knowing that Xˉnμ\bar{X}_n \to \mu leaves open how far off we are at n=10,000n = 10{,}000 and what shape the deviation has. This is where the central limit theorem enters. De Moivre (1733) computed binomial probabilities from an approximation to the factorial and discovered that for large nn the graph of the binomial distribution matches what we now call the normal distribution. Laplace generalized this, and Lindeberg and Lévy put it into its modern form in the 1920s. The conclusion is astonishing: whatever the shape of the original distribution, the distribution of the sum converges to a normal law. Dice, exponential variables, variables taking only the values 00 and 11 — provided only that the mean and variance are finite, the limit is the same. This universality is the very reason the normal distribution sits at the center of statistics.

In this article we first sort out the notions of convergence (§3), then prove the law of large numbers in both its weak and strong forms (§4), and then prove the central limit theorem using characteristic functions (§5). Finally we see, with concrete numbers, how these are used in statistical estimation and machine learning (§6).

Throughout we fix a probability space (Ω,F,P)(\Omega, \mathcal{F}, P). A random variable is a measurable function X:ΩRX : \Omega \to \mathbb{R}, and its expectation E[X]=ΩXdPE[X] = \int_\Omega X \, dP is defined as a Lebesgue integral (see Random variables and expectation, and in particular Definition 4.1[Random Variables and Expectation]). We write N={1,2,}\mathbb{N} = \{1, 2, \ldots\}.

Let us fix the notation. To say that X1,X2,X_1, X_2, \ldots are independent and identically distributed (i.i.d.) means that they are mutually independent (Definition 2.3[Random Variables and Expectation]) and all have the same distribution. In that case we write

Sn=i=1nXi,Xˉn=SnnS_n = \sum_{i=1}^{n} X_i, \qquad \bar{X}_n = \frac{S_n}{n}

for the partial sum and the sample mean respectively. We set μ=E[X1]\mu = E[X_1] and σ2=Var(X1)=E[(X1μ)2]\sigma^2 = \operatorname{Var}(X_1) = E[(X_1-\mu)^2]. Since independence makes the variance additive (Proposition 5.3[Random Variables and Expectation]), we have

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

This single line Var(Xˉn)=σ2/n\operatorname{Var}(\bar{X}_n) = \sigma^2/n governs almost everything in this article. In terms of the standard deviation it reads σ/n\sigma/\sqrt{n}: the error shrinks like the reciprocal of n\sqrt{n}, not of nn.

“Almost surely” (a.s.) means: on an event of probability 11. That is, a statement A(ω)A(\omega) holds a.s. when P({ω:A(ω) holds})=1P(\{\omega : A(\omega) \text{ holds}\}) = 1.

3. Convergence of sequences of random variables

Section titled “3. Convergence of sequences of random variables”

For sequences of numbers there is only one notion of convergence, but a sequence of random variables is a sequence of functions on Ω\Omega, so convergence can mean several things. It is the same situation as for sequences of real functions, where pointwise, uniform and mean convergence all coexist (Sequences of functions and uniform convergence). Probability theory adds one further, weaker notion: that only the distributions come together.

Definition 3.1Almost sure convergence

Let a sequence of random variables (Xn)nN(X_n)_{n \in \mathbb{N}} and a random variable XX be defined on the same probability space (Ω,F,P)(\Omega, \mathcal{F}, P). If

P({ωΩ:limnXn(ω)=X(ω)})=1P\left(\left\{\omega \in \Omega : \lim_{n \to \infty} X_n(\omega) = X(\omega)\right\}\right) = 1

holds, we say that XnX_n converges almost surely to XX, and write Xna.s.XX_n \xrightarrow{\text{a.s.}} X.

Almost sure convergence is pointwise convergence — the convergence of the numerical sequence Xn(ω)X_n(\omega) for each ω\omega — stated so as to allow an exceptional set of probability 00. If we think of ω\omega as the complete record of one experiment (the sequence of outcomes of infinitely many coin tosses), almost sure convergence reads: in almost every experimental record, the sequence of values converges.

Definition 3.2Convergence in probability

Let (Xn)(X_n) and XX be defined on the same probability space. If for every ε>0\varepsilon > 0

limnP(XnX>ε)=0\lim_{n \to \infty} P(|X_n - X| > \varepsilon) = 0

holds, we say that XnX_n converges in probability to XX, and write XnPXX_n \xrightarrow{P} X.

Convergence in probability asserts that, at each fixed nn, the probability of XnX_n lying at distance ε\varepsilon or more from XX is small. The decisive difference from almost sure convergence is that the set of offending ω\omega is allowed to change with nn.

Definition 3.3LpL^p convergence

Let p1p \ge 1 and suppose E[Xnp]<E[|X_n|^p] < \infty and E[Xp]<E[|X|^p] < \infty. If

limnE[XnXp]=0\lim_{n \to \infty} E\left[|X_n - X|^p\right] = 0

holds, we say that XnX_n converges in LpL^p to XX (for p=2p=2, converges in mean square), and write XnLpXX_n \xrightarrow{L^p} X.

LpL^p convergence is nothing other than norm convergence in the space LpL^p (see Definition 3.1[L^p 空間と関数解析への導入] in L^p spaces and an introduction to functional analysis). It is the standpoint that measures error by its average size.

Definition 3.4Convergence in distribution (weak convergence)

Let Fn(x)=P(Xnx)F_n(x) = P(X_n \le x) be the distribution function of XnX_n and F(x)=P(Xx)F(x) = P(X \le x) that of XX. If

limnFn(x)=F(x)\lim_{n \to \infty} F_n(x) = F(x)

holds at every point xx at which FF is continuous, we say that XnX_n converges in distribution to XX, and write XndXX_n \xrightarrow{d} X. The XnX_n need not live on a common probability space.

Convergence in distribution is the only one of the four that concerns the distributions rather than the random variables themselves. It therefore makes sense even when XnX_n and XX inhabit different probability spaces. The proviso “only at continuity points of FF” cannot be dropped. We certainly want the constants Xn1/nX_n \equiv 1/n to converge in distribution to X0X \equiv 0; but Fn(0)=P(1/n0)=0F_n(0) = P(1/n \le 0) = 0 while F(0)=1F(0) = 1, so there is no convergence at the discontinuity point x=0x=0.

flowchart LR
A["L^p convergence (p ≥ 1)"] --> B["Convergence in probability"]
C["Almost sure convergence"] --> B
B --> D["Convergence in distribution"]
D -. "only when the limit is constant" .-> B
The implications between the four notions of convergence. The reverse arrows fail in general

Proposition 3.5The Markov and Chebyshev inequalities

Let YY be a nonnegative random variable and a>0a > 0. Then

P(Ya)E[Y]aP(Y \ge a) \le \frac{E[Y]}{a}

(Markov’s inequality). In particular, for a random variable XX with E[X2]<E[X^2] < \infty and for ε>0\varepsilon > 0, writing μ=E[X]\mu = E[X],

P(Xμε)Var(X)ε2P(|X - \mu| \ge \varepsilon) \le \frac{\operatorname{Var}(X)}{\varepsilon^2}

(Chebyshev’s inequality).

Proof(Proposition 3.5)

Since Y0Y \ge 0, the indicator 1A\mathbf{1}_A of the event A={Ya}A = \{Y \ge a\} satisfies YY1Aa1AY \ge Y\mathbf{1}_A \ge a \mathbf{1}_A pointwise. Indeed, if ωA\omega \in A then Y(ω)aY(\omega) \ge a, while if ωA\omega \notin A the right-hand side is 00 and Y(ω)0Y(\omega) \ge 0. By monotonicity of the expectation (monotonicity of the Lebesgue integral),

E[Y]E[a1A]=aP(A)=aP(Ya)E[Y] \ge E[a \mathbf{1}_A] = a\,P(A) = a\,P(Y \ge a)

and dividing by a>0a > 0 gives Markov’s inequality.

Chebyshev’s inequality follows by applying Markov’s inequality with Y=(Xμ)20Y = (X-\mu)^2 \ge 0 and a=ε2>0a = \varepsilon^2 > 0. Since the events satisfy {Xμε}={(Xμ)2ε2}\{|X-\mu| \ge \varepsilon\} = \{(X-\mu)^2 \ge \varepsilon^2\},

P(Xμε)=P((Xμ)2ε2)E[(Xμ)2]ε2=Var(X)ε2P(|X-\mu| \ge \varepsilon) = P\left((X-\mu)^2 \ge \varepsilon^2\right) \le \frac{E[(X-\mu)^2]}{\varepsilon^2} = \frac{\operatorname{Var}(X)}{\varepsilon^2}

as claimed.

Theorem 3.6Implications among the notions of convergence

For a sequence (Xn)(X_n) of random variables and a random variable XX on the same probability space, the following hold.

  1. If Xna.s.XX_n \xrightarrow{\text{a.s.}} X then XnPXX_n \xrightarrow{P} X.
  2. If XnLpXX_n \xrightarrow{L^p} X for some p1p \ge 1 then XnPXX_n \xrightarrow{P} X.
  3. If XnPXX_n \xrightarrow{P} X then XndXX_n \xrightarrow{d} X.
  4. If cc is a constant and XndcX_n \xrightarrow{d} c, then XnPcX_n \xrightarrow{P} c.

None of the converses holds in general.

Proof(Theorem 3.6)

(1) Fix ε>0\varepsilon > 0 and put An={XnX>ε}A_n = \{|X_n - X| > \varepsilon\} and Bn=mnAmB_n = \bigcup_{m \ge n} A_m. The sets BnB_n decrease in nn. To say ωnBn\omega \in \bigcap_{n} B_n is to say that Xm(ω)X(ω)>ε|X_m(\omega) - X(\omega)| > \varepsilon for infinitely many mm, which is incompatible with Xn(ω)X(ω)X_n(\omega) \to X(\omega). Hence by hypothesis (almost sure convergence) P(nBn)=0P(\bigcap_n B_n) = 0. By continuity of the measure from above (Theorem 4.3[Probability Spaces and Kolmogorov's Axioms]; applicable since P(B1)1<P(B_1) \le 1 < \infty) we get P(Bn)P(nBn)=0P(B_n) \to P(\bigcap_n B_n) = 0, and therefore P(An)P(Bn)0P(A_n) \le P(B_n) \to 0.

(2) Applying Markov’s inequality from Proposition 3.5 with Y=XnXp0Y = |X_n - X|^p \ge 0 and a=εp>0a = \varepsilon^p > 0 gives

P(XnXε)=P(XnXpεp)E[XnXp]εpP(|X_n - X| \ge \varepsilon) = P(|X_n-X|^p \ge \varepsilon^p) \le \frac{E[|X_n - X|^p]}{\varepsilon^p}

and the right-hand side tends to 00 by hypothesis.

(3) Let xx be a continuity point of FF and let ε>0\varepsilon > 0 be arbitrary. The inclusion of events

{Xxε}{Xnx}{XnX>ε}\{X \le x - \varepsilon\} \subset \{X_n \le x\} \cup \{|X_n - X| > \varepsilon\}

holds (for an ω\omega in the left-hand set, if Xn(ω)>xX_n(\omega) > x then Xn(ω)X(ω)>εX_n(\omega) - X(\omega) > \varepsilon). Hence

F(xε)Fn(x)+P(XnX>ε).F(x-\varepsilon) \le F_n(x) + P(|X_n - X| > \varepsilon).

Similarly, from {Xnx}{Xx+ε}{XnX>ε}\{X_n \le x\} \subset \{X \le x+\varepsilon\} \cup \{|X_n - X| > \varepsilon\},

Fn(x)F(x+ε)+P(XnX>ε).F_n(x) \le F(x+\varepsilon) + P(|X_n - X| > \varepsilon).

Letting nn \to \infty and using P(XnX>ε)0P(|X_n-X| > \varepsilon) \to 0 from the hypothesis of convergence in probability,

F(xε)lim infnFn(x)lim supnFn(x)F(x+ε).F(x-\varepsilon) \le \liminf_n F_n(x) \le \limsup_n F_n(x) \le F(x+\varepsilon).

Since xx is a continuity point of FF, letting ε0\varepsilon \downarrow 0 makes both outer terms converge to F(x)F(x), and we obtain Fn(x)F(x)F_n(x) \to F(x).

(4) When the limit is the constant cc we have F(x)=1[c,)(x)F(x) = \mathbf{1}_{[c,\infty)}(x), whose continuity points are the xcx \ne c. For ε>0\varepsilon > 0,

P(Xnc>ε)P(Xncε)+P(Xn>c+ε)=Fn(cε)+1Fn(c+ε).P(|X_n - c| > \varepsilon) \le P(X_n \le c - \varepsilon) + P(X_n > c+\varepsilon) = F_n(c-\varepsilon) + 1 - F_n(c+\varepsilon).

Both c±εc \pm \varepsilon are continuity points of FF, so by hypothesis Fn(cε)F(cε)=0F_n(c-\varepsilon) \to F(c-\varepsilon) = 0 and Fn(c+ε)F(c+ε)=1F_n(c+\varepsilon) \to F(c+\varepsilon) = 1. The right-hand side therefore tends to 00.

That the converses fail is shown by Example 3.7, Example 3.8 and the remark below.

Example 3.7Convergence in probability without almost sure convergence (the typewriter sequence)

Equip Ω=[0,1]\Omega = [0,1] with Lebesgue measure. Write n1n \ge 1 uniquely as n=2k+jn = 2^k + j (with k0k \ge 0, 0j<2k0 \le j < 2^k) and set

Xn(ω)=1[j2k,(j+1)2k)(ω).X_n(\omega) = \mathbf{1}_{[\,j2^{-k},\,(j+1)2^{-k}\,)}(\omega).

This is a window of width 2k2^{-k} sweeping across [0,1][0,1] from left to right, its width halving each time a sweep is completed.

Convergence in probability: for 0<ε<10 < \varepsilon < 1 we have P(Xn0>ε)=P(Xn=1)=2kP(|X_n - 0| > \varepsilon) = P(X_n = 1) = 2^{-k}, and kk \to \infty as nn \to \infty, so this tends to 00. Hence XnP0X_n \xrightarrow{P} 0.

Failure of almost sure convergence: fix any ω[0,1)\omega \in [0,1). For each kk there is exactly one jj with ω[j2k,(j+1)2k)\omega \in [j2^{-k}, (j+1)2^{-k}), so Xn(ω)=1X_n(\omega) = 1 for infinitely many nn. At the same time Xn(ω)=0X_n(\omega) = 0 for infinitely many nn as well (for k1k \ge 1 there is at least one such nn at every stage). Hence Xn(ω)X_n(\omega) has lim sup=1\limsup = 1 and lim inf=0\liminf = 0 and diverges, so the set of ω\omega at which the sequence converges is empty. Not probability 11, but probability 00.

Example 3.8Almost sure convergence without L1L^1 convergence

Again equip Ω=[0,1]\Omega = [0,1] with Lebesgue measure and set Xn=n1(0,1/n)X_n = n \cdot \mathbf{1}_{(0,1/n)}.

Almost sure convergence: fix ω(0,1]\omega \in (0,1]. For every n>1/ωn > 1/\omega we have ω(0,1/n)\omega \notin (0,1/n), that is Xn(ω)=0X_n(\omega) = 0. Hence Xn(ω)0X_n(\omega) \to 0 on (0,1](0,1], and since P((0,1])=1P((0,1]) = 1 we get Xna.s.0X_n \xrightarrow{\text{a.s.}} 0.

Failure of L1L^1 convergence: E[Xn0]=nP((0,1/n))=n1n=1E[|X_n - 0|] = n \cdot P((0,1/n)) = n \cdot \frac{1}{n} = 1, which does not tend to 00. A thin tower of height nn and width 1/n1/n vanishes while preserving its area. This example shows that passing from almost sure convergence to L1L^1 convergence requires an extra hypothesis such as uniform integrability (see also the dominated convergence theorem(Theorem 7.3)[ルベーグ積分の定義と収束定理]).

Remark 3.9

It is equally easy to see that convergence in distribution does not give convergence in probability. Let XN(0,1)X \sim N(0,1) and set Xn=XX_n = -X for every nn. The standard normal law is symmetric about the origin, so X-X is again N(0,1)N(0,1) and XndXX_n \xrightarrow{d} X. But XnX=2X|X_n - X| = 2|X|, and P(2X>1)P(2|X| > 1) is a positive constant independent of nn (roughly 0.6170.617), so XnX_n does not converge to XX in probability. Convergence in distribution makes no claim whatsoever that the values are close.

Theorem 4.1Weak law of large numbers

Let X1,X2,X_1, X_2, \ldots be i.i.d. random variables with E[X1]<E[|X_1|] < \infty, and set μ=E[X1]\mu = E[X_1]. Then the sample mean Xˉn=n1i=1nXi\bar{X}_n = n^{-1}\sum_{i=1}^n X_i converges to μ\mu in probability: for every ε>0\varepsilon > 0,

limnP(Xˉnμ>ε)=0.\lim_{n\to\infty} P\left(\left|\bar{X}_n - \mu\right| > \varepsilon\right) = 0 .
Proof(Theorem 4.1)

We give the proof under the additional hypothesis σ2=Var(X1)<\sigma^2 = \operatorname{Var}(X_1) < \infty (the general case follows at once from Theorem 4.5; see Remark 4.8).

By linearity of the expectation, E[Xˉn]=1ni=1nE[Xi]=1nnμ=μE[\bar{X}_n] = \frac{1}{n}\sum_{i=1}^n E[X_i] = \frac{1}{n} \cdot n\mu = \mu. Since independence makes the variance additive, and since Var(cY)=c2Var(Y)\operatorname{Var}(cY) = c^2\operatorname{Var}(Y),

Var(Xˉn)=1n2Var(i=1nXi)=1n2i=1nVar(Xi)=nσ2n2=σ2n.\operatorname{Var}(\bar{X}_n) = \frac{1}{n^2}\operatorname{Var}\left(\sum_{i=1}^n X_i\right) = \frac{1}{n^2}\sum_{i=1}^n \operatorname{Var}(X_i) = \frac{n\sigma^2}{n^2} = \frac{\sigma^2}{n}.

Applying Chebyshev’s inequality from Proposition 3.5 to X=XˉnX = \bar{X}_n gives, for every ε>0\varepsilon > 0,

P(Xˉnμε)Var(Xˉn)ε2=σ2nε2n0P\left(|\bar{X}_n - \mu| \ge \varepsilon\right) \le \frac{\operatorname{Var}(\bar{X}_n)}{\varepsilon^2} = \frac{\sigma^2}{n\varepsilon^2} \xrightarrow[n\to\infty]{} 0

and since P(Xˉnμ>ε)P(Xˉnμε)P(|\bar{X}_n - \mu| > \varepsilon) \le P(|\bar{X}_n-\mu| \ge \varepsilon), the claim follows.

What the proof shows is that the substance of the weak law is the single line Var(Xˉn)=σ2/n0\operatorname{Var}(\bar{X}_n) = \sigma^2/n \to 0. Independence was used only to make the variance additive. The same proof therefore goes through if independence is weakened to uncorrelatedness.

Example 4.2A numerical estimate for coin tossing

Toss a fair coin nn times and let XiX_i be 11 for heads and 00 for tails, so that μ=1/2\mu = 1/2 and σ2=1/4\sigma^2 = 1/4. Taking n=10,000n = 10{,}000 and ε=0.01\varepsilon = 0.01, Chebyshev’s estimate gives

P(Xˉ10000120.01)1/4104×104=0.251=0.25.P\left(\left|\bar{X}_{10000} - \tfrac12\right| \ge 0.01\right) \le \frac{1/4}{10^4 \times 10^{-4}} = \frac{0.25}{1} = 0.25 .

The only guarantee we obtain is “at most one time in 44”. This looks weak, but it is reasonable once one recalls that it is obtained without assuming anything at all about the shape of the distribution. Later, using Theorem 5.6, we will see that the probability is in fact about 0.0460.046 (Example 5.7). Chebyshev errs heavily on the safe side, but in exchange its estimate is always valid at finite nn.

Example 4.3Without an expectation the law of large numbers collapses

Let the XiX_i be independent with the standard Cauchy distribution (density f(x)=1π(1+x2)f(x) = \frac{1}{\pi(1+x^2)}). Since xf(x)dx=\int |x| f(x)\,dx = \infty, the quantity E[X1]E[|X_1|] is not finite (Example 4.8[Random Variables and Expectation]), and the hypothesis of Theorem 4.1 fails. Indeed, the characteristic function of the Cauchy law is φ(t)=et\varphi(t) = e^{-|t|}, so by independence

φXˉn(t)=[φ ⁣(tn)]n=(et/n)n=et\varphi_{\bar{X}_n}(t) = \left[\varphi\!\left(\frac{t}{n}\right)\right]^n = \left(e^{-|t|/n}\right)^n = e^{-|t|}

and Xˉn\bar{X}_n again has the standard Cauchy distribution, whatever nn is. A single observation and the average of a million are equally accurate. Finiteness of the expectation is not decoration; it is the lifeline of the law.

The weak law speaks only of the probability at each fixed nn, and so does not exclude the possibility that Xˉn\bar{X}_n enters and leaves a neighborhood of μ\mu forever (behavior like that of Example 3.7). The strong law answers the question: if we run a single experiment forever, does its trajectory converge? First we prepare a tool (a restatement of the Borel–Cantelli lemma(Lemma 6.5)[Probability Spaces and Kolmogorov's Axioms]).

Lemma 4.4Borel–Cantelli lemma (first)

If a sequence of events (An)nN(A_n)_{n\in\mathbb{N}} satisfies n=1P(An)<\sum_{n=1}^{\infty} P(A_n) < \infty, then

P(lim supnAn)=P(n=1mnAm)=0.P\left(\limsup_{n\to\infty} A_n\right) = P\left(\bigcap_{n=1}^{\infty}\bigcup_{m \ge n} A_m\right) = 0 .

That is, with probability 11 only finitely many of the AnA_n occur.

Proof(Lemma 4.4)

Put Bn=mnAmB_n = \bigcup_{m \ge n} A_m. By subadditivity,

P(Bn)m=nP(Am).P(B_n) \le \sum_{m=n}^{\infty} P(A_m).

The right-hand side is the tail of the convergent series mP(Am)<\sum_m P(A_m) < \infty from the nn-th term on, so it tends to 00 as nn \to \infty. Since lim supnAn=nBnBn\limsup_n A_n = \bigcap_n B_n \subset B_n for every nn, we get P(lim supnAn)P(Bn)0P(\limsup_n A_n) \le P(B_n) \to 0, hence P(lim supnAn)=0P(\limsup_n A_n) = 0.

Theorem 4.5Strong law of large numbers (Kolmogorov)

Let X1,X2,X_1, X_2, \ldots be i.i.d. random variables with E[X1]<E[|X_1|] < \infty, and set μ=E[X1]\mu = E[X_1]. Then

P(limnXˉn=μ)=1,P\left(\lim_{n\to\infty} \bar{X}_n = \mu\right) = 1,

that is, Xˉna.s.μ\bar{X}_n \xrightarrow{\text{a.s.}} \mu. Conversely, if E[X1]=E[|X_1|] = \infty then lim supnXˉn=\limsup_n |\bar{X}_n| = \infty holds with probability 11.

Remark 4.6

The general proof (assuming only a first moment) needs Kolmogorov’s maximal inequality together with a truncation argument, or else Etemadi’s elementary argument, and takes considerable space. A complete proof can be found in Durrett, Probability: Theory and Examples, Chapter 2, or Billingsley, Probability and Measure, §22. Here we exhibit the skeleton of the argument — using the Borel–Cantelli lemma to make the probability of deviating infinitely often equal to 00 — under a strengthened hypothesis, in Proposition 4.7.

Proposition 4.7Strong law under a fourth moment

Let X1,X2,X_1, X_2, \ldots be i.i.d. random variables with E[X14]<E[X_1^4] < \infty, and put μ=E[X1]\mu = E[X_1]. Then Xˉna.s.μ\bar{X}_n \xrightarrow{\text{a.s.}} \mu.

Proof(Proposition 4.7)

Set Yi=XiμY_i = X_i - \mu, so that E[Yi]=0E[Y_i] = 0, E[Yi4]=K<E[Y_i^4] = K < \infty and E[Yi2]=σ2<E[Y_i^2] = \sigma^2 < \infty (by Hölder’s inequality, E[Y2](E[Y4])1/2<E[Y^2] \le (E[Y^4])^{1/2} < \infty). Put Tn=i=1nYiT_n = \sum_{i=1}^n Y_i, so that Xˉnμ=Tn/n\bar{X}_n - \mu = T_n/n.

Expanding Tn4T_n^4, the terms that appear have the forms Yi4Y_i^4, Yi3YjY_i^3Y_j, Yi2Yj2Y_i^2Y_j^2, Yi2YjYkY_i^2Y_jY_k and YiYjYkYlY_iY_jY_kY_l (with distinct indices). By independence and E[Yi]=0E[Y_i]=0, the expectation of any term containing a factor whose index appears exactly once is 00; for instance E[Yi3Yj]=E[Yi3]E[Yj]=0E[Y_i^3Y_j] = E[Y_i^3]E[Y_j] = 0 when iji \ne j. What remains are the terms of type Yi4Y_i^4 (nn of them) and of type Yi2Yj2Y_i^2Y_j^2 with iji \ne j (the multinomial coefficient (42)=6\binom{4}{2} = 6 multiplies each of the (n2)\binom{n}{2} unordered pairs among the n(n1)n(n-1) ordered pairs, giving 3n(n1)3n(n-1) in all). Hence

E[Tn4]=nK+3n(n1)σ4nK+3n2σ4.E[T_n^4] = nK + 3n(n-1)\sigma^4 \le nK + 3n^2\sigma^4 .

So with C=K+3σ4C = K + 3\sigma^4 we have, for n1n \ge 1,

E[(Tnn)4]nK+3n2σ4n4Cn2.E\left[\left(\frac{T_n}{n}\right)^4\right] \le \frac{nK + 3n^2\sigma^4}{n^4} \le \frac{C}{n^2}.

Fix ε>0\varepsilon > 0 and put An={Tn/n>ε}A_n = \{|T_n/n| > \varepsilon\}. Markov’s inequality from Proposition 3.5 (with Y=(Tn/n)4Y = (T_n/n)^4 and a=ε4a = \varepsilon^4) gives

P(An)E[(Tn/n)4]ε4Cε4n2,P(A_n) \le \frac{E[(T_n/n)^4]}{\varepsilon^4} \le \frac{C}{\varepsilon^4 n^2},

and since n1n2<\sum_{n\ge1} n^{-2} < \infty we get nP(An)<\sum_n P(A_n) < \infty. By Lemma 4.4, with probability 11 only finitely many nn satisfy Tn/n>ε|T_n/n| > \varepsilon. In other words Nε={ω:Tn(ω)/n>ε infinitely often}N_\varepsilon = \{\omega : |T_n(\omega)/n| > \varepsilon \text{ infinitely often}\} satisfies P(Nε)=0P(N_\varepsilon) = 0.

Finally we let ε\varepsilon vary. Put N=k1N1/kN = \bigcup_{k \ge 1} N_{1/k}; as a countable union of null sets, P(N)=0P(N) = 0. If ωN\omega \notin N then for each kk we have Tn(ω)/n1/k|T_n(\omega)/n| \le 1/k for all sufficiently large nn, whence Tn(ω)/n0T_n(\omega)/n \to 0, that is Xˉn(ω)μ\bar{X}_n(\omega) \to \mu. Since P(Nc)=1P(N^c) = 1, almost sure convergence is proved.

Remark 4.8

Combining Theorem 4.5 with Theorem 3.6(1) yields convergence in probability from E[X1]<E[|X_1|] < \infty alone. This is the general form of Theorem 4.1 (Khinchin’s weak law). Historically the weak law came first and was proved directly, under weaker hypotheses, by truncation.

Example 4.9Borel's normal number theorem

Let ω\omega be a random variable uniformly distributed on [0,1][0,1] and consider its binary expansion ω=i1di(ω)2i\omega = \sum_{i\ge1} d_i(\omega) 2^{-i} with di{0,1}d_i \in \{0,1\}. It is known that d1,d2,d_1, d_2, \ldots form an i.i.d. sequence with P(di=1)=1/2P(d_i = 1) = 1/2. Applying Theorem 4.5 with Xi=diX_i = d_i (so μ=1/2\mu = 1/2 and E[X1]=1/2<E[|X_1|] = 1/2 < \infty) gives

P(limnd1++dnn=12)=1.P\left(\lim_{n\to\infty} \frac{d_1 + \cdots + d_n}{n} = \frac12\right) = 1 .

Translated into the language of Lebesgue measure: for almost every real number in [0,1][0,1], the frequency of 11s in the binary expansion is exactly 1/21/2. This is Borel’s normal number theorem (1909). Although “almost every” number has the property, writing down a specific example is far from easy (whether 2\sqrt{2} or π\pi is normal remains open).

The law of large numbers says Xˉnμ0\bar{X}_n - \mu \to 0. By what factor, then, must we magnify Xˉnμ\bar{X}_n - \mu in order to see a limit that neither vanishes nor blows up? As we saw in §2 the standard deviation is σ/n\sigma/\sqrt{n}, so n\sqrt{n} is the right factor. Indeed

Zn=Xˉnμσ/n=SnnμσnZ_n = \frac{\bar{X}_n - \mu}{\sigma/\sqrt{n}} = \frac{S_n - n\mu}{\sigma\sqrt{n}}

is normalized so that E[Zn]=0E[Z_n] = 0 and Var(Zn)=1\operatorname{Var}(Z_n) = 1. The central limit theorem asserts that the distribution of this ZnZ_n converges to the standard normal law regardless of the original distribution.

Definition 5.1Characteristic function

For a random variable XX, define φX:RC\varphi_X : \mathbb{R} \to \mathbb{C} by

φX(t)=E[eitX]=E[cos(tX)]+iE[sin(tX)].\varphi_X(t) = E\left[e^{itX}\right] = E[\cos(tX)] + i\,E[\sin(tX)] .

This is called the characteristic function of XX. Since eitX=1|e^{itX}| = 1, the expectation always exists, and φX(t)1|\varphi_X(t)| \le 1 and φX(0)=1\varphi_X(0) = 1.

There are two reasons for using characteristic functions. First, the characteristic function of a sum of independent random variables is the product of their characteristic functions: if X,YX, Y are independent then E[eit(X+Y)]=E[eitXeitY]=φX(t)φY(t)E[e^{it(X+Y)}] = E[e^{itX}e^{itY}] = \varphi_X(t)\varphi_Y(t) (we are applying the fact that the expectation of a product of independent random variables is the product of the expectations(Proposition 7.5)[Random Variables and Expectation] to the bounded measurable function eitxe^{itx}). The awkward operation of convolution turns into multiplication. Second, by the following theorem, pointwise convergence of characteristic functions is equivalent to convergence in distribution.

Theorem 5.2Lévy's continuity theorem

For a sequence of random variables (Xn)(X_n) and a random variable XX, the following hold.

  1. If XndXX_n \xrightarrow{d} X, then φXn(t)φX(t)\varphi_{X_n}(t) \to \varphi_X(t) for every tRt \in \mathbb{R}.
  2. Conversely, if there is a function ψ:RC\psi : \mathbb{R} \to \mathbb{C} such that φXn(t)ψ(t)\varphi_{X_n}(t) \to \psi(t) for every tt and ψ\psi is continuous at t=0t = 0, then ψ\psi is the characteristic function of some random variable XX and XndXX_n \xrightarrow{d} X.

Remark 5.3

The proof lies beyond the scope of this article. Part (1) follows from the portmanteau theorem since xcos(tx),sin(tx)x \mapsto \cos(tx), \sin(tx) are bounded and continuous; part (2) is shown by combining tightness of the sequence of distributions (Prokhorov’s theorem) with the inversion formula. See Billingsley, Probability and Measure, §26, or Durrett, Probability: Theory and Examples, Chapter 3. The hypothesis of continuity at t=0t=0 cannot be dropped. For example, if XnN(0,n)X_n \sim N(0, n) then φXn(t)=ent2/21{0}(t)\varphi_{X_n}(t) = e^{-nt^2/2} \to \mathbf{1}_{\{0\}}(t), but this limit function is discontinuous at t=0t=0, and indeed XnX_n converges in distribution to no random variable at all (the probability escapes to infinity).

Lemma 5.4Second-order expansion of the characteristic function

Let XX satisfy E[X]=0E[X] = 0 and E[X2]=σ2<E[X^2] = \sigma^2 < \infty. Then, as t0t \to 0,

φX(t)=1σ2t22+o(t2).\varphi_X(t) = 1 - \frac{\sigma^2 t^2}{2} + o(t^2) .
Proof(Lemma 5.4)

We use the elementary estimate, valid for real uu,

eiu(1+iuu22)min(u36, u2).\left|e^{iu} - \left(1 + iu - \frac{u^2}{2}\right)\right| \le \min\left(\frac{|u|^3}{6},\ u^2\right).

This comes from the remainder representation eiuk=0m(iu)kk!=im+1m!0u(us)meisdse^{iu} - \sum_{k=0}^{m}\frac{(iu)^k}{k!} = \frac{i^{m+1}}{m!}\int_0^u (u-s)^m e^{is}\,ds, obtained by integration by parts, estimated using eis=1|e^{is}| = 1 in the cases m=2m = 2 and m=1m = 1 respectively (m=2m=2 gives u3/6|u|^3/6 and m=1m=1 gives u2u^2; in the latter the subtracted term (iu)22\frac{(iu)^2}{2} is handled by the triangle inequality).

Putting u=tXu = tX, taking expectations and using E[X]=0E[X] = 0,

φX(t)1+σ2t22=E[eitX1itX+t2X22]E[min(t3X36, t2X2)].\left|\varphi_X(t) - 1 + \frac{\sigma^2t^2}{2}\right| = \left|E\left[e^{itX} - 1 - itX + \frac{t^2X^2}{2}\right]\right| \le E\left[\min\left(\frac{|t|^3|X|^3}{6},\ t^2X^2\right)\right].

Dividing the right-hand side by t2t^2 gives E[Rt]E[R_t], where Rt=min(tX36,X2)R_t = \min\left(\frac{|t||X|^3}{6}, X^2\right). For each ω\omega we have Rt0R_t \to 0 as t0t \to 0, and 0RtX20 \le R_t \le X^2 with E[X2]<E[X^2] < \infty, so the dominated convergence theorem gives E[Rt]0E[R_t] \to 0. Hence the left-hand side is o(t2)o(t^2).

Lemma 5.5Convergence to the exponential

If a sequence of complex numbers (cn)(c_n) satisfies cncCc_n \to c \in \mathbb{C}, then

limn(1+cnn)n=ec.\lim_{n\to\infty}\left(1 + \frac{c_n}{n}\right)^n = e^{c} .
Proof(Lemma 5.5)

Put M=supncn<M = \sup_n |c_n| < \infty (a convergent sequence is bounded). With zn=1+cn/nz_n = 1 + c_n/n and wn=ecn/nw_n = e^{c_n/n} we have zn1+M/n|z_n| \le 1 + M/n and wneM/n1+M/neM|w_n| \le e^{M/n} \le 1 + M/n \cdot e^{M}. Setting θn=eM/n+M/n\theta_n = e^{M/n} + M/n gives zn,wnθn|z_n|, |w_n| \le \theta_n together with the uniform bound θnn1(1+2M+M2n)ne2M+M2\theta_n^{\,n-1} \le \left(1 + \tfrac{2M+M^2}{n}\right)^{n} \le e^{2M+M^2} (for nn large enough).

For complex numbers a,ba, b with a,bθ|a|, |b| \le \theta, the identity anbn=(ab)k=0n1akbn1ka^n - b^n = (a-b)\sum_{k=0}^{n-1} a^k b^{n-1-k} gives anbnnθn1ab|a^n - b^n| \le n\theta^{n-1}|a-b|. Moreover, from the power series of the exponential,

eu1u=k2ukk!u22eu|e^{u} - 1 - u| = \left|\sum_{k\ge2}\frac{u^k}{k!}\right| \le \frac{|u|^2}{2}e^{|u|}

so that with u=cn/nu = c_n/n we get znwnM22n2eM|z_n - w_n| \le \frac{M^2}{2n^2}e^{M}. Putting all of this together, for nn large enough,

znnwnnne2M+M2M2eM2n2=M2e3M+M22nn0.\left|z_n^{\,n} - w_n^{\,n}\right| \le n \cdot e^{2M+M^2}\cdot \frac{M^2 e^{M}}{2n^2} = \frac{M^2 e^{3M + M^2}}{2n} \xrightarrow[n\to\infty]{} 0 .

On the other hand wnn=ecnecw_n^{\,n} = e^{c_n} \to e^{c} by continuity of the exponential, so znnecz_n^{\,n} \to e^c.

Theorem 5.6Central limit theorem (Lindeberg–Lévy)

Let X1,X2,X_1, X_2, \ldots be i.i.d. random variables such that μ=E[X1]\mu = E[X_1] and σ2=Var(X1)\sigma^2 = \operatorname{Var}(X_1) exist and satisfy 0<σ2<0 < \sigma^2 < \infty. Putting Sn=i=1nXiS_n = \sum_{i=1}^n X_i,

Zn=SnnμσndZN(0,1);Z_n = \frac{S_n - n\mu}{\sigma\sqrt{n}} \xrightarrow{d} Z \sim N(0,1) ;

that is, for every xRx \in \mathbb{R},

limnP(Snnμσnx)=Φ(x)=x12πeu2/2du.\lim_{n\to\infty} P\left(\frac{S_n - n\mu}{\sigma\sqrt{n}} \le x\right) = \Phi(x) = \int_{-\infty}^{x}\frac{1}{\sqrt{2\pi}}e^{-u^2/2}\,du .
Proof(Theorem 5.6)

Put Yi=(Xiμ)/σY_i = (X_i - \mu)/\sigma; the YiY_i are i.i.d. with E[Yi]=0E[Y_i] = 0 and E[Yi2]=1E[Y_i^2] = 1, and

Zn=1ni=1nYi.Z_n = \frac{1}{\sqrt{n}}\sum_{i=1}^{n} Y_i .

Let φ\varphi be the characteristic function of Y1Y_1. By independence the expectation factors, and E[eit(Y/n)]=φ(t/n)E[e^{it(Y/\sqrt n)}] = \varphi(t/\sqrt n), so

φZn(t)=E[exp(itni=1nYi)]=i=1nφ ⁣(tn)=[φ ⁣(tn)]n.\varphi_{Z_n}(t) = E\left[\exp\left(\frac{it}{\sqrt{n}}\sum_{i=1}^n Y_i\right)\right] = \prod_{i=1}^{n} \varphi\!\left(\frac{t}{\sqrt{n}}\right) = \left[\varphi\!\left(\frac{t}{\sqrt{n}}\right)\right]^{n}.

Fix tt. As nn \to \infty we have t/n0t/\sqrt{n} \to 0, so Lemma 5.4 (in the case σ2=1\sigma^2 = 1) gives

φ ⁣(tn)=1t22n+o ⁣(1n)=1+cnn,cn=t22+no ⁣(1n).\varphi\!\left(\frac{t}{\sqrt{n}}\right) = 1 - \frac{t^2}{2n} + o\!\left(\frac{1}{n}\right) = 1 + \frac{c_n}{n}, \qquad c_n = -\frac{t^2}{2} + n\cdot o\!\left(\frac{1}{n}\right).

Here o(1/n)o(1/n) denotes a quantity that still tends to 00 after multiplication by nn, so cnt2/2c_n \to -t^2/2. Applying Lemma 5.5,

φZn(t)=(1+cnn)nnet2/2.\varphi_{Z_n}(t) = \left(1 + \frac{c_n}{n}\right)^{n} \xrightarrow[n\to\infty]{} e^{-t^2/2}.

This holds for every tRt \in \mathbb{R}. Since et2/2e^{-t^2/2} is the characteristic function of the standard normal law N(0,1)N(0,1) and is continuous at t=0t=0, part (2) of Theorem 5.2 gives ZndN(0,1)Z_n \xrightarrow{d} N(0,1).

Finally, Φ\Phi is continuous on all of R\mathbb{R}, so the restriction “at continuity points” in Definition 3.4 disappears and the distribution functions converge at every xx.

Looking back at the proof makes clear why the normal law appeared. All that was used about the distribution of Y1Y_1 were the two numbers E[Y]=0E[Y]=0 and E[Y2]=1E[Y^2]=1; everything of third order and beyond was absorbed into o(t2)o(t^2). Dividing by n\sqrt{n} crushes the contribution of the higher moments and leaves only information up to second order — this is what “independent of the original distribution” really means.

95%-1.961.960z
The standard normal density and the interval [-1.96, 1.96] carrying probability 95%

Example 5.7Coin tossing revisited: Chebyshev against the normal approximation

In the setting of Example 4.2 (n=10,000n = 10{,}000, μ=1/2\mu = 1/2, σ=1/2\sigma = 1/2) let us compute P(Xˉn1/20.01)P(|\bar{X}_n - 1/2| \ge 0.01) by the normal approximation. The standard deviation of Xˉn\bar{X}_n is σ/n=0.5/100=0.005\sigma/\sqrt{n} = 0.5/100 = 0.005, so 0.010.01 is exactly 22 standard deviations. By Theorem 5.6,

P(Xˉn120.01)=P(Zn2)2(1Φ(2))=2×0.02275=0.0455.P\left(\left|\bar{X}_n - \tfrac12\right| \ge 0.01\right) = P(|Z_n| \ge 2) \approx 2\left(1 - \Phi(2)\right) = 2 \times 0.02275 = 0.0455 .

Against Chebyshev’s 0.250.25, the true value is about 0.0460.046: a gap of more than a factor of 55. This shows how much sharper the estimate becomes once information about the shape of the distribution (here the normal approximation) is available. The normal approximation is, however, an asymptotic statement as nn \to \infty; error guarantees at finite nn are supplied by the next theorem.

Theorem 5.8Berry–Esseen theorem

Let X1,X2,X_1, X_2, \ldots be i.i.d. with E[X1]=μE[X_1] = \mu, Var(X1)=σ2(0,)\operatorname{Var}(X_1) = \sigma^2 \in (0,\infty) and ρ=E[X1μ3]<\rho = E[|X_1 - \mu|^3] < \infty. Let FnF_n be the distribution function of Zn=(Snnμ)/(σn)Z_n = (S_n - n\mu)/(\sigma\sqrt{n}). Then there is an absolute constant CC such that

supxRFn(x)Φ(x)Cρσ3n\sup_{x \in \mathbb{R}} \left|F_n(x) - \Phi(x)\right| \le \frac{C\rho}{\sigma^3\sqrt{n}}

for every n1n \ge 1. It is known that one may take C0.4748C \le 0.4748.

Remark 5.9

The proof translates the difference of characteristic functions into a difference of distribution functions by Esseen’s smoothing inequality, and can be found in Feller, An Introduction to Probability Theory and Its Applications, Vol. II, Chapter XVI. The constant C0.4748C \le 0.4748 is due to Shevtsova, “On the absolute constants in the Berry-Esseen type inequalities for identically distributed summands” (2011), arXiv:1111.6554. What matters in practice is that the error bound is again of order 1/n1/\sqrt{n}, and moreover proportional to the skewness-like quantity ρ/σ3\rho/\sigma^3. The rule of thumb that the more asymmetric a distribution is, the worse the normal approximation performs, is quantified here.

6. What this means in statistics and machine learning

Section titled “6. What this means in statistics and machine learning”

6.1. Standard error and confidence intervals

Section titled “6.1. Standard error and confidence intervals”

Proposition 6.1Slutsky's theorem

If XndXX_n \xrightarrow{d} X and YnPcY_n \xrightarrow{P} c with cc a constant, then

Xn+YndX+c,XnYndcX.X_n + Y_n \xrightarrow{d} X + c, \qquad X_n Y_n \xrightarrow{d} cX .

If moreover c0c \ne 0, then Xn/YndX/cX_n / Y_n \xrightarrow{d} X/c.

Remark 6.2

The proof proceeds by showing (Xn,Yn)d(X,c)(X_n, Y_n) \xrightarrow{d} (X, c) (this joint convergence does hold when one of the limits is constant) and then applying the continuous mapping theorem. See Billingsley, Convergence of Probability Measures, or van der Vaart, Asymptotic Statistics, Chapter 2.

Suppose we wish to estimate a population mean μ\mu. By Theorem 5.6 we have n(Xˉnμ)/σdN(0,1)\sqrt{n}(\bar{X}_n - \mu)/\sigma \xrightarrow{d} N(0,1), but in practice σ\sigma is unknown too. The sample standard deviation

σ^n=1n1i=1n(XiXˉn)2\hat{\sigma}_n = \sqrt{\frac{1}{n-1}\sum_{i=1}^{n}(X_i - \bar{X}_n)^2}

satisfies σ^na.s.σ\hat{\sigma}_n \xrightarrow{\text{a.s.}} \sigma (hence also in probability) by Theorem 4.5, provided E[X12]<E[X_1^2] < \infty, so that σ/σ^nP1\sigma/\hat{\sigma}_n \xrightarrow{P} 1. Applying Proposition 6.1 with Xn=n(Xˉnμ)/σX_n = \sqrt{n}(\bar{X}_n-\mu)/\sigma and Yn=σ/σ^nY_n = \sigma/\hat{\sigma}_n gives

n(Xˉnμ)σ^ndN(0,1).\frac{\sqrt{n}\,(\bar{X}_n - \mu)}{\hat{\sigma}_n} \xrightarrow{d} N(0,1) .

Solving for μ\mu produces the confidence interval at confidence level 95%95\%:

[ Xˉn1.96σ^nn,Xˉn+1.96σ^nn ]\left[\ \bar{X}_n - 1.96\frac{\hat{\sigma}_n}{\sqrt{n}},\quad \bar{X}_n + 1.96\frac{\hat{\sigma}_n}{\sqrt{n}}\ \right]

The number 1.961.96 comes from Φ(1.96)Φ(1.96)=0.95\Phi(1.96) - \Phi(-1.96) = 0.95. This interval, which appears out of nowhere in an introductory statistics course, is nothing but a consequence of the central limit theorem and Slutsky’s theorem. The quantity σ^n/n\hat{\sigma}_n/\sqrt{n} is called the standard error.

Example 6.3Sample size for an opinion poll

Let us find the sample size needed to estimate an approval rating pp to within ±3%\pm 3\% at confidence level 95%95\%. Here XiX_i takes the values 00 or 11 and σ2=p(1p)1/4\sigma^2 = p(1-p) \le 1/4. The condition from the normal approximation is

1.96×p(1p)n0.03.1.96 \times \frac{\sqrt{p(1-p)}}{\sqrt{n}} \le 0.03 .

Taking the worst case p=1/2p = 1/2 gives p(1p)=0.5\sqrt{p(1-p)} = 0.5, hence n1.96×0.5/0.03=32.67\sqrt{n} \ge 1.96 \times 0.5 / 0.03 = 32.67, that is n1067.1n \ge 1067.1, so n=1068n = 1068. This is why opinion polls so often use a little over 10001000 respondents.

For comparison, obtaining the same guarantee from Chebyshev’s inequality alone (Proposition 3.5) requires

0.25n×0.0320.05    n0.250.0009×0.05=5555.6,\frac{0.25}{n \times 0.03^2} \le 0.05 \iff n \ge \frac{0.25}{0.0009 \times 0.05} = 5555.6,

that is 55565556 respondents. Knowing the shape of the distribution changes the cost by more than a factor of 55.

What deserves particular notice is that the required sample size does not depend on the size of the population. In a country of 100100 million people or in a town of 10,00010{,}000, about 10681068 respondents are what is needed. The population size simply does not appear in the expression σ/n\sigma/\sqrt{n}.

6.2. Monte Carlo methods and the square-root barrier

Section titled “6.2. Monte Carlo methods and the square-root barrier”

Example 6.4Accuracy of Monte Carlo integration

Generate nn independent points (Ui,Vi)(U_i, V_i) from the uniform distribution on [0,1]2[0,1]^2 and set Xi=1{Ui2+Vi21}X_i = \mathbf{1}\{U_i^2 + V_i^2 \le 1\}. Since E[X1]=π/4E[X_1] = \pi/4, the estimator π^n=4Xˉn\hat{\pi}_n = 4\bar{X}_n converges almost surely to π\pi by Theorem 4.5. Let us assess its accuracy. With p=π/40.7854p = \pi/4 \approx 0.7854,

σ2=p(1p)0.7854×0.21460.1686,σ0.4106.\sigma^2 = p(1-p) \approx 0.7854 \times 0.2146 \approx 0.1686, \qquad \sigma \approx 0.4106 .

The standard deviation of π^n\hat{\pi}_n is 4σ/n1.642/n4\sigma/\sqrt{n} \approx 1.642/\sqrt{n}: about 0.001640.00164 at n=106n = 10^6. So even after throwing a million points, π\pi is pinned down only to about the third decimal place. To get five decimals one must divide the standard deviation by 100100, which requires n=1010n = 10^{10}.

import numpy as np
rng = np.random.default_rng(0)
n = 1_000_000
u, v = rng.random(n), rng.random(n)
x = (u**2 + v**2 <= 1.0).astype(float)
pi_hat = 4 * x.mean()
se = 4 * x.std(ddof=1) / np.sqrt(n)
print(f"pi_hat = {pi_hat:.5f}, 95% CI = [{pi_hat - 1.96*se:.5f}, {pi_hat + 1.96*se:.5f}]")

This 1/n1/\sqrt{n} is not an unbreakable barrier: the practitioner’s craft lies in winning constant factors by making σ\sigma smaller (importance sampling, control variates, quasi-Monte Carlo). But as long as one keeps sampling independently, the exponent 1/2-1/2 is fixed by Theorem 5.6.

The central limit theorem does not say that everything is normal once nn is large. Check the hypotheses.

HypothesisWhat happens when it fails
E[X12]<E[X_1^2] < \inftyFor heavy-tailed distributions (Cauchy, stable laws of index α<2\alpha < 2) the limit is not normal but a stable law. See Example 4.3
IndependenceStrong correlation reduces the effective sample size and makes σ/n\sigma/\sqrt{n} an underestimate of the standard error. For time series one needs a variance estimate corrected for autocorrelation
Identical distributionIf the variables are independent but not identically distributed, the Lindeberg condition (that no single term dominates the sum) is required
Speed of convergenceBy Theorem 5.8 the error is of order ρ/(σ3n)\rho/(\sigma^3\sqrt n). For skewed distributions or tail probabilities (such as P(Zn>4)P(Z_n > 4)) the approximation can be poor even at nn in the thousands

The last row in particular is easily overlooked in practice. The central limit theorem is an approximation theorem for the center of a distribution; it does not deliver extreme tail probabilities accurately. The tails have a theory of their own, the theory of large deviations, which handles exponentially small probabilities of the form enI(x)e^{-nI(x)}.

Exercise 7.1Easy

(a) Show that XnL2XX_n \xrightarrow{L^2} X implies XnL1XX_n \xrightarrow{L^1} X. (b) Give an example of a sequence that converges in L1L^1 but not in L2L^2.

Solution

(a) Applying the Cauchy–Schwarz inequality to XnX|X_n - X| and the constant 11,

E[XnX]=E[XnX1](E[XnX2])1/2(E[12])1/2=(E[XnX2])1/2.E[|X_n - X|] = E[|X_n-X|\cdot 1] \le \left(E[|X_n-X|^2]\right)^{1/2}\left(E[1^2]\right)^{1/2} = \left(E[|X_n-X|^2]\right)^{1/2}.

The right-hand side tends to 00 by hypothesis, hence so does the left. (In general, on a probability measure, pqp \le q implies YpYq\|Y\|_p \le \|Y\|_q; it is the total mass being 11 that makes this work.)

(b) Equip Ω=[0,1]\Omega = [0,1] with Lebesgue measure and set Xn=n1(0,1/n)X_n = \sqrt{n}\,\mathbf{1}_{(0,1/n)}. Then

E[Xn]=n1n=1n0,E[Xn2]=n1n=1↛0.E[|X_n|] = \sqrt{n}\cdot\frac{1}{n} = \frac{1}{\sqrt{n}} \to 0, \qquad E[|X_n|^2] = n \cdot \frac{1}{n} = 1 \not\to 0 .

So XnL10X_n \xrightarrow{L^1} 0 while L2L^2 convergence fails.

Exercise 7.2Standard

The weight XX of an item produced at a factory has unknown mean μ\mu and known standard deviation σ=20\sigma = 20 grams. Find the sample size nn needed to estimate μ\mu to within ±2\pm 2 grams at confidence level 99%99\%, using (a) Chebyshev’s inequality and (b) the normal approximation from the central limit theorem. You may use Φ(2.576)=0.995\Phi(2.576) = 0.995.

Solution

(a) By Proposition 3.5, P(Xˉnμ2)σ2/(n22)=400/(4n)=100/nP(|\bar{X}_n - \mu| \ge 2) \le \sigma^2/(n \cdot 2^2) = 400/(4n) = 100/n. To make this at most 0.010.01 we need n10,000n \ge 10{,}000.

(b) By Theorem 5.6, XˉnN(μ,σ2/n)\bar{X}_n \approx N(\mu, \sigma^2/n), so the condition at level 99%99\% is

2.576×20n2    n2.576×202=25.76    n663.6.2.576 \times \frac{20}{\sqrt{n}} \le 2 \iff \sqrt{n} \ge \frac{2.576 \times 20}{2} = 25.76 \iff n \ge 663.6 .

Hence n=664n = 664, about one fifteenth of Chebyshev’s 10,00010{,}000. The gap widens as the confidence level rises (that is, as one moves into the tails), because Chebyshev buys its freedom from distributional assumptions at the price of erring far on the safe side.

Exercise 7.3Standard

Let X1,X2,X_1, X_2, \ldots be i.i.d. with E[X1]=0E[X_1] = 0 and E[X12]=σ2<E[X_1^2] = \sigma^2 < \infty. Fixing ε>0\varepsilon > 0, prove that for the subsequence (Xˉn2)nN(\bar{X}_{n^2})_{n \in \mathbb{N}} one can establish Xˉn2a.s.0\bar{X}_{n^2} \xrightarrow{\text{a.s.}} 0 without assuming a fourth moment.

Solution

Put An={Xˉn2>ε}A_n = \{|\bar{X}_{n^2}| > \varepsilon\}. By Chebyshev’s inequality from Proposition 3.5 together with Var(Xˉm)=σ2/m\operatorname{Var}(\bar{X}_m) = \sigma^2/m (§2), taking m=n2m = n^2,

P(An)σ2n2ε2.P(A_n) \le \frac{\sigma^2}{n^2 \varepsilon^2}.

Since n1n2=π2/6<\sum_{n \ge 1} n^{-2} = \pi^2/6 < \infty, we get nP(An)σ2π2/(6ε2)<\sum_n P(A_n) \le \sigma^2\pi^2/(6\varepsilon^2) < \infty. By Lemma 4.4, with probability 11 only finitely many nn satisfy Xˉn2>ε|\bar{X}_{n^2}| > \varepsilon.

Doing this for ε=1/k\varepsilon = 1/k (kNk \in \mathbb{N}) and taking the countable union N=kN1/kN = \bigcup_k N_{1/k} of the exceptional sets gives P(N)=0P(N) = 0, and Xˉn2(ω)0\bar{X}_{n^2}(\omega) \to 0 for ωN\omega \notin N.

Remark: to obtain convergence along the full sequence one must separately estimate how far Xˉm\bar{X}_m can drift from Xˉn2\bar{X}_{n^2} in the range n2m<(n+1)2n^2 \le m < (n+1)^2 (for bounded random variables this gap-filling is easy). This subsequence argument has the same skeleton as the strategy of Proposition 4.7, where a fourth moment was assumed in order to obtain nP(An)<\sum_n P(A_n) < \infty directly.

Exercise 7.4Hard

Let X1,X2,X_1, X_2, \ldots be i.i.d. with E[X1]=μ0E[X_1] = \mu \ne 0 and Var(X1)=σ2(0,)\operatorname{Var}(X_1) = \sigma^2 \in (0,\infty). Show that

n(Xˉn2μ2)dN(0, 4μ2σ2)\sqrt{n}\left(\bar{X}_n^{\,2} - \mu^2\right) \xrightarrow{d} N\left(0,\ 4\mu^2\sigma^2\right)

(the delta method in the case g(x)=x2g(x) = x^2). You may use Theorem 5.6 and Proposition 6.1.

Solution

Factor the expression:

n(Xˉn2μ2)=n(Xˉnμ)(Xˉn+μ).\sqrt{n}\left(\bar{X}_n^{\,2} - \mu^2\right) = \sqrt{n}\left(\bar{X}_n - \mu\right)\left(\bar{X}_n + \mu\right).

For the first factor, Theorem 5.6 gives n(Xˉnμ)dN(0,σ2)\sqrt{n}(\bar{X}_n - \mu) \xrightarrow{d} N(0, \sigma^2).

For the second factor, Theorem 4.1 (or Theorem 4.5 together with Theorem 3.6(1)) gives XˉnPμ\bar{X}_n \xrightarrow{P} \mu, hence Xˉn+μP2μ\bar{X}_n + \mu \xrightarrow{P} 2\mu, and 2μ2\mu is a constant.

Applying the product part of Proposition 6.1 (if XndXX_n \xrightarrow{d} X and YnPcY_n \xrightarrow{P} c then XnYndcXX_nY_n \xrightarrow{d} cX) with Xn=n(Xˉnμ)X_n = \sqrt n(\bar X_n - \mu), Yn=Xˉn+μY_n = \bar X_n + \mu and c=2μc = 2\mu gives

n(Xˉn2μ2)d2μN(0,σ2).\sqrt{n}\left(\bar{X}_n^{\,2} - \mu^2\right) \xrightarrow{d} 2\mu \cdot N(0,\sigma^2).

For WN(0,σ2)W \sim N(0,\sigma^2), the variable 2μW2\mu W is normal with mean 00 and variance (2μ)2σ2=4μ2σ2(2\mu)^2\sigma^2 = 4\mu^2\sigma^2, which proves the claim.

Note that 4μ2σ2=(g(μ))2σ24\mu^2\sigma^2 = \left(g'(\mu)\right)^2\sigma^2 with g(x)=x2g(x)=x^2 and g(x)=2xg'(x) = 2x, in agreement with the general delta-method formula

n(g(Xˉn)g(μ))dN(0,(g(μ))2σ2)(g differentiable at μ).\sqrt{n}\left(g(\bar X_n) - g(\mu)\right) \xrightarrow{d} N\left(0, (g'(\mu))^2\sigma^2\right) \quad (g \text{ differentiable at } \mu).

When μ=0\mu = 0 we would have g(μ)=0g'(\mu) = 0, the limit degenerating to the constant 00; this is why μ0\mu \ne 0 was assumed here.

  • Itô Kiyosi, Kakuritsuron (Probability Theory), Iwanami Shoten, 1991 (in Japanese) — Chapter 3 (the law of large numbers), Chapter 4 (the central limit theorem).
  • Funaki Nobuhisa, Kakuritsuron (Probability Theory), Asakura Shoten, 2004 (in Japanese) — Chapters 5 through 7 give a systematic treatment of the notions of convergence, the law of large numbers and the central limit theorem.
  • R. Durrett, Probability: Theory and Examples, 5th ed., Cambridge University Press, 2019 — Chapter 2 (laws of large numbers, the Borel–Cantelli lemma), Chapter 3 (the central limit theorem, characteristic functions, the Lindeberg condition). A PDF is available on the author’s website.
  • P. Billingsley, Probability and Measure, 3rd ed., Wiley, 1995 — §22 (the strong law), §§26–27 (characteristic functions and Lévy’s continuity theorem).
  • W. Feller, An Introduction to Probability Theory and Its Applications, Vol. II, 2nd ed., Wiley, 1971 — Chapter XVI contains the Berry–Esseen theorem and error estimates for the normal approximation.
  • A. W. van der Vaart, Asymptotic Statistics, Cambridge University Press, 1998 — Chapter 2 (stochastic convergence, Slutsky’s theorem, the delta method). For readers who care most about statistical applications.

Appendix: Where the limit theorems go from here

Section titled “Appendix: Where the limit theorems go from here”

Dropping identical distribution. Theorem 5.6 assumes identically distributed variables, but what is really essential is only that no single term dominates the sum. For independent but differently distributed Xn,1,,Xn,nX_{n,1},\ldots,X_{n,n} (mean 00, sum of variances sn2s_n^2), if for every ε>0\varepsilon>0

1sn2i=1nE[Xn,i21{Xn,i>εsn}]0\frac{1}{s_n^2}\sum_{i=1}^{n} E\left[X_{n,i}^2\,\mathbf{1}\{|X_{n,i}| > \varepsilon s_n\}\right] \to 0

holds (the Lindeberg condition), then sn1iXn,idN(0,1)s_n^{-1}\sum_i X_{n,i} \xrightarrow{d} N(0,1). The meaning of the condition is that the contribution to the variance of the terms producing large values vanishes — precisely a quantification of “no single term dominates”. In the identically distributed case the condition is automatically satisfied, so Theorem 5.6 becomes a corollary.

Dropping independence. A central limit theorem holds if, instead of independence, one assumes that the variables form a martingale difference sequence (the martingale central limit theorem). In time series analysis and in the analysis of stochastic algorithms, independence is out of reach, whereas the property that the conditional expectation given the past is 00 often does hold, which makes this formulation the practical one. The framework of conditional expectation is treated in Conditional expectation (Definition 3.1[条件付き期待値]), and martingales themselves in Martingales and Brownian motion (Definition 3.1[マルチンゲールとブラウン運動]).

Promoting the limit to a process. Theorem 5.6 is the convergence of the distribution at a single point, time nn. Promoting it to the polygonal path of partial sums indexed by t[0,1]t \in [0,1],

Wn(t)=SntntμσnW_n(t) = \frac{S_{\lfloor nt \rfloor} - \lfloor nt\rfloor \mu}{\sigma\sqrt{n}}

yields Donsker’s invariance principle: this stochastic process converges in distribution to Brownian motion(Definition 5.1)[マルチンゲールとブラウン運動]. Where the central limit theorem speaks of the universality of the normal law, the invariance principle speaks of the universality of Brownian motion. Beyond this lies the entrance to stochastic analysis, continuing in Stochastic differential equations (the Itô integral).

Looking at the tails. Finally, when one wants to estimate P(Xˉnμ>x)P(\bar X_n - \mu > x) for a fixed x>0x > 0, the central limit theorem is of no use (this probability tends to 00 and is buried in the O(1/n)O(1/\sqrt n) error of the normal approximation). If the exponential moments are finite, Cramér’s theorem supplies the exponential decay 1nlogP(Xˉnμ>x)I(x)\frac{1}{n}\log P(\bar X_n - \mu > x) \to -I(x). The function II appearing here is called the rate function and can be written as the Legendre transform of the cumulant generating function. It clarifies matters to regard the law of large numbers (everything collapses to 00), the central limit theorem (viewed through a window of width n\sqrt n) and the theory of large deviations (take logarithms and divide by nn) as three images of the same quantity seen at different magnifications.

Report an error in this article ・Operated by: Mugen Giken LLCPricingTermsLegal notice

© 2026 夢現技研合同会社 ・Feeding the text to an LLM is welcome. Code samples are MIT licensed.