In your house, there are three light switches downstairs. Each corresponds to one of the three light bulbs in a room in the attic. You can turn the switches on and off and leave them in any position. How would you identify which switch corresponds to which light bulb, if you are only allowed one trip upstairs?
Keep the first bulb switched on for a few minutes. It gets warm, right? So all you have to do is switch it off, switch another one on, and then go upstairs to the room with the bulbs. Touch them to find out which one was switched on as the first one (the warm one). The other two can now be easily identified.