In a disc shop two employees are working. When we get inside the shop, we see that the two employees are already serving two customers (one customer for each employee), with the service time being a random variable of the exponential distribution, of parameter $\lambda=1/2$ (independent for each other). When we get inside the shop we also see another customer waiting in line to be served (in front of us).
(1) What is the distribution of the (total) time $T$ we need to be served at the disc shop?
(2) What is the probability that we are served before the customer waiting in line?
(3) What is the probability that we are served before a customer being served by the time we got inside the disc shop?
Attempts. Let $W_1$= the time the customer 1 needs to be served, $W_2$= the time the customer 2 needs to be served, $W_3$= the time the customer in line needs to be served. $W_4$= the time we need to be served.
(1) The total time we need to be served (counting from the time we got in the shop is $$T=\left \{\begin {array}{ll} W_1+W_3+W_4,~if W_1+W_3<W_2\\ W_2+W_4,~if W_1+W_3>W_2\\ \end{array} \right.$$ and $$P(T\leq t)=P(W_1+W_3<W_2)P(W_1+W_3+W_4\leq t)+P(W_1+W_3>W_2)P(W_2+W_4\leq t).$$
For $P(W_1+W_3<W_2)$ we note that $W_1+W_3$ follow $Gamma(2,\lambda)$ and $$P(W_1+W_3<W_2)=\int_{0}^{+\infty}\bigg(\int_{0}^{y}f_{W_1+W_3,~W_2}(x,y)dx\bigg)dy=\ldots=1/4.$$
(2) We are looking for the probability $$P(W_1<W_2)P(W_2+W_4<W_1+W_3 ~| ~W_1<W_2)+P(W_1>W_2)P(W_1+W_4<W_2+W_3~ | ~W_1>W_2)$$ but i can not calculate the probabilities $$P(W_2+W_4<W_1+W_3~ | ~W_1<W_2),~P(W_1+W_4<W_2+W_3 ~|~ W_1>W_2)$$ (which should be equal).
(3) We are looking for quantity $$2P(W_1<W_2)P(W_1+W_3+W_4<W_2 ~| ~W_1<W_2).$$
Thanks a lot in advance!
Let $S_n$ be i.i.d. $\mathsf{Exp}(\lambda)$ random variables.
For (1), we have $$T = (S_1\wedge S_2)+(S_3\wedge S_4)+S_5, $$ that is, waiting for two customers to be served, and then our own service time. Now, $S_1\wedge S_2$ and $S_3\wedge S_4$ have $\mathsf{Exp}\left(\frac\lambda 2\right)$ distribution, so $(S_1\wedge S_2)+(S_3\wedge S_4)$ has $\mathsf{Erlang}\left(2,\frac\lambda2\right)$ distribution, with density $$f(t) = \left(\frac\lambda 2t\right)\frac\lambda 2e^{-\frac\lambda 2 t}\, \mathsf 1_{(0,\infty)}(t). $$ $S_5$ has density $g(t) = \lambda e^{-\lambda t}\,\mathsf 1_{(0,\infty)}(t)$, so we compute the density of the sum by convolution: \begin{align} f\star g(t) &= \int_0^t f(s)g(t-s)\ \mathsf ds\\ &= \int_0^t\left(\frac\lambda 2s\right)\frac\lambda 2e^{-\frac\lambda 2 s}\lambda e^{-\lambda(t-s)}\ \mathsf ds\\ &= \lambda e^{-\lambda t}\int_0^t \frac{\lambda^2} 4se^{\frac\lambda 2 s}\ \mathsf ds\\ &= \lambda e^{-\lambda t} \left(1 - \left(1-\frac\lambda 2 t\right)e^{\frac\lambda 2 t} \right),\; t>0.\\ \end{align}
For (2), we exit the system before the waiting customer when that customer's service time exceeds that of the other customer in service at the time the waiting customer enters service and also exceeds our service time. The probability of the first event is $\frac12$, and the probability of the second event conditioned on the first is $\frac12$, so the probability in question is $\left(\frac12\right)^2=\frac14$.
The probability of the event in (3) is the same as that in (2).