www.austinfraser.com / Siège social: Reading
37 entretiens à Reading (sur 45)
You have 2 light bulbs. You are in multistory building such that if you drop a bulb from a floor of a certain height or higher the bulb will break: for ex: if the bulb will break at a minimum height of 10th floor, then the bulb will break if dropped only if dropped from a floor higher than tenth floor. it will not break if dropped from ninth floor or less. using the two bulbs how will you figure out at which floor will the bulb break?
Keep going from floor to floor starting from 1 to 2 to 3 and so on.....the first bulb will break at the threshold. So you basically don't even need the second bulb to decide which is the critical floor.
I forgot to mention that you have to try to figure out the floor in the least amount of tries. so incase the minimum floor is 100, you shouldn't try all the floors. The solution posted above works, but is the least efficient.
With 2 bulbs we can skip 3 floors at a time. 1) Drop bulb #1 at floor x 2) If it breaks then try floor x-1 else try floor x+3 Start with floor 1.