A shop with one counter. Customers arrive at random moments, and each one needs a random amount of the assistant's time. The assistant is quick enough: on average a customer is dealt with faster than the next one arrives. So there should be no line. Watch the line.
For the curious kid.
The slider says how busy the counter is. At 80%, the assistant is serving somebody four fifths of the time and standing idle the other fifth. That sounds comfortable, with room to spare. Yet the shop holds four people on average, and every so often the line reaches the door. Move the slider to 90% and the average is nine. At 95% it is nineteen. At 99% it is ninety-nine. The counter is still idle some of the time, and the line is out of sight.
Here is why. Customers do not arrive evenly. By chance, three turn up close together, and then nobody for a while. When three come at once, two must wait. When nobody comes, the assistant stands idle, and that idle time is gone. It cannot be saved up and spent on the next rush. So bad luck piles up as a line, and good luck is thrown away. The busier the counter, the less often the line gets a chance to empty, and the longer it takes to recover from one bad patch.
Press Everyone takes the same time. Customers still arrive at random, but now each takes exactly as long as every other. The line is shorter: the waiting part of it is cut in half. Half of every queue comes from customers who take longer than usual, and half from the bunching of arrivals. If the arrivals were even too, there would be no line at all, at any load below 100%. A line is made of chance and nothing else.
This is why a hospital that is "only" 95% full has people on trolleys in the corridor, why a road carrying nearly its full load jams for no visible reason, and why the last few percent of efficiency are so expensive. Running anything close to its limit means living far up this curve.
Deeper.
Agner Erlang worked this out in 1909 for the Copenhagen telephone exchange, where the customers were calls and the counter was a line. Write ρ for the share of time the counter is busy. Customers arrive at random at rate ρ, and each takes a time with no memory, 1 on average: however long a customer has already taken, the time still to go has the same odds. Then the number of people in the shop settles into a simple law. The chance of finding n of them is (1 − ρ)ρⁿ. The shop is empty a share 1 − ρ of the time, and each extra person is ρ times as likely as one fewer. Add that up and the average is ρ/(1 − ρ), the dashed curve, which has no top as ρ approaches 1. The bars at the lower left are the first law, measured, and the dots on the right are the second.
The bottom line of the picture is a law of a different kind, found by John Little in 1961. The average number of people in a shop equals the rate at which they arrive times the average time each one spends there. It needs no assumption about chance at all. It is true of any shop, any rule for who goes first, any pattern of arrivals. The three quantities here are measured separately and then multiplied out.
When every customer takes the same time, the average becomes ρ + ρ²/(2(1 − ρ)), a formula of Felix Pollaczek and Aleksandr Khinchine from 1930. In general the waiting part is multiplied by half of one plus the square of how variable the service is, which is 1 for the memoryless kind and 0 for the steady kind. One caution about the dots at the far right. Near 100% the line takes a very long time to show its true average, because a bad patch lasts so long. The dot at 95% comes from three hundred thousand customers and still wanders by a few percent.
One more question, which every supermarket has had to answer. With two counters, is it better to have one line or two? Type the four-letter word for sharing a thing in common, the kind you swim in.
Idle time cannot be saved for later. That is the whole trouble.