Definition · Maximum loadFor a placement of m keys into n bins, the maximum load is the occupancy of the fullest bin. The case of interest here is m = n, where the mean occupancy is exactly 1 and the maximum is therefore entirely a statement about the spread. The d-choice rule places each key in the least loaded of d bins chosen at random for that key.
At m = n the mean is one key a bin, so any maximum above 1 is imbalance and nothing else. That is what makes this the clean case to measure: there is no scale in the answer, and a maximum of 5 means the fullest bin holds five times what an even placement would give it.
1 024 keys into 1 024 bins, mean exactly 1 key a bin
seed max, one choice max, 2 choices ratio
3 5 3 1.67×
4 5 3 1.67×
5 5 3 1.67×
6 5 3 1.67×
7 5 3 1.67×
8 6 3 2.00×
9 6 3 2.00×
10 5 3 1.67×
mean 5.25 3.00
bins left empty, seed 3: 377 under one choice, 243 under two
The second column is the striking one: eight seeds, eight maxima, and every one of them is 3. One choice produced 5 or 6; two choices produced 3 every time. The rule does not merely lower the maximum, it makes it much less variable, which is the property a capacity plan actually wants.
The empty-bin counts are worth a glance too. Two choices left 243 bins empty where one choice left 377, because a key that would have piled onto a busy bin goes to a quieter one instead. The exact expectation for the one-choice case, m(1 − 1/m)ⁿ with m bins and n keys, is computed on the Algorithms path in “Balls in Bins and the Birthday Bound”; this lesson counts rather than derives it.
The standing of the two results
The one-choice maximum load at m = n is Θ(log n / log log n), and sampling d bins instead of one replaces it with a quantity growing like log log n — this course states and measures the d = 2 case as ln ln n, which is the figure the lab prints. Both of those results are stated, not proved — not in this lesson, not on the Algorithms path, not anywhere in this library. Their proofs need Chernoff bounds, which no subject here teaches, and the Algorithms path's scope explicitly excludes them.
So the numbers printed beside the measurements are quoted results rather than derived ones, and they are quoted as floating-point approximations: ln n / ln ln n = 3.58 and ln ln n = 1.94 at n = 1 024 are rounded, and the lab labels them where it prints them. “Balls in Bins and the Birthday Bound” states the one-choice result with the same caveat and computes the exact collision and empty-bin expectations that this lesson does not; it points back here as the place where the maximum load is what a system actually pays for.
Example · What a stated rate can and cannot be used forAt n = 1 024 the stated one-choice figure is 3.58 and the measured maximum over eight seeds averaged 5.25. Those do not contradict each other: Θ(log n / log log n) is a growth rate with constants suppressed, so it says how the maximum scales and not what it equals at a particular n. Use the rate to answer “what happens when the fleet is ten times bigger”, and use the measurement to answer “what do I provision now”. Substituting one for the other is the error this example exists to prevent.
Why not scan every bin
Because the benefit is nearly all in the first extra look, and the cost of the search is not. A full least-loaded placement needs the load of every bin at the moment of placement, which in a distributed system means either a central allocator or a global view that is stale by the time it is used — and a stale global view herds new keys onto whichever bin looked emptiest, which is worse than either rule here. Two random probes need no global state at all.
The rule also has an obvious application outside key placement, and it is the reason the result is famous: the same arithmetic governs a load balancer choosing between backends. Sampling two backends and sending the request to the one with fewer outstanding requests gets most of the benefit of least-loaded balancing with none of its coordination, which is exactly the trade above with keys replaced by requests.