A1129 of 55
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

A11 · Lesson 29 · The law of large numbers

Why averages settle, and how many samples you need

To measure a bit error rate of one in a million, how many bits must you send? To estimate a noise voltage's mean to within 1 mV, how many readings? Lesson 1 defined probability as a long-run frequency, trusting that averages settle down. The law of large numbers proves they do, and two simple inequalities, Markov's and Chebyshev's, say how fast, with no assumptions about the distribution's shape. Turned around, they tell you how much data a measurement needs.

  • Each draw is the average of n dice. The histogram shows how those averages spread around the true mean, 3.5.
  • Raise n and watch the spread shrink as 1/n. The readout measures how often an average misses 3.5 by more than ε.
  • Chebyshev's inequality gives a guaranteed upper limit on that chance. How cautious is it compared with what you see?

Predict

You want to measure a bit error rate near 10−6 to within about 10%. Roughly how many bits must you send?

Name it

Two inequalities

Markov. For a variable that's never negative, the chance of being large is limited by the mean:

P(X≥a)≤E[X]a

Chebyshev. For any variable with mean μ and standard deviation σ,

P(|X−μ|≥kσ)≤1k2

It follows from Markov applied to (X−μ)2. These hold for every distribution, so they're cautious: Chebyshev allows a 25% chance of a 2σ miss where a Gaussian has 4.6%. Use them when you don't know the shape, and the Gaussian when you do.

The sample mean

The average Mn=1n(X1+⋯+Xn) of n independent draws, each with mean μ and variance σ2, has

E[Mn]=μσMn=σn

The weak law of large numbers

Chebyshev applied to Mn:

P(|Mn−μ|≥ε)≤σ2nε2→0

The average converges to the mean. Long-run frequency is the special case where each Xi is 1 when an event happens and 0 otherwise, so Mn is the fraction of trials where it happened and μ=p.

How many samples

  • Guaranteed (Chebyshev): to miss by more than ε with probability at most δ, take n≥σ2ε2δ.
  • Typical (Gaussian, by the central limit theorem): the average is within ±zσn with the usual Gaussian odds, so n≈(zσε)2; z=2 for about 95%.
  • Rare events: an estimated probability p^=kn has relative error about 1k, set by the number of events seen, not the number of trials. Plan for enough events.

Worked example

A die is thrown 100 times. Bound the chance that the average misses 3.5 by 0.5 or more, then estimate it with the Gaussian.

Show the solution
  1. One die's variance. σ2=3512=2.92
  2. Chebyshev's bound. P≤2.92100×0.25=0.117
  3. Spread of the average. σ=2.92/100=0.171 so 0.5 is 2.93σ.
  4. Gaussian estimate. 2Q(2.93)=0.0034
  5. Compare. The guarantee is about 30 times more cautious than the reality.

Answer Chebyshev bounds the chance by 0.117, and the Gaussian estimate is 0.0034.

Worked example

How many bits must a test send to measure a BER near 10−5 with a 1σ error of 20%?

Show the solution
  1. Errors needed. A relative error of 1k=0.2 needs k=25 errors.
  2. Bits needed. At 10−5 per bit that's 2510−5=2.5×106bits

Answer the test must send 2.5×106 bits.

Worked example

A Monte Carlo run estimates a failure probability near 0.01 with 104 trials. How accurate is it?

Show the solution
  1. Standard deviation of the estimate. The estimate is an average of N yes/no outcomes, so σ=p(1−p)N=0.0099104=0.00099 about 10% of p.
  2. More trials. Halving that error takes four times as many trials.
  3. Rare events. Rare events need many trials, roughly 100p for 10% accuracy.

Answer the estimate has a standard deviation of 0.00099, about 10% of p.

Check

A current is never negative and averages 2 mA. What upper limit does Markov's inequality put on the chance it exceeds 10 mA?

Check

For any distribution, what is the most the chance of landing 3 or more standard deviations from the mean can be?

Check

Readings have noise 4 mV RMS, independently. What is the standard deviation of the average of 16 readings?

Write units the way you normally would: 1.5 mV, 1500 µV and 0.0015 V are the same answer.

Check

Readings have standard deviation 1. By Chebyshev, how many are needed so their average misses the mean by 0.1 or more with probability at most 0.1?

Check

A simulation runs 100 independent trials of an event with probability 0.1. What is the standard deviation of the estimated probability k/n?

Check

About how many bits must be sent to measure a BER near 1 × 10⁻⁶ with a relative error (1σ) of 0.1?

Check

A Monte Carlo run estimates a probability near 0.001 with 10000 trials.

(a)

What is the estimate's standard deviation?

(b)

What is that relative to p?

Check

Averaging n independent readings, each with standard deviation s.

Step 1

What is the standard deviation of the average?

Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.

Explain why

Why does the average of many independent readings settle down, while a single reading never does?

Practice

Keep practicing

10 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.