Solving Lights Out - Network Theory in Practice!

  Рет қаралды 5,541

Last Heart Games

Last Heart Games

Күн бұрын

Пікірлер: 9
@passelcrawfordon2277
@passelcrawfordon2277 Жыл бұрын
I wrote a program in VB3 a little over 20 years ago to allow playing the game and analyzing the solutions. You said exactly half of the configuration of lights is unsolvable, but I remember it as being 3/4ths of the possible light combinations are unsolvable. A solvable configuration can only lead to other solvable configurations. Likewise, an unsolvable configuration can only lead to other unsolvable configurations. You can quickly reduce any given configuration of lights into a single set of lights along one edge of the game board. Since you can use your program to test if a solution is solvable, you should be able to quickly verify the 31 combinations of possible lit light configurations at the edge of the board to find that there are only 7 out of 31 combinations that are solvable. The 32nd configuration of the row is no lights lit, which is by definition solvable, so you have 8 out of 32 combinations solvable for the row, and that ratio applies to the set of 25 lights by extension. Also, every puzzle has four unique paths to reach Lights Out, but the four paths will most often not be the same length, but in some cases, there are multiple equal short paths (i.e. button sequences), so more than one "least button presses" sequence. I downloaded the python script and ran it. The first game I tried demonstrated the error. I just set the very first checkbox (A1) and hit solve, and the program "solved" it. The fact is setting any single light around the edge of the board is an unsolvable configuration. There is an error at step 9 of the solve. I show step 8 and step 9. Step 8. Button B3 X O X O X Note that A1 is set O X X O X X O O O O O O O O O O O O O O Step 9. Button B1 X O X O X Note that A1 should be not set. X O X O X O O O O O O O O O O O O O O O Pressing Button B1, should have Toggled button A1 off (reference the state at Step 8), but your code leaves it on I'm assuming that first bit, A1, is probably incorrectly processed somehow, so you end up with double the number of actual solutions in your Data file, but I don't understand what your code is doing well enough at this point to be able to figure out the issue. It may be the "B1" mask value is incorrect. *Update* 5 April 2023, I did look at the Mask generation code and the "B1" Mask (masks[5]) was indeed incorrect. It was 1120, but it should have been 1121. That single bit missing in the one mask (out of 25 masks) caused the program to generate 16+ million (2^24) solutions instead of the correct 8+ million (2^23) solutions. Line 168 of the script is if i - 5 > 0: But should be if i - 5 >= 0:
@dixon1e
@dixon1e 4 жыл бұрын
Very nice video, especially how you thought through the problem with different data structures. Never heard of the game. Diabolical way to keep the kids quiet :)
@LastHeartGames
@LastHeartGames 4 жыл бұрын
Glad you enjoyed it. I hope to be able to do more like these in the future.
@The-Anathema
@The-Anathema 6 ай бұрын
If you only care about the optimal solution you can use some trivial algebra to calculate the optimal solution for any given board (and you obviously also learn if the puzzle is solvable), this solution is very overkill. You can do this in 135MB naive, probably under 40 if you account for non-unique board states (all symmetries and rotations are equivalent so about 3/4 of board states should be duplicates). Add a bit extra overhead if we want to multithread it for speed, this is trivially parallelizable so it's not going to have a lot of overhead. Sorta tempted to do it now.
@valentinadominguez8659
@valentinadominguez8659 Жыл бұрын
Bo loco acabas de salvar a mi grupo de un trabajo nefasto! Te agradezco un monton
@michaelmcguffin7160
@michaelmcguffin7160 2 жыл бұрын
Wow I forgot all about that game. God the 90s were great
@discountmorty213
@discountmorty213 3 жыл бұрын
I got this as a kid and wonder how it being solved lol
@kevinleesmith
@kevinleesmith 2 ай бұрын
A) its not a list of lists its a 2 dimensional array. B) you can store 1 board in 1 32 bit long aka 4 bytes, not 1.2kB!! I will look at the python and if I can be bothered re-write it
@dersportstatistiker
@dersportstatistiker Жыл бұрын
Nice solutiion, but not everything was right: You explained, that 50% of the possible starts couldn't be solved. That is not correct, 25% are possible to solve. Test this: Find the first row of a solution (always one of four) with the structure 00ABC (A,B,C are 0 or 1). solve this 3 equations: a=1-A, b=1-B, c=1-C the 3 other solutions are always starting with: 01abC, 10aBc, and 11Abc The starting row defines alway the next row and so on. I could say much more and give you all my proofs, just ask ...
Solving the "Lights Out" Problem
16:17
Physics for the Birds
Рет қаралды 157 М.
The Most Amazing Fact About Light Switching Puzzles (SoME1)
13:58
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН
Правильный подход к детям
00:18
Beatrise
Рет қаралды 11 МЛН
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
How Computers Draw Weird Shapes (Marching Squares)
28:00
Reducible
Рет қаралды 413 М.
I built my own 16-Bit CPU in Excel
15:45
Inkbox
Рет қаралды 1,6 МЛН
Cracking Enigma in 2021 - Computerphile
21:20
Computerphile
Рет қаралды 2,5 МЛН
What P vs NP is actually about
17:58
Polylog
Рет қаралды 143 М.
'Lights Out' Game (with Solution Procedure)
15:12
TatooineSky
Рет қаралды 2,9 М.
Solving The Electrifying TESLA BOX Puzzle!!
20:01
Chris Ramsay
Рет қаралды 1,3 МЛН
Building a DIY Simon game using an ARDUINO UNO?
16:10
Print 'N Play
Рет қаралды 16 М.
An impossible game at the heart of math
16:31
SackVideo
Рет қаралды 126 М.
How I play old PC GAMES in 2021 (Win98 / WinXP / Windows 10)
15:42
MetalJesusRocks
Рет қаралды 596 М.
Lights Out and Linear Algebra 1/3 - Mathapptics
8:38
mathapptician
Рет қаралды 29 М.
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН