Note: You are looking at a static copy of the former PineWiki site, used for class notes by James Aspnes from 2003 to 2012. Many mathematical formulas are broken, and there are likely to be other bugs as well. These will most likely not be fixed. You may be able to find more up-to-date versions of some of these notes at http://www.cs.yale.edu/homes/aspnes/#classes.
Suppose that every box of cereal you buy contains one of n coupons, all equally likely, and you need to collect all n coupons to win a valuable prize. How many boxes of cereal do you need to buy on average to get all n coupons? The answer is exactly n Hn = Θ(n log n); for the analysis, see RandomizedAlgorithms.