The bus comes every ten minutes. Why do you wait longer than five?
A bus alternates between a two-minute gap and an eighteen-minute gap. The dispatcher records an average of ten minutes between buses. You arrive at a random time with no knowledge of the schedule. How long until you board? Mark three bus arrivals on a timeline. The answer depends on where your arrival falls between them.
Where did your minute land?
Put arrivals at minutes 0, 2 and 20 and repeat the schedule forever. Pick a point uniformly on the twenty-minute cycle. The short interval occupies one tenth of the line. The long one occupies the other nine tenths. Once you know which interval contains your arrival, your position inside it is uniform, so the average remaining time is half its length.
| Gap | Share of bus gaps | Share of passenger arrivals | Mean remaining wait |
|---|---|---|---|
| 2 minutes | 1/2 | 1/10 | 1 minute |
| 18 minutes | 1/2 | 9/10 | 9 minutes |
The passenger averages minutes. A perfectly regular service with the same mean gap gives a five-minute wait. Both timetables run six buses an hour on average. Where the dispatcher sees one long interval, a passenger has eighteen minutes in which to encounter it.
The area under the waiting-time graph
Immediately after a bus leaves, the time to the next bus jumps to the full gap. Then it falls with slope minus one until the next arrival. A gap of length contributes a triangle of area to this graph. Divide total area by the elapsed time over any complete set of consecutive gaps:
Gaps of 2 and 18 minutes give a mean wait of 8.20 minutes.
Try moving the middle bus from minute 2 to minute 10. The two triangles now have equal bases. Moving the bus one more minute in either direction keeps the total base fixed and increases the total area.
For a stationary renewal process with positive independent identically distributed gaps , finite second moment and a passenger sampling independently in time, the long-run mean becomes
This separates two contributions. A regular service pays the baseline . Dispersion adds a penalty of . The alternating timetable has dependent gaps, yet the finite-cycle area calculation applies exactly. Independence enters the renewal model used to interpret the population formula.
What are the chances you wait over ten minutes?
A length- gap offers minutes from which the remaining wait exceeds . Counting those minutes gives the whole tail,
On the alternating service only the first eight minutes of the long gap qualify. The probability is . If you simulate the timetable by flipping a fair coin for the gap and drawing a uniform position inside it, your simulation answers a different question. It assigns the passenger to a gap selected by the dispatcher.
A market-data version
Imagine a quote feed with update gaps of 2 and 18 milliseconds. At each update a logger records the duration of the quote that just expired. A second logger polls the live quote at independently sampled clock times and later measures its entire lifetime. The first logger’s average quote lifetime is 10 milliseconds. The second logger’s is milliseconds. Both can be perfectly accurate. Before averaging, decide whether each update or each millisecond deserves equal weight.
If your polls occur every twenty milliseconds starting at exactly the same phase, they always see the same part of this feed. Uniform coverage of time was a substantive assumption.
Practice
Interview follow-upFor exponential gaps with mean ten minutes, how long does a random passenger wait?Show answer
The variance is 100 square minutes, giving a ten-minute mean wait. Equivalently, the exponential survival law gives the same remaining-time distribution after any elapsed time. The full interval containing the passenger has mean twenty minutes.
Reverse the calculationWith ten-minute mean gaps, what standard deviation produces a seven-minute mean wait?Show answer
Solve . The variance is 40 square minutes and the standard deviation is about 6.32 minutes.