wu :: forums (http://www.ocf.berkeley.edu/~wwu/cgi-bin/yabb/YaBB.cgi)
riddles >> easy >> Dropping eggs from a building
(Message started by: ngoc_quynh on Sep 10th, 2012, 9:34pm)

Title: Dropping eggs from a building
Post by ngoc_quynh on Sep 10th, 2012, 9:34pm
You stand before a 100-story building with two eggs. Using only these two eggs, you must figure out the highest floor from which you can drop an egg such that the egg won't break when it hits the ground (we'll call this the "highest safe floor"). Every floor is equally likely to be the highest safe floor, including the top floor, and it's also just as likely that the egg will break from every floor. You can assume that if you drop an egg and it doesn't break, its shell is just as strong as it was before you dropped it.

If you want to minimize the expected number of drops you have to perform, what strategy should you use for picking which floors to drop the eggs from? You should write a program to solve this problem.

Title: Re: Dropping eggs from a building
Post by rmsgrey on Sep 11th, 2012, 5:08am
My homework sense is tingling!

There are already at least three threads on this over in the hard forum (Search may help). Once you solve for the worst case (which the threads focus on), optimising the expected performance is simple enough...

Title: Re: Dropping eggs from a building
Post by Gelinlik on Sep 15th, 2012, 7:23am
I would drop in first floor. Most probablt the eggshell will be broken.
All the best

Title: Re: Dropping eggs from a building
Post by benmartorano on Oct 15th, 2012, 11:49pm
Drop from the ground floor ... less walking up and down stairs

Title: Re: Dropping eggs from a building
Post by Grimbal on Oct 16th, 2012, 1:29am

on 09/10/12 at 21:34:08, ngoc_quynh wrote:
If you want to minimize the expected number of drops you have to perform, what strategy should you use for picking which floors to drop the eggs from? You should write a program to solve this problem.

I'll go with Gelink and benmartorano.
If you want to reduce the expected number of drops, you have to consider the prior distribution of egg hardness.  Unless you are talking about frog or fish eggs, it is very likely that a drop from the ground floor already breaks the egg.

This is unlike where you want to minimize the maximum number of drops.  That problem was already discussed in this forum.

Title: Re: Dropping eggs from a building
Post by benmartorano on Oct 25th, 2012, 3:40pm
ahhhhh yeah! I wasnt even considering other types of eggs

Title: Re: Dropping eggs from a building
Post by seo@rivaa.in on Dec 10th, 2012, 9:11pm
[hide] According to me the highest safe floor would be top floor because i will cover the both eggs with unbreakable coating [/hide] ;)



Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board