**From New Scientist #3263, 4th January 2020** [link] [link]

A tall office building is being rewired. There is a staircase, but the lift is out of action.

There are four identical-looking wires, A, B, C and D, feeding into a pipe in the ceiling of the basement. You are reasonably confident that it is those same four wires that emerge from a pipe on the top floor. Unfortunately the wires have become tangled, so it isn’t known which wire becomes 1, 2, 3 or 4.

To find out, you can join two wires together in the basement (for example A and C) and you can attach two wires at the other end to a light bulb and battery (for example 1 and 3). If the bulb lights, you have made a circuit.

Starting in the basement, what is the smallest number of light bulb flashes that you need in order to figure out which wire is which? And how many times do you need to climb the stairs?

[puzzle#40]

### Like this:

Like Loading...

If we start by connecting wires A+B together, and then ascending the stairs.

At the top can test the pairs: 1+2, 1+3, 1+4, 2+3, 2+4, 3+4 until the bulb lights, in which case we have identified the pair of wires that correspond to A+B.

For example it could turn out that A+B = 1+4 (and we would also know that C+D = 2+3).

We then connect one of the wires from the A+B pair with one of the wires from the C+D pair at the top. In this case we could connect 1+2.

We then go back down the stairs, and disconnect A+B, and test the pairs: A+C, A+D, B+C, B+D, until the bulb lights. We have then identified the pair of wires corresponding to 1+2.

For example it could turn out that A+C = 1+2

So we have:

hence:

And we have identified the wires using 2 bulb flashes, and climbed the stairs once.