# Expected Waiting Time: memoryless property

Smith is waiting for his two friends Lee and Yang to visit his house. The time until Lee arrives is Exp($\lambda_1$) and the time until Yang arrives is Exp($\lambda_2$). After arrival, Lee stays an amount of time that is Exp($\mu_1$), whereas Yang stays an amount of time that is Exp($\mu_2$).

All four random variables are independent.

What is the expected time of the first departure?

Hint: Let X be the time of the first departure, and write X=F+Y where F is the time of the first arrival and Y is the additional amount of time until the first departure. Compute E(Y) by conditioning on who arrived first.

Attempt:

Denote S=Lee's arrive time; U=Lee's stay time; T=Yang's arrive time; V=Yang's stay time.

$E\{first arrival\}=E[X]=E[\min(S,T)]=\frac 1{\lambda_1+\lambda_2}$

After that, everything refreshes, then the additional waiting time is again:

$E[A]=E[\min(U,V)]=\frac 1{\mu_1+\mu_2}$.

Therefore, total time of expected first departure = $\frac 1{\mu_1+\mu_2}+\frac 1{\lambda_1+\lambda_2}$.

Which is wrong

• It might be less confusing if you don't use the same letters to denote different things. What is A? Lee's arrival time or the additional time till first departure? – Graham Kemp Mar 4 '16 at 0:48
• Everything doesn't refresh after first arrival. Suppose Lee arrives first: On that condition: the additional time until first departure is then the minimum time until: Lee's departure, or Yang's arrival and departure. – Graham Kemp Mar 4 '16 at 0:56

## 2 Answers

Everything doesn't refresh after first arrival.   The first person could depart before the other person even arrives.

Suppose Lee arrives first: On that condition: the additional time until first departure is then the minimum time until: Lee's departure, or Yang's arrival and departure.

\begin{align}\mathsf E(X) = & ~\mathsf E[(S+U)\wedge (T+V)] \\ = & ~ \mathsf E(S\wedge T) + \mathsf P(S<T)~\mathsf E [U\wedge (T+V)]+\mathsf P(S>T)~\mathsf E[(S+U)\wedge V] \\ = & ~\mathsf E(S\wedge T) + \mathsf P(S<T)~(\mathsf E(U\wedge T)+\mathsf P(U>T)~\mathsf E(U\wedge V))+\mathsf P(S>T)~(\mathsf E(S\wedge V)+\mathsf P(S<V)~\mathsf E(U\wedge V)) \\ = & ~\frac{1}{\lambda_1+\lambda_2} + \frac{\lambda_1}{\lambda_1+\lambda_2}~(\frac{1}{\mu_1+\lambda_2}+\frac{\lambda_2}{\mu_1+\lambda_2}~\frac{1}{\mu_1+\mu_2})+\frac{\lambda_2}{\lambda_1+\lambda_2}~(\frac{1}{\lambda_1+\mu_2}+\frac{\lambda_1}{\lambda_1+\mu_2}~\frac{1}{\mu_1+\mu_2}) \end{align}

• I kept trying to find a simpler form for the solution but I suppose there isn't one :( – Math1000 Mar 4 '16 at 2:48

We have $$\mathbb E[A] = \frac1{\lambda_1+\lambda_2}$$ and \begin{align} \mathbb E[F] &= \mathbb E[F\mid \text{Lee arrives first }]\mathbb P(\text{Lee arrives first})\\ &+ \mathbb E[F\mid \text{Yang arrives first }]\mathbb P(\text{Yang arrives first})\\ &= \left(\frac1{\mu_1+\lambda_2} + \left(\frac{\lambda_2}{\mu_1+\lambda_2}\right)\left(\frac1{\mu_1+\mu_2} \right) \right) \left( \frac{\lambda_1}{\lambda_1+\lambda_2}\right)\\ &+\left(\frac1{\mu_2+\lambda_1} + \left(\frac{\lambda_1}{\mu_2+\lambda_1}\right)\left(\frac1{\mu_1+\mu_2} \right) \right) \left( \frac{\lambda_2}{\lambda_1+\lambda_2}\right). \end{align} It follows that \begin{align} \mathbb E[X] &= \mathbb E[A] + \mathbb E[F]\\ &= \left(\frac1{\lambda_1+\lambda_2}\right)\left(1 + \frac{\lambda _1 \left(\lambda _2+\mu _1+\mu _2\right)}{\left(\mu _1+\mu _2\right) \left(\lambda _2+\mu _1\right)} + \frac{\lambda _2 \left(\lambda _1+\mu _1+\mu _2\right)}{\left(\mu _1+\mu _2\right) \left(\lambda _1+\mu _2\right)} \right). \end{align}