Imagine there is a 5x5 grid of lights, and only the middle light 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 right 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? (Assume all the switches work in the manner explained, and there is 1 switch for each of the lights.)
(In reply to
re: Brute Force by Tristan)
I'd say probably 3/4 of all lit configurations are impossible. To test a given configuration, go through the "Chase the lights down" technique given by Lee in the "real-world method" comment. Then, if the bottom row does not match one of the configurations on the left of the diagram:
x---x............cc---
-x-x-............c--c-
xxx--............-c---
--xxx............---c-
x-xx-............----c
-xx-x............c----
xx-xx............--c--
then the layout is impossible to solve.
If it is one of those, then as Lee says, click as shown in the pattern on the right, on the top row, and again chase the lights down.
Note that 8 of the possible bottom rows are accounted for: the 7 shown plus the all out configuration which is already solved without further punching, that's 8 out of the 2^5=32 possibilities, or 25%.
|
Posted by Charlie
on 2003-11-03 23:18:07 |