4 ms·
LEDs Puzzle
- tlhunter 5y agoSee Lights Out: https://en.wikipedia.org/wiki/Lights_Out_(game) https://en.wikipedia.org/wiki/Lights_Out_(game)
- johnsondavies 5y agoThank 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.
- tromp 5y agoUsing 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
- tromp 5y agoOops; 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.
- MarkusWandel 5y agoHere's a video of the cube version: https://www.youtube.com/watch?v=CUUoLWqZhdk https://www.youtube.com/watch?v=CUUoLWqZhdk They seem to be rare. I have one from a garage sale, years ago. Maybe I should check that the batteries in it haven't leaked, and not let the kids destroy it.
- Goz3rr 5y ago> but this would require 12 I/O lines, and the small 14-pin processors only provide 11. Actually the 14 pin chips provide 12 GPIO lines, it just requires you to set a fuse which will disable the reset function to get the 12th one. If you then need to change the programming once more after setting that fuse, you'll need what is known as a "high voltage programmer" (high voltage being 12V instead of 5V) to regain access to the reset pin.