Lights on game algorithm

69 Views Asked by At

When I was a young child I was on holiday with my mother with a dutch family. One day Dick, the family man, handed me a wooden box with some switches and lights (maybe eight, but I'm not sure) and told me to switch on all lights. When playing with the switches, some lights went on while others went out again. Back then I wasn't able to make all the lights shine.

Now I have an FPGA development board in front of me and want to recreate the game but I lack the algorythm to go with it.

Why am I asking this question to this forum? Now Dick's real name was Nicolaas Govert deBruijn and I think one of his students built the box for him. Unfortunately, Dick has since passed away and his mathematical legacies were returned to the University of Eindhoven. Now I have no chance to take a look into the box and solve the puzzle.

Perhaps you can help me at this point...

Edit as a result of a comment:

Obviously my question concerns mathematics, otherwise I would have asked the question in another forum.

Unfortunately I have nothing more than this nice but vague story. I was a child then and the story happened almost 50 years ago.

But I'm pretty sure that the game has to do with his work on sequences and was a tribute to his work. Therefore I think that someone in this forum can help me with the possibly underlying algorithms.

1

There are 1 best solutions below

0
On

I'll guess a game, rather like the one you are talking about.

Suppose the box is a square 5-by-5 lights. and there are few switches that each changes the state of some subset of lights.

The goal of the game is to light all lights or to shut them down or something.

Think of subset, each switch controls, as a 25 long vector above $\mathbb{F}_2$, with some bits set (what it actually controls).

Each switch have exactly two values on/off, again above $\mathbb{F}_2$ - or 0, or 1. Index them and call this variable $a_i$ for $i^{th}$ switch.

Let $s$ - be the initial state vector and $t$ the desired one.

Then you want to solve for $$P \cdot a = t - s,$$ where $a = (a_1, a_2, \ldots, a_k)^T$ - switches state vector, $P$ is a 25-by-$k$ matrix of each switch controlled vector.

Now pick your favorite method to solve the linear system over $\mathbb{F}_2$ for $a$.