Imagine five vertical pipes arranged in a circle. The pipes are labeled A, B, C, D and E, with each letter standing for the color of water that is poured into the top of the pipe: amber, blue, crimson, diamond and emerald. (Because the pipes are in a circle, pipe A is between pipes B and E.) Between any two adjacent pipes are three switches that can be used to divert the flows of colored water. For example, if the top switch between pipes A and B is open, the amber water from pipe A will be rerouted to pipe B and the blue water from pipe B will flow into pipe A. Further exchanges can take place at the middle and bottom switches; at each level, the water in a pipe can flow either to the left, to the right or straight down (if neither of the pipe's switches is open). But water cannot flow in two directions at once. For instance, the top switch between pipes A and B cannot be open if the top switch between pipes A and E is also open.
Here's a warm-up problem: Can you arrange the switches so that the colors of the liquids in pipes A, B, C, D and E become C, D, E, A and B at the very bottom? (That is, crimson at the bottom of pipe A, diamond at the bottom of pipe B, and so on.) As the illustration shows, you must first open the top switches between pipes A and B and pipes C and D, which changes the sequence of colors to B, A, D, C and E. Then open two of the middle switches to change the pattern to B, D, A, E and C. Last, open two bottom switches to create the desired arrangement.
This article was originally published with the title Liquid Switchboard.