Math paradoxes

Glossary / Variance and standard deviation

Glossary · variance

Same average temperature, same weather?

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 wordspictures, analogies, small numbers

“In plain words” is hidden on all puzzles.

The two-city paradox

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°

Yearly average · A and B–
Days of frost · A and B–

The average hides the spread

  • The average temperature of a hospitalSome patients have a fever, others run cold, and on average you get a perfect 36.6 °C. Ukrainians even have a saying, "the average temperature across the hospital": the average can look healthy while no one actually is.
  • A river that is knee-deep on averageAn average depth of half a metre says nothing about the hole in the middle. For someone wading across, that hole is what matters.

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.

Rigoroustables, charts, formulas

“Rigorous” is hidden on all puzzles.

The average squared deviation

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.

Five days in city A

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°

Five days in city B

−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.

Two 30-minute routes to work

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?

Average time · 1 and 2–
Standard deviation · 1 and 2–
Late days a year · 1 and 2–

When the spread matters more than the average

  • When to leave homeThe time buffer you need depends not on the average trip but on its spread. Two routes with the same average need very different buffers.
  • Money that swingsOne year +50%, the next −50%: the average return is zero, yet 100 hryvnias have become 75. With the same average, a bigger spread eats money. This is arithmetic, not advice on where to invest.
  • A recipe and an ovenAn oven that holds 180 °C on average but wanders between 140° and 220° will burn the top of a cake and leave the middle raw. The average is right, the result is not.
  • An insurance companyThe average payout sets the price of a policy. How much money to keep in reserve for a bad year is set by the spread of payouts.
  • Parts in a factoryBolts that are exactly the right size on average but with a large spread won't fit half the nuts. Quality in manufacturing is first of all a small spread.
  • And when the average is enoughWhen only the total over many repeats matters: how much fuel a year takes, how much pizza for 30 people. The spread of single cases largely cancels out in such a total.
Deepergeneralisations, theory, history

“Deeper” is hidden on all puzzles.

A shorter formula

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 σ = –°.

Variances add, standard deviations don't

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 √(– + –).

An average of n measurements wobbles √n times less

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.

σ of the averages · measured–
Formula 1.71 / √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.

Where it shows up

Other terms