Logic Puzzle Forums (http://www.logic-puzzles.org/forum/index.php)
-   Logic Puzzles and Brain Benders (http://www.logic-puzzles.org/forum/forumdisplay.php?f=5)
-   -   Press down the lights! (http://www.logic-puzzles.org/forum/showthread.php?t=1159)

 dutchfreak 02-07-2018 03:23 PM

Press down the lights!

https://media.discordapp.net/attachm...125&height=633

Goal: all the squares of the bottom grid have to be 'pressed down'. (No glowing ones remain).

Rules: Pressing a square changes ALL the squares around it. Also diagonal ones. Except itself. Example below; when pressing the middle square.
x x x >> o o o
x o x >> o o o
x x x >> o o o

You can only press each square once. (the top grid represents what you can still change).

I'm looking for the answer, but more importantly if there's a more easy way to solve it than using common sense. Would also love to play this puzzle somewhere in a fast way (java script). This puzzle within the game takes a lot of time to press down each button and reset it.

Thanks a lot!

 fiddleback 02-07-2018 09:11 PM

I can give you an approach to the problem.

Picture an empty board with only one lit square. Solve the board and record the solution as a 5x7 matrix of ones and zeroes. One means a tile was pressed, zero means it was not.

Again, picture the board empty but for a different single lit square. Solve the board and record the solution as a matrix. Do this 33 more times. That is, create a matrix solution of ones and zeroes for each single square on the board. There is a lot of symmetry here, so you're not really required to do this 35 times. For example, the corner solutions are the same, but rotated. If you're clever, you can generate these single tile solutions programatically, but it's just as effective to do it by hand.

Now, see your pictured puzzle, with 16 lit tiles. The solution is just the sum of the solutions for those individual lit tiles. So you'll be choosing sixteen of your pre-calculated solutions and adding them up. You'll wind up with a 5x7 matrix of numbers ranging (in this case) from 0 to 16. If a particular tile is clicked for every one of those individual solutions, it'll be a 16. If it's clicked in only 5 of those solutions, it'll be a 5.

Note that two clicks on any tile (on, then off again) maintains the same state. So any odd number in your solution matrix becomes a 1, and any even number becomes a 0. To solve your puzzle, click the ones.

In short, any puzzle can be solved by superimposing the solutions for individual tiles.

edit:
Heh. I'm working on the assumption that solutions exist for each of the 35 single-tile puzzles. I wonder if that is true! Let me know if you try it. If not, superimposing solutions still works, but some of your pre-calculated solutions will have to be small groups (two or three lit tiles) rather than singles, and there will be a few more of them.

 dutchfreak 02-08-2018 12:27 PM

Im only allowed to press each square once. Does your theory still apply then?

 fiddleback 02-08-2018 03:33 PM

Quote:
 Note that two clicks on any tile (on, then off again) maintains the same state. So any odd number in your solution matrix becomes a 1, and any even number becomes a 0. To solve your puzzle, click the ones.
I'll clear this up a bit: Clicking a single tile 2, 4, 6, or 8... times has the same effect on the surrounding eight squares as not having clicked it at all, regardless of what other tiles may have been clicked. Clicking a single tile 3,5,7, or 9... times has the same effect as clicking it once, again regardless of what other tiles may have been clicked.

When you add up the solutions from individual lit tiles, your matrix might look something like this. (Of course, it should be 5x7. I'm using 3x3 to demonstrate.):
Code:

```3 0 1 2 6 8 1 5 4```
Clicking the counts in the above solution will result in the same final board state as clicking the counts below:
Code:

```1 0 1 0 0 0 1 1 0```
Why? Because clicking any square a second time completely cancels any changes that resulted from clicking it once. Clicking any square more than once is unnecessary.

My only doubts in the approach I've posted hinge on whether or not it's actually possible to solve a board with a particular single tile illuminated. If not, things will be a bit trickier.

If you are only allowed to press a button 0 or 1 times, it doesn't really change the puzzle. If your solution involved hitting a button n times, and n is even, then just hit it 0 times. If n is odd, hit it once.

The order that you hit the buttons doesn't matter.

This seems to be a variation of the Light's Out puzzles. Light's Out was an electronic toy that was sold by Tiger Electronics, starting in 1995. There have been lots of variations made.

In the original Light's Out game, hitting one button changed the light for it, and for the 4 buttons it touched, but not the 4 diagonal buttons. So, the variation you have is slightly different, but the way to come up with a generalized solution for it is the same.

Coming up with a generalized solution is not easy, unless you are very familiar with linear algebra. Rather than try to explain it, I'll just link this page:

https://www.jaapsch.net/puzzles/lomath.htm

There is a lot to read there, especially if you follow the references that he gives. Hopefully something in there helps!

 fiddleback 02-08-2018 03:56 PM

The 'solvability' section in uigrad's excellent link makes me suspect that each tile won't be individually solvable, even though the rules of that game are slightly different. I'll read through it tonight-- looks interesting, thanks!

 dutchfreak 02-09-2018 03:11 AM

Ye I really doubt you can solve every grid with only 1 square up.

I've been looking into the game of lights out, it's simular yet so different. This looks much more complicated.

I understand that pressing a square any even number of times will have the same result as not pressing it at all. So it's indeed a matter of finding which to press and which not to press.

Each lighted up square much have an odd number of squares used around it.
Each pressed down square must have an even number of squares used around it.

My theory is that it's the easiest to solve when trying to bring the lit up squares all towards an edge or corner, 'clearing' the rest of teh area. But thats easier said than done.

I appreciate all the help you guys are giving. Would by nice to practise this game through a simple browser game like this: http://www.logicgamesonline.com/lightsout/

I also know of a place you can play a variation where each button has a random number of neighbors that it will influence (random but clearly shown via a small image on the button)

https://www.chiark.greenend.org.uk/~...s/js/flip.html

There's an Android version of this also. Just search the Google Play Store for "Simon Tatham"