Skip to content

Lesson 29: Applications and the Economic Analysis of Queues

29.1 Learning Outcomes

By the end of this hour a student will be able to:

  1. Choose the optimal number of servers by total-cost minimisation and marginal analysis.
  2. Justify the choice between \(L_s\) and \(L_q\) in the cost objective, and show that it matters.
  3. Use the Pollaczek–Khinchine formula to price the cost of service variability.
  4. Cross-check an analytic result against a simulation, and know when simulation is mandatory.
  5. State the assumptions that queuing formulas rest on, and what to do when they fail.

29.2 The Optimal Number of Servers

The structure is that of Lesson 25, with the discrete decision variable \(c\):

\[\boxed{\ TC(c) = C_w\,L(c) + C_s\,c\ }\tag{1.1}\]

where \(L\) is \(L_s\) or \(L_q\) according to what is genuinely costly, \(C_w\) is the cost per customer per unit time and \(C_s\) the cost per server per unit time.

Because \(c\) is an integer, calculus is unavailable. Two equivalent procedures:

Enumeration. Compute \(TC(c)\) for \(c = c_{\min}, c_{\min}+1,\dots\) where \(c_{\min}=\lceil \lambda/\mu\rceil\) is the smallest number giving stability. Stop when \(TC\) starts rising: \(TC(c)\) is convex in \(c\), so the first rise is the optimum.

Marginal analysis. Add a server while

\[C_w\left[L(c)-L(c+1)\right] > C_s,\]

that is, while the waiting cost saved exceeds the cost of the extra server. This is the form to present to management, because it makes the trade-off explicit.

29.3 Variability Costs Money: the Pollaczek–Khinchine Formula

Everything so far assumed exponential service. Real service times are usually less variable (a standard procedure) or far more variable (a helpdesk where most calls are trivial and a few take hours). The \(M/G/1\) model handles any service distribution.

Pollaczek–Khinchine formula. For \(M/G/1\) with mean service time \(1/\mu\) and service-time coefficient of variation \(C_v=\sigma_S\mu\), $\(\boxed{\ L_q=\frac{\rho^{2}\left(1+C_v^{2}\right)}{2(1-\rho)}\ }\tag{2.1}\)$

Three special cases, all at the same \(\rho\):

Service distribution \(C_v\) \(L_q\) Relative to \(M/M/1\)
Deterministic (\(M/D/1\)) 0 \(\dfrac{\rho^2}{2(1-\rho)}\) \(\times\,0.5\)
Exponential (\(M/M/1\)) 1 \(\dfrac{\rho^2}{1-\rho}\) \(\times\,1\)
Highly variable 2 \(\dfrac{5\rho^2}{2(1-\rho)}\) \(\times\,2.5\)

The variability lesson. Waiting time is driven by two things: how loaded the system is, and how variable it is. Halving the variability of service is worth as much as a substantial capacity increase — and standardising a process usually costs far less than buying a server.

29.4 When Formulas Fail: Simulation

Analytic queuing formulas assume steady state, Poisson arrivals, a stationary environment and simple routing. Reach for discrete-event simulation when any of these fails:

Situation Why formulas fail
Arrival rate varies by hour of day No steady state exists; Lesson 25 Problem 4 showed averaging is invalid
Customers balk, renege or jockey between queues State-dependent behaviour not captured by \(\lambda_n\) alone
Networks of queues with feedback and blocking Departures are no longer Poisson
Priority classes with pre-emption Different classes need different \(W\); means diverge
Non-standard shift patterns and breaks Server availability is itself a stochastic process
Only a short horizon matters (opening rush) Transient, not steady-state, behaviour

But always compute the analytic answer first. It costs minutes, provides a sanity check on the simulation, and identifies the regime you are in. A simulation that disagrees materially with \(M/M/c\) under \(M/M/c\) conditions has a bug.

29.5 Solved Problems

Problem 1 — How many servers to hire

A service facility faces \(\lambda=6\) customers per hour; each server works at \(\mu=4\) per hour. A customer's time in the system costs the firm \(₹300\) per hour; a server costs \(₹150\) per hour. Find the optimal \(c\).

Solution. Stability needs \(c\mu>\lambda\), i.e. \(c\ge2\). Offered load \(r=1.5\).

\(c\) \(\rho\) \(L_s\) Waiting cost \(300L_s\) Server cost \(150c\) Total
2 0.750 3.42857 ₹1028.57 ₹300 ₹1328.57
3 0.500 1.73684 ₹521.05 ₹450 ₹971.05
4 0.375 1.54475 ₹463.43 ₹600 ₹1063.43
5 0.300 1.50863 ₹452.59 ₹750 ₹1202.59
6 0.250 1.50157 ₹450.47 ₹900 ₹1350.47
\[\boxed{c^{*}=3\ \text{servers},\ TC=₹971.05\text{ per hour}}\]

Marginal analysis.

Step Waiting cost saved Server cost Decision
2 → 3 ₹507.52 ₹150 add
3 → 4 ₹57.62 ₹150 stop
4 → 5 ₹10.84 ₹150 no

The saving collapses by a factor of nine at the third step. Note also that \(L_s\) can never fall below \(r=1.5\) — the customers in service. Beyond the point where the queue is nearly empty, extra servers buy nothing at all, because the residual \(L_s\) is service time, not waiting.

Problem 2 — Does L_s or L_q change the answer?

Repeat Problem 1 charging only for waiting time (\(L_q\)), as would be right if service time is value-adding and only queueing is waste.

Solution.

\(c\) \(L_q\) Waiting cost \(300L_q\) Server cost Total
2 1.92857 ₹578.57 ₹300 ₹878.57
3 0.23684 ₹71.05 ₹450 ₹521.05
4 0.04475 ₹13.43 ₹600 ₹613.43
5 0.00863 ₹2.59 ₹750 ₹752.59
\[\boxed{c^{*}=3\text{ again, at }₹521.05\text{ per hour}}\]

Interpretation. The decision is unchanged but the reported cost is not — ₹971 versus ₹521. The two differ by exactly \(300r=₹450\) per hour, the cost of unavoidable service time, which is a constant and therefore cannot affect the optimum.

Rule. When \(L_s\) and \(L_q\) differ by a constant (as in \(M/M/c\) with fixed \(\lambda,\mu\)), the choice does not change the optimal \(c\). It does change the headline number quoted to management, so state which convention you used. In models where \(\lambda_{\text{eff}}\) varies with the decision — a finite-capacity or finite-source system — the constant is no longer constant, and the choice can flip the decision.

Problem 3 — Airport check-in counters

An airline expects \(100\) passengers per hour at check-in. Each counter processes \(15\) per hour. Passenger time is valued at \(₹500\) per hour; a staffed counter costs \(₹800\) per hour. How many counters should be opened?

Solution. Stability requires \(15c>100\), so \(c\ge7\). Here \(r=100/15=6.667\).

\(c\) \(\rho\) \(L_q\) \(W_q\) Waiting cost Counter cost Total
7 0.9524 17.2227 10.33 min ₹8611.4 ₹5600 ₹14211.4
8 0.8333 2.6634 1.60 min ₹1331.7 ₹6400 ₹7731.7
9 0.7407 0.8950 0.54 min ₹447.5 ₹7200 ₹7647.5
10 0.6667 0.3492 0.21 min ₹174.6 ₹8000 ₹8174.6
11 0.6061 0.1415 0.08 min ₹70.8 ₹8800 ₹8870.8
\[\boxed{c^{*}=9\text{ counters}}\]

Interpretation.

  • The minimum-stability choice \(c=7\) is catastrophic: it nearly doubles total cost because \(\rho=0.95\) sits on the vertical part of the congestion curve. Never staff to bare stability.
  • \(c=8\) and \(c=9\) are within \(1\,\%\) of each other — the optimum is flat, so either is defensible. The tie-breaker should be robustness: at \(c=8\) a \(10\,\%\) demand surge to \(110\)/h pushes \(\rho\) to \(0.917\) and \(L_q\) past \(12\); at \(c=9\) it only reaches \(\rho=0.815\). Choose \(c=9\) for the safety margin, not for the ₹84 per hour.
  • The famous square-root staffing rule predicts \(c \approx r + \beta\sqrt r = 6.67+\beta(2.58)\); with the usual \(\beta\approx1\) that gives \(c\approx9.25\), agreeing with the exact answer at almost no computational cost.

Problem 4 — Cross-checking with a simulation

A simulation of an \(M/M/1\) queue with \(\lambda=8\)/h and \(\mu=10\)/h over \(200{,}000\) customers reports a mean time in system of \(0.4961\) hours. Is the simulation trustworthy?

Solution. The theoretical value is

\[W_s=\frac{1}{\mu-\lambda}=\frac{1}{2}=0.5\text{ hours}\]

Discrepancy: \(|0.4961-0.5| = 0.0039\) h, a relative error of \(0.78\,\%\).

Is that within sampling error? For \(M/M/1\), \(W_s\) is exponential with mean \(0.5\), so \(\sigma_W = 0.5\) and the standard error of the mean over \(n=200{,}000\) observations is

\[\frac{\sigma_W}{\sqrt n}=\frac{0.5}{\sqrt{200000}}=0.00112\text{ h}.\]

The discrepancy is \(0.0039/0.00112 = 3.5\) standard errors — larger than one would like, but successive customers' waiting times are strongly positively correlated (a busy period makes everyone in it wait), so the true standard error is several times the i.i.d. figure. The result is consistent.

Also check Little's law inside the simulation:

\[L_s=\lambda W_s = 8(0.4961)=3.969\quad\text{versus theory } 4.000\ \checkmark\]

Verdict: the simulation is behaving correctly.

How to validate any queuing simulation. (1) Run it under conditions where a formula exists and compare. (2) Check Little's law internally — it must hold in any correct simulation. (3) Discard a warm-up period; a simulation started empty is biased low. (4) Report a confidence interval, never a single number. A simulation without a validation step is an expensive random-number generator.

Problem 5 — Pricing the cost of variability

A single-server process has \(\lambda=8\)/h and mean service time \(6\) minutes (\(\mu=10\)/h), so \(\rho=0.8\). Compare the queue under (a) exponential service, (b) perfectly standardised service, and (c) a poorly controlled process with \(C_v=2\). Waiting is worth \(₹250\) per customer-hour.

Solution. Apply (2.1) with \(\rho=0.8\), \(\dfrac{\rho^2}{2(1-\rho)}=\dfrac{0.64}{0.4}=1.6\).

Case \(C_v\) \(L_q=1.6(1+C_v^2)\) \(W_q=L_q/8\) Waiting cost \(250L_q\)
(b) Standardised (\(M/D/1\)) 0 1.60 12 min ₹400/h
(a) Exponential (\(M/M/1\)) 1 3.20 24 min ₹800/h
(c) Poorly controlled 2 8.00 60 min ₹2000/h

Interpretation.

  • Moving from (a) to (b) — eliminating variability without adding any capacity — halves the queue and saves \(₹400\) per hour.
  • Letting variability rise from (a) to (c) multiplies the queue by 2.5 at unchanged capacity and unchanged mean service time. Every number a manager watches (\(\rho\), throughput, mean service time) is identical in the three cases; only the queue differs.
  • To achieve the \(M/D/1\) queue length by adding capacity instead, one would need \(\rho\) such that \(\rho^2/(1-\rho)=1.6\), i.e. \(\rho=0.685\) — a \(17\,\%\) increase in service rate. Standardising the process is usually far cheaper than buying that capacity.

This is the quantitative justification for standard operating procedures, checklists and Six Sigma programmes. They do not make the average task faster; they make it more predictable, and by (2.1) predictability alone buys shorter queues.

29.6 Practice Problems

  1. \(\lambda=15\)/h, \(\mu=6\)/h per server, \(C_w=₹100\)/customer-hour (use \(L_q\)), \(C_s=₹80\)/server-hour. Find \(c^{*}\). (Answer: \(c^*=4\), \(TC=₹373.31\)/h; \(c=3\) costs ₹591.12 and \(c=5\) costs ₹413.04)
  2. In Problem 3, at what value of \(C_w\) would \(c=8\) become optimal? (Answer: below \(₹452\) per passenger-hour; equate \(C_w(2.6634-0.8950)=800\))
  3. Using (2.1), find \(L_q\) for \(\rho=0.9\) and \(C_v = 0, 1, 3\). Comment on the spread. (Answer: \(4.05\), \(8.10\), \(40.50\) — a tenfold range at identical utilisation)
  4. A simulation of \(M/M/2\) with \(\lambda=6\), \(\mu=4\) reports \(L_q=1.95\). Is it plausible? (Answer: theory gives \(1.92857\); a \(1.1\,\%\) discrepancy — plausible)
  5. List three real systems from your own experience where the steady-state assumption fails, and say what you would do instead.

29.7 Summary

  • Choose \(c\) by minimising \(TC(c)=C_wL(c)+C_sc\). \(TC\) is convex in \(c\), so enumerate upwards and stop at the first rise.
  • Present the decision as marginal analysis: add a server while the waiting cost saved exceeds the server's cost.
  • Never staff to bare stability. In Problem 3 the minimum-stable choice cost nearly twice the optimum.
  • The optimum is usually flat; break ties on robustness to demand surges, not on rupees.
  • The square-root staffing rule \(c\approx r+\sqrt r\) gets very close to the exact answer instantly.
  • Pollaczek–Khinchine: \(L_q=\dfrac{\rho^2(1+C_v^2)}{2(1-\rho)}\). Deterministic service halves the \(M/M/1\) queue; \(C_v=2\) multiplies it by \(2.5\). Reducing variability is a genuine alternative to buying capacity, and usually a cheaper one.
  • Use simulation when arrivals are non-stationary, customers balk or renege, or only a short horizon matters — but always compute the analytic answer first as a check, and always validate against Little's law.

Next lesson: L30 — Inventory control: concepts, cost structure and classification.

Practise now: unit3-queue-inventory-lab.html → Cost Optimiser and Variability Lab: sweep \(c\) to find the minimum-cost staffing, then vary \(C_v\) to see the P–K formula move the queue.