Expected value of the total waiting time of all passengers catching a train.

poisson processprobability theoryrandom variables

Suppose that we are at time zero. Passengers arrive at a train station
according to a Poisson process with intensity $\lambda$. Compute the expected
value of the total waiting time of all passengers who have come to the
station in order to catch a train that leaves at time $t$.

This problem really made me lose confidence in my understand of probability theory. I can't really find where my thinking is wrong. This is how i try to solve it:

Let $X(t)$ denote the number of passengers arriving at the train station in the time interval $[0,t)$. Let $S_i$ be the time of arrival of the $ith$ passenger and $T$ the total time waited of all passengers until time $t$. Then:
$$Y=(t-S_1)+(t-S_2)…….+(t-S_{X(t)})$$
Since $E(Y)=E(E(Y|X)), S_i \in Gamma(i,1/\lambda)$ and $X(t) \in Po(\lambda t)$ we get:

$$E(Y|X)=E((t-S_1)+(t-S_2)…….+(t-S_{X}))=tX-\sum\limits_{i=1}^X E(S_i)=$$
$$tX-\sum\limits_{i=1}^X \frac{i}{\lambda}=tX – \frac{X(X+1)}{2\lambda}$$
Then, $$E(Y)=E(tX – \frac{X(X+1)}{2\lambda})=tE(X)-\frac{1}{2\lambda}(E(X^2)+E(X))=$$
$$tE(X)-\frac{1}{2\lambda}(Var(X)+(E(X))^2+E(X))$$
Now, setting $E(X)=Var(X)=t\lambda$ i get that

$$E(Y)=\frac{\lambda t^2}{2}-t$$ which does not make sense since it allows for negative values for $t<\frac{2}{\lambda}$. The correct answer is $E(Y)=\frac{\lambda t^2}{2}.$ Where am i mistaken?

Best Answer

Your procedure to find $\mathbb E[Y\mid X(t)]$ is incorrect. You calculate the $\mathbb ES_i$ without taking into account that they must be calculated under a condition.


Let $U_1,\dots, U_n$ be iid rv's with uniform distribution on $[0,t]$ and let $U_{(1)},\dots, U_{(n)}$ be the corresponding order statistics.

Then it can be shown that under condition $X(t)=n$ the distribution of $(S_1,\dots,S_n)$ is the same as the distribution of $(U_{(1)},\dots, U_{(n)})$.

Consequently the distribution (and expectation) of $S_1+\cdots+S_n$ is the same as the distribution (and expectation) of $U_{(1)}+\cdots+U_{(n)}=U_1+\cdots+U_n$.

So if $Y$ denotes the total waiting time then $$\mathbb E[Y\mid X(t)=n]=\mathbb E[(t-S_1)+\cdots +(t-S_n)\mid X(t)=n]=\frac12nt$$

So: $$\mathbb E[Y\mid X(t)]=\frac12 X(t)t$$ and consequently:$$\mathbb EY=\mathbb E[\mathbb E[Y\mid X(t)]]=\mathbb E\frac12X(t)t=\frac12\lambda t^2$$

Related Question