Modified M/M/1/2 with 2 possible arrival rates and M/M/1/5 queue I've been stuck on this question for hours, and could use some help :)
"An M/M/1/2 queue has service rate $\mu$ and arrival rate of either $\lambda_1$ or $\lambda_2$. The rate can change only when the server is idle (state 0), whereupon it changes as a Markov process with instantaneous transition rate $\alpha$ from $\lambda_1$ to $\lambda_2$ and $\beta$ from $\lambda_2$ to $\lambda_1$."
1) Define the state space, draw its state-transition diagram: I have 6 states {$0_{\lambda_1}$, $0_{\lambda_2}$, $1_{\lambda_1}$, $1_{\lambda_2}$, $2_{\lambda_1}$, $2_{\lambda_2}$} (so the system can start at state $0_{\lambda_1}$ or $0_{\lambda_2}$, with an arrival rate $\lambda_1$ or $\lambda_2$, which it then keeps until it comes back to one of the $0$'s and switches arrival rates).
2) Show that the queue is equivalent to a standard M/M/1/5 queue and specify its service and arrival rate functions?
I can see why it 'looks' like an M/M/1/5 (as it has 6 states), but I can't figure out what M/M/1/5 (alternatively, I may have completely mis-interpreted the question...).
EDIT (how I think I've solved it)
My initial M/M/1/2 queue had the following transitions:


*

*$0_{\lambda_1} \rightarrow 1_{\lambda_1}:  (1-\alpha)\lambda_1$

*$0_{\lambda_2} \rightarrow 1_{\lambda_2}:  (1-\beta)\lambda_2$


and


*

*$0_{\lambda_1} \rightarrow 1_{\lambda_2}:  \alpha\lambda_1$

*$0_{\lambda_2} \rightarrow 1_{\lambda_1}:  \beta\lambda_2$


I don't know why I assumed that the rate changes would occur at the same time as an arrival, and this is how I got stuck. If instead, we consider the rate changes ($\lambda_1 \rightarrow \lambda_2$ and $\lambda_2 \rightarrow \lambda_1$) as occurring 'on their own', then we need to replace transitions 3 and 4 above with the following:


*

*$0_{\lambda_1} \rightarrow 0_{\lambda_2}:  \alpha\lambda_1$

*$0_{\lambda_2} \rightarrow 0_{\lambda_1}:  \beta\lambda_2$


Then it reduces to a standard M/M/1/5 (that you can get by relabelling the states in the range [0..5])
Let me know if this isn't clear enough! (I don't have time to draw the Chains in TikZ which would be better, exams start on Monday).
 A: The transition rates are
$$
q_{ij} = \begin{cases}
\lambda_1,& (i,j)\in\{(0_{\lambda_1},1_{\lambda_1}),1_{\lambda_1},2_{\lambda_1}) \}\\
\lambda_2,& (i,j)\in\{(0_{\lambda_2},1_{\lambda_2}),1_{\lambda_2},2_{\lambda_2}) \}\\
\mu,& (i,j)\in\{(1_{\lambda_1},0_{\lambda_1}),(2_{\lambda_1},1_{\lambda_1}),(1_{\lambda_2},0_{\lambda_2}),(2_{\lambda_2},1_{\lambda_2})\}\\
\alpha,& (i,j) = (0_{\lambda_1},0_{\lambda_2})\\
\beta,& (i,j) = (0_{\lambda_2},0_{\lambda_1})
\end{cases}
$$
The global balance equations $$\sum_{j\ne i}q_{ij} = \sum_{j\ne i}q_{ji} $$ can be solved to yield the stationary distribution
\begin{align}
&\left(\pi_{0_{\lambda_1}},\pi_{1_{\lambda_1}},\pi_{2_{\lambda_1}},\pi_{0_{\lambda_2}},\pi_{01_{\lambda_2}},\pi_{2_{\lambda_2}}\right)\\ &= \frac1{(\mu ^2 (\alpha +\beta )+\alpha  \lambda _2 \left(\lambda _2+\mu \right)+\beta  \lambda _1 \mu +\beta  \lambda _1^2)}(\beta\mu^2, \beta\mu\lambda_1,\beta\lambda_1^2,\alpha\mu^2,\alpha\mu\lambda_2,\alpha\lambda_2^2).
\end{align}
It follows that the equilibrium arrival rate is
\begin{align}
\lambda &= \lambda_1\left(\pi_{0_{\lambda_1}}+\pi_{1_{\lambda_1}}+\pi_{2_{\lambda_1}}\right)+\lambda_2\left(\pi_{0_{\lambda_2}}+\pi_{1_{\lambda_2}}+\pi_{2_{\lambda_2}}\right)\\
&=\left(\alpha +\beta +\mu ^3\right) \left(\alpha  \lambda _2 \left(\lambda _2+\mu \right)+\beta  \lambda _1 \left(\lambda _1+\mu \right)\right)+\mu ^2 \left(\alpha  \lambda _2^3+\beta  \lambda _1^3\right)
\end{align}
There remains some work to show that the M/M/1/5 queue with arrival rate $\lambda$ and service rate $\mu$ is equivalent to the original system, but the intuition should be clear.
An alternative approach would be to consider the alternating renewal process whose state at time $t$ is given by the arrival rate at time $t$. (The actual arrival process is a phase-type renewal process, by the way.)
