Glossary / Variance and standard deviation
Two cities have the same average temperature over the year: +15°. In one it feels like May all year round. In the other the winters are bitterly cold and in summer the asphalt melts. The average is the same, yet life there is completely different. A second number is missing: how far from the average the values usually are.
“In plain words” is hidden on all puzzles.
Each line is the temperature over 365 days. Both cities are made up, and both average exactly +15° over the year. Move the slider and make the weather in city B swing harder. The average won't move by a hundredth of a degree.
city Acity Baverage, +15°
That is why the average needs a companion number: how far values usually stray from it. It is called the standard deviation, and its square is the variance.
“Rigorous” is hidden on all puzzles.
A three-step recipe. Find the average. For each value, work out how far it is from the average and square it, so the minuses don't cancel the pluses. Average those squares: that is the variance. Its square root is the standard deviation σ, and it is back in the same units as the data.
14, 15, 16, 15, 15 → average 15
deviations −1, 0, 1, 0, 0
squares 1, 0, 1, 0, 0 → variance 2 / 5 = 0.4 deg²
σ = √0.4 ≈ 0.6°
−5, 35, 15, −10, 40 → average 15
deviations −20, 20, 0, −25, 25
squares 400, 400, 0, 625, 625 → variance 2050 / 5 = 410 deg²
σ = √410 ≈ 20.2°
Variance is measured in "degrees squared", which is hard to picture. That is why everyday talk uses σ: "in city B the temperature is usually about 20 degrees away from the average". Mathematicians prefer the variance because it is easier to calculate with, as the "Deeper" layer shows.
Both routes take half an hour on average. The first almost always takes 26–34 minutes. The second usually takes 15–30, but roughly once a week there is a jam and then it's an hour. Each dot is one working day out of 250. How many minutes before work do you need to leave?
“Deeper” is hidden on all puzzles.
Var X = E[(X − μ)²] = E[X²] − 2μ·E[X] + μ² = E[X²] − (E[X])²
Variance is "the mean of the squares minus the square of the mean". For a die: E[X²] = (1 + 4 + 9 + 16 + 25 + 36) / 6 = 91/6, and (E[X])² = 3.5² = 12.25. The variance is 35/12 ≈ 2.92, σ ≈ 1.71.
The same for city B in the first simulation, at the current slider position: E[X²] = –, (E[X])² = 15², so the variance is – deg², and σ = –°.
Var (X + Y) = Var X + Var Y for independent X and Y ⇒ σX+Y = √(σX² + σY²)
The bus varies by σ = 3 minutes, the metro by σ = 4. The whole trip varies not by 7 but by √(9 + 16) = 5 minutes: the delays mostly don't coincide, and sometimes one cancels the other. Two dice together have a variance of 35/6 and σ ≈ 2.42, not 1.71 + 1.71 = 3.42.
In the city simulation, city B's temperature is the sum of the season and independent day-to-day weather. Right now the season gives σ = –°, the weather σ = –°. Adding the deviations would give –°, but the real σ = –°, exactly √(– + –).
Roll n dice and take the average score. Repeat this 4,000 times and look at how those averages are spread. The rule for adding variances says the sum of n dice has a variance of n · 35/12, so the average (the sum divided by n) has σ / √n.
To halve the spread you need four times as many dice; to cut it tenfold, a hundred times as many. The square root makes precision expensive.
One more detail: when σ is estimated from a sample and the true average is unknown, the sum of squares is often divided by n − 1 instead of n. Deviations from the sample average are slightly smaller than from the true one, and n − 1 corrects for that.
The middle value: line everyone up in order, and half are below it, half above.
A millionaire walks into a bar: the average income shoots up, the median barely moves.
The sum of all values divided by how many there are: what everyone would get if it were shared equally.
Almost everyone has more legs than average: the average is a little under two.
The average result you can expect if you repeat the same thing very many times.
A die's expected value is 3.5, yet no face shows 3.5.
A number from −1 to +1 showing how closely two quantities move together.
In summer both ice cream sales and drownings go up. Ice cream isn't to blame: the heat drives both.
A bell-shaped distribution: most values sit near the mean, and the further away, the rarer.
Every ball on a Galton board falls at random, yet thousands of balls always build the same bell.
The more repetitions, the closer the share of an outcome gets to its true probability.
The share of heads creeps towards 50%, while the gap between heads and tails in coins usually grows.
The chance of an event given that something else is already known.
Almost all NBA players are tall, but almost all tall people are not NBA players.
Events are independent if knowing about one doesn't change the chances of the other.
After five heads in a row tails is no more likely: the coin remembers nothing.
How many times you multiply the base by itself to get a number: log₂ 8 = 3, because 2 · 2 · 2 = 8.
A sheet of paper folded in half 42 times would be thicker than the distance to the Moon.
A sample some people get into more easily than others, so it describes everyone badly.
In 1936 a magazine polled millions of Americans and still picked the wrong election winner.
How often chance alone would produce a gap at least as big as yours if there were really no difference.
When there is no effect at all, p below 0.05 turns up as often as p between 0.50 and 0.55.
A range around a measured number, built by a method that covers the true value in a chosen share of samples, such as 95%.
Of twenty honest 95% intervals, on average one misses the truth, and none of them knows whether it is the one.
The probability that a test notices a real effect of a given size. A power of 80% means the test misses one working effect in five.
A weak A/B test that does find an effect almost always exaggerates it: a real +10% shows up on the dashboard as +24%.
How far an average or a rate computed from a sample usually misses the truth: σ divided by the square root of the sample size.
Halving the error takes four times as much data.