July 22nd, 2012, 2:16 pm
QuoteOriginally posted by: katastrofaQuoteOriginally posted by: Traden4AlphaGiven the goal of minimizing the number of egg drops, my first inclination is to use bisection search. That is, do a drop at floor 25, then 38 or 13 depending on the results at floor 25, etc. That strategy will take 5 or 6 drops and break 0 to 6 eggs.If the goal is to maximize the number of surviving eggs, then that's a different kettle of fish. For that objective function, start on floor 1, then 2, 3, 4, 5, etc. until that first egg breaks. The worst case is 50 drops but only one egg gets broken (and no eggs are broken if the test egg survives floor 50).Or if you want to minimise the distance one has to cover, you also should throw an egg on each consecutive floor. This shows why linear search can be sometimes more effective then the binary search (?)a.Excellent point. A binary search assumes a random access memory. If the "building's floors" were encoded on a linked list or Turing tape, then a linear search might be best. The optimal solution is a function of the cost of dropping an egg, the cost of breaking an egg, the cost of moving between floors, and any nonlinearities in the objective function (e.g., minimizing the worst case cost vs. the average cost). The priors on P(break | floor_i) also impact the strategy. If we replace the eggs with ping pong balls, then the optimal strategy is climb to floor 50, drop one ball and show that it doesn't break.