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.


CategoryAlgorithmNotes

CouponCollector (last edited 2007-12-25 23:42:14 by localhost)