Determining the balance equations for a Poisson Process

I'm trying to do an exercise (not homework) and I fail to understand the solution the reader is giving me.

Consider a gas station with one gas pump. Cars arrive at the gas station according to a Poisson process with an arrival rate of 20 cars per hour. An arriving car finding $n$ cars at the station immediately leaves with probability $q_n = \frac{n}{4}$ and joins the queue with probability $1-q_n$, where $n=0,1,2,3,4$. Cars are served in order of arrival. The service time (ie. the time for pumping and paying) is exponential and the mean service time is 3 minutes.

Determine the stationary distribution of the number of cars at the gas station.

Converting everything to minutes we have arrival rate $\lambda = \frac{1}{3}$ and service rate $\mu = \frac{1}{3}$.

Now, the reader I use gives as solution:

Solve the global balance equation $\lambda q_n p_n = \mu p_{n+1}, n=0,1,2,3$.

Here, $p_n = P(L = n)$ is the probability that there are $n$ people in the system (either in the queue or in service).

I fail to see how these balance equations are obtained. If I were to make a guess then I'd say "there are $\lambda$ amount of cars coming to the gas station per minute, of which $1-q_n\lambda$ goes to the gas station queue, which happens with probability $p_n$. The amount of cars leaving is $\mu p_{n+1}$ because a car was added to the queue so there were $p_{n+1}$ cars, so $\lambda(1-q_n)p_n = \mu p_{n+1}$" I'm sure this doesn't make any sense but I'm having a hard time getting a feel for this equation. Any help is appreciated.

• I am studying Masters in Applied Statistics and doing the course Stochastic Models and Forecasting, similar topic to what your doing. I have some reference books below: Reference books such as Introduction to probability models by sheldon Ross and probability and Random Processes by Geoffry Grimmett and David Stirzaker, Third Edition, These books are good, but one by Ross is better to read and has explanations, easier to understand – user64079 Feb 26 '13 at 16:04
• @user64079: references are always welcome. Thanks! – Stijn Feb 26 '13 at 16:45

Their equations $\lambda q_n p_n = \mu p_{n+1}$ are clearly wrong, and your equations $\lambda(1-q_n)p_n = \mu p_{n+1}$ are correct. They accidentally switched $q_n$ and $1-q_n$.
• Your chain is a "birth and death" process with birth rates $\lambda_n=\lambda (1-q_n)$ and death rates $\mu_n=\mu$. Solving the detailed balance equations $\lambda(1-q_n)p_n = \mu p_{n+1}$ proves that the process is reversible, and that the $p_n$'s are the stationary probabilities. The intuition for the balance equations is that, in the long run, the rate of transitions from $n$ to $n+1$ must equal the rate of transitions from $n+1$ to $n$. – user940 Apr 27 '11 at 18:20