Expectation and PDF of bus waiting time

probabilityprobability distributions

I have a constant chance of arriving at the bus stop at all times during the hour, and two buses arrive per hour – one on the hour and one at 40 minutes past the hour. If $S$ is the time I wait for the bus, what is the pdf and the expected time I have to wait until the bus comes?

I am trying to solve the above question. I'm getting the expected time to be $16.666$ but I'm not sure if this is correct. I'm also not sure how to find the pdf. Thanks in advance for any help.

Best Answer

It's useful to split this into two cases as a function of the arrival time. Let event $A_0=$ arrival at bus stop before 40 minutes past the hour (that is, $\geq 0$ but $<40$ minutes), and $A_1=$ arrival at bus stop $\geq 40$ minutes past the hour. These events have probabilitites $$ P(A_0) = \frac{40}{60} = \frac{2}{3}; \qquad P(A_1) = \frac{1}{3} $$
Now we can consider the waiting time for a bus. Let $S$ be the waiting time in minutes. Now the CDF is $$ \begin{split} F_S(S) = P(S<s) &= P(S<s|A_0)P(A_0) + P(S<s | A_1)P(A_1) \\ \end{split} $$ The term $P(S=s|A_0)$ is evenly distributed between $0$ and $40$, and the term $P(S=s | A_1)$ is evenly distributed between $0$ and $20$, and therefore $$ \begin{split} F_S(s) = P(S<s) &= P(S<s|A_0)P(A_0) + P(S<s | A_1)P(A_1) \\ &= \text{Uniform}[0,40] \frac{2s}{3} + \text{Uniform}[0,20]\frac{1s}{3} \end{split} $$ Therefore, the PDF is (just the derivative of $F_S$) $$ f_S(s) = \left\{ \begin{array}{ccc} \frac{1}{30},& 0 \leq s \leq 20 \\ \frac{1}{60},& 20 \leq s \leq 40 \\ 0 , & \text{otherwise} \end{array} \right. $$ The mean value is $$ \mathbb{E}[S] = \int_0^{40}f_S(s') s' \, ds' = \int_0^{20} \frac{s'}{30} \, ds' + \int_{20}^{40} \frac{s'}{60} \, ds' = \frac{20}{3} + 10 \approx 16.6667 $$

Related Question