Register free in 2 easy steps
Forgot Password

Here is the Solution

 

Two Eggs - Hundred Floors

You have two identical eggs. There is a 100 storey building. Among these 100 floors, there is a threshold floor. If you drop an egg from any floor below this threshold floor, the egg will not break. But if an egg is dropped from threshold floor or any other floor above it, the egg will break. What is the minimum number of tries needed to find out the threshold floor?

SOLUTION : Let us start with the easiest solution that can come to our mind. We start dropping egg from 1st floor, if it breaks, this is the threshold floor, else we move to 2nd floor, and so on. In this way, the answer comes out to be a maximum of 100 tries. But wait, we have 2 eggs with us. Let us start at the second floor. If the egg breaks, then we can use the second egg to go back to the first floor and try again. If it does not break, then we can go ahead and try on the 4th floor (in multiples of 2). It will take 50 tries to reach floor 100 and one more egg to try on the 99th floor so the total is 51 tries. If we try at intervals of 3, we get a better solution with a maximum of 35 tries to find threshold floor. You can try it yourself to find it how. If we increase the intervals further, we get minimum number of tries (20 tries) for an interval of 14. But this is not the best solution we can reach at.

Instead of taking equal intervals, we can take interval to be one less than the previous interval. Let the egg is first dropped for floor 14. If it breaks, then we need 13 more tries to find the solution. If it does not break, then we should try floor 27 (14 + 13). If it breaks, we need 12 more tries to find the solution. So the initial 2 tries plus the additional 12 tries would still be 14 tries in total. If it doesn't break, we can try 39 (27 + 12) and so on. Moving in this way, we drop egg from floor 50 in 4 tries, floor 60 in 5 tries, floor 69 in 6 tries, floor 77 in 7 tries, floor 84 in 8 tries, floor 90 in 9 tries, floor 95 in 10 tries, floor 99 in 11 tries, floor 102 in 12 tries. The maximum number of tries will be for worst case scenario when the threshold floor is 13 or 26 or 38 or 49, and so on.

So, 14 tries is the best solution we can get.

Back to all the Puzzles