Tutorials › Stochastic Processes › Local Balance Equations for Queue Length

The M/M/1 Queue · Tutorial 625 of 994

Local Balance Equations for Queue Length

Learn how stationary flow across each queue-length boundary gives a geometric probability law, and when that law can be normalized.

Intermediate 9 min read

What You'll Learn

  • State the M/M/1 generator and check its boundary and interior row sums.
  • Derive local balance from the stationary global-balance equations.
  • Solve the adjacent-state recurrence and normalize the geometric probabilities.
  • Explain why no stationary probability distribution results when the arrival rate is at least the service rate.
  • Check local balance and normalization in exact-rate examples.
  • Distinguish a stationary distribution from a limiting distribution.

Stationary Flow Across Queue-Length Boundaries

In an M/M/1 queue, arrivals increase the number of customers in the system by one, while service completions decrease it by one whenever the system is nonempty. A stationary distribution describes probabilities that remain unchanged over time. Local balance expresses this stationarity through a particularly simple comparison: for each adjacent pair of queue lengths, the stationary flow upward must equal the stationary flow downward. This turns a system of balance equations into a recurrence for the probabilities.

Assume throughout that the arrival rate \(\lambda\) and service rate \(\mu\) are both strictly positive. On a probability space \((\Omega,\mathcal{F},\mathbb{P})\), let \((X_t)_{t\ge0}\) be the queue-length continuous-time Markov chain on \(S=\{0,1,2,\ldots\}\), with its natural filtration \((\mathcal{F}_t)_{t\ge0}\). From state \(0\), an arrival moves the chain to \(1\) at rate \(\lambda\). From state \(n\ge1\), arrivals move it to \(n+1\) at rate \(\lambda\), and service completions move it to \(n-1\) at rate \(\mu\).

The generator \(Q=(q_{ij})\) records these transition rates. Its nonzero entries are \(q_{01}=\lambda\), \(q_{00}=-\lambda\), and, for \(n\ge1\), \(q_{n,n+1}=\lambda\), \(q_{n,n-1}=\mu\), and \(q_{nn}=-(\lambda+\mu)\). Every other entry is zero. The row at state \(0\) sums to \(-\lambda+\lambda=0\); each row at a positive state sums to \(\mu-(\lambda+\mu)+\lambda=0\). The rates out of any state are at most \(\lambda+\mu\), so this generator has bounded rates.

Definition: A stationary distribution is a probability vector \(\pi=(\pi_0,\pi_1,\ldots)\) such that, if \(X_0\) has distribution \(\pi\), then \(X_t\) has distribution \(\pi\) for every \(t\ge0\). Here \(\pi_n=\mathbb{P}(X_t=n)\) under that initialization, and \(\sum_{n=0}^{\infty}\pi_n=1\). The local-balance equations for the M/M/1 queue are \(\pi_n\lambda=\pi_{n+1}\mu\) for every \(n\ge0\).

From Global Balance to Local Balance

For this bounded-rate chain, stationarity is equivalent to the coordinate equations \((\pi Q)_n=0\) for all \(n\). To see why the generator equations apply, the transition semigroup is \(P(t)=e^{tQ}\). Since the rates are bounded, \(Q\) is a bounded operator on summable row vectors, and the exponential series converges. If \(\pi P(t)=\pi\) for all \(t\), differentiating at \(t=0\) gives \(\pi Q=0\). Conversely, if \(\pi Q=0\), then every positive power satisfies \(\pi Q^k=0\) for \(k\ge1\), so the exponential series gives \(\pi e^{tQ}=\pi\). This argument is specific to the bounded-rate setting used here.

Theorem: For the M/M/1 generator above, a probability vector \(\pi\) is stationary if and only if it satisfies the local-balance equations \(\pi_n\lambda=\pi_{n+1}\mu\) for every \(n\ge0\).

Proof. Assume first that \(\pi\) is stationary. By the generator characterization, \(\pi Q=0\). At state \(0\), the coordinate equation is \[ -\lambda\pi_0+\mu\pi_1=0. \] At each state \(n\ge1\), it is \[ \lambda\pi_{n-1}-(\lambda+\mu)\pi_n+\mu\pi_{n+1}=0. \] Define the net upward flow across the boundary between states \(n\) and \(n+1\) by \(J_n=\lambda\pi_n-\mu\pi_{n+1}\). The equation at state \(0\) gives \(J_0=0\). For each \(n\ge1\), direct subtraction gives \[ J_{n-1}-J_n =\lambda\pi_{n-1}+\mu\pi_{n+1}-(\lambda+\mu)\pi_n =0. \] Thus \(J_n=J_{n-1}\) for every \(n\ge1\). Starting from \(J_0=0\), induction gives \(J_n=0\) for all \(n\ge0\), which is exactly local balance. Conversely, suppose local balance holds. It gives the state \(0\) equation immediately. For \(n\ge1\), subtracting the local-balance equation at \(n\) from the one at \(n-1\) yields \[ \lambda\pi_{n-1}-(\lambda+\mu)\pi_n+\mu\pi_{n+1}=0. \] Therefore \(\pi Q=0\), and the bounded-rate semigroup argument shows that \(\pi\) is stationary. \(\square\)

The boundary equation matters: there is no transition from state \(0\) to a negative queue length. The first balance equation is therefore \(\lambda\pi_0=\mu\pi_1\), not an interior equation with an additional probability \(\pi_{-1}\). Once the boundary equation holds, each interior equation says that the net flow across consecutive boundaries is unchanged; the proof shows that this flow must be zero at every boundary.

Solving and Normalizing the Recurrence

Because \(\mu>0\), local balance can be rearranged as \(\pi_{n+1}=(\lambda/\mu)\pi_n\). Set \(\rho=\lambda/\mu\), the traffic intensity. Repeated application gives \(\pi_n=\pi_0\rho^n\) for every \(n\ge0\). This recurrence determines the relative probabilities, but they form a stationary distribution only if they can be normalized to sum to one.

Result: If \(0<\rho<1\), the local-balance recurrence has the normalized solution \(\pi_n=(1-\rho)\rho^n\), \(n\ge0\). If \(\rho\ge1\), no probability vector can satisfy the recurrence.

Proof. The recurrence gives \(\pi_n=\pi_0\rho^n\) by induction: it holds at \(n=0\), and if it holds at \(n\), then \(\pi_{n+1}=\rho\pi_n=\pi_0\rho^{n+1}\). If \(\pi_0=0\), the recurrence forces every \(\pi_n=0\), contradicting the requirement that the probabilities sum to one. Thus any probability solution must have \(\pi_0>0\). When \(\rho\ge1\), every term \(\pi_0\rho^n\) is at least \(\pi_0\), so the infinite sum diverges and cannot equal one. When \(0<\rho<1\), the geometric-series identity gives \(\sum_{n=0}^{\infty}\pi_0\rho^n=\pi_0/(1-\rho)\). Setting this sum equal to one requires \(\pi_0=1-\rho\). The resulting probabilities are nonnegative, sum to one, and satisfy \(\pi_n\lambda=\pi_{n+1}\mu\), since \((1-\rho)\rho^n\lambda=(1-\rho)\rho^{n+1}\mu\) when \(\rho=\lambda/\mu\). The theorem then shows that this probability vector is stationary. \(\square\)

This result identifies when the local-balance solution can be a probability distribution. It does not say that a chain started from every initial state converges to that distribution; stationarity and convergence to stationarity are different claims.

Worked Example: Arrival Rate Below Service Rate

Take \(\lambda=2\) and \(\mu=3\). The generator has row \(0\) with entries \(q_{00}=-2\), \(q_{01}=2\), whose sum is \(-2+2=0\). Each positive-state row has entries \(q_{n,n-1}=3\), \(q_{nn}=-5\), \(q_{n,n+1}=2\), whose sum is \(3-5+2=0\). The traffic intensity is \(\rho=2/3<1\), so the normalized recurrence solution is \(\pi_n=(1-2/3)(2/3)^n\).

Substituting \(n=0,1,2\) gives \(\pi_0=1/3\), \(\pi_1=(1/3)(2/3)=2/9\), and \(\pi_2=(1/3)(2/3)^2=4/27\). Local balance at the first boundary gives \(\pi_0\lambda=(1/3)2=2/3\), while \(\pi_1\mu=(2/9)3=2/3\). At the next boundary, \(\pi_1\lambda=(2/9)2=4/9\), while \(\pi_2\mu=(4/27)3=4/9\).

Check: The probabilities sum to \((1/3)\sum_{n=0}^{\infty}(2/3)^n=(1/3)/(1-2/3)=1\). The adjacent-state flow calculations also agree at both boundaries checked.

Worked Example: Arrival Rate Above Service Rate

Take \(\lambda=3\) and \(\mu=2\). The row at state \(0\) has entries \(-3\) and \(3\), summing to zero. Each positive-state row has entries \(2\), \(-5\), and \(3\), summing to \(2-5+3=0\). Here \(\rho=3/2\), so the local-balance recurrence requires \(\pi_n=\pi_0(3/2)^n\).

If \(\pi_0>0\), then every term is at least \(\pi_0\), because \((3/2)^n\ge1\) for \(n\ge0\); hence the series cannot have finite sum. If \(\pi_0=0\), the recurrence forces every probability to be zero. Neither case gives a probability distribution, so there is no stationary distribution satisfying these equations.

Check: The local-balance equation at \(n=0\) requires \(3\pi_0=2\pi_1\), or \(\pi_1=(3/2)\pi_0\), consistent with the recurrence. The obstacle is normalization, not failure of the adjacent-state equation.

Worked Example: Checking Global Balance from Local Balance

Take \(\lambda=1\) and \(\mu=2\). The generator row at state \(0\) has entries \(-1,1\) and sums to zero; each positive-state row has entries \(2,-3,1\) and sums to zero. Since \(\rho=1/2\), the candidate probabilities are \(\pi_n=(1/2)(1/2)^n\). In particular, \(\pi_0=1/2\), \(\pi_1=1/4\), \(\pi_2=1/8\), and \(\pi_3=1/16\).

The boundary equation is \(\lambda\pi_0=1(1/2)=1/2\) and \(\mu\pi_1=2(1/4)=1/2\). At the boundary between states \(1\) and \(2\), \(\lambda\pi_1=1/4\) and \(\mu\pi_2=2(1/8)=1/4\). To check the global equation at state \(1\), its incoming flow is \(\lambda\pi_0+\mu\pi_2=1/2+1/4=3/4\), and its outgoing flow is \((\lambda+\mu)\pi_1=3(1/4)=3/4\). At state \(2\), incoming flow is \(\lambda\pi_1+\mu\pi_3=1/4+1/8=3/8\), and outgoing flow is \((\lambda+\mu)\pi_2=3(1/8)=3/8\).

Check: The probabilities sum to \((1/2)/(1-1/2)=1\), and the first two interior global-balance equations agree numerically. The theorem establishes the same equality at every positive state from local balance.

Interpreting the Flow Equations

The equation \(\pi_n\lambda=\pi_{n+1}\mu\) compares flows across the cut separating states \(0,\ldots,n\) from states \(n+1,n+2,\ldots\). Under stationarity, the only upward crossing of this cut is an arrival from state \(n\), with probability of being at that state \(\pi_n\) and rate \(\lambda\). The only downward crossing is a service completion from state \(n+1\), with probability \(\pi_{n+1}\) and rate \(\mu\). The equation says these stationary rates match.

A common mistake is to reverse the ratio and write \(\pi_{n+1}=(\mu/\lambda)\pi_n\). For the rates \(\lambda=3,\mu=2\), this mistake gives the proposed values \(\pi_0=1/3\) and \(\pi_1=(1/3)(2/3)=2/9\), using the reversed ratio’s geometric normalization. But the boundary flows would be \(\lambda\pi_0=3(1/3)=1\) and \(\mu\pi_1=2(2/9)=4/9\), which are unequal. The correction is to solve \(\lambda\pi_n=\mu\pi_{n+1}\) for the next probability: \(\pi_{n+1}=(\lambda/\mu)\pi_n\). A second frequent error is to normalize a geometric sequence with ratio at least one; checking the infinite sum prevents treating a formal recurrence solution as a stationary probability distribution.

Check Your Understanding

For each question, use the local-balance equation with the stated arrival and service rates, and distinguish a recurrence solution from a normalized probability distribution.

  1. For \(\lambda=2\), \(\mu=5\), compute \(\rho\), \(\pi_0\), and \(\pi_2\) if the recurrence is normalized.
  2. Write the global-balance equation at state \(2\) and show how the local-balance equations at the adjacent boundaries imply it.
  3. For \(\lambda=\mu>0\), what sequence does the recurrence require, and why can it not be normalized?
  4. For the rates \(\lambda=1,\mu=3\), check the local-balance equation at \(n=0\) using the normalized probabilities.
  5. In one sentence, explain why satisfying a stationary balance equation is not by itself a claim about convergence from every initial state.