# Thread: 2 server exponential queue time

1. ## 2 server exponential queue time

Assume that in a two server system, a customer is serviced by server 1 then by server 2. The service times are exponentially distributed with means $\displaystyle \mu_1$and $\displaystyle \mu_2$, respectively. Further assume that if server 2 is busy, then the customer in server 1 will remain there until server 2 becomes free (blocking any other customer from entering the system until server 2 becomes free). After being serviced by server 2 the customer then leaves the system. Suppose that you arrive to find server 1 and 2 busy, what is the expected time you spend in the system?

Attempt:

for your service it would merely be $\displaystyle \frac{1}{\mu_1} +\frac{1}{\mu_2}$

now for the waiting time, I basically reasoned it as follows:

Assume that there is only one customer and he's at server 2, leaving server 1 empty.

so his expected time in the system will be $\displaystyle \bigg{[}\frac{1}{\mu_1} +\frac{1}{\mu_2} \bigg{]} +\frac{1}{\mu_2}P\{\mu_1<\mu_2\} = \overbrace{\left[\frac{1}{\mu_1} +\frac{1}{\mu_2}\right]}^{\mbox{service time}} +\overbrace{\frac{1}{\mu_2} \cdot \frac{\mu_1}{\mu_1+\mu_2}}^{\mbox{wait time}}$ (where I get the probability from http://www.mathhelpforum.com/math-he...tribution.html)

using the above result would yield:

$\displaystyle \frac{1}{\mu_1} +\frac{1}{\mu_2} + \bigg{[}\left(\frac{1}{\mu_1} +\frac{1}{\mu_2}\right) + \frac{1}{\mu_2} \cdot \frac{\mu_1}{\mu_1+\mu_2}\bigg{]} + \bigg{[}\frac{1}{\mu_2} \cdot \frac{\mu_1}{\mu_1+\mu_2}\bigg{]}$

where the last term is your wait time given that you finished with server 1 before the customer finished with server 2.

2. Originally Posted by lllll
Assume that in a two server system, a customer is serviced by server 1 then by server 2. The service times are exponentially distributed with means $\displaystyle \mu_1$and $\displaystyle \mu_2$, respectively. Further assume that if server 2 is busy, then the customer in server 1 will remain there until server 2 becomes free (blocking any other customer from entering the system until server 2 becomes free). After being serviced by server 2 the customer then leaves the system. Suppose that you arrive to find server 1 and 2 busy, what is the expected time you spend in the system?

Attempt:

for your service it would merely be $\displaystyle \frac{1}{\mu_1} +\frac{1}{\mu_2}$
This is nothing crucial, but the text says "exponentially distributed with means $\displaystyle \mu_1$ and $\displaystyle \mu_2$", so I guess the parameters are $\displaystyle \frac{1}{\mu_1}$ and $\displaystyle \frac{1}{\mu_2}$, and the expected service time is then just $\displaystyle \mu_1+\mu_2$.

now for the waiting time, I basically reasoned it as follows:

Assume that there is only one customer and he's at server 2, leaving server 1 empty.

so his expected time in the system will be $\displaystyle \bigg{[}\frac{1}{\mu_1} +\frac{1}{\mu_2} \bigg{]} +\frac{1}{\mu_2}P\{{\color{red}T_1<T_2}\} = \overbrace{\left[\frac{1}{\mu_1} +\frac{1}{\mu_2}\right]}^{\mbox{service time}} +\overbrace{\frac{1}{\mu_2} \cdot \frac{\mu_1}{\mu_1+\mu_2}}^{\mbox{wait time}}$ (where I get the probability from http://www.mathhelpforum.com/math-he...tribution.html)

using the above result would yield:

$\displaystyle \frac{1}{\mu_1} +\frac{1}{\mu_2} + \bigg{[}\left(\frac{1}{\mu_1} +\frac{1}{\mu_2}\right) + \frac{1}{\mu_2} \cdot \frac{\mu_1}{\mu_1+\mu_2}\bigg{]} + \bigg{[}\frac{1}{\mu_2} \cdot \frac{\mu_1}{\mu_1+\mu_2}\bigg{]}$

where the last term is your wait time given that you finished with server 1 before the customer finished with server 2.
Forgetting about the painless means/parameters confusion, I feel like this is almost correct (I just changed a notation), except that I think you count one $\displaystyle \frac{1}{\mu_2}$ too many: the time spent by the previous customer at server2 is included in your last term (it only matters if you're served before he exits), so you don't have to take it in account.

I would have expressed it differently, like: the waiting time is the sum of
- the waiting time before going to server 1, which equals (the serving time at server 1 + the possible waiting time to go to server 2)
- the possible waiting time to go to server 2.

Your computation heavily uses the "memoryless property" of exponential variables. Depending on what you're supposed to justify, additional explanation may be good, notably about the time spent at waiting that the other customer, if any, exits the system.