# How to determine queue distribution?

I'm working with a queue with exponential service times with rate $1/\mu$. There are two customers in the queue and when they are served they rejoin the queue exponentially with rate $1/\lambda$.

Now, how can I calculate the probability that there is 1 customer in the queue at a random moment in time, and the probability that there is 1 customer in the queue upon arrival of a customer.

[I'm preparing for an exam and this question was used last year]

• "they rejoin the queue exponentially with rate $1/\lambda.$" Does that mean each customer, after being served, waits an amount of time with expected value $\lambda$ and then rejoins the queue? Is a customer being served at the initial time when these two customers are in the queue? Do only two customers exist? – Michael Hardy Jan 17 '18 at 16:13
• I think only two customers exist in the queue and that a customer after being served waits before rejoining the queue. – Ricardo Jan 17 '18 at 17:12
• You have a continuous-time Markov chain with the following states: (1) No one is in the queue and no one is being serviced. (2) One customer is being serviced and no one is in the queue. (3) One customer is being serviced and one is in the queue. The transition rate from (1) to (2) is $2/\lambda.$ The sum of the transition rates from (2) to (3) and from (2) to (1) is $1/\mu.$ – Michael Hardy Jan 17 '18 at 18:03