Glossary / Median and mean
Ten people with ordinary salaries sit in a bar. A millionaire walks in, and the "average person" in the bar suddenly earns hundreds of thousands a month. Nobody cheated: there are simply two ways to say "typical", and they answer different questions.
“In plain words” is hidden on all puzzles.
Each dot is a person, placed by monthly income. The scale is logarithmic: each mark is ten times the previous one, otherwise the millionaire wouldn't fit on the screen.
“Rigorous” is hidden on all puzzles.
Add up all the values and divide by how many there are. It is what everyone would get if everything were shared equally.
1, 2, 3, 4, 100 → (1 + 2 + 3 + 4 + 100) / 5 = 22
Line everyone up in order and take the one in the middle. Half are below, half above.
1, 2, 3, 4, 100 → 3
A single 100 pulled the mean up to 22, though four out of five values are below 5. The median barely noticed it: to the median it makes no difference whether that value is 100 or a million.
It sounds like a mistake, but it is an ordinary property of skewed distributions. Incomes are like that: most people bunch up at the bottom, and a few very rich ones stretch the tail to the right and drag the mean along. Move the inequality slider.
10,000 random incomes from a log-normal distribution with a median of 20 thousand. With no inequality everyone earns the same, and the mean equals the median.
The rule is simple: the median answers "what is it like for a typical person?", the mean answers "how much is there in total, shared among everyone?".
“Deeper” is hidden on all puzzles.
Σ (xᵢ − a)² → min ⇔ a = x̄ = (x₁ + … + xₙ) / n
The derivative in a is −2 Σ (xᵢ − a). It is zero when a is the mean. A square grows fast, so a distant point pulls very hard: a millionaire 5,000 thousand away weighs, squared, as much as hundreds of thousands of ordinary deviations of 10 thousand hryvnias.
Σ |xᵢ − a| → min ⇔ a = median
Move a one step to the right: the distances to all points on the left grow by a step, to all on the right shrink by a step. The sum stops falling when there are as many points on each side. Here every point has one "vote" however far away it is, so the millionaire counts like anyone else.
Statisticians call this the breakdown point. To move the mean anywhere at all, changing one value is enough. To move the median the same way, you have to spoil half the data. That is why the median is called robust and the mean sensitive. Sensitivity is not a flaw: it is exactly what makes the mean right for totals, where every hryvnia counts.
The incomes in the simulation above are log-normal: the logarithm of income is normal, with mean μ and spread σ. For such a distribution everything has an exact formula.
median = eμ · mean = eμ + σ²/2 · share below the mean = Φ(σ/2)
Φ is the share of a normal distribution to the left of a point. For the current slider position: the mean is bigger than the median by –, and – of people are below the mean. Compare with the numbers the simulation got from 10,000 incomes.
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 measure of spread: how far values typically stray from the mean. The standard deviation is its square root, in the same units.
Two towns with the same average temperature: one stays near +15 all year, the other swings from −20 to +50.
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.