You are a young tech just hired by Artslet (your friendly Telco) and obviously someone is out to make your life hard!

You have just assisted your supervisor to lay 1 Km of special cable containing 100 individual wires. As he was about to head off for a very long lunch, he left you the job of tagging all the wires so they can be connected to the correct equipment, promising to buy you a drink if you get there before knock-off time.

Unfortunately, the wires are completely indistinguishable — this would have been a much easier job if you could have done it before the cable was laid!

To assist you in this task you have a large supply of numbered tags, a chart in which you have to record the tags attached to each end of each wire and a simple continuity tester consisting of a battery and a light. If you (say) joined 2 wires together at one end, you could then walk down the other end and test to find out which 2 wires are joined. There is no limit to how many wires you could join and test like this.

The question is: how far are you going to have to walk to tag and record all the wires? What strategy will you employ? Do you have any chance of the supervisor buying you that drink?

Answer: 2km. You should get that drink.

Solution

1. At one end connect together groups of wires chose at random, such that each group has a different number of wires. One way is to make 13 groups comprising 1,2,3,4,6,7 and so on up to 14 wires, with no group of size 5.
2. Tag each wire with a code for the size of the group it belongs to (eg A for 1, B for 2 and so on).
3. Walk to the other end (1 km walked).
4. Pick any wire and use your tester to find all wires connected to it.
5. Tag each wire for the size of the group using the same code as in (2), and a second code which is its number in the group (eg C3 for the third wire in a group of 3 wires).
6. Repeat until every wire has been tagged.
7. Connect together groups of wires that have the same second code value (eg a group might contain wires tagged C3, D3, E3 and so on). Note that every group is of a different size.
8. Walk to the other end (2 km walked).
9. Disconnect all the wires.
10. Pick any wire and use your tester to find all wires connected to it.From the size of the group attach the same second code to each wire that was assigned at the other end.
11. Repeat until every wire has been tagged.