Tutorials › Stochastic Processes › The Waiting-Time Distribution Under FCFS

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

The Waiting-Time Distribution Under FCFS

Learn how the stationary queue length seen by an arrival yields the probability of zero delay and the exponential tail for positive FCFS waits.

Intermediate 10 min read

What You'll Learn

  • Define queueing delay separately from time spent in the system.
  • Use the stability condition and PASTA to find the queue length seen by an arrival.
  • Derive the conditional waiting-time law given the number in the system.
  • Prove the zero-delay probability and the exponential tail formula.
  • Compute and check waiting probabilities and means for specific M/M/1 queues.
  • Identify why omitting the zero-delay atom gives an incorrect tail.

Queueing Delay Under FCFS

In an M/M/1 queue, some arrivals begin service immediately, while others wait for the customers ahead of them. The waiting time therefore has two parts to its distribution: a probability mass at zero and a continuous tail for positive waits. Under first-come, first-served (FCFS) service, both parts can be derived by conditioning on the number of customers already in the system when an arrival occurs.

Consider a queue on a probability space \((\Omega,\mathcal{F},\mathbb{P})\). Let \(N(t)\) be the number of customers in the system at time \(t\), a continuous-time Markov chain with state space \(\{0,1,2,\ldots\}\). Arrivals form a Poisson process of rate \(\lambda\), service times are independent exponential random variables of rate \(\mu\), and the arrival process and service times are independent. There is one server, service is FCFS, and the queue is in stationarity. We assume \(0<\lambda<\mu\), and write \(\rho=\lambda/\mu\), so \(0<\rho<1\).

For a stationary arrival, let \(W_q\) denote the time from that arrival until its service begins. It does not include the arrival’s own service time. An arrival that finds the system empty has \(W_q=0\); one that finds at least one customer has a positive wait with probability one.

Queue-length distribution used below: In stationarity, the M/M/1 queue has \(\mathbb{P}(N(t)=n)=(1-\rho)\rho^n\) for \(n\geq 0\). The probabilities sum to \(1\), since \((1-\rho)\sum_{n=0}^{\infty}\rho^n=1\). They satisfy the local balance equations \((1-\rho)\rho^n\lambda=(1-\rho)\rho^{n+1}\mu\), because \(\rho=\lambda/\mu\). The stationary-arrival version of PASTA says that a Poisson arrival independent of the queue state sees this same distribution just before arrival.

Thus a stationary arrival sees zero customers with probability \(1-\rho\), and sees \(n\geq1\) customers with probability \((1-\rho)\rho^n\). Conditional on seeing \(n\geq1\), FCFS means the arrival must wait for \(n\) service completions before its own service starts. The service currently in progress, if there is one, has an exponential remaining time of rate \(\mu\), by the memoryless property. The following \(n-1\) service times are also independent exponentials of rate \(\mu\). The wait is therefore a sum of \(n\) independent exponential random variables.

The Conditional Waiting-Time Calculation

Lemma: If \(S_n\) is a sum of \(n\geq1\) independent exponential random variables of rate \(\mu>0\), then for \(t\geq0\), \(\mathbb{P}(S_n>t)=e^{-\mu t}\sum_{k=0}^{n-1}(\mu t)^k/k!\).

Proof. For \(n=1\), the exponential tail is \(\mathbb{P}(S_1>t)=e^{-\mu t}\), which is the stated formula. For general \(n\), convolution gives the density \(f_n(u)=\mu^n u^{n-1}e^{-\mu u}/(n-1)!\) for \(u>0\). Indeed, this holds for \(n=1\); if it holds for \(n\), then for \(t>0\), convolution with one more exponential density gives \(f_{n+1}(t)=\int_0^t f_n(u)\mu e^{-\mu(t-u)}\,du =\mu^{n+1}e^{-\mu t}\int_0^t u^{n-1}/(n-1)!\,du =\mu^{n+1}t^n e^{-\mu t}/n!\). This proves the density formula by induction. Integrating this density from \(t\) to infinity and integrating by parts gives \(\mathbb{P}(S_n>t)=e^{-\mu t}(\mu t)^{n-1}/(n-1)!+\mathbb{P}(S_{n-1}>t)\) for \(n\geq2\). Starting with the \(n=1\) tail and applying this recurrence yields the stated finite sum. \(\square\)

The lemma applies to the conditional wait when the arrival sees \(n\) customers. In particular, for \(t\geq0\), the contribution to the tail from that queue length is its probability of occurring multiplied by the conditional probability that the sum of \(n\) service times exceeds \(t\). Summing those contributions produces the waiting-time distribution.

Theorem (Stationary FCFS queueing delay): For a stationary arrival in a stable M/M/1 queue with \(0<\lambda<\mu\), \(W_q\) has an atom at zero of size \(\mathbb{P}(W_q=0)=1-\rho\). For every \(t\geq0\), its strict tail is \(\mathbb{P}(W_q>t)=\rho e^{-(\mu-\lambda)t}\).

Proof. The arrival waits zero time exactly when it sees an empty system. By PASTA, that event has probability \(1-\rho\), proving the mass at zero. For \(t\geq0\), condition on the number \(n\geq1\) seen. The queue-length probabilities and the lemma give \(\mathbb{P}(W_q>t)=(1-\rho)\sum_{n=1}^{\infty}\rho^n e^{-\mu t}\sum_{k=0}^{n-1}(\mu t)^k/k!\). All terms are nonnegative, so the order of these sums may be interchanged. For each \(k\geq0\), the terms involving that \(k\) have \(n\geq k+1\), and \(\sum_{n=k+1}^{\infty}\rho^n=\rho^{k+1}/(1-\rho)\). Consequently, \(\mathbb{P}(W_q>t)=\rho e^{-\mu t}\sum_{k=0}^{\infty}(\rho\mu t)^k/k! =\rho e^{-\mu t}e^{\rho\mu t} =\rho e^{-(\mu-\lambda)t}\), because \(\rho\mu=\lambda\). This calculation includes \(t=0\): the strict tail there is \(\mathbb{P}(W_q>0)=\rho\), as required by the zero-wait mass. \(\square\)

The tail formula describes positive waits as well as the unconditional delay. Since \(\mathbb{P}(W_q>0)=\rho\), for \(t\geq0\) the conditional tail given that a wait occurs is \(\mathbb{P}(W_q>t\mid W_q>0)=e^{-(\mu-\lambda)t}\). Thus, conditional on waiting, the delay is exponential with rate \(\mu-\lambda\). Unconditionally, this exponential component has total probability \(\rho\), while the remaining probability \(1-\rho\) is concentrated at zero. Integrating the tail also gives \(\mathbb{E}[W_q]=\int_0^\infty\mathbb{P}(W_q>t)\,dt=\rho/(\mu-\lambda)\). This tail-integral identity applies because \(W_q\) is nonnegative.

Worked Calculations

Worked Example: The Atom and Tail at Given Rates

Suppose arrivals occur at rate \(\lambda=2\) and service occurs at rate \(\mu=5\), with time measured in the corresponding rate units. Find the probability of no wait and the probability that the queueing delay exceeds \(1\).

First, \(\rho=\lambda/\mu=2/5\), which is less than \(1\), so the stability condition holds. The probability of zero delay is \(\mathbb{P}(W_q=0)=1-\rho=1-2/5=3/5\). The difference of the rates is \(\mu-\lambda=5-2=3\). Substituting \(t=1\) in the strict tail gives \(\mathbb{P}(W_q>1)=\rho e^{-(\mu-\lambda)} =(2/5)e^{-3}\).

Check: At \(t=0\), the tail formula gives \(\mathbb{P}(W_q>0)=(2/5)e^0=2/5\). This plus the mass at zero is \(2/5+3/5=1\), so the two parts account for all probability.

Worked Example: Conditional Wait and Mean Delay

Suppose \(\lambda=3\) and \(\mu=5\). Find the probability that a stationary arrival waits at all, the conditional probability that its wait exceeds \(1/2\) given that it waits, and its unconditional mean queueing delay.

Here \(\rho=3/5\), and \(\mu-\lambda=5-3=2\). Therefore \(\mathbb{P}(W_q>0)=3/5\), while the zero-delay mass is \(1-3/5=2/5\). The conditional tail at \(t=1/2\) is \(\mathbb{P}(W_q>1/2\mid W_q>0)=e^{-2(1/2)}=e^{-1}\). Multiplying by the probability of waiting gives the unconditional tail \(\mathbb{P}(W_q>1/2)=(3/5)e^{-1}\). Finally, \(\mathbb{E}[W_q]=(3/5)/(5-3)=3/10\).

Check: The conditional exponential rate is \(2\), so its mean is \(1/2\). Weighting that mean by the probability \(3/5\) of a positive wait gives \((3/5)(1/2)=3/10\), agreeing with the tail integral.

Worked Example: Probability of a Positive Wait Within a Time Window

Suppose \(\lambda=1\) and \(\mu=3\). Find the probability that the queueing delay is positive but no greater than \(1/3\).

The traffic intensity is \(\rho=1/3\), and \(\mu-\lambda=3-1=2\). The event is \(0<W_q\leq1/3\). Since the strict tail at zero is \(\mathbb{P}(W_q>0)=1/3\), subtracting the strict tail at \(1/3\) gives \(\mathbb{P}(0<W_q\leq1/3)=\mathbb{P}(W_q>0)-\mathbb{P}(W_q>1/3) =1/3-(1/3)e^{-2/3} =(1/3)(1-e^{-2/3})\). The strict inequality in the tail is important: the event being calculated excludes the zero-delay atom and includes the endpoint \(1/3\). There is no atom at that positive endpoint.

Check: The probability of a positive wait is \(1/3\). The probability of a positive wait greater than \(1/3\) is \((1/3)e^{-2/3}\). Their difference is exactly the probability just computed, and adding it back to the remaining positive tail gives \(1/3\).

Why the Atom Matters

A common mistake is to treat the waiting time as exponential for every arrival. For example, with \(\lambda=2\) and \(\mu=5\), writing \(\mathbb{P}(W_q>t)=e^{-3t}\) would give \(\mathbb{P}(W_q>0)=e^0=1\). That contradicts the fact that a stationary arrival sees an empty system with probability \(1-\rho=3/5\). The correction is the factor \(\rho=2/5\): the correct tail is \((2/5)e^{-3t}\). The exponential law describes the delay conditional on a positive wait; the factor \(\rho\) accounts for the chance that a wait occurs at all.

The service rate alone is also not the rate of the positive waiting-time tail. A customer may have several customers ahead, so its delay is a mixture of sums of service times. Summing over the stationary queue-length distribution changes the exponential rate to \(\mu-\lambda\), while leaving the probability of a positive wait as \(\rho\). The result depends on stationarity, Poisson arrivals independent of the queue state, exponential service, and FCFS service. If the queue is unstable, \(\rho<1\) fails and there is no stationary arrival distribution of the stated form. If \(\lambda=0\), there are no stationary arrivals to sample; the stationary queue is empty and a hypothetical customer arriving to that empty system waits zero.

This distribution concerns only time until service begins. The service duration of the arriving customer is not included. Keeping that distinction explicit prevents confusing queueing delay with total time in the system.

Check Your Understanding

Use the strict-tail formula for \(t\geq0\), and distinguish the zero-delay probability from the conditional law given a positive wait.

  1. For \(\lambda=2\) and \(\mu=6\), find \(\rho\), \(\mathbb{P}(W_q=0)\), and \(\mathbb{P}(W_q>1)\).
  2. For a stable M/M/1 queue, explain why an arrival that sees \(n\geq1\) customers waits for \(n\) service completions before starting service.
  3. Show from the tail formula that the conditional waiting time given \(W_q>0\) has exponential rate \(\mu-\lambda\).
  4. Why does the formula \(\mathbb{P}(W_q>t)=e^{-(\mu-\lambda)t}\) fail for the unconditional queueing delay?
  5. For \(\lambda=1\) and \(\mu=4\), compute \(\mathbb{P}(0<W_q\leq1)\), showing which strict tail probabilities you subtract.