Matrix Reducer
What the heck is this?
This page appears to be a departure from all the other little projects I have in this site, and on the off chance someone stumbles into this page, I thought I’d add some context. I plopped my little shiny app above so I could actually use it occasionally without scrolling through 1000 lines of text, like on every recipe site I’ve ever seen.
Studying linear algebra for fun?
To the mild amusement of Madeleine, I’ve been working through the A First Course in Linear Algebra textbook by Robert Beezer (the online version can be found here). It sort of started because I was hoping to learn more about the principles underlying machine learning techniques like PCA and multiple linear regression – and then I discovered that I really like Beezer’s writing and was deeply craving some fun math puzzles to play with.
After the first few chapters, the systems of linear equations in the book were getting too complicated to perform row-reduction on by hand and I didn’t want to keep relying on the embedded Sage executables that are in the web version of the book (mostly because I found Sage kind of annoying, even if it’s clearly a powerful language). To make it easier to progress through the more challenging practice problems, I decided to try to build a function that takes in a user-specified matrix and performs the classic linear algebra operations to derive the row-reduced echelon form of the matrix. Then I decided that it would be fun and helpful to host my tool in a Shiny app so I could easily access and use it.
It’s been fun to dig into a math subject I knew nothing about. It’s very cool that this row-reduced echelon form (RREF) gives extremely apparent insights into a system of linear equations: you can immediately recognize if the system is consistent, whether there’s a unique solution or whether there are infinite solutions, which (if any) variables are dependent or independent, and what the structure to the solution set is – and the RREF can be produced with extremely straightforward computational steps.
But really, why?
Reading through this book has been the first time a text has held my hand through the concept of building mathemetical proofs – there’s a whole section in the back describing proof techniques! I’m really enjoying seeing how one actually thinks through proving a claim, because I’ve always thought of math as being the tools you use to solve a specific problem. Instead, this book is showing that math is a language you can use to describe whole sets of problems and what their solutions look like.
For example, using a self-consistent definition of systems of linear equations, you can confidently say that every system of linear equations has one of three classes of solution sets: 1. The system is inconsistent and there is no solution that satisfies every equation. 2. The system is constrained such that there is exactly one solution set that satisfies every equation. 3. The system is unconstrained, and thus there are an infinite number of solutions – and there is a vector form which can describe the form of every one of these solutions.
I think that’s so cool! I’m less than a quarter of the way through the book and I have no idea if I’ll lose interest at some point soon, but for now this has been fun! At some point I may go back into my Shiny app and expand it so that it produces the vector form of the solution set; it sort of depends on whether I’m having fun writing this out by hand.