GATE Computer ScienceVery hardGATE CS (PYQ pattern)

The egg-drop puzzle: a building has 100 floors, and you have 3 identical eggs. An egg that is dropped from a floor at or above the critical floor breaks and cannot be reused; otherwise it can be reused. What is the minimum number of drops that suffices to determine the critical floor in the worst case?

  1. A. 9
  2. B. 7
  3. C. 11
  4. D. 14

Correct answer: A. 9

With t drops and e eggs one can cover f(t, e) = f(t − 1, e − 1) + f(t − 1, e) + 1 floors; for e = 3, f(8, 3) = 92 and f(9, 3) = 129, so 9 drops are needed for 100 floors. With 2 eggs the answer would be 14.

More Algorithms questions

Exams that ask this topic