Help with law of total expectation and exponential distribution

28 Views Asked by At

I have the following question: A man walks into a bank with one employee. After $T$~$Exp(\mu = \frac{1}{6})$ time another man walks into the bank. If the employee finished helping the first man he will immediately begin helping the second. If the employee hadn't finished helping the first man, the second man will wait until the employee does and then immediately will go to the employee. The time it takes the employee to help each man is $T_1, T_2$ ~ $Exp(\lambda = \frac{1}{3})$ where $T_1$ is the time it takes to help man 1 and $T_2$ is the time it takes to help man 2.

$T, T_1,$ and $T_2$ are independent.

After helping both men the employee will take a break. What is $E(T_B)$ where $T_B$ is the time until the employee takes a break?

Here is my attempt at the solution:

Let's consider two cases: $T>T_1$ and $T<T_1$. In the first case, the time until break will be $T_B = T+T_1$. In the second case $T_B = T_1 + T_2$. Using the law of total expectation I can write

$E(T_B) = E(T_B | T>T_1)P(T>T_1) + E(T_B | T<T_1)P(T<T_1) = $

$E(T+T_2)(1-P(T<T_1))+E(T_1+T_2)P(T<T_1)$

Let's calculate the probability that the time it takes the 2nd man to come to the bank is less then the time it takes for the employee to help the 1st man. To do so I will use the fact the $T,T_1$ are independent and so their combined distribution is:

$f_{T,T_1} (T,T_1) = f_T (T)\cdot f_{T_1} (T_1) = \lambda \mu e^{-\mu t -\lambda t_1}$

therefor we get:

$P(T<T_1) = \int_0^\infty \int_{0}^{t_1} \lambda \mu e^{-\mu t -\lambda t_1} dt dt_1 = \frac{1}{3}$

(I double checked with WolframAlpha)

Therefor we get:

$E(T_B) = E(T+T_2)(1-P(T<T_1))+E(T_1+T_2)P(T<T_1) = \frac{2}{3} (E(T)+E(T_2)) + \frac{1}{3} (E(T_1)+E(T_2)) = \frac{2}{3} (6+3) + \frac{1}{3} (3+3) = 8$

But the correct answer is

$E(T_B) = 10$.

I would much appreciate it if someone could point out where I went wrong as well as how to calculate this kind of question.

1

There are 1 best solutions below

2
On BEST ANSWER

Your error comes because $E(T_B) = E(T+T_2 \mid T\ge T_1 )(1-P(T<T_1))+E(T_1+T_2 \mid T<T_1)P(T<T_1)$ $\not =E(T+T_2)(1-P(T<T_1))+E(T_1+T_2)P(T<T_1)$ as you do not have independence

One possible approach could use the memorylessness of the exponential distribution:

  • The expected time until the earlier of the first customer finishing and the second arriving is $\frac{1}{\frac16+\frac13}=2$
  • The first customer finishes before the second customer arrives with probability $\frac{\frac13}{\frac16+\frac13}=\dfrac23$. If that happens then
    • The expected time from the first customer finishing and the second arriving is $\frac{1}{\frac16}=6$
    • The expected service time for the second customer is $\frac{1}{\frac13}=3$
    • The expected total time if the first customer finishes before the second customer arrives is $2+6+3=11$
  • The first customer finishes after the second customer arrives with probability $\frac{\frac16}{\frac16+\frac13}=\frac13$. If that happens then
    • The expected additional service time for the first customer is $\frac{1}{\frac13}=3$
    • The expected service time for the second customer is $\frac{1}{\frac13}=3$
    • The expected total time if the first customer finishes before the second customer arrives is $2+3+3=9$
  • So the overall expected time is $$\frac23 \times 11+\frac13 \times 8 = 10.$$