6.5

From The Algorithm Design Manual Solution Wiki
Jump to navigation Jump to search

I heard 15 different songs before the 16-th pick finally repeated one. For a large catalogue of N songs the chance that the first k random picks are all different is well–approximated by the “birthday-paradox” formula P(no repeat in k picks) ≈ exp(−k(k−1)/(2N)). A repeat becomes likely when this probability has dropped to about ½, i.e. when

k(k−1)/(2N) ≈ ln 2 ≈ 0.693.
Putting k = 15 gives
N ≈ k(k−1)/(2 ln 2) ≈ 15·14 / 1.386 ≈ 150 – 160.
Allowing for the approximate nature of the model (and the extra song it took to see the repeat) pushes the estimate up slightly, so a round-number Fermi answer is
About 2 × 10² songs
In other words, the Beatles recorded on the order of two hundred distinct songs.


Back to Chapter 6