Verify that $L = \lambda W$, $M/M/2$ I have a $M/M/2$ system, with traffic intensity $\rho = \frac{\lambda}{2\mu}$.
I will call $\boldsymbol \pi$ the stationary distribution. Then, I have formulas for $\pi_0$ and $\pi_k$, and I also have a formula for the mean queue length,
$$L = L_0+\frac{\lambda}{\mu} = \frac{\pi_0}{s!}\left(\frac{\lambda}{\mu}\right)^2\frac{\rho}{(1-\rho)^2}+\frac{\lambda}{\mu}.\tag{1}$$
If I use this formula, I don't think that qualifies as verifying that $L = \lambda W$.
From what I understand, it is also true that
$$L = \sum_{k=0}^\infty k\pi_k.\tag{2}$$
My questions are:


*

*Is equation (2) true?

*How should I verify that $L = \lambda W$?


I did attempt to compute (1) and (2), but I don't think they matched.
I am I on the right track?
 A: Firstly, equation $(2)$ holds by definition since $L$ is the long-term mean of the number of customers in the system, and $\pi_k$ its distribution.
I guess you need to calculate $W$ and this might be made simpler by breaking it up as $W=W_0+W_1$ where:
\begin{align}
W_0 &: \text{the mean time waiting to be served} \\
W_1 &: \text{the mean actual service time.}
\end{align}
The service time has distribution $Exp(\mu)$ so its mean, $W_1$, is $1/\mu$.
Let $T$ be the wait time for any particular new arrival. We condition on the number, $N$, of customers in the system at that time. Note that $N$ (in the long term) has distribution $\pi_n$, and further that if $N\lt 2$ then $T=0$ and since we want the mean of $T$ we don't need the probability of $T=0$. So we find the distribution of $T$ by conditioning on $N$. For $t\gt 0$,
\begin{align}
P(T=t) &= \sum_{n=2}^{\infty} P(T=t\mid N=n)P(N=n) \\
&= \sum_{n=2}^{\infty} \dfrac{(2\mu)^{n-1}t^{n-2}e^{-2\mu t}}{\Gamma(n-1)} \pi_n \\
& \qquad\qquad\qquad\text{since, given $N=n$, $T$ is the wait time for $n-1$ arrivals, } \\
& \qquad\qquad\qquad\text{which has distribution $\Gamma(2\mu,n-1)$} \\
&= \pi_0 \dfrac{\lambda^2}{\mu} e^{-2\mu t} \sum_{n=2}^{\infty} \dfrac{(\lambda t)^{n-2}}{(n-2)!} \qquad\qquad\qquad\text{using $\pi_n=\pi_0 \left(\dfrac{\lambda}{2\mu}\right)^{n-1} \dfrac{\lambda}{\mu}$} \\
&= \pi_0 \dfrac{\lambda^2}{\mu} e^{(\lambda-2\mu) t} \qquad\qquad\qquad\qquad\qquad\text{using Taylor series for $e^x$} \\
& \\
\therefore\quad W_0 &=\int_{0}^{\infty} tP(T=t)\;dt \\
&= \pi_0 \dfrac{\lambda^2}{\mu} \int_{0}^{\infty} te^{(\lambda-2\mu) t}\;dt \\
&= \pi_0 \dfrac{\lambda^2}{\mu} \left[e^{(\lambda-2\mu) t}\left(\dfrac{t}{\lambda-2\mu} - \dfrac{1}{(\lambda-2\mu)^2} \right)\right]_{0}^{\infty}  \\
&= \pi_0 \dfrac{\lambda^2}{\mu} \dfrac{1}{(\lambda-2\mu)^2} \\
&= \dfrac{\lambda^2}{\mu(4\mu^2-\lambda^2)} \qquad\qquad\text{using $\pi_0=\dfrac{1-\frac{\lambda}{2\mu}}{1+\frac{\lambda}{2\mu}}$} \\
& \\
\therefore\quad W &= W_0+W_1 \\
&= \dfrac{4\mu}{4\mu^2-\lambda^2}.
\end{align}
