<<

University of Puget Sound Sound Ideas

Summer Research

2010 Reverse-Engineering Linear Algebra Billy Wonderly University of Puget Sound

Follow this and additional works at: http://soundideas.pugetsound.edu/summer_research

Recommended Citation Wonderly, Billy, "Reverse-Engineering Linear Algebra" (2010). Summer Research. Paper 46. http://soundideas.pugetsound.edu/summer_research/46

This Presentation is brought to you for free and open access by Sound Ideas. It has been accepted for inclusion in Summer Research by an authorized administrator of Sound Ideas. For more information, please contact [email protected]. Reverse-Engineering Linear Algebra Billy Wonderly Department of and Computer Science University of Puget Sound

Introduction 3. Unimodular Matrices 5. Eigenspaces The problem of generating matrices with desirable properties is a difficult Unimodular matrices are nonsingular and have the special one. These matrices are sought after for a variety of reasons, one being The final routine generates a diagonalizable whose property that their is one. This makes many com- students looking for practice in mastering the skills they need to succeed eigenspaces have nice basis vectors if computed by hand. In- putations turn out very nicely. in Linear Algebra. A solution to this problem is to do Linear Algebra in puts of matrix size, eigenvalues, and associated eigenspace reverse. Theorems and procedures used to produce answers from ques- 3 15 4 4 − − dimensions are allowable. tions can often in effect be ’undone’, meaning that we can use a solution  3 11 4 3  with specific properties, to produce a problem whose answer will retain A = − −   5 24 2 19 those properties. This idea was put in motion by developing and modify-   − −  20 18 36 18 ing Sage, open source mathematics software.  4 19 5 6  size=4 − − −     − −   6 16 6 18 det(A) = 1 eigenvalues=[-2,1,4]  = A =  −   ⇒  12 3 34 27  1. Generating Solutions    dimensions=[1,1,2]  −  This funcion is essentially is the a specific case of the rou-  6 3 24 23 •   − − − −  In reverse engineering problems the first and most important step is find- tine 2 where the input is a square, full rank, matrix.    ing the ideal solution. In general, solutions in linear algebra are extracted 2 Because 2 only uses scalar row addition, even after a large Characteristic polynomial: pA(x) = (x + 2)(x 1)(x 4) from the reduced row-echelon form of a matrix. The function created al- • 4 6 3 3 − − lows for inputs of number of rows, columns, and pivot columns for a matrix. number of row operations, the determinant remains un- − − −  1 4 2 3 changed. 1 0 5 0 4 Matrix of eigenvectors: S =  − − −  row=4  2 1 1 0  01 302   col=5  = − The series of row operations is performed on the identity −  •  1101  ⇒ 0 0 0 1 2   rank=3    matrix, which has determinant one. 0 0 0 0 0 2000     − Matrices are in reduced row-echelon  form.  Unimodular matrices are useful because a unimodular ma-  0 1 0 0 • • 1 trix that contains only entries will have an inverse Giving: S− AS = D =   Output matrices have only integer entries.  0 0 4 0 •   containing only integer entries.   Leading one’s are placed skewed to the left side of the matrix.  0 0 0 4 •     Matrices can be generated over a variety of finite algebraic rings. Multiplying a matrix B by a U results in 1 • • Built by reversing the similarity transformation D = S− AS to hiding a problem, and can be easily undone bye multiplying • 1 1 give SDS− = A 2. Matrices with nice Echelon Forms the resulting matrix by U − Eigenvectors are given a nice pattern of zeros and ones to Another In order to get a matrix into rref, if not careful, the computations • necessary can produce very ugly and hard to work with fractions. A ma- 4. Random Four Subspaces Routine show . trix with a desirable reduced row-echelon form is achieved by ’reversing’ Matrices built from eigenvectors are determinant one to en- an algorithm to put a matrix in reduced row-echelon form. The Four Subspaces routine utilizes the 1 and 2 routines to • produce matrices whose extended echelon form is ’nice’. sure all matrix inverses and products of 1 0 5 0 4 1 6 23 8 24 contain only .   − − − −  01 302 Reverse RREF 16 23 10 28 1 0 0 3 1 A =  −  − − −  To preserve determinant one, the matrix of eigenvectors was 0 0 0 1 2 −−−−−−−−→  2 9 37 16 42 010 1 2  •    − − −   build from the using addition of both column     B =  − −   0 0 0 0 0  01 3 10 0 0 1 3 2   1 0 5 0 4 0 1 10 -47    − −     and row multiples.          1 0 5 0 4 0 0 0 0 0   0 1 -3 0 2 0 -1 3 -15    =        RREF 01 302 1 10 47  ⇒  0 0 0 1 2 0 0 4 -19  Matrices with complex eigenvalues cannot be produced.     −  = A  −    • −−−→ 0 0 0 1 2 K = 13 15   0 0 0 0 0 1 -4 -2 0    − −           0 0 0 0 0  04 19     −        Uses the output of the routine 1. L = 1 4 20  − −  • + ,  Acknowledgements Reverses the rref process by randomly performing addition All submatrices contain only integer entries. • • of the scalar multiple of one row to another row of the matrix. The B and L matrices are generated by the 1 routine, and • This research was made possible by the University of Puget the K matrix is called from the 3 routine. These matrices are Has an additional entry size control feature because a large Sound Summer Research Grants in Science and Mathemat- • then pushed together to produce the solution. number of scalar row multiples of rows being added together ics. I would like to thank Professor Robert Beezer for his help can make entry sizes very large and unmanageable. The matrix formed by stacking K and L is created to be uni- • throughout this project. I would also like to thank all of the Matrices can be generated over a variety of finite algebraic modular because its inverse is multiplied on the left side of • Sage developers who devote their time and effort to develop- rings. B. This matrix product is the output of the routine. ing free and open source mathematics software.

Puget Sound Science Symposium, September 09, 2010