Little's Law
In one sentence: Little’s law says the number of things inside a system equals how fast they arrive, multiplied by how long each one stays.
Read it out loud: “L equals lambda times W. The average number of items in the system equals the arrival rate times the average time each item spends in it.”
What each symbol means
| Symbol | Meaning |
|---|---|
| The average number of items inside the system at any moment, such as customers in a shop or requests in a server. | |
| The arrival rate: how many items enter the system per unit of time, such as customers per hour. | |
| The average time one item spends in the system, from arrival to departure. Use the same time unit as , for example hours. |
What the formula is doing
Picture a queue. People walk in at a steady pace, and each one stays for some time before leaving. At any moment, the number of people inside depends on two things: how fast they come in, and how long each one stays.
If customers arrive twice as fast and stay for the same time, there are twice as many inside. If they arrive at the same speed but each stays twice as long, there are again twice as many. So grows in proportion to both, and the formula is a product: .
The law does not need to know how arrivals are spread out. They can come in bursts or evenly, and stays can be short or long. The system only needs to be steady, meaning it is not slowly filling up forever. Then the long-run average count equals the rate times the average time.
The units must match. If is in customers per hour, must be in hours. Six minutes is 0.1 hours, so using 6 would give an answer 60 times too big.
An everyday picture
Think of an escalator in a shopping mall. Shoppers step on at a steady rate, and each rides for about the same time. The number of people standing on the escalator at any moment is how fast they step on, multiplied by how long each ride lasts.
Worked example: Customers in a coffee shop
A coffee shop gets customers per hour. Each customer stays minutes on average. We need the same time unit as the rate, so we use hours.
- Convert the time: minutes hours hours.
- Apply the law: customers.
- Second case, a web server: requests per second and seconds. So requests in flight.
Answer: On average 3 customers are inside the coffee shop at any moment. The same rule says a web server that gets 200 requests per second, each taking 0.05 seconds, has about 10 requests in progress at once. Both results are averages, not exact counts.
The numbers in this example are recomputed by script every time the site is built.
Common mistakes
- Mixing time units, such as customers per hour with minutes. Convert the time first, or the answer is off by a factor of 60.
- Treating as the number of items that arrive in total. counts items inside the system at one moment, not everyone who ever came in.
- Expecting an exact count. Little’s law gives an average over a long period, so the number inside will go up and down around that average.
- Using the law for a system that is growing without limit. It needs a steady state, where the average does not keep climbing.
Where you will meet it
- Estimating how many requests a web server or database handles at once, from its request rate and response time.
- Staffing a checkout or call center, to estimate how many people are waiting or being served on average.
- Manufacturing and project management, where work in progress equals throughput times the time each job spends in the process.
- Queueing theory, the study of waiting lines, where the law is one of the most used results.
Questions people ask
Does Little's law need the arrivals to be evenly spaced?
No. It works with averages over a long time, so bursts and quiet periods are fine. It does need the system to be steady, which means it is not filling up forever.
What if I know the count and the time but not the rate?
Rearrange the formula to . For example, if 3 customers are inside on average and each stays 0.1 hours, then customers arrive per hour.
Why is it called Little's law?
It is named after John D. C. Little, who published a general proof of the formula in 1961.
Related formulas
- Amdahl's Law: Amdahl’s law tells you how much faster a whole program gets when you speed up only part of its work, and why the part you leave alone caps the gain.
- Binary Search Steps: Binary search finds an item in a sorted list by checking the middle and throwing away half, and this formula counts how many checks that takes at most.