Serving the Quantitative Finance Community

 
User avatar
Traden4Alpha
Posts: 3300
Joined: September 20th, 2002, 8:30 pm

6 eggs

July 22nd, 2012, 1:17 am

Given 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).
Last edited by Traden4Alpha on July 21st, 2012, 10:00 pm, edited 1 time in total.
 
User avatar
wileysw
Posts: 7
Joined: December 9th, 2006, 6:13 pm

6 eggs

July 22nd, 2012, 12:57 pm

outrun, you might want to clarify whether you want to minimize the average number of drops (assume some prior distribution of which floor is the highest that egg will not break, presumably not uniform...), or you want to minimize the number of drops for the worse case (in which case, i think it has been discussed quite many times probably and the approach is to consider the information-bound first then build recursively a strategy that satisfies this bound)----- ----- ----- ----- -----for N eggs and M floors, solve for the least integer x:(l.h.s.: by considering the total number of different outcomes)if N=6, M=50, one got 6 droppings at worst (there are quite many ways that work in this case since the inequality is loose)
Last edited by wileysw on July 23rd, 2012, 10:00 pm, edited 1 time in total.
 
User avatar
katastrofa
Posts: 7930
Joined: August 16th, 2007, 5:36 am
Location: Event Horizon

6 eggs

July 22nd, 2012, 1:59 pm

QuoteOriginally 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.
 
User avatar
Traden4Alpha
Posts: 3300
Joined: September 20th, 2002, 8:30 pm

6 eggs

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.
 
User avatar
MHill
Posts: 21
Joined: February 26th, 2010, 11:32 pm

6 eggs

July 23rd, 2012, 7:20 am

Eggs are not renowned for their resiliance upon being dropped. Using this prior knowledge:Assume eggs are uncooked, and are chicken eggs (or other bird eggs, as opposed to something like turtle, alligator or spider eggs).Assume the ground is a reasonably hard surface.Assume egg is not in a protective box or equipped with a parachute.Drop an egg out of the ground floor window.If it survives, drop it out the first floor window.If it survives, check assumptions, and maybe move to alternate strategy such as the binary search one suggested.Make omlette with remaining five eggs.Eat it on the 50th floor where the view should be good.
 
User avatar
Traden4Alpha
Posts: 3300
Joined: September 20th, 2002, 8:30 pm

6 eggs

July 23rd, 2012, 11:36 am

QuoteOriginally posted by: MHill...........Make omlette with remaining five eggs.Eat it on the 50th floor where the view should be good.LOL!Put a frying pan on the ground, aim well, and you can have a 6-egg omelette.
 
User avatar
Traden4Alpha
Posts: 3300
Joined: September 20th, 2002, 8:30 pm

6 eggs

July 23rd, 2012, 5:14 pm

QuoteOriginally posted by: outrunWhy are French omelettes made with only one egg? Because in France, 'one egg' is un oeuf.GROAN! Methinks you've been dropped from a 50-story building on your head!
 
User avatar
Cuchulainn
Posts: 22927
Joined: July 16th, 2004, 7:38 am

6 eggs

July 24th, 2012, 9:18 am

QuoteOriginally posted by: Traden4AlphaQuoteOriginally posted by: outrunWhy are French omelettes made with only one egg? Because in France, 'one egg' is un oeuf.GROAN! Methinks you've been dropped from a 50-story building on your head!Is he a little or big Endian?
 
User avatar
Traden4Alpha
Posts: 3300
Joined: September 20th, 2002, 8:30 pm

6 eggs

July 24th, 2012, 11:23 am

QuoteOriginally posted by: outrunI've both a liliputian and blefuscian base class, I'm serializable without endian issues.Btw, the answer is perhaps 3!Exactly. The answer is 3! which equals 6. Perhaps the trickster solution is to build ledges at carefully selected levels on the side of the building, drop the egg from floor 50, and have the egg hit one or more ledges on the way down to gather multiple data points per drop.
 
User avatar
Cuchulainn
Posts: 22927
Joined: July 16th, 2004, 7:38 am

6 eggs

July 24th, 2012, 11:36 am

QuotePerhaps the trickster solution is to build ledges at carefully selected levels on the side of the building, drop the egg from floor 50, and have the egg hit one or more ledges on the way down to gather multiple data points per drop.From a wall?