The following problem and its solution is well-known: you have two eggs and you have to measure which is the first floor of a building (that has in this example 36 floors) from which if an egg is dropped it breaks. Find an algorithm the worst case scenario of which involves the smallest number of tries. The solution: throw an egg from the 8th floor, if it breaks throw the second one from the 1st, 2nd... until it breaks. If the first egg didn't break, throw it from the (8+7=) 15th floor, and proceed in similar fashion till the (8+7+6+5+...+1=) 36th floor. From this it is easy to see the general solution for two eggs but what is the case (minimum number of throws required) if we have $n$ eggs?
Asked
Active
Viewed 81 times
0
-
1In this answer, Christian Blatter derives a recursion relation for any number of eggs and solves it for up to $3$ eggs. – joriki Jul 06 '16 at 23:25
-
@joriki thanks, can you make it an answer? – Nesa Jul 08 '16 at 14:16
-
I think an answer shouldn't be just a link to another answer. If that answers your question, we should close this one as a duplicate. – joriki Jul 09 '16 at 08:12
-
@joriki OK, do that then – Nesa Jul 09 '16 at 09:15
-
OK, I voted for that; it takes 5 votes. I'm not sure whether it's faster if you add your own vote. – joriki Jul 09 '16 at 10:32