Queueing Theory: M/M/1 Waiting Time Simulator

simulator intermediate ~9 min
Loading simulation...
Avg wait ≈ 0.75 min at 75 % utilization

With arrival rate 3/min and service rate 4/min, the M/M/1 queue operates at 75 % utilization with average wait time of 0.75 minutes and average queue length of 2.25 customers.

Formula

ρ = λ / µ — server utilization
L_q = ρ² / (1 - ρ) — average queue length (M/M/1)
W_q = ρ / (µ - λ) — average waiting time in queue
L = λ × W — Little's Law

The Mathematics of Waiting

Queueing theory, born from Agner Krarup Erlang's work on telephone exchanges in 1909, is the mathematical study of waiting lines. The M/M/1 queue — one server, random arrivals, random service times — is the foundational model. Despite its simplicity, it reveals a profound insight: even when average service is faster than average demand, randomness creates waiting. The ratio of arrival rate to service rate (utilization, ρ) determines whether the queue is manageable or catastrophic.

The Utilization Trap

The most counterintuitive result in queueing theory is the nonlinear relationship between utilization and wait time. At 50 % utilization, average queue length is just 0.5 customers. At 80 %, it rises to 3.2. At 90 %, it jumps to 8.1. At 95 %, it reaches 18. And at 99 %, the average queue is 98 customers long. This explosive growth near capacity explains why hospitals, airports, and highways experience sudden congestion when demand increases by seemingly small amounts.

Little's Law: The Universal Queue Truth

In 1961, John Little proved an elegantly simple result: the average number of items in a system (L) equals the arrival rate (λ) times the average time each item spends in the system (W). Remarkably, L = λW holds for any stable queue, regardless of the arrival distribution, service distribution, or number of servers. It is the E = mc² of operations research — a compact equation with sweeping implications for system design and capacity planning.

Applications in Transportation

Every transportation system contains queues: vehicles at traffic signals, passengers at boarding gates, ships waiting for berths, parcels in sorting facilities. Queueing models help engineers determine how many toll booths, security lanes, or boarding gates to operate. The key design principle is maintaining utilization well below 100 % — typically targeting 70–80 % — to keep wait times reasonable while avoiding the enormous cost of idle capacity.

FAQ

What does M/M/1 mean in queueing theory?

M/M/1 describes a queue with Markovian (exponential) inter-arrival times, Markovian service times, and 1 server. The 'M' stands for memoryless — the defining property of exponential distributions. It is the simplest and most widely studied queueing model.

Why do wait times explode near 100 % utilization?

The average queue length formula ρ²/(1-ρ) has a singularity at ρ=1. As utilization approaches 100 %, the denominator approaches zero, causing queue length and wait times to grow without bound. This is why systems should never operate near full capacity.

How does queueing theory apply to transportation?

Traffic signals, toll booths, airport security, bus stops, and ride-sharing dispatch all involve queues. Understanding arrival patterns and service rates helps engineers design systems that minimize waiting — for example, determining how many toll booths to open during rush hour.

What is Little's Law?

Little's Law states L = λW: the average number of customers in a system equals the arrival rate times the average time spent in the system. It applies to any stable queue regardless of distribution, making it one of the most powerful and general results in queueing theory.

Sources

Embed

<iframe src="https://homo-deus.com/lab/transportation/queue-theory/embed" width="100%" height="400" frameborder="0"></iframe>
View source on GitHub