Practice / Probability for ML

The law of large numbers, Markov's inequality and Chebyshev's inequality

Ten problems on the law of large numbers and the inequalities behind it: Markov's bound on a latency, Chebyshev's bound against the normal's exact tail, Chebyshev proved from Markov with the distribution that makes it tight, the bound against a uniform's exact tail, the weak law for die rolls, the sample size for estimating a coin's bias, a Monte Carlo estimate of π, the batch size for a minibatch gradient, the variance of an average of correlated samples and why proportions settle while counts spread, with worked solutions and the mistakes of using Markov on a variable that can be negative, putting σ where σ² belongs, dividing by n instead of √n, averaging correlated samples as if they were independent and expecting a coin to even out.

Before you start

The law of large numbers is the reason an average of many noisy measurements can be trusted: as the sample grows, the sample mean settles on the true mean. Every Monte Carlo estimate, every minibatch gradient and every test-set accuracy relies on it. Its simplest proof is two lines long and rests on two inequalities that hold for any distribution with a mean and, for the second, a variance: Markov's, which bounds a tail using only the mean, and Chebyshev's, which bounds the distance from the mean using the variance. These ten problems use both bounds, compare them with exact answers to see how much they give away, prove the weak law and use it to size a sample, a Monte Carlo run and a minibatch, and then look at what changes when samples are correlated and why a fair coin's proportion of heads settles while its count of extra heads does not. The five mistakes at the end are the ones that give a believable number: Markov applied to a variable that can be negative, σ\sigma written where σ2\sigma^2 belongs, an error divided by nn instead of n\sqrt n, correlated samples averaged as if independent, and a coin expected to make up for its past.

  • Markov's inequality. If X≥0X \ge 0 and a>0a > 0, then P(X≥a)≤E[X]aP(X \ge a) \le \dfrac{E[X]}{a}.
  • Chebyshev's inequality. If XX has mean μ\mu and variance σ2\sigma^2, then for every t>0t > 0, P(∣X−μ∣≥t)≤σ2t2P(|X - \mu| \ge t) \le \dfrac{\sigma^2}{t^2}. With t=kσt = k\sigma this reads P(∣X−μ∣≥kσ)≤1k2P(|X - \mu| \ge k\sigma) \le \dfrac{1}{k^2}.
  • The sample mean. For independent, identically distributed (i.i.d.) X1,…,XnX_1, \dots, X_n with mean μ\mu and variance σ2\sigma^2, Xˉn=1n∑iXi\bar X_n = \tfrac1n\sum_i X_i has E[Xˉn]=μE[\bar X_n] = \mu and Var⁡(Xˉn)=σ2/n\operatorname{Var}(\bar X_n) = \sigma^2/n, so its standard deviation is σ/n\sigma/\sqrt n.
  • The weak law of large numbers. For every ε>0\varepsilon > 0, P(∣Xˉn−μ∣≥ε)≤σ2nε2P(|\bar X_n - \mu| \ge \varepsilon) \le \dfrac{\sigma^2}{n\varepsilon^2}, which tends to 00 as n→∞n \to \infty.
  • Proportions. The fraction p^\hat p of nn independent trials in which an event of probability pp happens is the sample mean of indicators, each with mean pp and variance p(1−p)≤14p(1 - p) \le \tfrac14.
  • Correlation. For a sum, Var⁡(∑iXi)=∑iVar⁡(Xi)+∑i≠jCov⁡(Xi,Xj)\operatorname{Var}\big(\sum_i X_i\big) = \sum_i \operatorname{Var}(X_i) + \sum_{i \ne j}\operatorname{Cov}(X_i, X_j). Φ\Phi is the standard normal CDF, as on the normal-distribution page.

Builds on: Discrete random variables: expectation, variance and the binomial, geometric and Poisson, Variance, covariance and correlation

Problems

  1. ·

    A service's response time TT is never negative and has mean 200200 ms. What does Markov's inequality say about P(T≥1000)P(T \ge 1000) and about P(T≥100)P(T \ge 100)? If TT is in fact exponential with mean 200200 ms, what is P(T≥1000)P(T \ge 1000)?

  2. ·

    A measurement has mean 5050 and variance 2525. Bound P(∣X−50∣≥15)P(|X - 50| \ge 15) with Chebyshev's inequality, and give the guarantee it implies for P(35<X<65)P(35 < X < 65). Compare with the exact value if XX is normal.

  3. ··

    Prove Chebyshev's inequality from Markov's. Then let k>1k > 1 and let XX equal μ−kσ\mu - k\sigma and μ+kσ\mu + k\sigma with probability 12k2\dfrac{1}{2k^2} each, and μ\mu otherwise. Show that XX has mean μ\mu and variance σ2\sigma^2, and that Chebyshev's bound is an equality for it.

  4. ··

    Let XX be uniform on (0,1)(0, 1). Compute P(∣X−12∣≥0.4)P(|X - \tfrac12| \ge 0.4) and P(∣X−12∣≥0.3)P(|X - \tfrac12| \ge 0.3) exactly, and compare each with Chebyshev's bound.

  5. ··

    A fair die is rolled nn times. Use the weak law to bound the probability that the average roll is 0.10.1 or more away from 3.53.5 when n=1000n = 1000, and find the nn that makes the bound 0.010.01. What does the normal approximation give for n=1000n = 1000?

  6. ··

    A coin of unknown bias pp is flipped nn times and p^\hat p is the fraction of heads. Using only p(1−p)≤14p(1 - p) \le \tfrac14, how large must nn be for Chebyshev to guarantee P(∣p^−p∣≥0.05)≤0.05P(|\hat p - p| \ge 0.05) \le 0.05? What nn does the normal approximation suggest?

  7. ··

    To estimate π\pi, draw n=10 000n = 10\,000 points uniformly in the unit square and let p^\hat p be the fraction with x2+y2≤1x^2 + y^2 \le 1; the estimate is 4p^4\hat p. Find its standard deviation, and bound P(∣4p^−π∣≥0.05)P(|4\hat p - \pi| \ge 0.05).

  8. ··

    Each example's gradient component has mean gg and variance 44, independently across examples. Find the standard deviation of the minibatch average over BB examples, the BB that makes it 0.10.1, and Chebyshev's bound on P(∣gˉ−g∣≥0.25)P(|\bar g - g| \ge 0.25) at that BB.

  9. ···

    Let X1,…,XnX_1, \dots, X_n each have variance σ2\sigma^2, with Cov⁡(Xi,Xj)=ρσ2\operatorname{Cov}(X_i, X_j) = \rho\sigma^2 for every i≠ji \ne j. Find Var⁡(Xˉn)\operatorname{Var}(\bar X_n) and its limit as n→∞n \to \infty. Evaluate for σ2=1\sigma^2 = 1, ρ=0.1\rho = 0.1 and n=100n = 100, and find the number of independent samples that would give the same variance.

  10. ···

    A fair coin is flipped nn times, with HH heads. Find the standard deviation of the proportion H/nH/n and of the excess H−n/2H - n/2 for n=100n = 100 and n=10 000n = 10\,000. Then find P(H=n/2)P(H = n/2) for both, given that it is about 2/(πn)\sqrt{2/(\pi n)} for large nn.

Worked solutions

Problem 1

A service's response time TT is never negative and has mean 200200 ms. What does Markov's inequality say about P(T≥1000)P(T \ge 1000) and about P(T≥100)P(T \ge 100)? If TT is in fact exponential with mean 200200 ms, what is P(T≥1000)P(T \ge 1000)?

  1. P(T≥1000)≤2001000=0.2P(T \ge 1000) \le \dfrac{200}{1000} = 0.2Markov with a=1000a = 1000; T≥0T \ge 0, so it applies.
  2. P(T≥100)≤200100=2P(T \ge 100) \le \dfrac{200}{100} = 2Markov with a=100a = 100.
  3. A bound of 22 says nothingEvery probability is at most 11 already. Markov is only useful for aa above the mean.
  4. Exponential: P(T≥t)=e−t/200P(T \ge t) = e^{-t/200}, so P(T≥1000)=e−5P(T \ge 1000) = e^{-5}The exponential's tail.
  5. Markov: P(T≥1000)≤0.2P(T \ge 1000) \le 0.2, and nothing useful about P(T≥100)P(T \ge 100); for an exponential the true value is e−5≈0.0067e^{-5} \approx 0.0067The bound is thirty times the truth here because it uses only the mean. It holds for every nonnegative distribution with that mean, including the worst one: T=1000T = 1000 with probability 0.20.2 and T=0T = 0 otherwise, where it is exact.

Problem 2

A measurement has mean 5050 and variance 2525. Bound P(∣X−50∣≥15)P(|X - 50| \ge 15) with Chebyshev's inequality, and give the guarantee it implies for P(35<X<65)P(35 < X < 65). Compare with the exact value if XX is normal.

  1. P(∣X−50∣≥15)≤25152=19P(|X - 50| \ge 15) \le \dfrac{25}{15^2} = \dfrac19Chebyshev with σ2=25\sigma^2 = 25 and t=15t = 15.
  2. 15=3σ15 = 3\sigma, so this is 1/k21/k^2 with k=3k = 3σ=5\sigma = 5.
  3. P(35<X<65)=1−P(∣X−50∣≥15)≥89P(35 < X < 65) = 1 - P(|X - 50| \ge 15) \ge \dfrac89The complement.
  4. For a normal: P(∣X−50∣≥15)=2(1−Φ(3))=0.0027P(|X - 50| \ge 15) = 2(1 - \Phi(3)) = 0.0027Three standard deviations, both tails.
  5. P(∣X−50∣≥15)≤19≈0.111P(|X - 50| \ge 15) \le \tfrac19 \approx 0.111, so P(35<X<65)≥89≈0.889P(35 < X < 65) \ge \tfrac89 \approx 0.889; for a normal the tail is only 0.00270.0027Chebyshev knows nothing about the shape, so it must allow for heavy tails. It is the guarantee to quote when the distribution is unknown, and the normal's 99.7%99.7\% is the one to quote when it is known.

Problem 3

Prove Chebyshev's inequality from Markov's. Then let k>1k > 1 and let XX equal μ−kσ\mu - k\sigma and μ+kσ\mu + k\sigma with probability 12k2\dfrac{1}{2k^2} each, and μ\mu otherwise. Show that XX has mean μ\mu and variance σ2\sigma^2, and that Chebyshev's bound is an equality for it.

  1. Let Y=(X−μ)2Y = (X - \mu)^2, so Y≥0Y \ge 0 and E[Y]=σ2E[Y] = \sigma^2The definition of the variance.
  2. ∣X−μ∣≥t|X - \mu| \ge t exactly when Y≥t2Y \ge t^2Both sides are nonnegative, so squaring keeps the inequality.
  3. P(∣X−μ∣≥t)=P(Y≥t2)≤E[Y]t2=σ2t2P(|X - \mu| \ge t) = P(Y \ge t^2) \le \dfrac{E[Y]}{t^2} = \dfrac{\sigma^2}{t^2}Markov on YY with a=t2a = t^2.
  4. For the three-point XX: E[X]=μE[X] = \muThe two outer values are symmetric about μ\mu and equally likely.
  5. Var⁡(X)=2⋅12k2(kσ)2=σ2\operatorname{Var}(X) = 2\cdot\dfrac{1}{2k^2}(k\sigma)^2 = \sigma^2Only the outer values are away from μ\mu, each by kσk\sigma.
  6. P(∣X−μ∣≥kσ)=2⋅12k2=1k2P(|X - \mu| \ge k\sigma) = 2\cdot\dfrac{1}{2k^2} = \dfrac1{k^2}Exactly the bound.
  7. Chebyshev is Markov applied to (X−μ)2(X - \mu)^2, and the three-point distribution attains 1/k21/k^2 exactly, so no better bound holds for every distributionFor k=2k = 2 it puts 18\tfrac18 at each of μ±2σ\mu \pm 2\sigma and 34\tfrac34 at μ\mu. A smaller bound, like the one in Mistake 2, fails on a distribution of this kind.

Problem 4

Let XX be uniform on (0,1)(0, 1). Compute P(∣X−12∣≥0.4)P(|X - \tfrac12| \ge 0.4) and P(∣X−12∣≥0.3)P(|X - \tfrac12| \ge 0.3) exactly, and compare each with Chebyshev's bound.

  1. μ=12\mu = \tfrac12 and σ2=112\sigma^2 = \tfrac1{12}The uniform's mean and variance on an interval of length 11.
  2. ∣X−12∣≥0.4|X - \tfrac12| \ge 0.4 means X≤0.1X \le 0.1 or X≥0.9X \ge 0.9: probability 0.20.2Two end pieces of length 0.10.1.
  3. Chebyshev: 1/120.16≈0.521\dfrac{1/12}{0.16} \approx 0.521t=0.4t = 0.4, t2=0.16t^2 = 0.16.
  4. ∣X−12∣≥0.3|X - \tfrac12| \ge 0.3 means X≤0.2X \le 0.2 or X≥0.8X \ge 0.8: probability 0.40.4Two end pieces of length 0.20.2.
  5. Chebyshev: 1/120.09≈0.926\dfrac{1/12}{0.09} \approx 0.926t=0.3t = 0.3.
  6. Exact 0.20.2 against a bound of 0.5210.521, and exact 0.40.4 against 0.9260.926The bounds hold, with room to spare: a uniform has no tails at all. In units of σ≈0.289\sigma \approx 0.289 these are k≈1.39k \approx 1.39 and k≈1.04k \approx 1.04, where 1/k21/k^2 is barely below 11.

Problem 5

A fair die is rolled nn times. Use the weak law to bound the probability that the average roll is 0.10.1 or more away from 3.53.5 when n=1000n = 1000, and find the nn that makes the bound 0.010.01. What does the normal approximation give for n=1000n = 1000?

  1. μ=3.5\mu = 3.5 and σ2=16∑k=16k2−3.52=916−12.25=3512\sigma^2 = \tfrac{1}{6}\sum_{k=1}^6 k^2 - 3.5^2 = \tfrac{91}{6} - 12.25 = \tfrac{35}{12}E[X2]−(E[X])2E[X^2] - (E[X])^2.
  2. P(∣Xˉ−3.5∣≥0.1)≤35/121000⋅0.01≈0.292P(|\bar X - 3.5| \ge 0.1) \le \dfrac{35/12}{1000 \cdot 0.01} \approx 0.292The weak law with ε=0.1\varepsilon = 0.1.
  3. 35/12n⋅0.01≤0.01\dfrac{35/12}{n \cdot 0.01} \le 0.01 needs n≥29 166.7n \ge 29\,166.7Solve for nn.
  4. Normal: Xˉ\bar X has standard deviation (35/12)/1000≈0.0540\sqrt{(35/12)/1000} \approx 0.0540σ/n\sigma/\sqrt n.
  5. 2(1−Φ(0.1/0.0540))=2(1−Φ(1.85))2\big(1 - \Phi(0.1/0.0540)\big) = 2\big(1 - \Phi(1.85)\big)Both tails, at z≈1.85z \approx 1.85.
  6. The bound is 0.2920.292 at n=1000n = 1000, and n≥29 167n \ge 29\,167 makes it 0.010.01; the normal approximation gives about 0.0640.064Chebyshev's guarantee is about four and a half times the likely value. The law of large numbers says the average converges; the central limit theorem says how fast in a form sharp enough to plan with.

Problem 6

A coin of unknown bias pp is flipped nn times and p^\hat p is the fraction of heads. Using only p(1−p)≤14p(1 - p) \le \tfrac14, how large must nn be for Chebyshev to guarantee P(∣p^−p∣≥0.05)≤0.05P(|\hat p - p| \ge 0.05) \le 0.05? What nn does the normal approximation suggest?

  1. Var⁡(p^)=p(1−p)n≤14n\operatorname{Var}(\hat p) = \dfrac{p(1 - p)}{n} \le \dfrac{1}{4n}The sample mean of indicators.
  2. P(∣p^−p∣≥0.05)≤14n⋅0.0025=100nP(|\hat p - p| \ge 0.05) \le \dfrac{1}{4n \cdot 0.0025} = \dfrac{100}{n}Chebyshev with t=0.05t = 0.05.
  3. 100n≤0.05\dfrac{100}{n} \le 0.05 needs n≥2000n \ge 2000Solve for nn.
  4. Normal: 1.9614n≤0.051.96\sqrt{\tfrac{1}{4n}} \le 0.05 needs n≥(1.960.05)2⋅14=384.16n \ge \big(\tfrac{1.96}{0.05}\big)^2\cdot\tfrac14 = 384.16A two-sided 95%95\% margin of 0.050.05.
  5. Chebyshev needs n≥2000n \ge 2000; the normal approximation suggests 385385The worst case p=12p = \tfrac12 is built into both. A poll of about 400400 for a ±5\pm5 point margin is the normal figure; 20002000 is what can be promised with no assumption about the shape of the sampling distribution.

Problem 7

To estimate π\pi, draw n=10 000n = 10\,000 points uniformly in the unit square and let p^\hat p be the fraction with x2+y2≤1x^2 + y^2 \le 1; the estimate is 4p^4\hat p. Find its standard deviation, and bound P(∣4p^−π∣≥0.05)P(|4\hat p - \pi| \ge 0.05).

  1. Each point lands in the quarter disk with probability p=π4≈0.7854p = \tfrac\pi4 \approx 0.7854The quarter disk has area π/4\pi/4 and the square area 11.
  2. E[4p^]=πE[4\hat p] = \pi and Var⁡(4p^)=16 p(1−p)n\operatorname{Var}(4\hat p) = \dfrac{16\,p(1 - p)}{n}Scaling by 44 multiplies the variance by 1616.
  3. 16⋅0.7854⋅0.2146/10 000≈2.70×10−416 \cdot 0.7854 \cdot 0.2146 / 10\,000 \approx 2.70 \times 10^{-4}p(1−p)≈0.1685p(1 - p) \approx 0.1685.
  4. Standard deviation ≈0.0164\approx 0.0164The square root.
  5. P(∣4p^−π∣≥0.05)≤2.70×10−40.0025≈0.108P(|4\hat p - \pi| \ge 0.05) \le \dfrac{2.70 \times 10^{-4}}{0.0025} \approx 0.108Chebyshev with t=0.05t = 0.05.
  6. Standard deviation ≈0.0164\approx 0.0164; P(∣4p^−π∣≥0.05)≤0.108P(|4\hat p - \pi| \ge 0.05) \le 0.108, so the estimate is within 0.050.05 of π\pi at least 89%89\% of the timeThe error shrinks like 1/n1/\sqrt n: one more correct digit costs a hundred times as many points. That rate, and not the dimension of the problem, is why Monte Carlo is used for high-dimensional integrals.

Problem 8

Each example's gradient component has mean gg and variance 44, independently across examples. Find the standard deviation of the minibatch average over BB examples, the BB that makes it 0.10.1, and Chebyshev's bound on P(∣gˉ−g∣≥0.25)P(|\bar g - g| \ge 0.25) at that BB.

  1. Var⁡(gˉ)=4/B\operatorname{Var}(\bar g) = 4/B, so its standard deviation is 2/B2/\sqrt BThe sample mean of BB i.i.d. values.
  2. 2/B=0.12/\sqrt B = 0.1 gives B=20\sqrt B = 20Solve.
  3. B=400B = 400Square.
  4. P(∣gˉ−g∣≥0.25)≤4/4000.252=0.010.0625P(|\bar g - g| \ge 0.25) \le \dfrac{4/400}{0.25^2} = \dfrac{0.01}{0.0625}Chebyshev with σ2=0.01\sigma^2 = 0.01.
  5. 2/B2/\sqrt B; B=400B = 400; the bound is 0.160.16Halving the noise of a gradient estimate takes four times the batch, which is why very large batches give diminishing returns per example. Examples drawn without replacement from a finite dataset, or correlated as in Problem 9, change the 4/B4/B.

Problem 9

Let X1,…,XnX_1, \dots, X_n each have variance σ2\sigma^2, with Cov⁡(Xi,Xj)=ρσ2\operatorname{Cov}(X_i, X_j) = \rho\sigma^2 for every i≠ji \ne j. Find Var⁡(Xˉn)\operatorname{Var}(\bar X_n) and its limit as n→∞n \to \infty. Evaluate for σ2=1\sigma^2 = 1, ρ=0.1\rho = 0.1 and n=100n = 100, and find the number of independent samples that would give the same variance.

  1. Var⁡(∑iXi)=nσ2+n(n−1)ρσ2\operatorname{Var}\big(\sum_i X_i\big) = n\sigma^2 + n(n - 1)\rho\sigma^2nn variances and n(n−1)n(n - 1) ordered pairs i≠ji \ne j.
  2. Var⁡(Xˉn)=σ2n+n−1nρσ2\operatorname{Var}(\bar X_n) = \dfrac{\sigma^2}{n} + \dfrac{n - 1}{n}\rho\sigma^2Divide by n2n^2.
  3. As n→∞n \to \infty this tends to ρσ2\rho\sigma^2, not 00The first term vanishes and the second tends to ρσ2\rho\sigma^2.
  4. For σ2=1\sigma^2 = 1, ρ=0.1\rho = 0.1, n=100n = 100: 0.01+0.99⋅0.1=0.1090.01 + 0.99 \cdot 0.1 = 0.109Step 2.
  5. Independent samples: σ2/m=0.109\sigma^2/m = 0.109 gives m≈9.2m \approx 9.2The effective sample size.
  6. Var⁡(Xˉn)=σ2n+n−1nρσ2→ρσ2\operatorname{Var}(\bar X_n) = \dfrac{\sigma^2}{n} + \dfrac{n - 1}{n}\rho\sigma^2 \to \rho\sigma^2; here 0.1090.109, the same as about 99 independent samplesWith a shared positive correlation the average never settles: the part of the noise that all samples share does not average out. Neighboring frames of a video, or a minibatch drawn from one document, behave like this.

Problem 10

A fair coin is flipped nn times, with HH heads. Find the standard deviation of the proportion H/nH/n and of the excess H−n/2H - n/2 for n=100n = 100 and n=10 000n = 10\,000. Then find P(H=n/2)P(H = n/2) for both, given that it is about 2/(πn)\sqrt{2/(\pi n)} for large nn.

  1. Var⁡(H)=n⋅12⋅12=n4\operatorname{Var}(H) = n \cdot \tfrac12 \cdot \tfrac12 = \tfrac n4, so HH has standard deviation 12n\tfrac12\sqrt nA binomial count.
  2. H−n/2H - n/2 has the same standard deviation, 12n\tfrac12\sqrt n: 55 and 5050Subtracting a constant changes nothing but the mean.
  3. H/nH/n has standard deviation n2n=12n\dfrac{\sqrt n}{2n} = \dfrac{1}{2\sqrt n}: 0.050.05 and 0.0050.005Dividing by nn divides the standard deviation by nn.
  4. P(H=50∣n=100)=(10050)2−100≈0.0796P(H = 50 \mid n = 100) = \binom{100}{50}2^{-100} \approx 0.0796Exact; 2/(100π)≈0.0798\sqrt{2/(100\pi)} \approx 0.0798.
  5. P(H=5000∣n=10 000)≈2/(10 000π)≈0.0080P(H = 5000 \mid n = 10\,000) \approx \sqrt{2/(10\,000\pi)} \approx 0.0080The approximation; the exact value is 0.007980.00798.
  6. Proportion: 0.050.05 then 0.0050.005; excess heads: 55 then 5050; exactly half heads: 0.0800.080 then 0.0080.008The law of large numbers is about the proportion. The excess of heads over half grows like n\sqrt n, and an exact tie becomes ten times less likely. The proportion settles because the excess grows more slowly than nn, not because the coin corrects itself (Mistake 5).

Where this goes wrong

1. Using Markov on a variable that can be negative

Markov's inequality needs only the mean, and a change in temperature has a mean.

  1. A daily change XX has E[X]=1E[X] = 1Right so far.
  2. “By Markov, P(X≥4)≤14P(X \ge 4) \le \tfrac14.”The condition that is missing: Markov needs X≥0X \ge 0. Large negative values can pull the mean down while the upper tail stays heavy.
  3. P(X≥4)≤0.25P(X \ge 4) \le 0.25Let X=−10X = -10 or 1212 with probability 12\tfrac12 each. Its mean is 11, and P(X≥4)=0.5P(X \ge 4) = 0.5, twice the claimed bound.

2. Putting σ where σ² belongs

Problem 2's numbers are given as a mean and a variance, and a standard deviation of 55 is the number that comes to mind.

  1. μ=50\mu = 50, σ=5\sigma = 5, t=15t = 15Right so far.
  2. “Chebyshev: P(∣X−50∣≥15)≤σ/t2P(|X - 50| \ge 15) \le \sigma/t^2.”The slip that causes the mistake: the numerator is the variance σ2=25\sigma^2 = 25, which is what makes the two sides of the inequality the same units.
  3. P(∣X−50∣≥15)≤5225≈0.0222P(|X - 50| \ge 15) \le \dfrac{5}{225} \approx 0.0222The distribution of Problem 3 with k=3k = 3, putting 118\tfrac1{18} at each of 3535 and 6565 and the rest at 5050, has variance 2525 and P(∣X−50∣≥15)=19≈0.111P(|X - 50| \ge 15) = \tfrac19 \approx 0.111, five times the claimed bound.

3. Dividing by n instead of √n

The average divides the sum by nn, and the same nn seems to divide the noise.

  1. Var⁡(gˉ)=4/B\operatorname{Var}(\bar g) = 4/BRight so far: Problem 8.
  2. “So the standard deviation of gˉ\bar g is 2/B2/B.”The slip that causes the mistake: the variance is divided by BB, so the standard deviation is divided by B\sqrt B.
  3. a batch of B=20B = 20 gives standard deviation 0.10.1At B=20B = 20 it is 2/20≈0.4472/\sqrt{20} \approx 0.447, more than four times the target. The batch that gives 0.10.1 is 400400.

4. Averaging correlated samples as if they were independent

The formula σ2/n\sigma^2/n is the one remembered, and the samples in Problem 9 each have variance σ2\sigma^2.

  1. n=100n = 100 samples, each with variance 11Right so far.
  2. “Var⁡(Xˉ)=σ2/n=0.01\operatorname{Var}(\bar X) = \sigma^2/n = 0.01, so the average has standard deviation 0.10.1.”The condition that is missing: σ2/n\sigma^2/n needs the covariances to be 00. Here every pair has covariance 0.10.1.
  3. standard deviation of Xˉ\bar X =0.1= 0.1It is 0.109≈0.330\sqrt{0.109} \approx 0.330, more than three times larger. Error bars computed this way look tight on data that is far less informative than its size suggests.

5. Expecting the coin to even out

The law of large numbers says the proportion of heads tends to 12\tfrac12, and after a run of heads it seems that tails must now be due.

  1. After 100100 flips there have been 6060 headsRight so far.
  2. “To bring the proportion back to 12\tfrac12, the coming flips must favor tails.”The habit that causes the mistake: reading a statement about the long-run proportion as a force acting on the next flips. Each flip is still fair.
  3. the next 100100 flips are expected to give fewer than 5050 headsThey are expected to give exactly 5050. After 10 00010\,000 more flips the expected total is 50605060 heads out of 10 10010\,100, a proportion of 0.5010.501: the excess of 1010 is still there in expectation, but it is swamped by the new flips, not canceled.

Print this set: law-of-large-numbers-and-chebyshevs-inequality.pdf (problems, answers, and worked solutions on separate pages).