Hacker News new | ask | show | jobs
by johnsondavies 1652 days ago
Thank you for putting my 16 LEDs Puzzle on Hacker News! Yes, the principle is similar to Lights Out, but in my puzzle pressing a button toggles its LED and all the other LEDs on the same diagonal(s). I found that this rule is harder to solve, even on a 4x4 grid.
1 comments

Using diagonals decomposes the puzzle into 2 disjoint puzzles according to the black and white squares in a checkerboard pattern. One puzzle can be marked as

    _ A _ B

    C _ D _

    _ E _ F

    B _ G _
If we denote the corresponding buttons in lowercase, we have the equation

    A   1 0 1 1 0 1 0   a
    B   0 1 0 1 1 0 0   b
    C   1 0 1 0 1 0 1   c
    D = 1 1 0 1 1 1 0   d
    E   0 1 1 1 1 0 1   e
    F   1 0 0 1 0 1 1   f
    G   0 0 1 0 1 1 1   g
Where A=1 if and only if light A needs to change.

This matrix over GF(2) is not invertible; its rank is only 5, so the lights cannot be changed arbitrarily. By Gaussian elimination, one finds that button f does the same as buttons a b e together, and button g the same as b c d together. This reduces the equation to

    A   0 1 1 1 1   a
    B   0 1 0 1 1   b
    C = 1 1 0 1 1   c
    D   0 0 0 1 0   d
    E   0 0 0 0 1   e
and the solution comes out as

    e = E
    d = D
    c = A B
    b = B D E
    a = B C
Solving for the remaining buttons yields

    e = E
    d = D
    c = A B
    b = B D E
    a = B C
Oops; I can't edit my post anymore. It went south starting from

> This reduces the equation to

We instead just ignore buttons f and g, and invert the equation

    A   1 0 1 1 0   a
    B   0 1 0 1 1   b
    C = 1 0 1 0 1   c
    D   1 1 0 1 1   d
    E   0 1 1 1 1   e
to

    a   0 1 0 1 0   A
    b   1 1 1 0 0   B
    c = 0 1 0 0 1   C
    d   1 0 0 1 1   D
    e   0 0 1 1 1   E
Showing which buttons to press in terms of exclusive-or of wrong lights, e.g. press button a if exactly one of lights B and D is wrong.