# How to apply queuing theory to find the long run proportion of customers who leave the system?

I am trying to apply queuing theory / birth and death process to the following.

Suppose customers arrive in a restaurant according to a Poisson process with rate $$\lambda = 1$$.

Suppose there are $$2$$ counters in the restaurant. Customers are served in counter $$1$$ in Exponential $$(1)$$ amount of time, and customers are served in counter $$2$$ in Exponential $$(2)$$ amount of time.

Usage of counters by each customer is independent of the usage of counters by other customers. When a customer comes, s/he chooses counter $$2$$ if it's free/available, otherwise the customer goes to counter $$1$$.

If both counters are occupied, the customer leaves.

Here, I am trying to calculate the long run proportion of customers that leave because both counters are occupied.

I have been trying to set up the balance equations but I am not sure that's the correct approach. I'm preparing for the upcoming finals and I'd be grateful for any help on how to solve this. Thank you so much.

$$EDIT:$$

I tried to model this as an $$M/M/2$$ queue, and I get the following results:

I take the state space to be $$S = (0, 1, 2),$$ where each state refers to the number of customers in the system.

The balance equations are

$$\lambda P_0 = (\mu_1 + \mu_2)P_1$$

$$\lambda P_1 = (\mu_1 + \mu_2)P_2$$

And the normalizing equation is: $$P_0 + P_1 + P_2 = 1$$

Solving this gives me $$P_0 = \frac{9}{13}, P_1 = \frac{3}{13},$$ and $$P_2 = \frac{1}{13}$$

Is this correct? I am doubtful about the logic I have used to arrive at the balance equations, especially because of the fact that customers prefer counter $$2$$ over counter $$1$$.

If this is correct, then, I have $$P_2$$, which is the long run probability that a customer leaves because both counters are occupied. With this, how can I find the long run proportion of customers that leave because both counters are occupied? Thank you for any help.

It sounds like you are modeling an $$M/M/2/2$$ queue. It may be helpful to view the transition diagram, as follows.
Suppose that "deaths" in the process are given by a constant rate, $$\mu_{i}$$, corresponding to the service times at counters $$i=1,2$$. The long-run proportion (steady-state distribution) you seek can be found by first considering the rate in and out of each state. In particular, by viewing the graph, the "flow" out/in of state $$0$$ is $$\begin{equation*} \lambda\pi_{0} = \mu_{2}\pi_{1}; \end{equation*}$$ while the flow out/in of states $$1$$ and $$2$$, respectively, are \begin{alignat*}{1} \pi_{1}(\lambda+\mu_{2}) &= \lambda\pi_{0}+(\mu_{2}+\mu_{1})\pi_{2},\\ (\mu_{2}+\mu_{1})\pi_{2} &= \lambda\pi_{1}. \end{alignat*} Solving the above system of equations (while also accounting for the normalizing equation $$\sum \pi_{i}=1$$) will yield the long-run proportion. There may be some additional interpretation needed to get the exact long-run proportion you are looking for, though.
• Thank you very much for the explanation! The diagram is very helpful. I have one clarification: when we say state $0$, state $1$, etc. here, what does each state represent? Is it the number of customers who are present in the system? Thank you again! Commented Dec 1, 2023 at 2:51
• Hmm, this now makes me think whether $\Pi_2$ is actually the long run proportion of customers who leave because both counters are occupied! This is because customers leave when they see that there are already $2$ customers using the $2$ counters. Commented Dec 1, 2023 at 3:08