Transcript
Page 1: Turning outthe lights with - SFU.cajtmulhol/math302/notes/Chapter24-LightsOut-blank.pdf · Chapter 24: Lights Out Out the Assign Turning outthe lights withlinearalgebra TigerElectronics

Chapter 24: Lights Out

Turning out the lights with linear algebraTigerElectronics

LightsOut LightsOut2000

Samplegameplay

MatricModelforpuzzleRepresent the state of each light by an element of FL o I

off Oon I

Assign a matrix in Mas Fz to a configurationof lights i

Assign a toggle matnic to each move

Page 2: Turning outthe lights with - SFU.cajtmulhol/math302/notes/Chapter24-LightsOut-blank.pdf · Chapter 24: Lights Out Out the Assign Turning outthe lights withlinearalgebra TigerElectronics

button 3,4

Sample game play written in terms of matrices

Page 3: Turning outthe lights with - SFU.cajtmulhol/math302/notes/Chapter24-LightsOut-blank.pdf · Chapter 24: Lights Out Out the Assign Turning outthe lights withlinearalgebra TigerElectronics

A lit button configuration is solvable iff

I E Xi Ti j B matnie equationis ije5

for some Xi je Fz 0,1

xi is called the strategymatrix written as a vector itis calleda stretegyneckr

E Xin Xin24,324,4 Kus Kzn Ks's

5 5 matric dimension 25 vector

Ti EiB b

EqnCtx can be written as a BIG linear system

AE 5 where A E Ei Isis25equations in 25 unknowns

Solanglightsootessolungkthfarastrategyueebracymmunj

we now neet to determine the matrix A

Page 4: Turning outthe lights with - SFU.cajtmulhol/math302/notes/Chapter24-LightsOut-blank.pdf · Chapter 24: Lights Out Out the Assign Turning outthe lights withlinearalgebra TigerElectronics

LightsOut Matrix A Ei I ti z o Isis whereEij is togglevectorforbutton i j

I 2 3 4 5 67 g a co n iz is n is is it too1920 a 22232425

3456

78aco11

14

17too19

mis

Page 5: Turning outthe lights with - SFU.cajtmulhol/math302/notes/Chapter24-LightsOut-blank.pdf · Chapter 24: Lights Out Out the Assign Turning outthe lights withlinearalgebra TigerElectronics

A littletwist

we can use techniques from linear algebra to solve butarithmetic must be done in Fz

toI 0 1

ALL results in linearalgebrahold when IR is replaced by a field R

Solvinglinear systems over Fz

X t Kz Augmented

x Xz O2GtXz I matrix

Page 6: Turning outthe lights with - SFU.cajtmulhol/math302/notes/Chapter24-LightsOut-blank.pdf · Chapter 24: Lights Out Out the Assign Turning outthe lights withlinearalgebra TigerElectronics

Sagemath demo

In sagemath Ez is denote GFC2 called theGalois field of size 2

Example Solve the following configuration

I

Solution

Solvable Configurations i

5 is a solvable configuration AE D has a solution

Moreover

AI _5 is solvable foreal I cHIS A is invertibledetA to

For 5 5 lights out detA

For example is

Page 7: Turning outthe lights with - SFU.cajtmulhol/math302/notes/Chapter24-LightsOut-blank.pdf · Chapter 24: Lights Out Out the Assign Turning outthe lights withlinearalgebra TigerElectronics

How many configurations are solvable

I solvableThe dimensionof ColA is rankA so there are

lookA I solvable configurationsout of 225configurhas

Theorem The probability a random configuration is solvable is223225 44

The nullspace of A solutions to AE 8 has dimension

nullityA RankNullitytheorem

sonulA span

o

J d d d de

Optimal solution

If I and I are two strategy vectors for configuration To theirAI D Aj

O It Naka

are four different ways to solve b Pickthe onethathastheleast number of 1 s that is theoptimal solution

Page 8: Turning outthe lights with - SFU.cajtmulhol/math302/notes/Chapter24-LightsOut-blank.pdf · Chapter 24: Lights Out Out the Assign Turning outthe lights withlinearalgebra TigerElectronics

Lightchasing A wayto solve with some memorization


Top Related