1.3.14 · D4Probability & Statistics

Exercises — Law of large numbers

2,553 words12 min readBack to topic

Notation reminders, stated in words:

  • = "the probability that something happens", a number between and .
  • = the distance between and , always (it ignores which is bigger).
  • means "at least", means "at most".

Level 1 — Recognition

L1.1

Which statement is the Weak Law of Large Numbers? (a) (b) (c) for large

Recall Solution

(b). The Weak Law talks about a probability shrinking to zero as grows: for any tolerance , the chance of missing by that much fades away. Option (a) is the Strong Law (a statement about a single infinite run settling forever). Option (c) is simply false — the average never equals exactly, it only concentrates near it. Answer ::: (b)

L1.2

An i.i.d. sample has . What is for ? What is the standard error?

Recall Solution

. The standard error is its square root: . Equivalently . The average is tighter than a single draw (). Var ::: 0.09 SE ::: 0.3

L1.3

True or false: increasing changes .

Recall Solution

False. for every — averaging never shifts the centre, it only shrinks the spread. This is exactly why the average is an unbiased estimate of (see Expected Value and Bias-Variance Tradeoff). Answer ::: False


Level 2 — Application

L2.1

A fair die is rolled times, = the face value. For one die and . Bound using Chebyshev.

Recall Solution

Plug into with , , : So at most about a 12.2% chance the average roll is off by or more. Bound ::: ≈ 0.1215

L2.2

Coin flips, with . How large must be so that ?

Recall Solution

Set the Chebyshev bound to the target: . Compute , so the left side is . Now (because ), leaving . Solve: . You need flips (Chebyshev is conservative; the tighter Central Limit Theorem needs far fewer). n ::: 2000

L2.3

A sensor gives readings with . You want the sample-mean error with probability at least (i.e. failure ). Find the minimum .

Recall Solution

Chebyshev: with , , . The left side is . Since (because dividing by is the same as multiplying by , and ), this becomes . Minimum readings. n ::: 640


Level 3 — Analysis

L3.1

You currently sample and your standard error is . Your boss wants the error halved. By what factor must you increase ?

Recall Solution

. To make half as large you need , i.e. . So multiply by 4 (from to ).

The figure below plots the standard error against sample size (with ). Follow the magenta curve: doubling barely dents the height, and the two marked points show that dropping from to the same error halved requires jumping all the way to (the violet and orange dots). The curve flattens brutally to the right — that flatness is the "precision costs quadratically" lesson, because the last slice of accuracy demands the most data.

Figure — Law of large numbers
Factor ::: 4

L3.2

Two estimators of the same : estimator A averages i.i.d. draws with ; estimator B averages i.i.d. draws with . Which has the smaller standard error?

Recall Solution

. . A is tighter (), even though B has the samples — because B's per-draw noise is larger. Sample size and variance both matter; more data cannot always outrun a noisier source. Smaller SE ::: Estimator A (0.2 vs 0.25)

L3.3

Take a fair coin flipped times, with for heads, for tails, so and . Chebyshev bounds by , yet the true probability is only . Explain the gap. Which theorem produces the tighter number, and why is it allowed to be tighter?

Recall Solution

First reproduce the loose bound so it is self-contained: with , , , Chebyshev only uses the variance — it makes no assumption about the shape of the distribution, so it must stay safe for the worst-case shape. That safety costs sharpness, giving the loose .

The Central Limit Theorem adds a real assumption: for large , is approximately normal with SE . Then is standard errors out, and the two-tailed normal tail beyond SE is . Because CLT knows the bell shape, it can commit to a much smaller number. Tighter theorem ::: Central Limit Theorem (uses the normal shape, not just variance)


Level 4 — Synthesis

L4.1 (Monte Carlo)

You estimate by drawing and averaging . Suppose so . How many samples guarantee, via Chebyshev, that ?

Recall Solution

Use the worst-case variance so the guarantee holds no matter what is. , so the left side is . Now (because ), giving . . Need 1,250,000 samples. This is the pessimistic Chebyshev count behind Monte Carlo Methods; CLT-based error bars are much smaller in practice. n ::: 1,250,000

L4.2 (SGD mini-batch)

Stochastic Gradient Descent estimates the true gradient by averaging per-example gradients (i.i.d., each with variance per coordinate). If a batch of gives gradient-noise standard deviation , what batch size gives noise ?

Recall Solution

The averaged-gradient noise scales as , so noise . To divide noise by we need , i.e. . Batch size 256. Notice more compute buys only less noise — the same tax that governs all LLN estimates, and why huge batches show diminishing returns. Batch size ::: 256

L4.3 (Bootstrap)

In Bootstrap Sampling you resample your dataset times to estimate the standard error of a statistic. If resamples give a Monte-Carlo SE of on that estimate, roughly what drives it to ?

Recall Solution

The bootstrap's own Monte-Carlo error also obeys . To cut to is a factor of , needing , so . About 1600 resamples. B ::: 1600


Level 5 — Mastery

L5.1 (Where LLN quietly fails)

The Cauchy distribution has a well-defined median but no finite mean ( does not exist). Does the sample mean converge as ? Explain using the toolkit's assumptions.

Recall Solution

No — it does not converge. Every version of the Law we built assumes a finite (and Chebyshev also needs finite ). The Cauchy distribution violates the very first hypothesis, so the Law does not apply, and in fact keeps wandering forever — a single extreme draw can dominate the whole average no matter how large is. Lesson: the guarantee is conditional. Heavy tails (infinite variance, or worse, infinite mean) break LLN. Always check the hypotheses before trusting an average. Converges? ::: No — mean is undefined, LLN's assumptions fail

L5.2 (Absolute vs relative error)

You flip a fair coin times. Show that the fraction of heads concentrates at , yet the absolute count of heads deviates from by a growing amount. Give the growth pattern of each.

Recall Solution

Let = total heads, = fraction. Recall SD = standard deviation = square root of variance.

  • Fraction: . This shrinks like — multiply by and it halves — so the fraction concentrates at . ✓
  • Count: . This grows like — multiply by and it doubles — so it heads to infinity.

So the typical gap between heads-count and grows like , even while the fraction's gap from shrinks like . Both are true at once — this is exactly why "I'll get exactly heads" is wrong. Fraction error growth ::: shrinks like 1/√n Count error growth ::: grows like √n

L5.3 (Reading an observation correctly)

You flip a fair coin times and see heads. Is this strong evidence the coin is biased? Quantify with standard errors.

Recall Solution

Under a fair coin, has and . The observed fraction sits at A deviation of SE or more happens roughly of the time for a fair coin (normal approximation). That is not strong evidence of bias — it is a mildly unusual but perfectly ordinary result. Concluding "biased!" here is the gambler's-fallacy reflex; you should build a proper confidence interval and demand a much larger deviation (say SE or more) before doubting the coin. Conclusion: → not strong evidence; a fair coin produces results this far out about of the time. z ::: 2 standard errors → not strong evidence


Recall Self-test checklist
  • Can you restate WLLN vs SLLN in words? ::: WLLN: probability of missing by → 0. SLLN: a single run settles at with probability 1.
  • What must you multiply by to halve the error? ::: 4.
  • What breaks the Law entirely? ::: Infinite mean or infinite variance (heavy tails, e.g. Cauchy).