4 ms·
He doesn't write down the math in the general case for the number of floors F(e,d) that you can check with e eggs and d drops: F(1,d) = d F(e,d) = sum k>0. F(
by shasta 14y ago
He doesn't write down the math in the general case for the number of floors F(e,d) that you can check with e eggs and d drops:
F(1,d) = d
F(e,d) = sum k>0. F(e-1, d-k)
The sum can given a closed form solution for e > 2, just like for e=1 and e=2.
Another thing is that he directly solves the quadratic, but in fact n^2/2 < n(n+1)/2 < (n+1)^2/2. So taking the square root of twice the number of floors will get you either give you the number of drops you need with 2 eggs, or will under count by 1. It's easy to check which that is.