You are standing in a hallway with three light switches.

Each switch has an accurately labeled on and off position. In an adjoining room, behind a closed door, there is a bare lightbulb, which is controlled by one of the three switches. The other two switches are not connected to anything. You are free to manipulate the switches any way you like and for as long as you like, and you are permitted to enter the room containing the lightbulb once and only once. If and when you exit the room, you must close the door behind you – you are never permitted to view the lightbulb while manipulating the switches.

Here’s your challenge: figure out which of the three switches controls the lightbulb.