Five Quantities That Describe Different Things
In an M/M/1 queue, it is easy to use “queue length” as if it meant every customer present. That shortcut can lead to incorrect probabilities and delays. The number waiting excludes any customer in service; the number in the system includes that customer. A customer’s waiting time ends when service begins, whereas the total time in the system also includes that customer’s own service.
Assume throughout that arrivals form a Poisson process with rate \(\lambda\), service times are independent exponential random variables with rate \(\mu\), service is first-come, first-served (FCFS), and \(0<\lambda<\mu\). Work on a probability space \((\Omega,\mathcal{F},\mathbb{P})\). Let \((N_t)_{t\ge0}\) be the continuous-time Markov chain giving the number of customers in the system at time \(t\), with state space \(S=\{0,1,2,\ldots\}\) and filtration \((\mathcal{F}_t)_{t\ge0}\) recording the queue history through time \(t\). Its generator \(Q=(q_{ij})\) has \(q_{0,0}=-\lambda\), \(q_{0,1}=\lambda\), and, for \(n\ge1\), \(q_{n,n} =-(\lambda+\mu)\), \(q_{n,n+1}=\lambda\), and \(q_{n,n-1}=\mu\); all other entries are zero. Each row sums to zero. Write \(\rho=\lambda/\mu\), so \(0<\rho<1\).
We consider the stationary regime. The stationary system-size probabilities are \(\pi_n=(1-\rho)\rho^n\), \(n\ge0\). The next result verifies this distribution and translates it into queue-length probabilities. For arrival-based statements, we use PASTA: in a stationary system with Poisson arrivals independent of the state evolution, arrivals see the same state distribution as observations at an arbitrary time. This is the standard Poisson Arrivals See Time Averages result.
Proof. Since \(0<\rho<1\), the geometric series gives \(\sum_{n=0}^\infty(1-\rho)\rho^n=1\). To check stationarity, the probability flow into state \(0\) is \(\pi_1\mu=(1-\rho)\rho\mu=(1-\rho)\lambda=\pi_0\lambda\), its flow out. For each \(n\ge1\), the incoming flow is \(\pi_{n-1}\lambda+\pi_{n+1}\mu\). Using \(\rho\mu=\lambda\), this equals \(\pi_n\mu+\pi_n\lambda=\pi_n(\lambda+\mu)\), the outgoing flow. Thus \(\pi Q=0\); for this birth-death chain with bounded rates, the forward equations then leave \(\pi\) unchanged, so it is stationary. Now \(Q_t=0\) exactly when \(N_t=0\) or \(N_t=1\), giving \(\pi_0+\pi_1=(1-\rho)(1+\rho)=1-\rho^2\). For \(k\ge1\), \(Q_t=k\) exactly when \(N_t=k+1\), giving the stated probability. Finally, the geometric-series identities \(\sum_{n\ge0}n\rho^n=\rho/(1-\rho)^2\) and \(\sum_{k\ge1}k\rho^k=\rho/(1-\rho)^2\) yield \(\mathbb{E}[N_t]=(1-\rho)\sum_{n\ge0}n\rho^n=\rho/(1-\rho)\) and \(\mathbb{E}[Q_t]=(1-\rho)\sum_{k\ge1}k\rho^{k+1}=\rho^2/(1-\rho)\). \(\square\)
What an Arrival Sees and What the Customer Experiences
At an arrival, immediate service means that the system is empty: there is neither a customer in service nor anyone waiting. By PASTA, the probability of immediate service is \(\pi_0=1-\rho\). This is not the probability that the waiting line is empty. The latter is \(1-\rho^2\), because the line is also empty when one customer is being served alone.
The waiting-time distribution makes another distinction. If an arrival finds \(N=n\), then for \(n=0\) its queueing delay is zero. For \(n\ge1\), it must wait for \(n\) service completions before its own service begins: the residual service time of the customer in service is exponential with rate \(\mu\), by memorylessness, and the \(n-1\) customers ahead then receive independent exponential service times. Thus, conditional on seeing \(n\), the delay is a sum of \(n\) independent exponential service times.
Proof. By PASTA, the arrival sees \(n\) customers with probability \((1-\rho)\rho^n\). Let \(s\ge0\), and write \(\mathbb{E}[e^{-sW_q}]\) for the Laplace transform of its delay. Conditional on seeing \(n\ge1\), the delay is a sum of \(n\) independent exponential variables of rate \(\mu\), whose transform is \((\mu/(\mu+s))^n\). Therefore, with \(x=\rho\mu/(\mu+s)\), the geometric series gives \(\mathbb{E}[e^{-sW_q}]=(1-\rho)+(1-\rho)\sum_{n\ge1}x^n=(1-\rho)(1+x/(1-x))=(1-\rho)(s+\mu)/(s+\mu-\lambda)\). The mass at zero is the probability of seeing \(n=0\), namely \(1-\rho\). Subtracting that atom and dividing by \(\rho\), the conditional transform given positive delay is \(\big(\mathbb{E}[e^{-sW_q}]-(1-\rho)\big)/\rho=(\mu-\lambda)/(s+\mu-\lambda)\). This is the transform of an exponential random variable with rate \(\mu-\lambda\), so the stated positive-delay law and tail follow. The arriving customer’s own service time is independent of the delay and has transform \(\mu/(\mu+s)\). Hence \(\mathbb{E}[e^{-sT}]=\mathbb{E}[e^{-sW_q}]\mu/(\mu+s)=(\mu-\lambda)/(s+\mu-\lambda)\), the transform of an exponential variable with rate \(\mu-\lambda\). Taking means from these distributions gives \(\mathbb{E}[W_q]=\rho/(\mu-\lambda)\) and \(\mathbb{E}[T]=1/(\mu-\lambda)\). \(\square\)
The results distinguish three useful probabilities and two different means. The probability the line is empty is \(1-\rho^2\); the probability an arrival begins service immediately is \(1-\rho\); and the probability an arrival has to wait is \(\rho\). The mean queueing delay is not the mean total time: it excludes the customer’s service.
| Quantity | Definition or event | Stationary value |
|---|---|---|
| Number in system | Waiting customers plus any customer in service | \(\mathbb{E}[N_t]=\rho/(1-\rho)\) |
| Number waiting | \(Q_t=(N_t-1)^+\) | \(\mathbb{E}[Q_t]=\rho^2/(1-\rho)\) |
| Immediate service | Arrival sees \(N=0\) | \(1-\rho\) |
| Queueing delay | Arrival until service begins | \(\mathbb{E}[W_q]=\rho/(\mu-\lambda)\) |
| Total time | Arrival until departure | \(\mathbb{E}[T]=1/(\mu-\lambda)\) |
Worked Calculations
Worked Example: Counts and Immediate Service
Take \(\lambda=2\) and \(\mu=5\) customers per unit time. The generator’s row at \(0\) sums to \(-2+2=0\); each row \(n\ge1\) sums to \(2+5-7=0\). The stability condition holds, and \(\rho=2/5\).
The system-size probabilities are \(\pi_n=(3/5)(2/5)^n\). In particular, \(\mathbb{P}(N=0)=3/5\), \(\mathbb{P}(N=1)=(3/5)(2/5)=6/25\), and \(\mathbb{P}(N=2)=(3/5)(4/25)=12/125\). The number waiting is zero at \(N=0\) and \(N=1\), so \(\mathbb{P}(Q=0)=3/5+6/25=21/25\). For exactly one waiting, \(N=2\), giving \(\mathbb{P}(Q=1)=12/125\). Immediate service, however, requires \(N=0\), so its probability is \(3/5\), not \(21/25\).
Check: \(\mathbb{P}(Q=0)=1-\rho^2=1-4/25=21/25\), as computed from the two system-size cases. Also \(\mathbb{P}(N=0)=1-\rho=1-2/5=3/5\), the immediate-service probability.
Worked Example: Queueing Delay and Total Time
For the same rates, the generator row sums are \(-2+2=0\) at state \(0\) and \(2+5-7=0\) at every positive state. Here \(\rho=2/5\) and \(\mu-\lambda=5-2=3\). The probability of zero queueing delay is \(1-\rho=3/5\); the probability of a positive delay is \(2/5\). The positive delay, conditional on occurring, is exponential with rate \(3\).
Thus, for \(t\ge0\), \(\mathbb{P}(W_q>t)=(2/5)e^{-3t}\), and \(\mathbb{E}[W_q]=(2/5)(1/3)=2/15\). The total time is exponential with rate \(3\), so \(\mathbb{E}[T]=1/3\). Its mean exceeds the mean queueing delay because it includes service.
Check with mean customer counts: The mean number waiting is \(\rho^2/(1-\rho)=(4/25)/(3/5)=4/15\), and \(\lambda\mathbb{E}[W_q]=2(2/15)=4/15\). The mean system size is \(\rho/(1-\rho)=(2/5)/(3/5)=2/3\), and \(\lambda\mathbb{E}[T]=2(1/3)=2/3\). These agree with Little’s law for the waiting line and the whole system, respectively.
Worked Example: Conditioning on the Number Seen
Take \(\lambda=1\) and \(\mu=3\). The generator row at \(0\) sums to \(-1+1=0\), and each row \(n\ge1\) sums to \(1+3-4=0\). Then \(\rho=1/3\), so an arrival sees two customers with probability \(\pi_2=(2/3)(1/3)^2=2/27\).
Conditional on seeing \(N=2\), the arriving customer waits for two service completions before service begins. The delay is the sum of two independent exponential service times of rate \(3\), with conditional mean \(2/3\). This conditional mean is not the overall mean waiting time: arrivals who see \(N=0\) have no queueing delay, and other arrival states have different conditional delays. The overall positive-delay probability is \(1/3\), and the conditional positive-delay mean is \(1/(\mu-\lambda)=1/2\). Therefore \(\mathbb{E}[W_q]=(1/3)(1/2)=1/6\), while \(\mathbb{E}[T]=1/(3-1)=1/2\).
Check: The count means are \(\mathbb{E}[Q_t]=\rho^2/(1-\rho)=(1/9)/(2/3)=1/6\) and \(\mathbb{E}[N_t]=\rho/(1-\rho)=(1/3)/(2/3)=1/2\). Multiplying the computed time means by the arrival rate \(1\) gives those same values.
Common Confusion and a Practical Check
Common mistake: For \(\rho=2/5\), one might calculate the probability of immediate service as the probability that no one is waiting, \(1-\rho^2=21/25\). That is wrong: a state with one customer in service and no one in line still leaves the arriving customer waiting. Immediate service requires the system to be empty, so the correct probability is \(\pi_0=1-\rho=3/5\). Conversely, the number waiting is zero in both the empty state and the one-customer state.
A reliable check is to identify the quantity before selecting a formula. For a snapshot, ask whether the count includes the customer in service. For an arrival, use the system size it sees to decide whether it must wait. For a time measure, specify whether the clock stops at service start or at departure. Under FCFS, the relation \(T=W_q+S_{\mathrm{own}}\) keeps queueing delay and service time separate. The formulas above require the stationary, stable M/M/1 assumptions; they are not formulas for an unstable queue or a different service discipline.
Check Your Understanding
Use the definitions and formulas above, and distinguish the state observed at an arbitrary time from the event an arriving customer receives immediate service.
- For \(\rho=1/2\), find the probability that the waiting line is empty and the probability that an arrival receives immediate service.
- If \(\lambda=3\) and \(\mu=6\), find the mean number waiting and the mean number in the system.
- For \(\lambda=1\) and \(\mu=4\), find the probability of a positive queueing delay and the conditional mean delay given that it is positive.
- Explain why an arrival who sees exactly two customers waits for two service completions before beginning service in an FCFS M/M/1 queue.
- State which mean time is paired with the mean number waiting in Little’s law, and which is paired with the mean number in the system.