Problem 12.18 Medium Free

Bus Wait With Random Delays

A bus is scheduled to arrive every 1010 minutes. However, before each scheduled run, independently with probability 0.10.1, the driver stops to refuel, which delays that bus by an extra 6060 minutes (so the resulting gap between consecutive arrivals is 7070 minutes instead of 1010). You arrive at a uniformly random time during the day. Find the expected number of minutes until the next bus arrives.

Work it out, then compare with the answer.

SolutionShow the worked solution

Let LL be the gap between consecutive arrivals. The gaps are i.i.d. with

L={10with probability 0.9,70with probability 0.1,E[L]=9+7=16,E[L2]=0.9⋅100+0.1⋅4900=580.L=\begin{cases}10 & \text{with probability } 0.9,\\ 70 & \text{with probability } 0.1,\end{cases} \qquad \mathbb{E}[L]=9+7=16,\qquad \mathbb{E}[L^2]=0.9\cdot 100+0.1\cdot 4900=580 .

We treat the day as long compared with the gaps, so we may use long-run proportions.

Which gap you land in. Consider nn consecutive gaps. About 0.9n0.9n of them have length 1010 and about 0.1n0.1n have length 7070. The total time is therefore about 16n16n, of which about 7n7n lies in long gaps. A uniformly random arrival time thus falls in a 7070-minute gap with probability

0.1⋅70E[L]=716.\frac{0.1\cdot 70}{\mathbb{E}[L]}=\frac{7}{16}.

It falls in a 1010-minute gap with probability 916\frac{9}{16}. In general, a gap of length ℓ\ell is selected with probability ℓ P(L=ℓ)/E[L]\ell\,\mathbb{P}(L=\ell)/\mathbb{E}[L], which is proportional to its length.

Wait within the gap. Given the gap you land in, your position in it is uniform. The expected wait until its end is therefore half its length: 3535 minutes in a long gap and 55 minutes in a short one.

By the law of total expectation,

E[W]=716⋅35+916⋅5=245+4516=1458.\mathbb{E}[W]=\frac{7}{16}\cdot 35+\frac{9}{16}\cdot 5=\frac{245+45}{16}=\frac{145}{8}.

This agrees with the general formula

E[W]=∑ℓℓ P(L=ℓ)E[L]⋅ℓ2=E[L2]2 E[L]=58032=1458.\mathbb{E}[W]=\sum_\ell \frac{\ell\,\mathbb{P}(L=\ell)}{\mathbb{E}[L]}\cdot\frac{\ell}{2}=\frac{\mathbb{E}[L^2]}{2\,\mathbb{E}[L]}=\frac{580}{32}=\frac{145}{8}.
E[W]=1458≈18.1 minutes\boxed{\mathbb{E}[W]=\dfrac{145}{8}\approx 18.1\text{ minutes}}

Key idea. A random arrival is far more likely to fall in a long gap. The answer is therefore not the naive E[L]/2=8\mathbb{E}[L]/2=8 minutes, but

E[L2]2 E[L]=E[L]2+Var⁡(L)2 E[L].\frac{\mathbb{E}[L^2]}{2\,\mathbb{E}[L]}=\frac{\mathbb{E}[L]}{2}+\frac{\operatorname{Var}(L)}{2\,\mathbb{E}[L]}.