A thousand wires hang on a very high tower, so high that you cannot see which top belongs with what bottom. This is something you are interested in knowing. You have a battery and a light bulb which will light up if two wires connect it to the battery with appropriate polarity (i.e. the battery and bulb each have two contact points, and one of each is + and the other side is -). Wires may have their ends tied together, and you can see the bulb light up even if you are at the opposite end of the tower. Since the tower is so high, you want to minimize the number of times you have to climb up and/or down the ladder, regardless of how much you have to do while you are at the top or bottom. What is the minimum number of traversals required?
A really simple way and inefficient way wrote:
I'll call one end A, and one end B and the wire ends will then be A1,A2...A1000 and B1,B2...B1000.
Start at the top. Hook the bulb to two wires (A1 and A2). Climb down. Try all wire combinations until you find the B ends for A1 and A2 (polarity will let you tell which is which once you have the pair) Climb up, put the bulb on A3 and A4. Climb down. Test again. Repeat.
Total trips: 499 (no need to climb back to the bulb after the last test.)