# Distribution of the number of customers in a system

Consider the following scenario.

Groups of potential customers arrive according to a Poisson process with a rate of 5 groups per hour at a single server service station. When a group arrives, with probability $3/10$ two customers in the group decide that they want to be served by the server, with probability $5/10$ only one customer in the group wants to be served by the server and with probability $2/10$ no customers at all want to be served by the server. It takes an exponential time with a mean of $7.5$ minutes to serve a customer. Customers are served in order of arrival.

Let $p_n$ denote denote the equilibrium probability that there are $n$ customers in the system. I want to determine the distribution of the number of customers present at the server who want to be served. The solution given by my instructor is as follows:

The balance equations are given by:

$$4 p_0 = 8 p_1 \\ 12 p_1 = 2.5 p_0 + 8 p_2\\ 12 p_n = 1.5 p_{n-2} + 2.5 p_{n-1} + 8 p_{n+1}\\$$

with solution $p_n = \frac{15}{64} (3/4)^n + \frac{5}{64} (-1/4)^n$.

My question is, how were the balance equations derived? For instance I don't see where the term $p_{n-1}$ comes from.

To solve this problem you need to write down the transition rate matrix for the problem $Q$ and then solve for a row vector $p$ such that $p Q = 0$ where the sum of the elements of $p$ is 1.