# There are three lights which can be in one of three states. Can we get the system of lights into a specific state?

If there is someone who can come up with a better title for this please edit the title.

There are three lights in a line. Each light can be in one of three states: off, light red, and dark red. There is a cycle of states: OFF, then LIGHT RED, then DARK RED, then back to OFF.

There are three switches which control the lights like so:

Switch A - advances the cycle for the first two lights Switch B - advances the cycle for the all three lights Switch C - advances the cycle for the last two lights.

If we start with all three lights in the off state can the switches be pushed in some order so that the three lights in the line are in: OFF-LIGHT RED-DARK RED?

I'm trying to model this with linear algebra. Where A,B,C are the lights in a row and we push A x times, B y times, and C z times. Of course the numbers are mod 3 because after 3 pushes we wrap back to the off state.

Any suggestions?

Note that we can switch the first, second and third light independently, so any state can be reached:

1. Switching $$A$$ twice and then $$B$$ is the same as switching the last light.
2. Switching $$C$$ twice and then $$B$$ is the same as switching the first light.
3. Switching $$A$$ once, switching $$C$$ once and switching $$B$$ twice is the same as switching the middle light.

We can represent the states of the lights with $$0=Off, 1=Light Red, 2=Dark Red$$. Then we want $$x+y\equiv 0\\ x+y+z\equiv 1\\y+z\equiv 2$$ where all the equivalences are $$\mod 3$$ The first two tell us $$z=1$$. The last two tell us $$x=2$$. Then from the first $$y=1$$. So we use A twice and the others once.

• Why does the last one fail? What is wrong with $(x,y,z)=(2,1,1)$? Commented Oct 7, 2018 at 20:36
• @Servaes: I confused myself. That does work. Fixed. Commented Oct 7, 2018 at 20:45
• After we subtract equation one from equation two to get $z=1$ can't we just put $z=1$ into equation 3 to get $y+1=2$ implying that $y = 1$? Then the first statement is just $x + 1 = 0$ which implies $x=2$ since $3 = 0 \mod 3$. It's the same thing we just aren't using a linear combination of equation two and three to determine the value of $y$. Commented Oct 7, 2018 at 21:52
• @vol7ron In both cases it's simply a matter of subtracting one from the other. In the context of linear algebra this really isn't worth elaborating on. Commented Oct 8, 2018 at 8:58
• @Servaes Again, I’d kindly ask that you update the answer instead of explaining it in comments. It appears incomplete. This is a mathematics forum where there are many students of all ranges that would gain benefit from answers that are “elaborated on”. In the context of the forum, it’s your opinion that it isn’t needed. It also seems to be your opinion to argue here, instead of pumping the equations through a simple algebraic solver and copy/pasting into your answer. Commented Oct 8, 2018 at 14:04

You can consider the actions of the switches as set of vectors in a three dimensional vector space over the finite field {0,1,2}, with basis (1,0,0), (0,1,0), (0,0,1).

You have switches: \begin{align} a&=(1,1,0) \\ b&=(1,1,1) \\c&=(0,1,1) \end{align}

Because $${a,b,c}$$ are linearly independent, they generate a three-dimensional vector space, which must contain every possible state, and indeed you have:

\begin{align} (1,0,0) &= b - c &= b + 2c \\ (0,1,0) &= a - b + c &= a + 2b + c \\ (0,0,1) &= -a + b &= 2a + b \end{align} so $$(0,1,2) = a + 2b + c + 2(2a + b) = 2a + b + c$$