Math paradoxes

The bus paradox A bus every 10 minutes. How long will you wait?10 minutes on average, not 5.

A bus comes every 10 minutes on average, but with no timetable: the gaps are random, sometimes 2 minutes, sometimes 25. You walk up to the stop at an arbitrary moment. How long do you wait on average? Lock in your answer, then check it against a bus line, a simulation of 100,000 riders and the explanations.

A bus comes every 10 minutes on average, but with no timetable: the gaps are random, sometimes 2 minutes, sometimes 25. You walk up at an arbitrary moment and wait 10 minutes on average, a whole average gap. Long gaps take up more of the clock, so you are more likely to land in one. The gap between buses that you land in lasts 20 minutes on average.

Make a guess
10 minaverage wait
20 minthe gap you land in
5 minwith a strict timetable
The puzzle

A stop, buses with no timetable, and you

In probability theory this puzzle is called the waiting time paradox or the inspection paradox. The setup is very simple.

In probability theory this puzzle is called the waiting time paradox or the inspection paradox: when you "inspect" the line at a random moment, you see not a typical gap but a longer one.

  1. 1

    The bus line

    Buses on one line reach your stop every 10 minutes on average. Over five hours, from 7:00 to 12:00, 30 of them come by on average.

  2. 2

    No timetable

    There is no timetable. Each bus arrives independently of the others, so the gaps vary a lot: sometimes two buses come 2 minutes apart, sometimes nothing shows up for 25 minutes. This kind of stream is called a Poisson process. A Geiger counter clicks with the same kind of randomness.

  3. 3

    You arrive

    You don't check any app. You walk up to the stop at an arbitrary moment that has nothing to do with the buses, and you take the first bus that comes.

  4. 4

    The question

    How many minutes do you wait for a bus on average?

Intuition says

"Half the gap, so 5 minutes"

In fact it is 10 minutes. Five minutes would be right for buses that keep a strict timetable. When the gaps are random, you land in long ones more often, and the wait doubles.

What we assume

  • The average gap between buses is 10 minutes.
  • Buses are independent: when the last one came tells you nothing about the next.
  • Your arrival is unrelated to the buses: you can't see them coming and don't know when the last one left.
  • You board the first bus, and there is room for everyone.
0minutes →60

One hour of such a line might look like this: seven buses, gaps from 2 to 22 minutes.

Round 1 · Guess

How many minutes will you wait?

Lock in your answer before reading on.

Lock in your answer before reading on. Then compare it with a timetable and with random buses.

6
05101520

A breakdown of your answer will appear here.

Round 2 · Go to the stop

Five hours of one bus line

Each row is one hour, from 7:00 to 12:00. The small blocks are buses. Tap the line anywhere to "arrive" at the stop at that moment, or let chance pick the moment. The gap you landed in is highlighted in yellow, and the magenta arrow shows how long you waited.

Arrivals0
Average wait–
Your average gap–

Your average wait

The day's average gap is close to 10 minutes. But your "own" average gap, the average length of the gaps you landed in, is clearly longer. Switch to the timetable: every gap there is 10 minutes, and the wait drops to 5.

"Exact for this day" averages the wait over every moment from 7:00 to 12:00 for these particular buses. The more arrivals, the closer your average gets to it.

Round 3 · Simulation

100,000 riders on a line with random buses

The computer builds a line of about 100,000 random buses, one every 10 minutes on average, and sends riders to the stop at random moments. For each one we record the wait and the length of the gap they landed in. Lines are the exact formulas, dots are the simulation.

How long riders waited

exact: e−t/10/10 simulation

Which gap they landed in

exact: t·e−t/10/100 riders' gaps all gaps of the line
Average wait
–
exact 10 min
A rider's gap
–
exact 20 min
An ordinary gap
–
exact 10 min
Waited over 10 min
–
exact 1/e ≈ 36.8%

Left: the wait has the same distribution as an ordinary gap between buses, with mean 10 minutes. Right: the gaps riders landed in (dots) are shifted to the right of all the line's gaps (grey line). Short gaps hardly ever show up, because they are hard to land in. Vertical ticks mark the means.

Simulation versus exact values

Round 4 · Explanations

Long gaps catch more riders

The slip is not in the arithmetic but in the sample. "The average gap" is computed over buses, while a rider sees a gap picked by time.

Length-biased sampling

A long gap covers more of the clock

2325 minutes between buses

Four buses in half an hour give three gaps: 2, 3 and 25 minutes, 10 on average. Spread 12 riders evenly, one every 2.5 minutes. The short gaps get one rider each, the long gap gets ten. A rider picks a moment, not a bus, and the long gap takes up 25 of the 30 minutes.

So the gap you land in is chosen with weight proportional to its length. That is what length-biased sampling means.

Doing the numbers

2, 3 and 25 minutes give 10.6, not 5

GapChance to landWait inside
22/301
33/301.5
2525/3012.5

Inside a gap you wait half of it on average. But the average has to be weighted by the chance of landing there: (2 · 1 + 3 · 1.5 + 25 · 12.5) / 30 = 319/30 ≈ 10.6 minutes. The gap you land in is (2² + 3² + 25²) / 30 ≈ 21.3 minutes long on average.

Half the average gap, 5 minutes, would only come out if all three gaps were 10 minutes.

No memory

The bus doesn't know how long you've waited

For Poisson buses there is an even shorter argument. Buses are independent, so in every minute the chance of a bus is the same, however long ago the last one came. Already waited 10 minutes? The expected remaining wait is still 10.

So the moment you arrive changes nothing: from any point to the next bus is, on average, as long as from one bus to the next, 10 minutes. This property is called memorylessness. Among continuous distributions only the exponential has it.

Back and forward

Where 20 minutes comes from

≈ 10≈ 10

Look both ways from the moment you arrive. Forward to the next bus: 10 minutes on average. Back to the previous one: also 10, because a Poisson stream played backwards looks the same. Together, the gap you are standing in lasts 20 minutes on average, twice an ordinary gap.

No contradiction: an ordinary gap really is 10 minutes on average, but you are not standing in an ordinary one.

The same effect everywhere

The average class as the dean sees it and as students see it

A university runs five courses: four seminars of 10 students and one lecture of 160. The dean computes the average course size: (4 · 10 + 160) / 5 = 40. Now ask all 200 students how many people are in their course. 40 students say "10" and 160 say "160". The average answer is (4 · 10² + 160²) / 200 = 130.

It's the same arithmetic as with the buses: a big course shows up in the survey as many times as it has students, just as a long gap "catches" riders in proportion to its length. And in the friendship paradox a person with many friends appears on many friend lists, so your friends have more friends than you on average.

For formula lovers

The wait depends on how much the gaps vary

Gaps t₁, t₂, …, tₙ: chance to land in tᵢ = tᵢ / Σt, wait inside it = tᵢ / 2
E[W] = Σ tᵢ · (tᵢ / 2) / Σ tᵢ = E[T²] / (2 · E[T]) = (E[T] / 2) · (1 + CV²),   CV = σ / E[T]
The gap you land in: g(t) = t · f(t) / E[T],   mean E[T²] / E[T] = E[T] · (1 + CV²)
Timetable: CV = 0  →  E[W] = 10/2 = 5
Poisson: f(t) = e−t/10/10, E[T²] = 200, CV = 1  →  E[W] = 200/20 = 10,   g(t) = t · e−t/10/100, mean 20
Gamma gaps with shape k: CV² = 1/k  →  E[W] = 5 · (1 + 1/k);   k = 1/2 (bunching) → 15

The wait equals half the average gap only when there is no spread (CV = 0). Each unit of CV² adds another half of the average gap. In a Poisson stream the standard deviation of a gap equals its mean, so CV = 1 and the wait doubles. When buses bunch up, the spread is even larger and you wait longer than the average gap.

Round 5 · Going further

From a timetable to buses that travel in pairs

Poisson buses are just one point on a scale. Real lines can be steadier, or worse. And biased sampling hides in many places besides bus stops.

How regular are the buses?

Wait, exact
Simulation, 100,000 riders
CV

The average gap is always 10 minutes. Only the spread changes. Gaps follow a gamma distribution with shape k: k = 1 gives Poisson buses, large k approaches a timetable, k < 1 gives buses that clump together. The curve shows 5 · (1 + CV²).

Why buses bunch

Delays feed themselves

Even a line with a timetable rarely stays even. If a bus runs a little late, more people are waiting at each stop. Boarding takes longer, so it falls further behind. The bus behind it picks up fewer people, runs faster and catches up. In the end two buses arrive back to back, and then there is a long gap with none.

This is called bus bunching. For riders it is worse than plain random buses: with the same 10-minute average gap, the wait goes above 10 minutes. Slide to the right and watch the numbers.

The left end shows why transit agencies care about regularity. Going from random buses to a timetable cuts the average wait by 5 minutes without adding a single bus.

Class-size calculator

The dean's average
The student's average
Survey of 10,000 students

Two strips, two samples

A random course or a random student

The top strip shows courses the way the dean sees them: each course gets the same space. The bottom strip shows them the way students do: a course's width is proportional to its number of students. Poke the top strip at random and you hit a typical course. Poke the bottom one and you most likely hit a big one.

The bottom strip is the same bus line: courses instead of gaps, students instead of minutes. The formula is the same too: the average a student sees is E[s²] / E[s], where s is the course size.

Both numbers are honest; they answer different questions. The dean asks how many students an average course has. The student asks how many people an average student shares a course with.

Where else the inspection paradox hides

The mechanism is always the same: something long, big or crowded is more likely to end up in our sample, because we "inspect" the world at a random moment or through a random person.

SituationWhat we seeWhy it's biased
Gym, flight, café"It's always packed"A busy hour holds more visitors, and each of them sees a crowd. Hardly anyone sees the empty room.
A prison surveyLong sentencesAn inmate with a long sentence stays inside longer, so on survey day he is more likely to be there than someone serving a few months.
A hospital on a given dayLong staysSame thing: a patient staying a month is present on 30 "inspection days", a one-day patient on just one.
Cancer screeningSlow tumoursA slow tumour lives without symptoms for a long time, so a routine check is more likely to catch it. This is called length time bias.
A raceEveryone is very fast or very slowA runner at your own speed never passes you and you never pass them, so you barely notice them. The ones going by are those whose speed is very different.
FriendsFriends have more friendsA person with many friends appears on many friend lists. See the friendship paradox.
Bonus · Fun facts

Things to tell your friends

1966

A paradox from Feller's textbook

The second volume of William Feller's classic textbook "An Introduction to Probability Theory and Its Applications" has a section called "Waiting time paradoxes". It works through buses with exponential gaps: a "symmetry" argument gives half the average gap, while memorylessness gives the whole gap. The second answer is the right one.

31 → 56

"The Inspection Paradox Is Everywhere"

That is the title of Allen Downey's 2015 post on his blog "Probably Overthinking It". Using Purdue University's class-size data for 2013–14, he worked out that the average course has about 31 students, while the average student sits in a course of about 56.

7.8 → 8.8

The real Boston subway

In the same post Downey recorded the arrival times of 70 trains on Boston's Red Line between 4 and 5 pm over several days. The average gap between trains was 7.8 minutes, while the gap a rider lands in averaged 8.8 minutes. Trains run more evenly than Poisson buses, so the effect is smaller, but it is there.

1991

Why your friends have more friends

The sociologist Scott Feld published "Why your friends have more friends than you do" in the American Journal of Sociology. The friendship paradox runs on the same mechanism as the buses: people with many friends get "inspected" more often because they are on many lists.

1 + 1

Buses in pairs

Bus bunching, when buses on one line arrive in groups, is a well-known transit problem. It is also called clumping, convoying or platooning. A late bus picks up more riders and falls further behind, while the one following catches up. So if you waited a long time and then two buses came together, it was most likely no coincidence.

Screening

A bias in medicine

In medical statistics, length-biased sampling goes by the name length time bias. Routine screening is more likely to find tumours that grow slowly and stay without symptoms for a long time. As a result, survival among screen-detected cases can look better even when screening itself does not extend lives.

Discussion

What do you think?

Share your own explanation, an objection or a variant of the puzzle. You need a GitHub account to comment.

Newsletter

New puzzles, explanations and discussions

I keep adding new puzzles, new ways to explain them and write-ups of the discussions they start. Leave your email and I'll write when something new is out. No spam, one-click unsubscribe.

The sign-up form will appear here soon.