A missed opportunity: the balls-and-bins discussion didn't go on to discuss the power of two choices.
In short, if you're tossing N balls randomly into N bins, you should expect the most heavily loaded bin to get log N of the balls.
If instead you "toss" by choosing two random bins and then putting the ball in the one with fewer balls, you should instead expect the most loaded bin to get only log(log N) balls.
In practice, it's often not so hard to modify the first strategy into the second to get dramatically more uniform load distribution among bins.
(You might ask, if two choices are good, are three better? Yes, but only slightly. You get an exponential improvement going from 1 to 2; after that, testing more bins improves by constant factors.)
> You might ask, if two choices are good, are three better? Yes, but only slightly. You get an exponential improvement going from 1 to 2; after that, testing more bins improves by constant factors.
The intuitive explanation for this is that the largest benefit comes from avoiding the most full bin. Two choices is always sufficient to do that.
In short, if you're tossing N balls randomly into N bins, you should expect the most heavily loaded bin to get log N of the balls.
If instead you "toss" by choosing two random bins and then putting the ball in the one with fewer balls, you should instead expect the most loaded bin to get only log(log N) balls.
In practice, it's often not so hard to modify the first strategy into the second to get dramatically more uniform load distribution among bins.
http://www.eecs.harvard.edu/%7Emichaelm/postscripts/handbook...
(You might ask, if two choices are good, are three better? Yes, but only slightly. You get an exponential improvement going from 1 to 2; after that, testing more bins improves by constant factors.)