Skip to content
Tutorials Center
My learning

Topics

Lesson 7 of 38 · Basics and Little's Law

Little's Law: L = λW

Learn Little's Law, the most general result in queueing theory: L = λW. See why it holds, check it on a simulation and apply it to real systems.

Little's Law is the most useful single equation in queueing theory. It says that, in a stable system, the average number of customers present equals the arrival rate multiplied by the average time each customer spends there:

L = λ W

It needs no assumption about the arrival distribution, the service distribution, the number of servers or the order of service. John Little proved it in 1961, and it holds for systems as different as a coffee shop, a hospital ward and a computer's memory buffer.

Reading the law

Imagine a shop where 30 customers walk in per hour (λ = 30) and each stays 0.5 hour on average (W = 0.5). Then L = 30 × 0.5 = 15: on average 15 customers are inside. If the shop gets busier and customers stay longer, the crowd grows. You can solve for whichever quantity is unknown:

  • L = λW: average number in the system
  • W = L / λ: average time per customer
  • λ = L / W: throughput from a count and a time

The law applies to any boundary you draw, as long as you measure L, λ and W for the same region and the same customers:

Region L W
The whole system L W
Only the waiting line Lq Wq
Only the servers average busy servers mean service time

For the last row, λ × (1/μ) = λ/μ is the average number of busy servers. With one server this is ρ, matching the identity from the last lesson.

Why it works: counting areas

Plot the number in the system N(t) over a long time T. The area under the curve can be computed in two ways:

  1. By time slices: the average height L times the length T.
  2. By customers: each customer contributes a rectangle of width equal to the time they stay. Adding these gives n customers × average stay W.

So L × T = n × W. Dividing by T gives L = (n/T) × W = λW. The only subtlety is the edge: customers still inside at time T stick out. In a stable system their contribution becomes negligible over a long period.

flowchart LR
  A["Arrival rate λ"] --> B["Region: average<br/>W per customer"]
  B --> C["Average count<br/>L = λ × W"]

Inflow rate times time spent equals the average stock.

Checking the law on data

If we run a simulation until every customer has left, the identity becomes exact, with no edge effect. This is a nice way to see that it is not an approximation but a mathematical fact about any sequence of arrivals and departures.

Python Little's law on a simulation

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 two printed numbers agree exactly, because the arrival rate is measured over the same span as the count. This happens whatever the distributions are; try changing the exponential draws to constants.

Applying the law

Little's law turns count measurements into time measurements, which is handy because counting is often easier than timing. If you can see 18 people in a clinic on average and 6 patients arrive per hour, their average stay is 18 / 6 = 3 hours. A web server that handles 200 requests per second and holds 50 in flight on average has an average response time of 50/200 = 0.25 seconds.

Python Little's law calculator

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.

Keep units consistent. If λ is per hour, W must be in hours. Also use the effective arrival rate: customers turned away by a full system do not count.

Check your understanding

Quick check · 4 questions

of 4 answered You scored / 4 · perfect!

  1. 1. A store has 40 customers inside on average, and 20 arrive per hour. What is the average time a customer spends inside?

    W = L / lambda = 40 / 20 = 2 hours.
  2. 2. Little's law holds only for exponential service times.

    The law is a general counting identity and needs no distributional assumptions.
  3. 3. A queue has 5 customers waiting on average and 10 arrive per hour. What is Wq?

    Wq = Lq / lambda = 5 / 10 = 0.5 hours.
  4. 4. Which arrival rate should be used if a full system turns some customers away?

    Use the effective arrival rate, counting only customers who enter the region.

Summary

  • Little's law: L = λW, valid for any stable system and any region of it.
  • It holds without assumptions on distributions, servers or discipline.
  • Proof idea: the area under the count curve equals total customer-time.
  • Keep units consistent and use the effective arrival rate.

Next: Utilization and Stability