
Write a Mathematica program to find all minimal solutions and use it to investigate which graphs have unique minimal solutions. Here are a few that we feel are espeicially worthy of investigation with Mathematica. Many open questions remain concerning the Lights Out problem on boards (grid graphs) and graphs in general. I n a n y s o l u t i o n t o t h e L i g h t s O u t p u z z l e, t h e t o t a l n u m b e r o f t i m e s e a c h s q u a r e a n d a l l i t s n e i g h b o r s a r e t o u c h e d m u s t b e o d d i f t h a t s q u a r e i s u l t i m a t e l y t o b e d a r k e n e d. W e s e t u p a l o c a l e q u a t i o n f o r e a c h s q u a r e o n t h e b o a r d t h a t m u s t b e s a t i s f i e d b y a n y s o l u t i o n. T h u s, a s o l u t i o n c o n s i s t s o f i n d i c a t i n g w h i c h s q u a r e s t o t o u c h o n c e. T h e s e f a c t s i m p l y t h a t, i f t h e p u z z l e c a n b e s o l v e d a t a l l, i t c a n b e s o l v e d b y t o u c h i n g s o m e s q u a r e s e x a c t l y o n c e a n d t h e o t h e r s n o t a t a l l. F u r t h e r m o r e, t h e o r d e r i n w h i c h w e t o u c h v a r i o u s s q u a r e s i s u n i m p o r t a n t - i t i s o n l y t h e n u m b e r o f t i m e s w e t o u c h a s q u a r e t h a t m a t t e r s. C h a n g i n g t h e s t a t e o f a s q u a r e a n e v e n n u m b e r o f t i m e s i s e q u i v a l e n t t o n o t c h a n g i n g i t a t a l l c h a n g i n g t h e s t a t e a n o d d n u m b e r o f t i m e s i s e q u i v a l e n t t o c h a n g i n g i t o n l y o n c e ( i t s s t a t e i s r e v e r s e d ). The computational aspect of the problem of finding solutions, as the board size increases, may at first appear rather daunting however, in the next section we show that it reduces to finding solutions of linear equations over the two element field -a very tractable problem.Ī c a s u a l e x a m i n a t i o n o f L i g h t s O u t p u z z l e s l e a d s t o i n t e r e s t i n g o b s e r v a t i o n s o n w h i c h a m u c h b e t t e r u n d e r s t a n d i n g o f t h e n a t u r e o f t h e p r o b l e m d e p e n d s. In fact it is convenient to consider the problem on graphs (defined below), especially since Mathematica, in its DiscreteMath Combinatorica package, has many defined graph functions. If there is a solution to the puzzle, it is natural to ask if there is more than one solution and, if so, what is a minimal solution-one with fewest squares touched. The puzzle is to touch squares of a board, which are initially all lit, so that all squares become dark. If a square is touched, its state reverses and so does the state of each of its neighboring squares (that is, those squares with which it shares an edge).

(The original puzzle consists of a 5-by-5 board.) Squares can be in one of two states: light or dark. A rectangular board is constructed from squares.


A puzzle, called Lights Out, provides an excellent opportunity to use Mathematica's functional programming style to easily explore mathematically interesting questions.
