# Expected time of last bus left

I came across the following problem in a probability exercise, and got confused. The problem is the following.

Problem: In a bus station, assume the expected time of next bus arriving is a exponential distribution $Exp(\lambda)$, where $\lambda$=0.1/min, and you arrive at the bus station in a uniform random time. Let $X$ be the amount of time that last bus has left before you arrive. What is $E(X)$?

I applied some probability properties, and got answer 0, which is obviously wrong. Could you please help me see where I am wrong? It would be even better if you could give me a correct solution. Thanks!

My solution: Assume starting at time 0, the buses arrive at time $X_1, X_2, \cdots$, and the interval between buses are $Z_1, Z_2, \cdots$, where $Z_i=X_{i}-X_{i-1}$. Then $Z_i \sim Exp(\lambda)$. Assume the person arrives at the station at time $Y$, and assume $X_k \leq Y < X_{k+1}$. Then $$X=Y-X_k=Y-\sum_{i=1}^k Z_i.$$ Fix $Y$ and $k$, we have $$E(X)=Y-k E(Z_1) = Y-k\frac{1}{\lambda}.$$ Fix $Y$, the number $k$ is the number of events between $[0, Y]$, and satisfies a Poisson distribution with parameter $\lambda$. Thus $$E(k)=\lambda Y.$$ Therefore we have $$E(X)=Y-\lambda Y \frac{1}{\lambda}=0.$$

-

One cannot arrive at the bus station [at] a uniform random time because there is no uniform distribution on the positive real halfline hence the problem is ill posed.

The correct version of the problem is called the waiting time paradox, and asks about the limit of the expected time since the last bus left if one arrives at time $y$, when $y\to\infty$. The expected time since the last bus left if one arrives at time $y$ is $\frac1\lambda(1-\mathrm e^{-\lambda y})$ hence the limit when $y\to\infty$ is $\frac1\lambda$. See here for some more detailed explanations.

-

The most important thing about $Y$ is $X_k \le Y \lt X_{k+1}$. Anything which happened before $X_k$ is irrelevant.

The obvious answer is that the expected time since the last bus is the expected time to the next bus, i.e. 10 minutes.

Let's prove this looking forward: the exponential distribution is memoryless, so knowing $X_k \le Y \lt X_{k+1}$ you find $\Pr(X_{k+1}-Y=x)=1 − e^{−\lambda x}$, leading to $E[X_{k+1}-Y] = 1/\lambda$.

Going backwards, you may decide the distribution is the similar by symmetry. Alternatively

-
Hmmm... The residual waiting time at time $t$ and the time since the last bus before $t$ are NOT equidistributed, except in the limit $t\to\infty$. –  Did Nov 8 '11 at 22:44
Why not, assuming that at least one bus has arrived before $t$? It is reasonable to state that you arrive at a time uniformly (and so symmetrically) distributed between the times of the two buses you arrive between, so $\Pr(Y-X_k \le x) = \Pr(X_{k+1}-Y \le x)$ –  Henry Nov 8 '11 at 23:50
Well, for one thing, the residual waiting time may be as large as one wants while the time since the last bus arrived is at most $t$. (You know, all this is really textbook matter...) –  Did Nov 9 '11 at 0:22
@Didier: I don't accept that: you seem to be presuming that the buses will run eternally into the future but have only been running since for a finite time. You are saying you have probably arrived closer to the last bus than to the next bus; I would suggest that the question suggests otherwise: "uniformly random time" must mean uniformly between buses if it is to mean anything, so the assumption should be that buses both will run and have been running eternally. –  Henry Nov 9 '11 at 0:33
... or at least that there will be sufficient time for the next bus and there has been sufficient time for the last bus, and these conditions are symmetric. –  Henry Nov 9 '11 at 0:45