# What is the probability of finding someone when a packet arrives in a queue

In an $$M/M/1/2$$ queue what is the probability that a packet arrives and finds one packet in the queue, given that we have an arrival rate of $$\lambda$$ and departure rate $$\mu$$.

I have thought of a number of possible solutions. One of them being simply calculating the probability of having two packets in the system as $$(1-\rho)\rho^2$$. Or the probability that a packet arrives and the previous one hasn't left yet as $$\frac{\lambda}{\mu + \lambda}$$.

What would be the correct way of thinking about it?

• What do you mean by "the probability that a packet arrives and finds one packet in the queue"? Over a certain period of time? Or do you mean: For any given packet, what is the probability that when it arrives it finds one packet in the queue? Commented Dec 12, 2019 at 0:04

Assuming you are referring to the steady state of the system, we have the balance equations \begin{align} \lambda\pi_0 &= \mu\pi_1\\ \lambda\pi_1 &= \mu\pi_2, \end{align} from which $$\pi_1 = \frac\lambda\mu \pi_0$$ and $$\pi_2 = \left(\frac\lambda\mu\right)^2\pi_0$$. Let $$\rho = \frac\lambda\mu$$. From $$\pi_0+\pi_1+\pi_2=1$$ we have $$\pi_0(1 + \rho + \rho^2) = 1 \implies \pi_0 = \frac1{1+\rho+\rho^2}.$$ It readily follows that $$\pi_1 = \frac\rho{1+\rho+\rho^2}$$ and $$\pi_2 = \frac{\rho^2}{1+\rho+\rho^2}$$. The probability that an arriving packet finds one packet in the system is exactly $$\pi_1$$.
• Shouldn't it be $\lambda\pi_1=2\mu\pi_2$? When there are two customers, the departure rate applies to each of them. Commented Dec 12, 2019 at 0:39