Q:

Exact probabilities in a $M/M/1$ queue

Suppose we have a $M/M/1$ queue with arrival rate $\lambda$, service rate $\mu$, and $\lambda<\mu$. Suppose also that there are initially $k$ people in the queue.
I want to find the exact probability that there are $n$ people in the queue at time $t$, for arbitrary $n$ and $t$. How can I do so? (Of course, as $t\rightarrow \infty$ the probability approaches the invariant distribution, but I am really only interested in the exact probability here.)

A:

This is covered in Wikipedia's M/M/1 queue article, it is the transient solution of the model. You're looking for
$$p_n(t)=e^{-(\lambda+\mu)t} \left[ \rho^{\frac{n-k}{2}} I_{n-k}(at) + \rho^{\frac{n-k-1}{2}} I_{n+k+1}(at) + (1-\rho) \rho^{n} \sum_{j=n+k+2}^{\infty} \rho^{-j/2}I_j(at) \right]$$
where $p_n(t)$ is the probability that there are $n$ customers in the queue at time $t$. $\rho=\lambda/\mu$, $a=2\sqrt{\lambda\mu}$ and $I_{n}$ is the modified Bessel function of the first kind. 
Note the notation in the article is slightly different to yours, in particular $k$ is different.

