The Jester and the Princess fell in love and the King was not happy about it. The King decided to give the Jester a test. If the Jester passed, the King would give the couple his blessing. The Jester was led down a hallway in the castle to a bare room with a lamp in the middle of the floor. The lamp contained a single lightbulb, which was off. The Jester was allowed to look at the room for a few moments, and then he was led out again. The door to the room was closed and an angry looking guard was stationed in front of it. There was, of course, no way to see the lamp through the closed door. The King then led the Jester down the hall to a panel with three simple light switches – all in the off position. One of these switches turns on the lamp in that room. The other two switches do nothing. “If you can tell me which switch turns on the lamp, I will give my blessing to you and my daughter. You can play with the switches as long as you wish. You can also go back into the room with the lamp, but once you do you can no longer touch the switches, and if you try that angry guard will kill you. If you can tell me with the absolute assurance which of these three switches controls the lamp in that room, I will let you marry my daughter.” The Jester was a clever fellow, and was able to do this. Can you?
The Jester turned on the first switch, waited a little while, and then turned it off again. Then he turned on the second switch and asked to be let into the room. If the lightbulb was on, the second switch was the answer. If the lightbulb was hot, the first switch was the answer. If neither, the third switch was the answer.