Expected Waiting Time With Random Bus Delays
A bus company runs a large number of identical lines. On each line, buses are scheduled to depart every $x$ minutes. Each bus independently experiences a random delay:
- With probability $p$, the bus is on time (zero delay).
- With probability $q$, the bus is delayed by $x/2$ minutes.
- With probability - p - q$, the bus is delayed by exactly $x$ minutes.
Assume the system has been running for a long time (stationarity) and that a passenger arrives at a uniformly random time on a randomly chosen line.
- Derive the stationary distribution of headways -- that is, the time between consecutive actual bus arrivals at a stop.
- Compute the passenger's expected waiting time $E[W]$ as a function of $p$, $q$, and $x$.
- Compare $E[W]$ to the naive expected waiting time you would get by ignoring the delay randomness (i.e., assuming buses arrive exactly every $x$ minutes). Comment on how the "inspection paradox" (bus paradox) effect depends on the parameters $p$ and $q$.
Hints
- The mean headway is unaffected by delays -- think about why. Focus on what the variance of headways does to a random arrival.
- The headway between consecutive buses is $H = x + D_{n+1} - D_n$. Since delays are i.i.d., $\text{Var}(H) = 2\,\text{Var}(D)$. The inspection paradox formula $E[W] = E[H^2]/(2E[H])$ is the key tool.
- Compute $\text{Var}(D)$ from the three-point distribution, then plug into $E[W] = x/2 + \text{Var}(D)/x$. Check your answer against the special cases $p=1$ and $q=1$.
Worked Solution
How to Think About It: This is a classic inspection paradox problem with a twist. Each scheduled bus gets randomly shifted, so consecutive arrivals are no longer equally spaced. The actual headway between two consecutive buses depends on both their delays. A passenger who arrives at a random time is more likely to fall in a long headway than a short one -- this is the inspection paradox. So the expected wait is not simply half the mean headway; it is inflated by the variance of headways. The key formula is $E[W] = E[H]/(2) \cdot (1 + \text{Var}(H)/E[H]^2)$ where $H$ is a headway drawn from the stationary distribution.
Quick Estimate: Take $x = 10$, $p = 0.8$, $q = 0.1$ (mostly on-time buses). The mean scheduled headway is 10 minutes, and most buses are on time, so delays are small perturbations. The naive wait is
0/2 = 5$ minutes. With a bit of delay variance, the actual wait should be slightly above 5 -- maybe 5.2-5.5 minutes. Now take $p = 0.2$, $q = 0.3$,-p-q = 0.5$ (half the buses delayed by a full interval). Many buses will bunch, creating short headways followed by long gaps. The wait should be noticeably above 5 minutes -- maybe 6-7 minutes.Approach: We compute the headway distribution by considering the difference in arrival times of consecutive scheduled buses, then apply the inspection paradox formula.
Formal Solution:
Let bus $n$ have scheduled departure time $nx$ and actual arrival time $A_n = nx + D_n$, where $D_n$ is the delay. The delay takes values $0$, $x/2$, $x$ with probabilities $p$, $q$,
-p-q$ respectively.The headway between bus $n$ and bus $n+1$ is:
$H_n = A_{n+1} - A_n = x + D_{n+1} - D_n$
Since the delays are i.i.d., the headway distribution is stationary. We need the distribution of $H = x + D' - D$ where $D$ and $D'$ are independent copies of the delay.
The delay $D$ has:
$E[D] = 0 \cdot p + \frac{x}{2} \cdot q + x \cdot (1-p-q) = \frac{xq}{2} + x(1-p-q)$
$E[D] = x\left(1 - p - \frac{q}{2}\right)$
The mean headway is:
$E[H] = x + E[D'] - E[D] = x$
This makes sense -- delays shift buses but do not change the average spacing.
For the variance, since $D'$ and $D$ are independent:
$\text{Var}(H) = \text{Var}(D') + \text{Var}(D) = 2\,\text{Var}(D)$
We compute $\text{Var}(D) = E[D^2] - (E[D])^2$:
$E[D^2] = 0 \cdot p + \frac{x^2}{4} \cdot q + x^2 \cdot (1-p-q) = x^2\left(\frac{q}{4} + 1 - p - q\right) = x^2\left(1 - p - \frac{3q}{4}\right)$
$\text{Var}(D) = x^2\left(1 - p - \frac{3q}{4}\right) - x^2\left(1 - p - \frac{q}{2}\right)^2$
Let $\alpha = 1 - p - q/2$ so that $E[D] = \alpha x$. Then:
$\text{Var}(D) = x^2\left(1 - p - \frac{3q}{4} - \alpha^2\right)$
And $\text{Var}(H) = 2\,\text{Var}(D)$.
Now apply the inspection paradox. A passenger arriving at a uniformly random time falls in a headway interval. The probability of landing in a headway of length $h$ is proportional to $h$. The expected waiting time for a random arrival in a renewal process in stationarity is:
$E[W] = \frac{E[H^2]}{2\,E[H]} = \frac{E[H]}{2}\left(1 + \frac{\text{Var}(H)}{E[H]^2}\right) = \frac{x}{2}\left(1 + \frac{2\,\text{Var}(D)}{x^2}\right)$
$E[W] = \frac{x}{2} + \frac{\text{Var}(D)}{x}$
Substituting:
$E[W] = \frac{x}{2} + x\left(1 - p - \frac{3q}{4} - \left(1 - p - \frac{q}{2}\right)^2\right)$
Expanding $\left(1 - p - q/2\right)^2 = 1 - 2p - q + p^2 + pq + q^2/4$:
$\text{Var}(D)/x^2 = 1 - p - \frac{3q}{4} - 1 + 2p + q - p^2 - pq - \frac{q^2}{4}$
$= p + \frac{q}{4} - p^2 - pq - \frac{q^2}{4}$
$= p(1 - p - q) + \frac{q(1 - q)}{4}$
So:
$E[W] = \frac{x}{2} + x\left(p(1-p-q) + \frac{q(1-q)}{4}\right)$
Comparison to naive: If buses arrived exactly every $x$ minutes (no randomness), the expected wait would be exactly $x/2$. The excess wait is:
$\Delta = E[W] - \frac{x}{2} = x\left(p(1-p-q) + \frac{q(1-q)}{4}\right) = \frac{\text{Var}(D) + \text{Var}(D')}{2x} = \frac{\text{Var}(H)}{2x}$
This excess is always non-negative and equals zero only when $\text{Var}(D) = 0$, i.e., when all buses have the same delay (deterministic). The more variable the delays, the longer passengers wait. This is the inspection paradox: a random arrival disproportionately samples long gaps.
Special cases: - If $p = 1$ (all buses on time): $\Delta = 0$, wait is exactly $x/2$. - If $q = 1$ (all buses delayed $x/2$): $\Delta = 0$, wait is exactly $x/2$ (uniform shift does not affect gaps). - If $p = 1/2$, $q = 0$ (coin flip between 0 and $x$ delay): $\Delta = x/4$, so $E[W] = 3x/4$. - Maximum variance (and thus maximum $\Delta$) occurs when probability is split between the extreme delays 0 and $x$.
Answer: The mean headway is $E[H] = x$ regardless of $p, q$. The expected waiting time is:
$E[W] = \frac{x}{2} + x\left(p(1-p-q) + \frac{q(1-q)}{4}\right)$
The excess over the naive $x/2$ equals $\text{Var}(H)/(2x)$, which is the inspection paradox penalty driven entirely by headway variance.
Intuition
This problem illustrates the inspection paradox (also called the bus paradox or length-biased sampling). When you arrive at a random time, you are more likely to land in a long gap between buses than a short one. Deterministic spacing ($x/2$ wait) is the best case; any randomness in delays strictly increases the expected wait. The excess is proportional to the variance of the headway distribution, not its mean.
In practice, this is why real bus systems feel worse than their schedules suggest. Even if the average frequency is maintained, bunching (two buses back-to-back followed by a long gap) destroys the passenger experience. The formula $E[W] = x/2 + \text{Var}(H)/(2x)$ is a workhorse in transit planning, queueing theory, and even market microstructure -- anywhere a random observer samples intervals from a renewal process. The takeaway for quant interviews: whenever you see "random arrival into a renewal process," reach for $E[H^2]/(2E[H])$ immediately.