3 ms·
There are many interesting calculations involving logarithms that you can do in your head if you already know a few logarithms. For instance, suppose you are r
by bumbledraven 3y ago
There are many interesting calculations involving logarithms that you can do in your head if you already know a few logarithms.
For instance, suppose you are reading a book by randomly flipping to one page each day and reading it. What is the expected number of days it will take for you to read every page in the book? (This is a variant of the well-known Coupon Collector's Problem).
Because you haven't seen any page before, any page will do, so you always see the first of the hundred pages on the first day. Hence, the expected number of days to see the first page is 1.
For the second page, you have a 99/100 probability of seeing any page except the one you already saw on day 1. To convert this probability into an expected number of days, we can use the fact that if you flip a biased coin that comes up heads with probability h, the expected number of flips until you see heads (including the final heads) is 1/h. Therefore, it will take 1/(99/100) = 100/99 days on average until you see the second page.
Continuing in this fashion, the expected number of days to see every page in the book is:
100/100 + 100/99 + 100/98 + ... + 100/1
= 100(1/100 + 1/99 + 1/98 + ... + 1/1)
= 100 * H_100
where H_100 is the 100th harmonic number. The nth harmonic number, written H_n, is the "sum of the reciprocals of the first n natural numbers" (Wikipedia). By expanding the first two terms of the Taylor expansion for H_n, we see that that H_n is approximately equal to ln n + y + 1/(2n), where y is Euler's constant, which is approximately 0.5772. So we have:
H_100
≈ ln 100 + 0.5772 + 1/(200)
≈ 2.3 lg 100 + 0.5772 + 0.005
≈ 2.3 * 2 + 0.6
= 5.2
Therefore, the expected number of days to see every page in the book is approximately 100 * H_100 = 100 * 5.2 = 520. You can check this result via simulation at https://demonstrations.wolfram.com/CouponCollectorProblem/ https://demonstrations.wolfram.com/CouponCollectorProblem/ .