Video 1, chapter 12

The Waiting-Time Paradox

How the waiting-time paradox, a case of the inspection paradox, makes a passenger arriving at a random time wait longer than half the average gap between buses, explained by length-biased sampling and the expected waiting time.

  • Video 1, chapter 12
  • What random really means

Video 1, chapter 12

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 TT minutes. In each cycle there are kk gaps between consecutive buses, of lengths L1,…,LkL_1, \dots, L_k minutes, all positive, with L1+⋯+Lk=TL_1 + \cdots + L_k = T. 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 00, which happens with probability 00 and does not change any average. The average gap is T/kT/k, and a natural guess is that the passenger waits half of it on average. The waiting-time paradox is that the expected wait is

E[W]=L12+⋯+Lk22T,E[W] = \frac{L_1^2 + \cdots + L_k^2}{2T},

which is at least half the average gap, T/(2k)T/(2k), 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 22 and 1818 minutes, so T=20T = 20, the average gap is 1010 minutes and half of it is 55. The arrival falls in the short gap with probability 2/20=0.12/20 = 0.1, and then the remaining wait is between 00 and 22 minutes, 11 minute on average. It falls in the long gap with probability 18/20=0.918/20 = 0.9, and then the remaining wait is 99 minutes on average. So

E[W]=0.1⋅1+0.9⋅9=8.2 minutes.\begin{aligned} E[W] &= 0.1 \cdot 1 + 0.9 \cdot 9 \\[0.4em] &= 8.2 \text{ minutes}. \end{aligned}

The formula agrees, since (22+182)/(2⋅20)=328/40=8.2(2^2 + 18^2)/(2 \cdot 20) = 328/40 = 8.2. The expected wait is less than the average gap of 1010 minutes, but well above 55.

Length-biased sampling

Definition Suppose a stretch of time of length TT is cut into consecutive intervals of lengths L1,…,LkL_1, \dots, L_k, and a moment is chosen uniformly at random in the stretch. The interval that contains it is interval ii with probability Li/TL_i / T, and the moment lands exactly on a boundary with probability 00. 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 kk intervals from a list, which gives each of them probability 1/k1/k. The expected length of the interval that contains the moment is

L12+⋯+Lk2T,\frac{L_1^2 + \cdots + L_k^2}{T},

which is at least the average length T/kT/k, 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 22 and 1818 minutes, the passenger’s gap is the short one with probability 1/101/10 and the long one with probability 9/109/10. 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

0.1⋅2+0.9⋅18=16.4 minutes,\begin{aligned} &0.1 \cdot 2 + 0.9 \cdot 18 \\[0.4em] &\quad = 16.4 \text{ minutes}, \end{aligned}

not 1010. The expected wait of 8.28.2 minutes is exactly half of 16.416.4, 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 WW over the random arrival time. For an arrival time uniform over a cycle of length TT, it is the area under the graph of the wait divided by TT. The wait at time tt is the time from tt until the next bus. Across a gap of length LL it falls at a rate of one minute per minute from LL down to 00, 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 LL, with area L2/2L^2/2, measured in square minutes. Adding the triangles and dividing by TT minutes gives the formula E[W]=(L12+⋯+Lk2)/(2T)E[W] = (L_1^2 + \cdots + L_k^2)/(2T) in minutes. The same formula follows from weighting the average remaining wait Li/2L_i/2 in gap ii by the probability Li/TL_i/T 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 22 and 1818 minutes the triangles have areas 12⋅22=2\tfrac12 \cdot 2^2 = 2 and 12⋅182=162\tfrac12 \cdot 18^2 = 162 square minutes. Their total is 164164, and 164/20=8.2164/20 = 8.2 minutes. Keeping the cycle at 2020 minutes with two buses, gaps of 44 and 1616 minutes give

42+1622⋅20=27240=6.8\frac{4^2 + 16^2}{2 \cdot 20} = \frac{272}{40} = 6.8

minutes, and gaps of 1010 and 1010 give 200/40=5200/40 = 5 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 kk parts of sizes s1,…,sks_1, \dots, s_k, all positive, with total SS, 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 ii with probability si/Ss_i / S, so its expected size is

s12+⋯+sk2S,\frac{s_1^2 + \cdots + s_k^2}{S},

which is at least the average part size S/kS/k, 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 1010 students and one of 5050, so the average class size is 3030. A student chosen at random is in the small class with probability 10/6010/60 and in the large class with probability 50/6050/60. The expected size of that student’s class is

102+50260=260060≈43.3.\begin{aligned} \frac{10^2 + 50^2}{60} &= \frac{2600}{60} \\[0.4em] &\approx 43.3. \end{aligned}

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

  1. 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 5/20=0.255/20 = 0.25 and in the long gap with probability 15/20=0.7515/20 = 0.75. The average remaining waits are 2.52.5 and 7.57.5 minutes, so

E[W]=0.25⋅2.5+0.75⋅7.5=0.625+5.625=6.25 minutes.\begin{aligned} E[W] &= 0.25 \cdot 2.5 + 0.75 \cdot 7.5 \\[0.4em] &= 0.625 + 5.625 \\[0.4em] &= 6.25 \text{ minutes}. \end{aligned}

The formula gives the same value, since (52+152)/(2⋅20)=250/40=6.25(5^2 + 15^2)/(2 \cdot 20) = 250/40 = 6.25. It lies between the 55 minutes of the regular timetable and the 6.86.8 minutes of the timetable with gaps of 44 and 1616.

  1. 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 (1+9)/2=5(1 + 9)/2 = 5 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 55 is the expected wait if a gap is chosen first, each with probability 12\tfrac12, and then the arrival time is chosen uniformly inside that gap. In general this experiment gives

1k(L12+⋯+Lk2)=T2k,\frac{1}{k} \left( \frac{L_1}{2} + \cdots + \frac{L_k}{2} \right) = \frac{T}{2k},

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, 0.10.1 for the short gap and 0.90.9 for the long one, and these weights give 0.1⋅1+0.9⋅9=8.20.1 \cdot 1 + 0.9 \cdot 9 = 8.2 minutes.

The answer 8.28.2 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.

  1. 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 44 gaps in 2020 minutes, so the average gap is 55 minutes. The expected wait is

1+1+1+1722⋅20=29240=7.3\begin{aligned} \frac{1 + 1 + 1 + 17^2}{2 \cdot 20} &= \frac{292}{40} \\[0.4em] &= 7.3 \end{aligned}

minutes, longer than the whole average gap. The single long gap holds 17/2017/20 of the time and leaves an average wait of 8.58.5 minutes.

With two gaps aa and bb, the average gap is (a+b)/2(a + b)/2 and the expected wait is (a2+b2)/(2(a+b))(a^2 + b^2)/(2(a + b)). Their difference is

a+b2−a2+b22(a+b)=(a+b)2−a2−b22(a+b)=aba+b,\begin{aligned} &\frac{a + b}{2} - \frac{a^2 + b^2}{2(a + b)} \\[0.4em] &\quad = \frac{(a + b)^2 - a^2 - b^2}{2(a + b)} \\[0.4em] &\quad = \frac{ab}{a + b}, \end{aligned}

which is positive because aa and bb 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 22 and 1818 the difference is 36/20=1.836/20 = 1.8, and 10−1.8=8.210 - 1.8 = 8.2 as before. With more gaps, as the timetable above shows, the expected wait can exceed the average gap.