There are three light switches outside a room. One of the switches is connected to a light bulb inside the room.
Each of the three switches can be either 'ON' or 'OFF'.
You are allowed to set each switch the way you want it and then enter the room(note: you can enter the room only once)
Your task is to then determine which switch controls the bulb?
A thief enters a store and threatens the clerk, forcing her to open the safe. The clerk says, “The code for the safe is different every day, and if you hurt me you’ll never get the code.†But the thief manages to guess the code on his own. How did he do it?