A11 · Lesson 25 · Sums of random variables
Convolution, tolerance stack-up and why sums turn Gaussian
Five 1 kΩ resistors, each within ±1%, are put in series. The worst case is off by ±50 Ω, but you'd have to make thousands of strings to see that. What does a typical string look like? The total is a sum of independent random errors, and sums have a simple rule for their mean and spread and a less obvious one for their shape: the density of a sum is the convolution of the densities, the same operation A10 used for filters. Repeated convolution is also why sums of almost anything end up Gaussian.
- Each draw adds two independent errors, uniform over widths and . The histogram is the sum; the line is the convolution of the two flat densities.
- With much smaller than the sum is nearly flat. Make : the convolution of two equal rectangles is a triangle.
- The sum's standard deviation is the root-sum-square of the parts. Check it against the readout.
Predict
Five resistors in series each have an error uniform within ±10 Ω, independently. Roughly what is the standard deviation of the total error?
About 13 Ω. One error, uniform over 20 Ω, has standard deviation Ω. Five independent ones add in variance, giving Ω. The worst case of 50 Ω is almost four standard deviations out, and a sum like this is nearly Gaussian, so fewer than one string in 10,000 gets anywhere near it.
Name it
Mean and variance of a sum
For any random variables, . For independent ones (or merely uncorrelated, lesson 22), variances add too:
So identical independent errors give a total spread of , while the worst case grows as .
The distribution of a sum
If and are independent with densities and , the density of is their convolution:
For each total , add up every way of splitting it as plus . Two flat densities convolve to a trapezoid, or a triangle when they're equal. For discrete counts the integral becomes a sum, which is how two dice give a triangle from 2 to 12.
Some families are closed under addition:
| Independent parts | Sum |
|---|---|
| Gaussian, means , variances | Gaussian, mean , variance |
| Poisson, means | Poisson, mean |
| binomial, same , tries | binomial, tries |
Toward the Gaussian
Every convolution smooths. Convolve enough independent pieces, none dominating, and the result approaches a Gaussian with the summed mean and variance, whatever the pieces looked like: the central limit theorem of lesson 16, seen as repeated convolution.
Tolerance stack-up
Designers combine part tolerances two ways:
- worst case: add the limits, guaranteed but pessimistic;
- statistical (RSS): add the variances, and design for a margin of, say, of the total.
For many independent parts, the statistical method is far less pessimistic and, thanks to the Gaussian shape of the sum, still very safe.
Worked example
Five 1 kΩ resistors in series each have errors uniform within ±1%. Compare the worst case with a statistical limit.
Show the solution
- One resistor. Each error is uniform over ±10 Ω, with
- The total.
- Compare. The statistical limit is Ω, against a worst case of 50 Ω.
- With 20 resistors. The gap widens: Ω against 200 Ω.
Answer the limit is 38.7 Ω, against a worst case of 50 Ω.
Worked example
and are independent and uniform on . What is the chance their sum exceeds 1.5?
Show the solution
- The sum's density. It's a triangle on peaking at 1.
- Area above 1.5. It's a small triangle with base 0.5 and height 0.5:
- Check. Equivalently, the corner of the unit square above the line has area
Answer the sum exceeds 1.5 with chance 0.125.
Worked example
Two independent delays are each uniform on 0 to 1 ms. What is the chance their total is under 0.5 ms?
Show the solution
- The sum's density. It's the convolution of two uniform densities: a triangle rising from 0 at 0 ms to 1 at 1 ms and back to 0 at 2 ms.
- Area below 0.5 ms.
- Why it's small. Short totals are rare because both delays must be short at once.
Answer the total is under 0.5 ms with chance 0.125.
Check
4 resistors of 1 kΩ, each with an error uniform within ±1%, are in series. What is the standard deviation of the total?
Write units the way you normally would: 1.5 Ω, 1500 mΩ and 0.0015 kΩ are the same answer.
Check
Same string: 4 resistors of 1 kΩ, each within ±1%. What is the worst-case error of the total?
Write units the way you normally would: 1.5 Ω, 1500 mΩ and 0.0015 kΩ are the same answer.
Check
and are independent and uniform on . What is ?
Check
is Gaussian with mean 1 and standard deviation 0.4; , independent, has mean 3 and standard deviation 0.3. What is ?
Check
25 independent errors, each with standard deviation 2, are added. What is the standard deviation of the sum?
Check
and are independent with densities and . What is the density of ?
Check
4 resistors in series each have independent errors of σ = 5 Ω.
(a)
What is the spread of the total?
Write units the way you normally would: 1.5 Ω, 1500 mΩ and 0.0015 kΩ are the same answer.
Check
Two independent delays are each uniform on .
Step 1
What is the chance their total is below (for )?
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°.
Check
Represent a uniform delay on [0, 1) ms by 1000 equal probabilities on a 1 µs grid. Convolve two of them with np.convolve and set p_short to the probability that the total is below 0.5 ms (the first 500 bins).
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Explain why
Why does the worst-case error grow as but the typical error only as ?
The worst case needs every error at its limit in the same direction. Typically the errors are independent, so some push up and some push down and they partly cancel. Variances add for independent errors, so the variance grows as and the standard deviation as . The more parts there are, the more cancellation there is, and the further the worst case lies from anything you'll actually see.
Practice
Keep practicing
9 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.