Unit 8, lesson 54

Law of Large Numbers for Discrete Variables

How Chebyshev's inequality proves the weak law of large numbers for IID averages and relative frequencies, what convergence in probability means for a fixed error tolerance, and what a sufficient sample size guarantees.

  • Video 54
  • The Law of Large Numbers and Streaks

Toss a fair coin 1010 times, and the fraction of heads misses one half by 0.10.1 or more with probability 193/256≈0.75193/256 \approx 0.75. With 10001000 tosses the same miss has probability below one in a billion. Why do averages of many independent observations settle near the mean, and in exactly what sense? This lesson proves the weak law of large numbers from Chebyshev’s inequality, explains convergence in probability with a fixed tolerance, and shows what the law does not promise at any finite sample size.

Key terms

Error tolerance

Definition Let X1,X2,…X_1, X_2, \dots have common mean μ\mu, and let Xˉn\bar{X}_n be the mean of the first nn of them. An error tolerance is a fixed number ε>0\varepsilon > 0, in the units of the observations, that marks the distance from μ\mu at which a miss begins. The sample mean misses by at least the tolerance on the event {∣Xˉn−μ∣≥ε}\{\lvert \bar{X}_n - \mu \rvert \ge \varepsilon\} and is within tolerance on its complement {∣Xˉn−μ∣<ε}\{\lvert \bar{X}_n - \mu \rvert < \varepsilon\}. In the law of large numbers ε\varepsilon is chosen first and stays fixed while nn grows.

In plain words Decide how close counts as close before asking how the probability of a miss changes with the sample size. A tolerance that shrinks as nn grows asks a different question, and its answer can be different.

Example For delays that are 00 or 44 minutes with probability 12\tfrac12 each, μ=2\mu = 2 minutes, and the tolerance ε=0.5\varepsilon = 0.5 minutes makes the miss event {Xˉn≤1.5}∪{Xˉn≥2.5}\{\bar{X}_n \le 1.5\} \cup \{\bar{X}_n \ge 2.5\}. For a shrinking tolerance, take fair 00 or 11 trials with nn odd. The number of successes KK is a whole number and nn is odd, so 2K−n≠02K - n \ne 0, and

∣Xˉn−12∣=∣2K−n∣2n≥12n\Bigl\lvert \bar{X}_n - \tfrac12 \Bigr\rvert = \frac{\lvert 2K - n \rvert}{2n} \ge \frac{1}{2n}

on every outcome. With the tolerance 1/(2n)1/(2n) the miss probability is 11 for every odd nn, while with any fixed tolerance it tends to 00, as the weak law below shows.

Convergence in probability

Definition A sequence of random variables Y1,Y2,…Y_1, Y_2, \dots converges in probability to a constant cc if for every ε>0\varepsilon > 0

lim⁡n→∞P(∣Yn−c∣≥ε)=0.\lim_{n \to \infty} P(\lvert Y_n - c \rvert \ge \varepsilon) = 0.

Each probability in the sequence is computed at a single nn, so the definition is a statement about a sequence of numbers. It makes no claim about the values along one observed run.

In plain words Name any closeness you like. For all large enough nn, missing cc by that much becomes as unlikely as you wish. A miss can still have positive probability at every finite nn, and nothing in the definition says that a particular run of observed values moves steadily toward cc.

Example For fair 00 or 11 trials and ε=0.1\varepsilon = 0.1, exact binomial calculations give the miss probabilities in the table, and they head toward 00.

nnP(∣Xˉn−0.5∣≥0.1)P(\lvert \bar{X}_n - 0.5 \rvert \ge 0.1)
10100.7540.754
1001000.0570.057
100010002.7×10−102.7 \times 10^{-10}

Weak law of large numbers

Definition Let X1,X2,…X_1, X_2, \dots be IID discrete random variables with finite mean μ\mu and finite variance σ2\sigma^2. Then for every ε>0\varepsilon > 0 and every n≥1n \ge 1

P(∣Xˉn−μ∣≥ε)≤σ2nε2,P(\lvert \bar{X}_n - \mu \rvert \ge \varepsilon) \le \frac{\sigma^2}{n\varepsilon^2},

and therefore Xˉn\bar{X}_n converges in probability to μ\mu. The proof uses E[Xˉn]=μE[\bar{X}_n] = \mu and Var⁡(Xˉn)=σ2/n\operatorname{Var}(\bar{X}_n) = \sigma^2/n, then Chebyshev’s inequality with distance ε\varepsilon. With σ2\sigma^2 and ε\varepsilon fixed, the right side tends to 00 as n→∞n \to \infty, and a probability between 00 and that bound tends to 00 as well. Independence enters only through the variance formula, which needs the covariances to vanish. The conclusion also holds for IID variables with a finite mean and infinite variance, but that case needs a different proof.

In plain words An average of many independent draws from one distribution is unlikely to be far from the mean. For any fixed tolerance, the chance of a miss can be made as small as you like by taking nn large enough, because the variance of the average shrinks like 1/n1/n while the tolerance stays put. Nothing pushes later outcomes to repair earlier ones. An early surplus becomes a smaller and smaller share of a growing total.

Example For IID delays of 00 or 44 minutes, μ=2\mu = 2 and σ2=4\sigma^2 = 4 square minutes. With ε=0.5\varepsilon = 0.5 minutes,

P(∣Xˉn−2∣≥0.5)≤4n⋅0.25=16n,\begin{aligned} &P(\lvert \bar{X}_n - 2 \rvert \ge 0.5) \\[0.4em] &\quad \le \frac{4}{n \cdot 0.25} = \frac{16}{n}, \end{aligned}

which is 0.040.04 at n=400n = 400 and 0.010.01 at n=1600n = 1600. The square minutes cancel. Independence matters. If one delay XX is copied into every position, each XiX_i still has mean 22 and variance 44, but Xˉn=X\bar{X}_n = X is 00 or 44 for every nn. Then P(∣Xˉn−2∣≥0.5)=1P(\lvert \bar{X}_n - 2 \rvert \ge 0.5) = 1 for every nn, and the averages do not converge to 22.

Relative frequency

Definition Let an experiment be repeated independently, let AA be an event with P(A)=pP(A) = p, and let XiX_i be the indicator of AA on trial ii. The XiX_i are IID Bernoulli⁡(p)\operatorname{Bernoulli}(p) with mean pp and variance p(1−p)p(1 - p). If KK counts the trials among the first nn on which AA occurs, the relative frequency of AA is Xˉn=K/n\bar{X}_n = K/n. The weak law gives, for every ε>0\varepsilon > 0,

P(∣K/n−p∣≥ε)≤p(1−p)nε2≤14nε2,\begin{aligned} &P(\lvert K/n - p \rvert \ge \varepsilon) \\[0.4em] &\quad \le \frac{p(1 - p)}{n\varepsilon^2} \le \frac{1}{4n\varepsilon^2}, \end{aligned}

where the last step uses p(1−p)≤14p(1 - p) \le \tfrac14. So K/nK/n converges in probability to pp. A relative frequency in finitely many trials is a random variable, while pp is a fixed model probability.

In plain words A relative frequency is an average of 00s and 11s, so the law for averages covers frequencies with no new theorem. This gives a precise meaning to the idea that a probability describes a long-run frequency. One finite frequency estimates pp and comes with sampling error.

Example Trials succeed independently with probability 0.40.4, n=600n = 600 and ε=0.1\varepsilon = 0.1. Each indicator has variance 0.4⋅0.6=0.240.4 \cdot 0.6 = 0.24, the frequency has variance 0.24/600=0.00040.24/600 = 0.0004, and

P(∣K/600−0.4∣≥0.1)≤0.24600⋅0.01=0.04.\begin{aligned} &P(\lvert K/600 - 0.4 \rvert \ge 0.1) \\[0.4em] &\quad \le \frac{0.24}{600 \cdot 0.01} = 0.04. \end{aligned}

The complement gives P(0.3<K/600<0.5)≥0.96P(0.3 < K/600 < 0.5) \ge 0.96, with strict inequalities. The frequencies 0.30.3 and 0.50.5 belong to the bounded event, and they occur at K=180K = 180 and K=300K = 300 with positive probability. The exact binomial probability of the miss is about 6.8×10−76.8 \times 10^{-7}, far below the bound 0.040.04.

Sufficient sample size

Definition Let X1,X2,…X_1, X_2, \dots be IID with mean μ\mu and finite variance σ2>0\sigma^2 > 0, and fix a tolerance ε>0\varepsilon > 0 and a target probability δ\delta with 0<δ<10 < \delta < 1. Chebyshev’s bound σ2/(nε2)\sigma^2/(n\varepsilon^2) is at most δ\delta exactly when

n≥σ2δ ε2,n \ge \frac{\sigma^2}{\delta\,\varepsilon^2},

and every such nn guarantees P(∣Xˉn−μ∣≥ε)≤δP(\lvert \bar{X}_n - \mu \rvert \ge \varepsilon) \le \delta. The smallest whole number that satisfies the condition is the right side rounded up. Such an nn is sufficient, but it need not be the smallest sample size with miss probability at most δ\delta, because the exact probability can drop below δ\delta at a much smaller nn. Halving ε\varepsilon with δ\delta fixed multiplies the right side by 44.

In plain words This calculation tells you how many observations are enough to guarantee, from the variance alone, that a miss of size ε\varepsilon or more has probability at most δ\delta. It is a safe planning number, and often much larger than needed when the full distribution is known.

Example For the delays with ε=0.5\varepsilon = 0.5 minutes and δ=0.01\delta = 0.01, the condition is n≥4/(0.01⋅0.25)=1600n \ge 4/(0.01 \cdot 0.25) = 1600. Exact binomial calculations show that the miss probability is already at most 0.010.01 at every nn from 113113 to 16001600, and Chebyshev’s bound covers every larger nn. At n=400n = 400 the exact probability is below one in a million. It does not decrease at every step, since it is about 0.00930.0093 at n=101n = 101 and about 0.01290.0129 at n=102n = 102. Halving the tolerance to 0.250.25 minutes raises the sufficient size to 64006400.

Finite-sample uncertainty

Definition For IID observations with mean μ\mu and finite variance σ2\sigma^2, the sample mean at a fixed sample size nn is still a random variable, with variance σ2/n\sigma^2/n. When σ2>0\sigma^2 > 0 this variance is positive, so Xˉn≠μ\bar{X}_n \ne \mu with positive probability. The weak law bounds the probability of a miss of a given size without ruling the miss out. It is a statement about the probabilities at each nn, so it does not say that the observed averages along one run move closer to μ\mu at every step, and it does not make later outcomes compensate for earlier ones.

In plain words Large samples make big misses unlikely. A miss that one observation can make stays possible at every nn, because all nn observations can miss by that much in the same direction. A single run can wander away from the mean and come back, long streaks happen under independence, and an observed frequency, however balanced it looks, does not reveal the underlying probability exactly.

Example For fair 00 or 11 trials, the observed sequence 1,0,11, 0, 1 has running averages 11, 12\tfrac12 and 23\tfrac23. The third observation moved the average away from 12\tfrac12, and the law does not forbid that. Given ten successes in the first ten trials, each later trial still succeeds with probability 12\tfrac12, so after 9090 more trials the expected frequency is

10+45100=0.55.\frac{10 + 45}{100} = 0.55 .

The early surplus of 55 successes over half the trials is not paid back on average, but it becomes a smaller share of the total, which pulls the expected frequency toward 12\tfrac12.

Check yourself

  1. Fair 00 or 11 trials are independent. How many trials does Chebyshev’s bound need to guarantee that the relative frequency misses 12\tfrac12 by 0.10.1 or more with probability at most 0.010.01?
Show the answer

Each indicator has variance 12⋅12=14\tfrac12 \cdot \tfrac12 = \tfrac14, so the bound is

1/4n⋅0.01=25n.\frac{1/4}{n \cdot 0.01} = \frac{25}{n}.

It is at most 0.010.01 exactly when n≥2500n \ge 2500, so 25002500 trials are sufficient by this argument.

  1. With 25002500 fair trials, is every possible relative frequency within 0.10.1 of 12\tfrac12? Separately, does an observed frequency of exactly 12\tfrac12 in 1010 trials prove that the success probability is 12\tfrac12?
Show the answer

No to both. The guarantee is that a miss of 0.10.1 or more has probability at most 0.010.01, not probability 00. A run of 25002500 successes, with frequency 11, has probability 2−25002^{-2500}, which is tiny but positive. For the second part, 55 successes in 1010 independent trials have probability (105)(0.5)10≈0.246\binom{10}{5}(0.5)^{10} \approx 0.246 when the success probability is 0.50.5, and (105)(0.4)5(0.6)5≈0.201\binom{10}{5}(0.4)^5(0.6)^5 \approx 0.201 when it is 0.40.4. The observation fits both models, so it does not settle which one generated it.

  1. Each inspection independently finds a flaw with probability 0.20.2. For n=400n = 400 inspections and the tolerance 0.050.05, bound the probability that the flaw frequency K/400K/400 misses 0.20.2 by at least the tolerance. What lower bound follows for P(0.15<K/400<0.25)P(0.15 < K/400 < 0.25), and why are the inequalities strict? How many inspections make the Chebyshev bound at most 0.050.05?
Show the answer

Each indicator has variance 0.2⋅0.8=0.160.2 \cdot 0.8 = 0.16, so

P(∣K/400−0.2∣≥0.05)≤0.16400⋅0.0025=0.16.\begin{aligned} &P(\lvert K/400 - 0.2 \rvert \ge 0.05) \\[0.4em] &\quad \le \frac{0.16}{400 \cdot 0.0025} = 0.16 . \end{aligned}

The complement gives P(0.15<K/400<0.25)≥0.84P(0.15 < K/400 < 0.25) \ge 0.84. The inequalities are strict because the bounded event includes the frequencies 0.150.15 and 0.250.25, which occur at K=60K = 60 and K=100K = 100 with positive probability. A bound of at most 0.050.05 needs n≥0.16/(0.05⋅0.0025)=1280n \ge 0.16/(0.05 \cdot 0.0025) = 1280 inspections. The exact binomial miss probability at n=400n = 400 is about 0.0150.015, so the Chebyshev bound 0.160.16 is conservative here.

How this lesson connects

Where this leads in Statistics