John and Mary have fallen in love. John wants to send Mary a ring through the post but in their country of Kleptopia, any package that is not locked will have its contents stolen. John and Mary have plenty of padlocks but neither has the other's key. How can John get the ring safely to Mary?
John sends Mary a box with the ring in it and one of his padlocks on it. Upon receipt Mary affixes her own padlock to box and mails it back with both padlocks on it. When John gets it he removes his padlock and sends the box back to Mary. Mary has the key for her own lock and can now access the ring.
You’re standing in a hallway with three light switches on the wall, each of which turns on a different lamp inside a closed room. You can’t see inside the room, and you can’t open the door except to enter the room. You can enter the room only once, and when you do, all the lamps must be turned off. How can you tell which switch turns on which lamp?
Turn on the right switch and leave it on for two minutes. After two minutes, turn on the middle switch and leave it on for one minute. When that minute is up, turn off both switches and enter the room. One light bulb will be hot (1st switch) and one will be warm (2nd switch). The cold bulb will correspond to the switch you didn’t turn on.