Skip to content
Tutorials Center
My learning

Topics

Lesson 10 of 38 · M/M/1 Queues

The M/M/1 Queue: Steady State

Derive the steady-state distribution of the M/M/1 queue, a geometric distribution, and check it against a numerical solution of the balance equations.

The M/M/1 queue is the "hydrogen atom" of queueing theory: Poisson arrivals at rate λ, exponential service at rate μ, one server, unlimited room, first come first served. It is simple enough to solve exactly and rich enough to teach the main lessons. In this lesson we find the long-run probability of seeing n customers in the system.

From the birth-death formula

M/M/1 is a birth-death process with λn = λ and μn = μ for all relevant n. The product form from the last chapter gives

Pn = P0 × (λ/μ)^n = P0 ρ^n

where ρ = λ/μ. The probabilities must add up to 1:

P0 (1 + ρ + ρ² + ρ³ + ...) = 1

When ρ < 1 the geometric series sums to 1/(1-ρ), so P0 = 1 - ρ. Therefore

Pn = (1 - ρ) ρ^n, n = 0, 1, 2, ...

The number of customers in an M/M/1 system has a geometric distribution. If ρ ≥ 1 the series does not converge, which is the stability condition again.

flowchart LR
  S0["0"] -- "λ" --> S1["1"]
  S1 -- "μ" --> S0
  S1 -- "λ" --> S2["2"]
  S2 -- "μ" --> S1
  S2 -- "λ" --> S3["3"]
  S3 -- "μ" --> S2

The M/M/1 state diagram: every up-arrow has rate λ, every down-arrow has rate μ.

What the formula says

  • The server is idle with probability P0 = 1 - ρ. So the busy fraction is exactly ρ, as we expected.
  • The tail is geometric: P(N ≥ k) = ρ^k. At ρ = 0.8, the chance of at least 5 customers is 0.8^5 ≈ 0.33.
  • The most likely state is 0, always, even at high load. Probabilities decrease with n.

The probability that an arriving customer finds n already present equals Pn as well. This is the PASTA property (Poisson Arrivals See Time Averages), which holds because arrivals are Poisson and independent of the past.

Verifying numerically

We can check the formula without algebra. Build the generator matrix Q of the truncated chain (states 0 to N), whose off-diagonal entries are the transition rates and whose rows sum to 0. The steady-state vector π satisfies π Q = 0 and Σ π = 1. Solving that linear system gives π directly.

Python Solve the balance equations

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The difference is tiny (the truncation at 60 states cuts off a negligible tail). This confirms the geometric form.

Tail probabilities and buffer sizing

Because P(N ≥ k) = ρ^k, we can answer capacity questions directly. How many customers must the waiting room handle so that the system holds more than that number with probability under 1%? We need the smallest k with ρ^(k+1) ≤ 0.01, since P(N > k) = ρ^(k+1).

Python Buffer size from the tail

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

At low utilization a small buffer is enough. At ρ = 0.95 you need room for nearly 90 customers, which again shows how load drives congestion.

All of this assumes unlimited waiting room. In the chapter on finite capacity, a full buffer changes the model: arrivals that find it full are lost.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. In an M/M/1 queue with rho = 0.6, what is the probability that the system is empty?

    P0 = 1 - rho = 0.4.
  2. 2. With rho = 0.5, what is P(N >= 3)?

    P(N >= k) = rho^k, so 0.5^3 = 0.125.
  3. 3. Which distribution describes the number in an M/M/1 system in steady state?

    Pn = (1 - rho) rho^n is a geometric distribution on 0, 1, 2, ...
  4. 4. Why does the steady-state formula require rho < 1?

    The sum of rho^n over all n is finite only when rho < 1.

Summary

  • M/M/1 has Pn = (1 - ρ) ρ^n for ρ = λ/μ < 1.
  • The server is busy a fraction ρ of the time; P(N ≥ k) = ρ^k.
  • The formula follows from the birth-death product form and a geometric sum.
  • Numerical solution of the balance equations gives the same numbers.

Next: M/M/1 Performance Measures