Enigmatic Code

Programming Enigma Puzzles

Puzzle #40: Light bulb moment

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]

One response to “Puzzle #40: Light bulb moment

  1. Jim Randell 5 January 2020 at 12:51 pm

    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:

    A+B = 1+4
    A+C = 1+2

    hence:

    A=1
    B=4
    C=2
    D=3

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

Leave a Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: