Buses on a route come every 10 minutes on average. A passenger who turns up at a random moment might expect to wait 5 minutes, half the average gap. If the timetable alternates gaps of 2 and 18 minutes, the average wait is in fact 8.2 minutes. This page explains why a random moment is more likely to fall in a long gap than in a short one, computes the expected wait exactly, and states the assumptions the result depends on.
Key terms
Waiting-time paradox
Definition Buses stop at a station on a timetable that repeats every minutes. In each cycle there are gaps between consecutive buses, of lengths minutes, all positive, with . A passenger arrives at a time chosen uniformly at random over one cycle, without regard to the timetable, and boards the first bus that comes, which always has room and leaves at once. An arrival at the exact moment a bus is there waits , which happens with probability and does not change any average. The average gap is , and a natural guess is that the passenger waits half of it on average. The waiting-time paradox is that the expected wait is
which is at least half the average gap, , with equality exactly when all the gaps are equal. The resolution is that a random moment falls in a gap with probability proportional to the length of the gap, and the long gaps, which are caught more often, are also the ones that leave long waits.
In plain words The timetable lists each gap once, but the clock spends more time inside the long gaps. A passenger who turns up at a random moment is therefore usually inside a long gap, and a long gap usually leaves a long wait.
Example Take gaps of and minutes, so , the average gap is minutes and half of it is . The arrival falls in the short gap with probability , and then the remaining wait is between and minutes, minute on average. It falls in the long gap with probability , and then the remaining wait is minutes on average. So
The formula agrees, since . The expected wait is less than the average gap of minutes, but well above .
Length-biased sampling
Definition Suppose a stretch of time of length is cut into consecutive intervals of lengths , and a moment is chosen uniformly at random in the stretch. The interval that contains it is interval with probability , and the moment lands exactly on a boundary with probability . This is called length-biased sampling. It is a case of size-biased sampling, in which each item is chosen with probability proportional to its size, and here the size of an interval is its length. It differs from choosing one of the intervals from a list, which gives each of them probability . The expected length of the interval that contains the moment is
which is at least the average length , with equality exactly when all the lengths are equal.
In plain words Throw a dart at a timeline, and the gap it hits is chosen in proportion to its length. Long gaps are easier targets.
Example In the timetable with gaps of and minutes, the passenger’s gap is the short one with probability and the long one with probability . The long gap is nine times as likely to be the one experienced, although the timetable lists each gap once. The expected length of the gap that contains the arrival is
not . The expected wait of minutes is exactly half of , because inside whichever gap contains the arrival, the remaining wait is on average half the length of that gap.
Expected waiting time
Definition The expected waiting time is the average of the wait over the random arrival time. For an arrival time uniform over a cycle of length , it is the area under the graph of the wait divided by . The wait at time is the time from until the next bus. Across a gap of length it falls at a rate of one minute per minute from down to , and it jumps back up when a bus leaves. Over each gap the region under the graph is therefore a right triangle whose two legs have length , with area , measured in square minutes. Adding the triangles and dividing by minutes gives the formula in minutes. The same formula follows from weighting the average remaining wait in gap by the probability of being in that gap. It needs the arrival time to be uniform over the cycle and chosen without regard to the timetable. A passenger who reads the timetable and times the arrival has a different arrival distribution and a different expected wait, and a fixed repeating timetable says nothing about how real buses spread out or bunch together.
In plain words Draw the wait as a sawtooth. It shrinks to zero as each bus approaches and jumps back up when the bus leaves. The expected wait is the average height of the sawtooth, and each gap contributes a triangle whose area grows with the square of the gap’s length, so a few long gaps weigh heavily.
Example For gaps of and minutes the triangles have areas and square minutes. Their total is , and minutes. Keeping the cycle at minutes with two buses, gaps of and minutes give
minutes, and gaps of and give minutes. The number of buses and the average gap are the same in all three timetables, and only the regularity changes.
Inspection paradox
Definition Suppose a whole is divided into parts of sizes , all positive, with total , and one unit of the whole, such as a moment of time or a member of a group, is chosen uniformly at random. The part that contains it is part with probability , so its expected size is
which is at least the average part size , with equality exactly when all the sizes are equal. The inspection paradox is this gap between the average size of the parts and the average size of the part found by inspecting a random unit. Both averages are correct, and they answer different questions.
In plain words Ask the people inside groups how big their group is, and the answers are larger on average than the average group size, because big groups contain more people to ask.
Example A school has two classes, one of students and one of , so the average class size is . A student chosen at random is in the small class with probability and in the large class with probability . The expected size of that student’s class is
The waiting-time paradox is the same effect with gaps as the parts and moments as the units. The friendship paradox is another case, with people as the parts and the entries on all friend lists as the units, since each person is named on as many lists as they have friends.
Check yourself
- A timetable repeats every 20 minutes with gaps of 5 and 15 minutes. Find the probability that a passenger arriving at a uniformly random time lands in each gap, and the expected wait.
Show the answer
The arrival lands in the short gap with probability and in the long gap with probability . The average remaining waits are and minutes, so
The formula gives the same value, since . It lies between the minutes of the regular timetable and the minutes of the timetable with gaps of and .
- For the timetable with gaps of 2 and 18 minutes, someone argues that half the gaps are short and half are long, so the average wait is minutes. Which random experiment does give 5 minutes, and why is it not the experiment of a passenger who arrives at a uniformly random time?
Show the answer
The value is the expected wait if a gap is chosen first, each with probability , and then the arrival time is chosen uniformly inside that gap. In general this experiment gives
exactly half the average gap. A passenger arriving at a uniformly random time does not choose a gap first. The arrival lands in a gap with probability proportional to its length, for the short gap and for the long one, and these weights give minutes.
The answer also needs the arrival to be chosen without regard to the timetable. A passenger who reads the timetable and always arrives one minute before a bus waits one minute every time.
- A timetable repeats every 20 minutes with gaps of 1, 1, 1 and 17 minutes. Find the average gap and the expected wait. Then show that a timetable with only two gaps per cycle always has an expected wait shorter than its average gap.
Show the answer
There are gaps in minutes, so the average gap is minutes. The expected wait is
minutes, longer than the whole average gap. The single long gap holds of the time and leaves an average wait of minutes.
With two gaps and , the average gap is and the expected wait is . Their difference is
which is positive because and are positive. So with two gaps the expected wait is always less than the average gap, and by the general result it is at least half of it. For gaps of and the difference is , and as before. With more gaps, as the timetable above shows, the expected wait can exceed the average gap.