All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars
 perplexus dot info

 Lights Out! (2) (Posted on 2022-10-31)
Imagine there is a 7x7 grid of lights, and only the middle in the grid is on.

The lights are wired such that when you flip the switch for one light (from on to off or off to on) the others next to it (not diagonally) flip as well.

Using this weird wiring of lights, what is the fewest number of switch changes it takes to turn all the lights off, and which lights should you switch?

Note: Assume all the switches work in the manner explained, and there is one switch for each of the lights.

 See The Solution Submitted by K Sengupta Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 re: Cleaned-up code for the extension and an observation | Comment 12 of 24 |
(In reply to Cleaned-up code for the extension and an observation by Charlie)

I noticed a pattern with the size 3, 7, and 15 solutions, those numbers are all of the form 2^n-1.  They all start with a top row of just a single 1 in the central spot.  I'd expect that to hold for larger numbers like 31, 63, 127.
 Posted by Brian Smith on 2022-11-14 12:06:27

 Search: Search body:
Forums (0)