Mathematical Analysis of a Nim-like Matrix Game Leo Livshits, Ph. D

Slides:



Advertisements
Similar presentations
February 26, 2015Applied Discrete Mathematics Week 5: Mathematical Reasoning 1 Addition of Integers Example: Add a = (1110) 2 and b = (1011) 2. a 0 + b.
Advertisements

Linear Algebra Applications in Matlab ME 303. Special Characters and Matlab Functions.
Transformations We want to be able to make changes to the image larger/smaller rotate move This can be efficiently achieved through mathematical operations.
Matrices: Inverse Matrix
Matrix Definition: An array of numbers in m rows and n colums is called an mxn matrix A square matrix of order n, is an (nxn) matrix.
1.7 Diagonal, Triangular, and Symmetric Matrices.
2.3 Matrix Inverses. Numerical equivalent How would we solve for x in: ax = b ? –a -1 a x = a -1 b –x=a -1 b since a -1 a = 1 and 1x = x We use the same.
Eigenvalues and Eigenvectors
Maths for Computer Graphics
Reversible Computation Computational Group Theory and Circuit Synthesis.
Review of Matrix Algebra
Mathematics of Cryptography Part I: Modular Arithmetic, Congruence,
MOHAMMAD IMRAN DEPARTMENT OF APPLIED SCIENCES JAHANGIRABAD EDUCATIONAL GROUP OF INSTITUTES.
MATRICES. Matrices A matrix is a rectangular array of objects (usually numbers) arranged in m horizontal rows and n vertical columns. A matrix with m.
1 Chapter 2 Matrices Matrices provide an orderly way of arranging values or functions to enhance the analysis of systems in a systematic manner. Their.
1.7 Diagonal, Triangular, and Symmetric Matrices 1.
Linear Algebra With Applications by Otto Bretscher. Page The Determinant of any diagonal nxn matrix is the product of its diagonal entries. True.
Mathematics of Cryptography Part I: Modular Arithmetic, Congruence,
 Row and Reduced Row Echelon  Elementary Matrices.
Chapter 6.7 Determinants. In this chapter all matrices are square; for example: 1x1 (what is a 1x1 matrix, in fact?), 2x2, 3x3 Our goal is to introduce.
Reading and Writing Mathematical Proofs
TH EDITION LIAL HORNSBY SCHNEIDER COLLEGE ALGEBRA.
Copyright © 2013, 2009, 2005 Pearson Education, Inc. 1 5 Systems and Matrices Copyright © 2013, 2009, 2005 Pearson Education, Inc.
Eigenvalues and Eigenvectors
Section 1.8. Section Summary Proof by Cases Existence Proofs Constructive Nonconstructive Disproof by Counterexample Nonexistence Proofs Uniqueness Proofs.
Chapter 2 Systems of Linear Equations and Matrices
Matrices. A matrix, A, is a rectangular collection of numbers. A matrix with “m” rows and “n” columns is said to have order m x n. Each entry, or element,
13.1 Matrices and Their Sums
The Integers. The Division Algorithms A high-school question: Compute 58/17. We can write 58 as 58 = 3 (17) + 7 This forms illustrates the answer: “3.
Matrices Matrices For grade 1, undergraduate students For grade 1, undergraduate students Made by Department of Math.,Anqing Teachers college.
4.5 Inverse of a Square Matrix
College Algebra Sixth Edition James Stewart Lothar Redlin Saleem Watson.
Learning Objectives for Section 4.5 Inverse of a Square Matrix
Matrices and Determinants
CS480 Cryptography and Information Security Huiping Guo Department of Computer Science California State University, Los Angeles 3. Mathematics of Cryptography.
Mathematics Medicine What is meant by a matrix A matrix is a set of numbers arranged in the form of a rectangle and enclosed in curved brackets.
Hex: a Game of Connecting Faces. Player 1 Player 2 Players take turns placing blue chips (player 1) and red chips (player 2). Player 1 plays first. Player.
CHAPTER 7 Determinant s. Outline - Permutation - Definition of the Determinant - Properties of Determinants - Evaluation of Determinants by Elementary.
Linear Algebra by Dr. Shorouk Ossama.
Chapter 4 Systems of Linear Equations; Matrices
Linear Algebra With Applications by Otto Bretscher.
Matrices Introduction.
Chapter 4 Systems of Linear Equations; Matrices
PIVOTING The pivot or pivot element is the element of a matrix, or an array, which is selected first by an algorithm (e.g. Gaussian elimination, simplex.
MAT 322: LINEAR ALGEBRA.
Linear Algebra Review.
Tools for Decision Analysis: Analysis of Risky Decisions
Chapter 7 Matrix Mathematics
1.4 Inverses; Rules of Matrix Arithmetic
Great Theoretical Ideas in Computer Science
CSE15 Discrete Mathematics 02/08/17
Monte Carlo simulation
3.1 Introduction to Determinants
L6 matrix operations.
Multiplication of Matrices
Matrices Elements, Adding and Subtracting
Chapter 4 Systems of Linear Equations; Matrices
Fundamentals of Computer Systems
Lial/Hungerford/Holcomb/Mullins: Mathematics with Applications 11e Finite Mathematics with Applications 11e Copyright ©2015 Pearson Education, Inc. All.
Learning Objectives for Section 4.5 Inverse of a Square Matrix
Linear Algebra Lecture 18.
Maths for Signals and Systems Linear Algebra in Engineering Lectures 13 – 14, Tuesday 8th November 2016 DR TANIA STATHAKI READER (ASSOCIATE PROFFESOR)
Maths for Signals and Systems Linear Algebra in Engineering Lectures 9, Friday 28th October 2016 DR TANIA STATHAKI READER (ASSOCIATE PROFFESOR) IN SIGNAL.
Maths for Signals and Systems Linear Algebra in Engineering Lecture 6, Friday 21st October 2016 DR TANIA STATHAKI READER (ASSOCIATE PROFFESOR) IN SIGNAL.
Chapter 4 Systems of Linear Equations; Matrices
Multiplication of Matrices
Chapter 4 Systems of Linear Equations; Matrices
DETERMINANT MATH 80 - Linear Algebra.
Eigenvalues and Eigenvectors
Chapter 4 Systems of Linear Equations; Matrices
Presentation transcript:

Mathematical Analysis of a Nim-like Matrix Game Leo Livshits, Ph. D Mathematical Analysis of a Nim-like Matrix Game Leo Livshits, Ph.D., Stephen Morse ‘14, Edward Chuang ‘14 Department of Mathematics and Statistics, Colby College, Waterville, ME 04901 The Matrix Game Our matrix game is similar to Nim, but with more structure. The game board is a square matrix with non-negative integer entries. The two players take turns reducing a non-0 entry by 1. If the resulting matrix has determinant equal to 0, then the game is over and whoever went last wins. So what is a determinant? For the purposes of this presentation, the determinant of a matrix is simply a number that is algorithmically calculated from its entries. For math nerds: the determinant is 0 iff the matrix is non- invertible Odd Sum 2x2 Matrices Odd sum matrices are those which have either 1 or 3 odd entries. If there are 3 odds entries, then there is only one even entry so one of ad or bc is even and the other is odd. Therefore ad – bc cannot be 0. So Player 1 can decrement the only even entry giving Player 2 a matrix with 4 odd entries, which must return to Player 1 with 3 odd entries again. If there is only 1 odd entry then things get more complicated. However, we showed that for any matrix with 1 odd entry, there is always a move for the next player such that the resulting matrix never has its ±determinant as an entry on the ±diagonal. Furthermore, if the sum is prime then the determinant cannot be 0 regardless of how many odds there are. If the determinant is 0, then the matrix is non-invertible and therefore one row is a multiple of the other. It is not too hard to show that in this case, the sum of the elements in the 2x2 matrix cannot be prime. Equivalent Games We define two games to be equivalent if there is a permutation of the entries of the matrices such that: The permutation changes one matrix into the other. The permutation does not change the invertibility of any game matrix. We proved that a permutation of the entries with these properties is simply a composition of row swaps, column swaps, and transpositions. It follows that the permutation can only change the sign determinant of any game matrix. Key points of the general argument: If a fixed permutation of the entries preserves invertibility for any NxN matrix, then it must leave the set of NxN permutation matrices invariant since the only invertible matrices with N 1s and 0s for all other entries are the NxN permutation matrices. 3 6 4 7 3 5 4 7 3 5 7 3 7 … Computer Algorithm We implemented a computer algorithm (in Java) to help determine which games were winnable and not winnable. Some of the outputs for the 2x2 case are shown below. For the 3x3 case, the program did not prove sufficient to help us gain any intuition due to the remarkably large running time of O((n^2)!), even though the algorithm pruned all equivalent games. The last four outputs are good examples of the conclusions that we proved for matrices with odd, prime +1, and composite + 1 sums. Winner Sum P1 P2 4 1 5 6 3 7 8 9 10 13 11 20 12 29 35 14 47 15 56 16 64 17 84 18 104 19 120 145 21 165 22 183 23 220 24 256 25 286 26 318 27 364 28 398 455 30 511 Basic Strategy Understanding how each move affects the determinant is essential to formulating a strategy. In the 2x2 case, the effect of each move is easily calculated. Call the NW to SE diagonal the positive diagonal. Decrementing an element of the positive diagonal decreases the determinant by an amount equal to the other element on the positive diagonal (see below). Similarly, call the NE to SW diagonal the negative diagonal. Decrementing an element of the negative diagonal increases the determinant by an amount equal to the other element on the negative diagonal (see below). Therefore a player can only end the game on their turn if one of the following is true: The determinant of the matrix is equal to an entry on the positive determinant. The determinant of the matrix is equal to the negative of an entry on the negative determinant. Even Sum 2x2 Matrices The conclusion for even sum matrices follows from what we know about the odd sum matrices. If Player 1 starts with an even sum matrix, then Player 2 receives an odd sum matrix and will win for the reasons outlined above unless Player 1 ends the game on the first move. Even numbers are either 1 more than a prime or 1 more than a composite odd number. In the prime + 1 case, then Player 2 receives a prime sum matrix, which cannot have determinant 0. Therefore Player 1 cannot win on the first turn; so Player 2 wins. In the composite + 1 case, Player 1 can only win on the first move if the matrix has its ±determinant as an entry on the ±diagonal. How about 3x3 matrices? As was no surprise, the game becomes far more complicated when we extend our games to include 3x3 matrices. For one, the claim that matrices with elements that sum to a prime cannot have determinant 0 is no longer true. For example, the matrix below has sum 13 but has determinant 0. Acknowledgements We would like to acknowledge: Professor Leo Livshits for his guidance and support Professor Kyle Burke for introducing us to this game The research assistantship funding given to us by Colby College