A light bulb is hanging in a room. Outside of the room there are three switches, of which only one is connected to the lamp. In the starting situation, all switches are off and the bulb is not lit.
You are allowed to enter the room only once (the bulb is not visible from outside). How can you determine which of the three switches turns on the light bulb?
You first flip on one switch and then wait for about 10 to 15
minutes. Then you flip off that switch and flipo on another
one. Then you go into the room. If the bulb is lit, then
the switch you just flipped turns on the light bulb. If the bulb
is not lit, but is hot, then the first switch turned on the bulb.
Finally, if the bulb is neither lit nor hot, then the switch you did
not handle turns on the lightbulb.