I have an M/M/1 queue with people arriving Poisson with parameter $\lambda$ and a service time exponentially distributed rate $\mu$.
I have been asked to find the average time between the first person arriving at the queue and the queue being empty again.
I let the Expected time for the queue to be empty from there being n people be denoted $E_n$
Thus:
$$ (\lambda + \mu)E_n = 1 + \lambda E_{n+1} + \mu E_{n-1} $$
Solving this gave me
$$ E_n = \frac{n}{\mu-\lambda} + c_1 + c_2 \left(\frac{\mu}{\lambda}\right)^n $$
And substituting $E_0=0$ in told me $c_1=-c_2$.
But this still leaves me with:
$$ E_n = \frac{c_2\left(\left(\frac{\mu}{\lambda}\right)^n -1\right)(\lambda - \mu) - n }{\lambda - \mu} $$
How should I work out what $c_2$ is?
If the system is in state $n$, then it moves to state $0$ by successively moving through states $n-1,\;n-2,\;\ldots,\;0$.
The mean time for each of these transitions equals $E_1$ since we have the same birth and death rates at all states greater than $0$. The sum of them equals $E_n$, so we have $E_n = nE_1$. That is, $E_n$ is $n$ times some constant ($E_1$). Given
$$E_n = \dfrac{n}{\mu-\lambda} + c_1 + c_2\left(\dfrac{\mu}{\lambda}\right)^n$$
the only possibility is to have $c_1=c_2=0$. This gives the solution
$$E_n = \dfrac{n}{\mu-\lambda}.$$
Hence the required answer is
$$E_1 = \dfrac{1}{\mu-\lambda}.$$