The Mathematics of Quatrainment Finding the Solution Loran Briggs and Daniel McBride College of the Redwoods Eureka, CA 95501, USA December 17, 2010
Abstract The game of Quatrainment is a simple game where you flip over tiles to make a 4 by 4 gird look like another target 4 by 4 grid. This is an example of a finite-state machine. In this presentation, we will be discussing our method of finding a unique solution to any quatrainment game using the fewest number of moves possible. We will go through the rules of the game, figuring out whether or not there is a solution to every game, how to find a solution, as well as our program which finds the quickest solution to the game. Loran Briggs and Daniel McBride (CR) The Mathematics of Quatrainment December 17, 2010 2 / 19
Overview Setup and Goal Rules Base Two Systems Is a Solution Always Possible? The Solution Algorithm Loran Briggs and Daniel McBride (CR) The Mathematics of Quatrainment December 17, 2010 3 / 19
Setup and Goal Starting Grid Target Grid X X X X X X X X X X X X X X Loran Briggs and Daniel McBride (CR) The Mathematics of Quatrainment December 17, 2010 4 / 19
Rules Edge Cell Selected Corner Cell Selected. Inner Cell Selected Loran Briggs and Daniel McBride (CR) The Mathematics of Quatrainment December 17, 2010 5 / 19
Base Two System Four possibilities when adding in base two: 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 0 0 1 0 1 1 1 1 0 1 0 1 1 0 0 1 0 1 1 0 0 1 1 1 0 + = 1 1 0 1 1 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0 Loran Briggs and Daniel McBride (CR) The Mathematics of Quatrainment December 17, 2010 6 / 19
Is a Solution Always Possible? First we need to define our moves in the form of 4 × 4 matrices. � 1 1 1 0 � � 1 0 1 0 � � 0 1 0 1 � � 0 1 1 1 � 1 1 0 0 0 1 0 0 0 0 1 0 0 0 1 1 M 1 = M 2 = M 3 = M 4 = 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 � 1 0 0 0 � � 0 1 0 0 � � 0 0 1 0 � � 0 0 0 1 � 0 1 0 0 1 1 1 0 0 1 1 1 0 0 1 0 M 5 = M 6 = M 7 = M 8 = 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 � 0 0 0 0 � � 0 0 0 0 � � 0 0 0 0 � � 0 0 0 0 � 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 M 9 = M 10 = M 11 = M 12 = 0 1 0 0 1 1 1 0 0 1 1 1 0 0 1 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 � 0 0 0 0 � � 0 0 0 0 � � 0 0 0 0 � � 0 0 0 0 � 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 M 13 = M 14 = M 15 = M 16 = 1 1 0 0 0 1 0 0 0 0 1 0 0 0 1 1 1 1 1 0 1 0 1 0 0 1 0 1 0 1 1 1 Loran Briggs and Daniel McBride (CR) The Mathematics of Quatrainment December 17, 2010 7 / 19
Are the Inputs Linearly Independent? Is every target array reachable from any starting array? Are the input moves independent of each other? α 1 M 1 + α 2 M 2 + α 3 M 3 + α 4 M 4 + α 5 M 5 + α 6 M 6 + α 7 M 7 + α 8 M 8 + α 9 M 9 + α 10 M 10 + α 11 M 11 + α 12 M 12 + α 13 M 13 + α 14 M 14 + α 15 M 15 + α 16 M 16 = 0 Is the only solution the trival solution? α 0 = α 1 = α 2 = α 3 = α 4 = α 5 = α 6 = α 7 = α 8 = α 9 = α 10 = α 11 = α 12 = α 13 = α 14 = α 15 = α 16 = 0 Loran Briggs and Daniel McBride (CR) The Mathematics of Quatrainment December 17, 2010 8 / 19
To do this we expand our M i matrices and multiply them with our α ′ s which gives 0 0 0 0 0 α 1 α 1 α 1 α 2 α 2 α 3 α 3 0 0 0 0 0 0 0 0 α 1 α 1 α 2 α 3 + + + 0 0 0 0 0 0 0 0 0 0 0 α 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 α 4 α 4 α 4 α 5 α 6 0 0 0 0 0 0 α 4 α 4 α 5 α 6 α 6 α 6 + + + 0 0 0 0 0 0 0 0 0 α 4 α 5 α 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 α 16 · · · + = 0 0 0 0 0 0 α 16 α 16 0 0 0 0 0 α 16 α 16 α 16 Loran Briggs and Daniel McBride (CR) The Mathematics of Quatrainment December 17, 2010 9 / 19
Each cell indiviually must equal zero, form the zero matrix α 1 + α 2 + α 5 = 0 α 1 + α 3 + α 4 + α 6 = 0 α 1 + α 2 + α 4 + α 7 = 0 α 3 + α 4 + α 8 = 0 α 1 + α 6 + α 9 + α 13 = 0 α 2 + α 5 + α 6 + α 7 + α 10 = 0 α 3 + α 4 + α 6 + α 7 + α 8 + α 11 = 0 α 4 + α 7 + α 12 + α 16 = 0 α 1 + α 5 + α 10 + α 13 = 0 α 6 + α 9 + α 10 + α 11 + α 13 + α 14 = 0 α 7 + α 10 + α 11 + α 12 + α 15 + α 16 = 0 α 4 + α 8 + α 11 + α 16 = 0 α 9 + α 13 + α 14 = 0 α 10 + α 13 + α 15 + α 16 = 0 α 11 + α 13 + α 14 + α 16 = 0 α 12 + α 15 + α 16 = 0 Loran Briggs and Daniel McBride (CR) The Mathematics of Quatrainment December 17, 2010 10 / 19
The previous sixteen equations form this matrix here. 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 α 1 1 0 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 α 2 1 1 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 α 3 0 0 1 1 0 0 0 1 0 0 0 0 0 0 0 0 0 α 4 1 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 0 α 5 1 1 0 0 1 1 1 0 0 1 0 0 0 0 0 0 0 α 6 0 0 1 1 0 1 1 1 0 0 1 0 0 0 0 0 0 α 7 0 0 0 1 0 0 1 0 0 0 0 1 0 0 0 1 0 α 8 R α = 0 : = 1 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 0 α 9 0 0 0 0 0 1 0 0 1 1 1 0 1 1 0 0 0 α 10 0 0 0 0 0 0 1 0 0 1 1 1 0 0 1 1 0 α 11 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 1 0 α 12 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0 0 α 13 0 0 0 0 0 0 0 0 0 1 0 0 1 0 1 1 0 α 14 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 1 0 α 15 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 0 α 16 Loran Briggs and Daniel McBride (CR) The Mathematics of Quatrainment December 17, 2010 11 / 19
In reduced row echelon form, matrix R yeilds: 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 Since there is a pivot in every row, R is non-singular and therefore our input moves are linearly independent. Loran Briggs and Daniel McBride (CR) The Mathematics of Quatrainment December 17, 2010 12 / 19
The Solution Algorithm If we replace the zero vector from before with a target vector we call p . We can now take our equation: R α = p Solving for α gives R − 1 R α = R − 1 p α = R − 1 p Now to find R − 1 . Loran Briggs and Daniel McBride (CR) The Mathematics of Quatrainment December 17, 2010 13 / 19
Recommend
More recommend