Lights Out with custom rules set

296 Views Asked by At

I'm trying to understand how to use linear algebra to solve a custom Lights Out puzzle with the following rules:

There are 8 lights, all the lights are off at the starting point, I need to turn on all of them. Every button change (on\off) of the lights like that: (If the light was on, it will turn it off, if it was off, it will turn it on)

1 1 0 1 1 0 0 0
1 1 1 1 0 0 1 1
0 1 1 0 0 0 0 1
1 1 0 1 1 1 1 0
1 0 0 1 1 1 0 0
0 0 0 1 1 1 1 0
0 1 0 1 0 1 1 0
0 1 1 0 0 0 1 1

For example:

Button 1 will change lights 1, 2, 4 and 5

Button 2 will change lights 1, 2, 3, 4, 7 and 8 You got the idea...

We start with

0 0 0 0 0 0 0 0

And we need to get to

1 1 1 1 1 1 1 1

I got no idea how to even start, I tried to solve it with many matrix but I didn't really understand what I was doing, so I failed. Any help will be appreciated.

2

There are 2 best solutions below

4
On

Call your matrix $A$. You want to use switch $1$ $x_1$ times, switch $2$ $x_2$ times and so on. Call the vector with the $x_i$ $\bar{x}$. So you obtain that $A \bar{x} = \bar{1}$. Do you know how to proceed from there?

0
On

Whatever state the lights are in, Button $A$ followed by Button $B$ has the same effect as Button $B$ followed by Button $A$. In other words, the eight operators are commutative. As a consequence, we can ignore the precise sequence in which the buttons are to operated. It only matters how often each Button is pushed.

Furthermore each Button is its own inverse. It follows that each Button need not be used more than once. For each Button the solution to the puzzle is either $0$ or $1$ times.

Reading the chart vertically yields for each separate light the equation that determines whether Button switch $(x)$ equals $0$ or $1$. Together these equations form a set of $8$ linear equations that is by determined by the transpose of the original matrix.

In conclusion, the solution of the puzzle is found by letting the transpose of the original matrix act on the all-out light state, which must result in the all-on light state.

Note that the equation for light $8$ is the same as for light $3$. Since we have $7$ equations for $8$ variables, we obtain two distinct solutions.

$(a) B_5 = 1$ and $B_8 = 1$

$(b) B_5 = 1$ and $B_1 = B_2 = B_6 = B_7 = 1$