|
|
|
|
|
by tgb
3604 days ago
|
|
Sorry how does it follow that you can form the pattern row by row? When you write this down as a linear algebra problem you kinda forget about the structure of the board, and the rows of the resulting matrix you apply Gauss elimination to don't correspond to the rows of the game board. So you must have meant something else that I'm missing, but I'm confused how you would solve just the bottom row without touching any others. |
|
We can represent any N×N board as a N² vector. So, we can represent one of the chessboard pattern as:
At the beginning of the game, the board is at some random initial pattern. The goal of the game is to find the necessary moves to form the chessboard pattern. Hence, we want to solve the equation where M is a N²×N² matrix representing the effect of every possible moves. Pressing on a tile is equation to addition by 1 modulo 2. For example, pressing the top left tile is the same as adding this effect vector to the board vector: If we do this for all 9 tiles of the 3x3 board, we find the matrix M to be: where the i-th row is the effect of pressing the i-th tile. Now, we can just solve for x (assuming M is not singular). Re-using our above example, we find This means we can press the following tiles (in any order) on the board to solve it: If you are interested, I wrote some quick demo code that shows how this could be implemented in Python: https://gist.github.com/avassalotti/7452318c9e9b8dec637bc7c0...