1
$\begingroup$

This question already has an answer here:

You have two coconuts and you want to find out how high they can be dropped from a 100 story building before they break. But you only have $1.40 and the elevator costs 10 cents each time you ride it up (it's free for rides down).

How can you drop the coconuts to guarantee you will find the lowest floor they will break at, while starting and ending at floor 1?

Note: They break when dropped from the same height and they don't weaken from getting dropped.

$\endgroup$

marked as duplicate by Rubio Feb 8 '18 at 18:32

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ this is from my book so credit goes to Charles, the writer of the book + I did not copy it! $\endgroup$ – A Cool Guy Feb 8 '18 at 18:15
  • 2
    $\begingroup$ This looks more like a mathematics or calculation-puzzle than a riddle puzzle. Sure you got the tagging right? $\endgroup$ – ibrahim mahrir Feb 8 '18 at 18:24
  • $\begingroup$ yea its a math-puzzle but a puzzle! ad not really matha puzzle. now the tags ok? $\endgroup$ – A Cool Guy Feb 10 '18 at 15:01
2
$\begingroup$

Starting from the bottom up, drop the first coconut on floors:

15, 28, 40, 51, 61, 70, 78, 85, 91, 96, and 100, stopping when it breaks.

Then, drop the second coconut

Starting at the floor just above the highest floor where the coconut didn't break. So, if the first coconut broke on floor 70, start the second one from floor 62.

You will always have enough cash to test it this way because

The number of floors between where you test the first coconut is equal to the number of trips you'll have left after the first one breaks. For example, if the lowest floor where the coconut breaks is floor 39, you'll use 3 drops to find that it's somewhere between 28 and 40, and 11 drops to find the exact floor that it's at. At most there will be 14 drops, which is what you have enough cash to test.

$\endgroup$
  • $\begingroup$ If floor 14 is the last survivable drop, your method will run out of cash before finding it. You're one off; see, e.g. Dinosaur egg drop for a working solution. $\endgroup$ – Rubio Feb 8 '18 at 18:34
  • 3
    $\begingroup$ @Rubio You start on the first floor, so it costs nothing to test there. $\endgroup$ – Apep Feb 8 '18 at 18:35
  • 1
    $\begingroup$ @Apep Oh. yeah, good point. :) $\endgroup$ – Rubio Feb 8 '18 at 18:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.