TITLE: Why this random variable is uniformly distributed?
QUESTION [5 upvotes]: Here is an exercise.

Suppose that people arrive at a bus stop in accordance with a Poisson
  process with rate $\lambda$. The bus departs at time $t$. Let $X$
  denote the total amount of waiting time of all those who get on the
  bus at time $t$. Let $N(t)$ denote the number of arrivals by time $t$.

Now we want to calculate $E[X\;|\;N(t)]$.
The solution says that the waiting time of each person, $T$, is uniformly distribute in $(0,t)$. So $E[X\;|\;N(t)=n]=n\int_0^t(t-s)\frac{1}{t}ds$.
My question is, why $T$ is uniformly distribute? If people arrivals obeying Poisson process, shouldn't $T$ obeying exponential distribute with parameter $\lambda$?

REPLY [4 votes]: This is all the difference there is between building Poisson processes from ordered samples or from unordered ones. The description recalled in the post, based on exponentially distributed interarrival times, uses the former. The latter stipulates that, once conditioned by $[N(t)=n]$ for some $n\geqslant1$, the (unordered) set of the $n$ arrival times is distributed as a sample of $n$ i.i.d. random variables uniformly distributed on $(0,t)$.
In particular, the mean sum of these arrival times is $n$ times the mean of a random variable uniform on $(0,t)$, that is, $\frac12nt$. Since the mean of $N(t)$ is $\lambda t$, the (unconditional) mean sum of these arrival times is $\frac12\lambda t^2$.
To get an idea of the reason why the two descriptions mentioned above are equivalent, let us recover the distribution of the first arrival time $T$ from the second description. 
If $N(t)=0$, all we know is that $T\gt t$. If $N(t)=n$ with $n\geqslant1$, then $T$ is distributed as the infimum of $n$ i.i.d. random variables uniformly distributed on $(0,t)$, hence, for every $s$ in $(0,t)$, $\mathbb P(T\geqslant s\mid N(t)=n)=(1-s/t)^n$. Using Bayes formula and assuming that $N(t)$ is Poisson with parameter $\lambda$, one gets for every $s\leqslant t$,
$$
\mathbb P(T\geqslant s)=\sum_{n\geqslant0}\mathbb P(T\geqslant s\mid N(t)=n)\mathbb P(N(t)=n),
$$
that is,
$$
\mathbb P(T\geqslant s)=\mathrm e^{-\lambda t}+\sum_{n\geqslant1}(1-s/t)^n\mathrm e^{-\lambda t}(\lambda t)^n/n!=\mathrm e^{-\lambda s}.
$$
This shows that, at least on $(0,t)$, $T$ is distributed as an exponential random variable with parameter $\lambda$.