# Independent M/M/1 Queues

Suppose that customers arrive at a bank with 6 tellers according to a Poisson process with rate $\lambda$.

Customers go to each teller with probability 1/6 (i.e. there are 6 independent M/M/1 queues), and suppose that each teller serves customers with rate $\mu$ > $\lambda$/6 (i.e. a stationary distribution exists).

Now, suppose that customer A enters the bank immediately after the system becomes stationary, and that customer B is the very next customer to enter the bank after customer A.

Let $T_A$ be the time at which customer A exits the bank (i.e. finishes being served) and let $T_B$ be the time at which customer B exits the bank.

Define $D := T_B - T_A$.

Find

(a) $\mathbb{E}(D$ | B joins the same queue as A$)$

(b) $\mathbb{E}(D)$

## 1 Answer

Denote $E$ the event that $B$ joins the same queue as $A$. Now, the service duration of $A$, $S_A$, is exponentially distributed with rate $\mu$, while the interarrival time for $B$, $X_B$ is exponentially distributed with rate $\lambda$. Notice that the probability that $A$ finishes before $B$ arrives is $$P(S_A \leq X_B) = \frac{\mu}{\lambda + \mu}.$$ There are many ways to justify the above equation, but the simplest is to evaluate a properly-configured integral.

(a). We can condition on the event $S_A \leq X_B$ to obtain \begin{align} \newcommand{\EE}{\mathbb{E}} \EE(D \mid E) &= \EE(T_B - T_A \mid E) \\ &= \EE(T_B \mid E) - \EE(T_A \mid E) \\ &= \left[\EE(T_B \mid E, S_A \leq X_B) \cdot P(S_A \leq X_B) + \EE(T_B \mid E, S_A \leq X_B) \cdot P(S_A > X_B)\right] - \frac{1}{\mu} \\ &= \left[ \frac{1}{\mu} \cdot \frac{\mu}{\lambda + \mu} + \frac{2}{\mu} \cdot \frac{\lambda}{\mu + \lambda} \right] - \frac{1}{\mu} \\ &= \frac{\lambda }{\lambda \mu + \mu^2}. \end{align}

(b). Writing $\EE(D) = \EE(\EE(D \mid E))$, we have \begin{align} \EE(D) &= \EE(D \mid E) \cdot P(E) + \EE(D \mid \lnot E) \cdot P(\lnot E) \\ &= \frac{1}{6} \cdot \frac{\lambda}{\lambda \mu + \mu^2} + \frac{1}{5} \cdot \left[ \EE(T_B \mid \lnot E) - \EE(T_A \mid \lnot E) \right] \\ &= \frac{1}{6} \cdot \frac{\lambda}{\lambda \mu + \mu^2} + \frac{1}{5} \cdot \left[ \frac{1}{\mu} + \frac{1}{\lambda} - \frac{1}{\mu} \right] \\ &= \frac{\lambda}{6\mu(\lambda + \mu)} + \frac{1}{5\lambda}. \end{align}