Data Structuresand Algorithms Good OldJava AdvancedInterview Topics Cloud andDatabases Web Designand Development Must-knowTools Good ToKnow

## Room with four bulbs

Puzzle: There is a room with a door (closed) and four light bulbs.
Outside the room there are four switches, connected to the bulbs.
It is not known before hand which switch connects to which bulb.
You may ON/OFF the switches as many times as you wish, but once you open the door you can't change them.
Identify each switch with its bulb.

Hint: Some out of the box thinking is required in this puzzle.

Solution: If there were two bulbs, and two switches only, then ON/OFF status would be enough to find the connection between the bulbs and the switches.
This could be done by employing the brightness property of the ON bulb.

For more than two bulbs, we need some more property of the bulbs to find the switches for number of bulbs.
Temperature of the bulb can be another such property.

ON first switch and third switch for half an hour.
OFF first switch, ON the 2nd switch and enter the room.

OFF and hot bulb belongs to switch 1.
ON and cold bulb belongs to switch 2.
ON and hot bulb belongs to switch 3.
OFF and cold bulb belongs to switch 4.

Like us on Facebook to remain in touch
with the latest in technology and tutorials!

Got a thought to share or found a
bug in the code?
We'd love to hear from you:

 Name: Email: (Your email is not shared with anybody) Comment: