# exponential bank waiting times

I have a question about expected waiting times at a bank. Consider a bank with two tellers. Three people, A, B and C enter the bank at almost the same time and in that order. A and B go directly into service while C waits for the first avaliable teller. Suppose that the service time for teller one is exponentially distributed with mean 3 and teller two with mean 6. a) What is the expected total amount of time for C to complete her business? b) What is the expected total time until the last of the three customers leaves? c) What is the probability C is the last one to leave?

-
Do you have any thoughts? Any partial progress? –  Ross Millikan May 26 '11 at 4:48
To quote myself about the question you asked four minutes later than this one: What do you know? What have you tried? Where are you stuck? –  Did May 26 '11 at 5:14

For part a), you were almost right. The correct solution is $$\frac{1}{{\lambda _1 + \lambda _2 }} + \bigg[\frac{{\lambda _1 }}{{\lambda {}_1 + \lambda _2 }}\frac{1}{{\lambda _1 }} + \frac{{\lambda _2 }}{{\lambda {}_1 + \lambda _2 }}\frac{1}{{\lambda _2 }}\bigg] = \frac{3}{{\lambda _1 + \lambda _2 }} = \frac{3}{{1/3 + 1/6}} = 6,$$ where we have used the following facts. If $X_i$, $i=1,2$, are independent exponential$(\lambda_i)$ random variables (meaning that they have densities $\lambda_i e^{-\lambda_i x}$, $x > 0$), then $U:=\min\{X_1,X_2\}$ is exponential$(\lambda_1+\lambda_2)$ (and hence its mean is $1/(\lambda_1+\lambda_2)$, which corresponds to the first term above), and moreover, $U$ is independent of the random variable $N$ defined by $N=1$ if $X_1 < X_2$, and $N=2$ if $X_2 \leq X_1$, for which it holds ${\rm P}(N = 1) = \lambda _1 /(\lambda _1 + \lambda _2 )$ and ${\rm P}(N = 2) = \lambda _2 /(\lambda _1 + \lambda _2 )$. For these facts, see this post (parts (a)-(c)).

EDIT:

For part b), consider $$2 + 2 + \frac{2}{3}6 + \frac{1}{3}3 = 9,$$ or more generally, $$\frac{1}{{\lambda _1 + \lambda _2 }} + \frac{1}{{\lambda _1 + \lambda _2 }} + \frac{{\lambda _1 }}{{\lambda _1 + \lambda _2 }}\frac{1}{{\lambda _2 }} + \frac{{\lambda _2 }}{{\lambda _1 + \lambda _2 }}\frac{1}{{\lambda _1 }} = \frac{{2\lambda _1 \lambda _2 + \lambda _1^2 + \lambda _2^2 }}{{(\lambda _1 + \lambda _2 )\lambda _1 \lambda _2 }} = \frac{{\lambda _1 + \lambda _2 }}{{\lambda _1 \lambda _2 }}.$$ (Setting $\lambda_1 = 1/3$ and $\lambda_2 = 1/6$ gives the desired answer, $9$.)

Apparently, you were supposed to solve part b) using the above method. Nevertheless, it may be worth giving here the following alternative derivation: $$\frac{1}{{\lambda _1 + \lambda _2 }} + {\rm E[\max \{ X_1 ,X_2 \} ]} = \frac{1}{{\lambda _1 + \lambda _2 }} + \bigg[ \frac{1}{{\lambda _1 }} + \frac{1}{{\lambda _2 }} - \frac{1}{{\lambda _1 + \lambda _2 }}\bigg] = \frac{1}{{\lambda _1 }} + \frac{1}{{\lambda _2 }} = 9.$$ The expression for ${\rm E[\max \{ X_1 ,X_2 \} ]}$ can be derived as follows. First note that $${\rm E[\max \{ X_1 ,X_2 \} ]} = \int_0^\infty {{\rm P}(\max \{ X_1 ,X_2 \} > x)\,dx} = \int_0^\infty {[1 - {\rm P}(\max \{ X_1 ,X_2 \} \le x)} ]\,dx.$$ Now, using the independence of $X_1$ and $X_2$, $${\rm P}(\max \{ X_1 ,X_2 \} \le x) = {\rm P}(X_1 \le x){\rm P}(X_2 \le x) = (1 - e^{ - \lambda _1 x} )(1 - e^{ - \lambda _2 x} ),$$ and hence $$1 - {\rm P}(\max \{ X_1 ,X_2 \} \le x) = e^{ - \lambda _1 x} + e^{ - \lambda _2 x} - e^{ - (\lambda _1 + \lambda _2 )x} .$$ Finally, $${\rm E[\max \{ X_1 ,X_2 \} ]} = \int_0^\infty {[e^{ - \lambda _1 x} + e^{ - \lambda _2 x} - e^{ - (\lambda _1 + \lambda _2 )x} ]\,dx} = \frac{1}{{\lambda _1 }} + \frac{1}{{\lambda _2 }} - \frac{1}{{\lambda _1 + \lambda _2 }}.$$

-
I worked out the probabilty that C goes to counter one to be 1/3 and the probabbility she goes to counter two to be 2/3s. For part a I need the expected value of her waiting time and her sevice time. For the expected value of her waiting time I added the two lamda together (1/3 + 1/6) to get 1/2 which gives an expected value of 2. For the expected value of the service time I mutliplied the probabilty that she goes to that counter by the expected service time of that counter and added this up for both to get a total of 5. This gave me an expected total time of 7 but apparently the answer is 6?? –  J.M May 26 '11 at 21:10
See the (new) answer. –  Shai Covo May 27 '11 at 0:46
Ok, I understand how to do part a and c. Part b is still a problem. I've worked out the expected time for the 1st customer to leave to be 2 mins and the same for the 2nd customer because of the lack of memory property of the exponential dist and also because the expected waiting time when there are two counters is 2 minutes. For the last customer I calculated the probability of her using counter 1 and counter 2 and multiplied these by their respective expected service times. From that I got another two lots of 2 mins which gives an expected total time of 8 mins but the answer is meant to be 9? –  J.M May 27 '11 at 3:56
For part b), see the edited answer. –  Shai Covo May 27 '11 at 10:45

Here is a tricky way to solve part b). (I decided to put this in a new answer, since the first one is too long already.)

The expected total time for part b) is given by $$E = {\rm E}[\min \{ X_1 ,X_2 \} ] + {\rm E}[\max \{ \tilde X_1 ,\tilde X_2 \} ],$$ where $X_i$, $i=1,2$, are independent exponential$(\lambda_i)$ random variables and $(\tilde X_1,\tilde X_2)$ is an independent copy of $(X_1,X_2)$. Hence $$E = {\rm E}[\min \{ X_1 ,X_2 \} ] + {\rm E}[\max \{ X_1 ,X_2 \} ] = {\rm E}[\min \{ X_1 ,X_2 \} + \max \{ X_1 ,X_2 \}].$$ But $\min \{ X_1 ,X_2 \} + \max \{ X_1 ,X_2 \} = X_1 + X_2$, and hence $$E = {\rm E}[X_1 + X_2] = \frac{1}{{\lambda _1 }} + \frac{1}{{\lambda _2 }}$$ (which is equal to $9$ if $\lambda_1 = 1/3$ and $\lambda_2 = 1/6$).

-