Third Ball and Bin Question
How many balls must one toss on average, until every bin contains at least one ball?
- Call a toss into an empty bin a hit.
- We want to know the expected number `n` of tosses to get `b` hits.
- Can partition the `n` tosses into stages where the `i`th stage is the number of tosses after the `(i-1)`st hit until the `i`th hit. The first stage is thus just the first toss.
- The probability of there being a hit for a given toss in stage `i` is `(b - i+1)/b`
- Let `n_i` denote the number of tosses in stage `i`. So the number of tosses to get `b` hits is
`n = sum_(i=1)^b n_i`.
- Each random variable `n_i` follows a geometric distribution with probability of success `(b-i+1)/b`. Using the same kind of calculation as the last day `E[n_i]=b/(b-i+1)`.
- Using linearity of expectation:
`E[n] = E[sum_(i=1)^b n_i] = sum_(i=1)^b E[n_i] = sum_(i=1)^b b/(b-i+1) = b sum_(i=1)^b 1/i` using the integral bound for 1/i
`= b (ln b + O(1))`.
- This problem is also called the coupon collector's problem.