listen · close

whatTwo cities of bins fed the same stream of falling balls. In the left one every ball drops into a random bin; in the right one every ball glances at two random bins and takes the emptier. The left skyline grows ragged towers; the right stays almost perfectly flat.

whyThis is the power of two choices, one of the sharpest free lunches in computer science: a single extra glance shrinks the worst overload exponentially. Every load balancer that keeps a datacentre from tipping over is quietly running this piece.

howBalls arrive at a steady rate and every bin leaks at the same slow rate, so both cities hold the same average. Pure chance piles coincidences into towers, and the worst tower keeps wandering upward. Best-of-two steers every ball away from the local pile-up, so the worst tower hugs the dotted average line. Click a city to dump a hundred balls on it at once: the random city spikes, the two-choices city digests the same shock in seconds. The traces follow the two worst towers.