Throw two dice and add them. Why is 7 the most likely total? Watch one die’s chances slide across the other’s.
Why two dice make a triangle
One die, the other turned round and slid along it: the bars that line up give a total.
One die on top. Below it, the other die turned round, which slides along: where bars line up, their faces add to the same total.
Describe this picture
Three rows of bars on one axis. The top row is one die, “first die”: six bars of height over the faces 1 to 6. Under it, “second die, turned round”: the other die with its faces in reverse order, which slides along to the right. For each total from 2 to 12, the turned die stops where its faces add to with the faces above; the bars that line up are lit, joined by dotted lines, and their products, each, stack into one bar of the bottom row, “chance of the total”, labelled with its count out of 36. As runs from 2 to 12 that row grows into a triangle: 1, 2, 3, 4, 5, 6, 5, 4, 3, 2, 1, each out of 36, with its peak at 7. Readouts give and its chance. When the clip has finished, a slider, “Total of the two dice, T”, moves the turned die, and the lit bars and the caption follow; at the caption lists , and , a chance of .
Counting the ways
Why does 7 come up more often than 2? There is only one way to throw 2: a 1 and a 1. There are six ways to throw 7: 1 and 6, 2 and 5, 3 and 4, 4 and 3, 5 and 2, 6 and 1. Each of the 36 pairs has chance , so , and .
The picture does the same count with the chances themselves. For a total , the first die shows some and the second shows . If the dice are independent, the chance of that pair is . Add over every :
That sum is a convolution, written . The second die is reversed because as goes up, goes down. After the clip, drag the total to 4: three pairs line up, , and , so .
Means add, always
The mean of a sum is the sum of the means:
This holds whether or not and are independent, because an average of sums is a sum of averages. Two dice have mean , the peak of the triangle.
Variances add, if uncorrelated
Spreads are different. Square the distance of the sum from its mean, and multiply out:
Take the mean of each part. The first two are the variances, and the last is twice the covariance of Covariance and correlation:
When and are uncorrelated, and in particular when they are independent, the covariance is 0 and the variances add. Two dice have variance , so the total has spread .
The correlation matters. Take two variables, each with spread 1. If , the sum has variance . If , they always move together and the variance is 4. If , each cancels the other and the variance is 0: the sum never moves.
Spreads add as squares
So spreads do not add; variances do. Two independent errors with spreads 3 and 4 give a total with variance , so a spread of 5, not 7. It is the right-angle rule for the sides of a triangle, with spreads as the sides.
The same goes for a difference. , so for independent variables the variances still add: the difference of two independent unit-variance variables has variance 2, not 0.
And it explains a fact about dice. Adding a second die doubles the variance, so the spread grows only by , about 1.41 times. That slow growth is where the of The law of large numbers comes from.
How errors spread
A measured length is cm and a width is cm, where each is a spread and the two errors are independent. What is the spread of the area, cm²?
A small error in the length changes the area by about , because the area is length times 10. A small error in the width changes it by about times that error. The two changes are independent, so their variances add:
In general, if a result changes by for each unit change in input , and the inputs have independent errors with spreads , then . This is called propagation of error. It holds well when the errors are small.
Worked example
- Two dice. Mean 7, variance , spread , .
- A total of 4. .
- Correlated parts. Spreads 1 and 1: variance of the sum 3 at , 4 at , 0 at .
- Spreads 3 and 4, independent. The sum has spread 5, not 7.
- A difference. For independent and with variance 1 each, .
- A rectangle. by : area 200, spread .
Where you’ll meet this
An amplifier with two independent noise sources has a total noise power equal to the sum of the two powers, because power is a variance. A machine part built from a stack of pieces, each with a small error in thickness, has a total error whose spread grows like the square root of the number of pieces, not in proportion to it. Engineers rely on this when they set tolerances.
In signal processing · convolution
The sum of this page is the convolution of Discrete convolution: there a filter slides a reversed impulse response along a signal, and here one die’s chances slide along the other’s. The page Finite word-length effects adds up independent rounding errors as variances, exactly as above.
Where this leads · convolution as a matrix
A convolution is also a matrix times a vector, with shifted copies of one list as the columns. The page A matrix moves the plane in the linear algebra course shows that view.
Reference card
| Quantity | Formula | Notes |
|---|---|---|
| Mean of a sum | always | |
| Variance of a sum | the covariance term vanishes if uncorrelated | |
| Spreads | independent; 3 and 4 give 5 | |
| Chances of a sum | convolution, independent | |
| Two dice | over 36 | peak at 7 |
| Error propagation | small independent errors |