Math paradoxes

Glossary / Median and mean

Glossary · median and mean

Who is the "typical" person in the bar?

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

“In plain words” is hidden on all puzzles.

The bar paradox

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.

Median · the typical person–
Mean · everything shared equally–

Almost everyone is "above average"

  • Almost everyone has more legs than averageSome people have fewer than two legs, and nobody has more. So the average is a little under 2, and almost everyone with two legs is already "above average".
Rigoroustables, charts, formulas

“Rigorous” is hidden on all puzzles.

Two numbers "in the middle"

Mean (average)

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

Median

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.

Most people earn less than average

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.

Earn less than the mean–
Mean is bigger than the median by–

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.

When to use which

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?".

  • What a typical person in town earnsMedian. A few millionaires shouldn't make the "typical" salary higher.
  • How much tax the town will collectThe mean times the number of people. Here every millionaire counts.
  • The price of an ordinary flatMedian. One penthouse doesn't make the area pricier for you.
  • How much pizza to order for 30 peopleAverage eaten times 30. The median "forgets" the ones who eat for three.
  • How long the commute usually takesMedian. But for planning a week, the mean: you still have to sit through the rare jams.
  • Class grades with no extreme valuesEither. When a distribution is symmetric, the mean and the median almost coincide.

Two more strange consequences

  • The mean can be impossible"1.5 children per family" is a perfectly fine mean, though no family has half a child. A median always equals a real value or sits between two real ones.
  • Most drivers can be better than averagePeople like to laugh at drivers who think they are better than average. But if a few very reckless drivers drag the average down, most drivers really will be above it. What is impossible is for most to be above the median.
Deepergeneralisations, theory, history

“Deeper” is hidden on all puzzles.

Why they differ: each number minimises something

The mean minimises the sum of squares

Σ (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.

The median minimises the sum of distances

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

How much data you have to spoil

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.

Formulas behind the inequality slider

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.

Where it shows up

Other terms