Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Found a problem floor by minimum steps
Message
 
To
26/11/2001 16:04:45
General information
Forum:
Games
Category:
Puzzles
Miscellaneous
Thread ID:
00585855
Message ID:
00586049
Views:
37
>>>>>>Hi everybody,
>>>>>>
>>>>>>This is a puzzle, which could be asked on a interview. I could not find a best answer.
>>>>>>
>>>>>>There is a 100 floor building. You have two glass balls. You need to find out the floor number, starting from which these balls will broke by minimal number of steps.
>>>>>>
>>>>>
>>>>>What is definition of a step in this case?
>>>>
>>>>I think, one dropping of a ball is a step.
>>>
>>>Are you saying that I need to find out the lowest floor of this building where a glass ball will break when dropped and I need to explain how it could be determined in the least number of actions?
>>>
>>>Renoir
>>
>>Yes, exactly. Thanks for translating this problem into proper English for me :)
>
>Go to floors:
>14
>27
>39
>50
>60
>69
>< and so on, going adding 1 less floor each time >
>99
>
>If ball breaks at any floor, go to previous step+1, and go to each floor in ascending order.
>
>Max steps=14, occurring at at 13, 26, 38, 49, etc. I chose 14 as the starting point because the sum of n + (n - 1) + (n - 2)... series for n=14 is the lowest n that gives a result greater than 100.
>
>I don't recall how to express this in the proper mathematical terminology...

I don't understand your solution. It is obvious one can't start at the 100th floor and work down. But, how do you garantee that one or both balls won't break before the 14th floor, if one starts at the first floor and works up, or won't bounce without breaking above the 14th floor?

I would start at floor one and use a variation of the Hi-Low game, moving to the midpoints of each segment above. 1, 3, 6 .. If the ball breaks at 3 then try 2. If it breaks then 2 is the answer, otherwise 3. If the ball breaks at six we know it didn't break at 3, so that leaves 4 and 5 in that order. Try 4. If it breaks the problem is solved. Otherwise try 5. If it breaks the problem is solved. If it doesn't break then floor 6 is the lowest floor.

Repeat the sequence in each split above.
JLK
Nebraska Dept of Revenue
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform