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

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 a and b. The histogram is the sum; the line is the convolution of the two flat densities.
  • With a much smaller than b the sum is nearly flat. Make a=b: 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?

Name it

Mean and variance of a sum

For any random variables, E[X+Y]=E[X]+E[Y]. For independent ones (or merely uncorrelated, lesson 22), variances add too:

Var(X1+⋯+Xn)=σ12+⋯+σn2

So n identical independent errors give a total spread of σn, while the worst case grows as n.

The distribution of a sum

If X and Y are independent with densities pX and pY, the density of S=X+Y is their convolution:

pS(s)=∫pX(x)pY(s−x)dx

For each total s, add up every way of splitting it as x plus s−x. 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 partsSum
Gaussian, means μi, variances σi2Gaussian, mean ∑μi, variance ∑σi2
Poisson, means λiPoisson, mean ∑λi
binomial, same p, ni triesbinomial, ∑ni 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, 3σ 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 3σ statistical limit.

Show the solution
  1. One resistor. Each error is uniform over ±10 Ω, with σ=2012=5.77Ω
  2. The total. σ=5×5.77=12.9Ω
  3. Compare. The statistical limit is 3σ=38.7 Ω, against a worst case of 50 Ω.
  4. With 20 resistors. The gap widens: 3σ=77 Ω against 200 Ω.

Answer the 3σ limit is 38.7 Ω, against a worst case of 50 Ω.

Worked example

X and Y are independent and uniform on [0,1]. What is the chance their sum exceeds 1.5?

Show the solution
  1. The sum's density. It's a triangle on [0,2] peaking at 1.
  2. Area above 1.5. It's a small triangle with base 0.5 and height 0.5: 0.5×0.52=0.125
  3. Check. Equivalently, the corner of the unit square above the line x+y=1.5 has area (2−1.5)22=0.125

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
  1. 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.
  2. Area below 0.5 ms. 12(0.5)(0.5)=0.125
  3. 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

X and Y are independent and uniform on [0,1]. What is P(X+Y>1.2)?

Check

X is Gaussian with mean 1 and standard deviation 0.4; Y, independent, has mean 3 and standard deviation 0.3. What is P(X+Y>5.6)?

Check

25 independent errors, each with standard deviation 2, are added. What is the standard deviation of the sum?

Check

X and Y are independent with densities pX and pY. What is the density of X+Y?

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 [0,1].

Step 1

What is the chance their total is below t (for t≤1)?

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 n but the typical error only as n?

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.