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 dice. The histogram shows how those averages spread around the true mean, 3.5.
- Raise and watch the spread shrink as . 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 to within about 10%. Roughly how many bits must you send?
About . The error count is close to Poisson, so if you expect errors the count wobbles by , a relative error of . For 10% you need errors, and at one per million bits that's bits. Sending only bits would show about one error, which says almost nothing.
Name it
Two inequalities
Markov. For a variable that's never negative, the chance of being large is limited by the mean:
Chebyshev. For any variable with mean and standard deviation ,
It follows from Markov applied to . 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 of independent draws, each with mean and variance , has
The weak law of large numbers
Chebyshev applied to :
The average converges to the mean. Long-run frequency is the special case where each is 1 when an event happens and 0 otherwise, so is the fraction of trials where it happened and .
How many samples
- Guaranteed (Chebyshev): to miss by more than with probability at most , take .
- Typical (Gaussian, by the central limit theorem): the average is within with the usual Gaussian odds, so ; for about 95%.
- Rare events: an estimated probability has relative error about , 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
- One die's variance.
- Chebyshev's bound.
- Spread of the average. so 0.5 is .
- Gaussian estimate.
- 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 with a 1σ error of 20%?
Show the solution
- Errors needed. A relative error of needs errors.
- Bits needed. At per bit that's
Answer the test must send bits.
Worked example
A Monte Carlo run estimates a failure probability near 0.01 with trials. How accurate is it?
Show the solution
- Standard deviation of the estimate. The estimate is an average of yes/no outcomes, so about 10% of .
- More trials. Halving that error takes four times as many trials.
- Rare events. Rare events need many trials, roughly for 10% accuracy.
Answer the estimate has a standard deviation of 0.00099, about 10% of .
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 ?
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 ?
Check
Averaging independent readings, each with standard deviation .
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?
Each reading carries its own random error. In a sum of readings the errors are independent, so their variances add: the sum's spread grows only as while the sum itself grows as . Dividing by to form the average leaves a spread of , which shrinks as more readings come in. Positive and negative errors increasingly cancel. A single reading has no partner errors to cancel with, so its spread stays .
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.