Quizzes & Puzzles0 min ago
You are given 2 eggs.
You are given 2 eggs.
You have access to a 100-story building.
Eggs can be very hard or very fragile means it may break if dropped from the first floor or may not even break if dropped from 100th floor.
Both eggs are identical.
You need to figure out the highest floor of a 100-story building an egg can be dropped without breaking.
The question is how many drops you need to make. You are allowed to break 2 eggs in the process.
You have access to a 100-story building.
Eggs can be very hard or very fragile means it may break if dropped from the first floor or may not even break if dropped from 100th floor.
Both eggs are identical.
You need to figure out the highest floor of a 100-story building an egg can be dropped without breaking.
The question is how many drops you need to make. You are allowed to break 2 eggs in the process.
Answers
Best Answer
No best answer has yet been selected by AB Editor. Once a best answer has been selected, it will be shown here.
For more on marking an answer as the "Best Answer", please visit our FAQ.If it didn't break from 50 then you still have 2 eggs. Go half way up the rest of the building to floor 75. If it breaks then answer lies between 50 and 75. So try 51, 52 etc until it breaks
If it didn't break at 75 you still have 2 eggs. Start again at 87.
continue 'splitting the difference' in this way until you get the answer.
If it didn't break at 75 you still have 2 eggs. Start again at 87.
continue 'splitting the difference' in this way until you get the answer.
Is this cheating?
http://www.theartofai...0inflatable%20egg.jpg
If it is then i'll go with what he ^^^^^^^^said. :)
http://www.theartofai...0inflatable%20egg.jpg
If it is then i'll go with what he ^^^^^^^^said. :)
factor, your approach to the problem is the right way to go, but you should not start on floor 50; if you start on floor 14 you would be able to tell in 14 drops or less.
(Start on 14; if it breaks try 1-13 order. If it does not break go to 27 and drop; if it breaks try 14-26 in order. if no break, go to 14+13+12 = 39,. etc etc).
(Start on 14; if it breaks try 1-13 order. If it does not break go to 27 and drop; if it breaks try 14-26 in order. if no break, go to 14+13+12 = 39,. etc etc).
The question was how many drops, factors answer could take 100 drops.
How about starting with every 10th floor and then you only have to check out the 9 floors below the one the first egg breaks on to get an answer giving a maximum of 19 drops.
Sure there is a way of getting it lower, but not that I can think of!
How about starting with every 10th floor and then you only have to check out the 9 floors below the one the first egg breaks on to get an answer giving a maximum of 19 drops.
Sure there is a way of getting it lower, but not that I can think of!
I think i can do it in less but i did get it a bit wrong. If it cracks from 50 rather than trying 1, 2,3 etc I should have split the difference to 25.
The trick is to keep splitting the difference.
I think you can do it in much fewer than 14 drops. I think 7.
I'll try it out later- not with eggs but on paper. I'll choose solutions such as floor 93, floor 67 and floor 37 and show how quickly you get each one. i think no more than 7 drops should do it
The trick is to keep splitting the difference.
I think you can do it in much fewer than 14 drops. I think 7.
I'll try it out later- not with eggs but on paper. I'll choose solutions such as floor 93, floor 67 and floor 37 and show how quickly you get each one. i think no more than 7 drops should do it
Suppose the solution is k, that is, we can find the floor always within k drops. For our first drop, we could try a floor as high as floor k. This is because if the egg breaks, we can try all the floors below floor k and still determine the floor within k drops.
After dropping an egg on floor k and not broken, we now have k-1 remaining drops. Since our solution is k, we can now move up to floor k + (k-1). This still satisfies the total k drops criteria.
Then, if this doesn't work out, we can move up to floor k + (k-1) + (k-2), and so on so forth.
So, eventually we can move up as high as floor
k + (k-1) + (k-2) + (k-3) + ... + 1 = k(k+1)/2
The highest floor should be 99. Thus, we have:
k(k+1)/2 >= 99, from this, we get k=14
So, the answer is 14 maximum drops and we can find the floor.
After dropping an egg on floor k and not broken, we now have k-1 remaining drops. Since our solution is k, we can now move up to floor k + (k-1). This still satisfies the total k drops criteria.
Then, if this doesn't work out, we can move up to floor k + (k-1) + (k-2), and so on so forth.
So, eventually we can move up as high as floor
k + (k-1) + (k-2) + (k-3) + ... + 1 = k(k+1)/2
The highest floor should be 99. Thus, we have:
k(k+1)/2 >= 99, from this, we get k=14
So, the answer is 14 maximum drops and we can find the floor.