Top Banner
SOLVING LIGHTS OUT BY: ALI THOMAS Recreational Mathematics:
20

Recreational Mathematics - Welcome | Union University

Sep 12, 2021

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Recreational Mathematics - Welcome | Union University

S O L V I N G L I G H T S O U T

B Y : A L I T H O M A S

Recreational Mathematics:

Page 2: Recreational Mathematics - Welcome | Union University

An Introduction:

  5 x 5 array of lights

  Object of the game:   Turn off all of the lights in

the fewest amount of moves given lights that are turned on in a specific configuration.

Lights Out

Page 3: Recreational Mathematics - Welcome | Union University

How to Play:

  The state of a light is affected by pressing the light.

  Pressing any light affects the state of the lights horizontally and vertically adjacent to the selected light.

Lights Out

W I N

Page 4: Recreational Mathematics - Welcome | Union University

U S I N G L I N E A R A L G E B R A

Let’s Solve Lights Out

A

Three Matrices are Used to Solve Lights Out:

Page 5: Recreational Mathematics - Welcome | Union University

To Begin:

1. Place original light configuration into a matrix. This is the first matrix .

• Place a 1 into the matrix if the light is on.

• Place a 0 in the matrix if the light is off.

Page 6: Recreational Mathematics - Welcome | Union University

The Strategy:

•  The matrix is the solution to solving a game of Lights Out.

•  There is a 1 if the button is to be pushed, and 0 otherwise.

•  Pressing any button changes .

•  These changes can be accounted for, and this is the origin of the strategy matrix.

•  is the representation of the changes needed to solve the game.

•  The strategy matrix tells the user what buttons must be pressed in order to win the game.

•  The size of the matrix is 25 x 1, the same as .

Page 7: Recreational Mathematics - Welcome | Union University

Matrix A:

• View the matrix row by row.

Page 8: Recreational Mathematics - Welcome | Union University

Matrix A:

•  25 x 25

• Originates from the relationship that the lights have with each other.

A =

Page 9: Recreational Mathematics - Welcome | Union University

Solving Lights Out

 To find a strategy to turn all of the lights off, solve .

 This equation develops by beginning with all of the lights out and discovering a strategy that generates .

Page 10: Recreational Mathematics - Welcome | Union University

To Find :

• Solve .

• Configuration is winnable if it belongs to the column space of matrix A.

• Perform all calculations modulo 2.

• Since A is symmetric, the column space is equal to the row space.

• The row space of matrix A is orthogonal to the null space of matrix A.

• To determine a basis for the null space of A, perform Gauss-Jordan elimination on A.

• There are two rows of zeros in the reduced row-echelon form of matrix A (The rank is 23).

• Thus, if is orthogonal to the basis for the null space of A, then it is in the row space of A and, consequently, the column space of A.

• Therefore, light configurations exist that cannot be solved.

Page 11: Recreational Mathematics - Welcome | Union University

Determining :

• Using a Computer Algebra System, such as Mathematica, solve for the strategy matrix.

•  Java Game

Pressing the blue buttons in any order will win the game.

Page 12: Recreational Mathematics - Welcome | Union University

U S I N G L I N E A R A L G E B R A

Let’s Solve Lights Out on a Torus

Page 13: Recreational Mathematics - Welcome | Union University

An Introduction:

  4 x 4 array of lights

  Object of the game:   Turn off all of the lights in

the fewest amount of moves given lights that are turned on in a specific configuration.

Lights Out on a Torus

http://www.math.cornell.edu/~mec/2008-2009/HoHonLeung/Torus.png

Page 14: Recreational Mathematics - Welcome | Union University

How to Play:

  The state of a light is affected the same.

  Now, the 1st and 4th columns are “adjacent.”

  The 1st and 4th rows are also “adjacent.”

Lights Out on a Torus

WINNER!

Page 15: Recreational Mathematics - Welcome | Union University

To Begin:

1. Place original light configuration into a matrix. This is the first matrix .

• Place a 1 into the matrix if the light is on.

• Place a 0 in the matrix if the light is off.

Page 16: Recreational Mathematics - Welcome | Union University

The Strategy:

•  A game of Lights Out on a torus is solved using the same methods used in the original Lights Out.

• The difference lies in matrix A.

Page 17: Recreational Mathematics - Welcome | Union University

Matrix A:

•  16 x 16

• Originates from the relationship that the lights have with each other.

Page 18: Recreational Mathematics - Welcome | Union University

To Find :

•  Solve .

• Recall, that is winnable if it belongs to the column space of matrix A.

 Remember that belonging to the column space is equivalent to being orthogonal to the null space.

 Perform Gauss-Jordan elimination on A.

 The matrix A row reduces completely. There are no rows of zeros and thus, no null space. The rank is 16.

 Every light configuration is winnable.

Page 19: Recreational Mathematics - Welcome | Union University

Determining :

• Using a Computer Algebra System, such as Mathematica, solve for the strategy matrix.

•  Java Game

•  Pressing those buttons in any order will win the game.

Page 20: Recreational Mathematics - Welcome | Union University

1.   A n d e r s o n , M a r l o w a n d F e i l , T o d d . “ T u r n i n g L i g h t s O u t w i t h L i n e a r A l g e b r a . ” M a t h e m a t i c s M a g a z i n e V o l . 7 1 , N o . 4 ( 1 9 9 8 ) : 3 0 0 - 3 0 3 .

2.   “ J a v a s c r i p t L i g h t s O u t K e y c h a i n . ” 2 0 0 2 . 2 D e c . 2 0 0 9 . < h t t p : / / w w w . h a a r . c l a r a . c o . u k / L i g h t s / J S / l o u t k e y . h t m l > .

3.   “ L i g h t s O u t . ” 1 9 9 6 . 2 D e c . 2 0 0 9 . < h t t p : / /w w w . w h i t m a n . e d u / m a t h e m a t i c s / l i g h t s _ o u t / > .

4.   G r o s s m a n , S t a n l e y I . “ E l e m e n t a r y L i n e a r A l g e b r a . ” F i f t h E d i t i o n . S a u n d e r s C o l l e g e P u b l i s h i n g : P h i l a d e l p h i a . 1 9 9 4 .

References