# average waiting time

who can help me to resolution of this statistic exercise? below the track: Caio go in a bank,the number of customers ahead him are described by a Poisson random variable of parameter a>0. Calculate the average waiting time knowing that: -the waiting time is given by the sum of service time of single person. -the timing of customer service that precede it are modeled as random variables, independent, marginally exponential of parameter lambda >0.

///// I thought that average waiting time is given by theorem of conditional mean: E[X]=E[E[X|Y]]; then call: Ta average waiting time -> (Ta=Summation of Ts) ,Ts time service customer ,X number of customer.

E[Ta]=E[E[Ta|X]] is right? What will i do now?. Thank all!

-

Given that there are $k$ customers ahead of him, the average waiting time is $k/\lambda$. This is because if $W_1,\dots, W_k$ are any random variables, then $E(W_1+\cdots+W_k)=E(W_1)+\cdots+E(W_k)$. In our case, the $k$ random variables have exponential distribution with parameter $\lambda$.
Thus the random variable $E(T|X)$ is the constant $\dfrac{1}{\lambda}$ times a Poisson random variable with parameter $a$. It follows that $E(E(T|X))=\dfrac{a}{\lambda}$.