We are math students and love the field of Linear Algebra. Creating and trying to optimize algorithms for computing algorithms we learned in class sounded super fun.

What it does

We implemented two algorithms; one to compute the determinant of an NxN matrix and second to row reduce a MxN matrix.

How we built it

We decided to use Python for it's flexible design, simplicity, and ability to be used in procedural programming. When we designed the program, we decided to separate the each type of computation, and main prompt, into separate files. This design allows for modularity (i.e. if it was later decided, programmers could add more types of computation).

Challenges we ran into

One challenge we encountered was time management. We tried our best to coordinate on a daily basis and to keep everyone updated on how the project was moving along. Another challenge we encountered was with implementing Gaussian Elimination algorithm. Although we are all very familiar with the algorithm on paper, it was much harder to teach the computer how to do it. A challenge we encountered while implementing the algorithms was validating user input (e.g. making sure the number of rows they inputted is a positive integer). For this we created a separate function that would handle this work and called it whenever we asked a user for an input. The hard part was to check for real numbers. Built-in functions like str.isnumeric() do not work for negative decimal numbers.

Accomplishments that we're proud of

We are proud of being able to take what we learned in class and learn how to implement an algorithm that a computer can execute. We are also proud of the optimization done for the determinant algorithm. Here we had many ideas such as searching for the rows/columns with the most zero entries for the co-factor expansion. Also, most online calculators have limited functionality. They have a size limit for which matrix determinants they can find and which matrices they and reduce. In our application, users can input very large matrices and compute the determinant or row-reduce it—although it may be slow.

What we learned

We enforced our skills of recursive and iterative algorithms. We also learned techniques to optimize determinant computing algorithms. We also learned that most matrix determinant computing algorithms are O(n!) in most-case since we have to make n recursive calls on an input size n-1. So in our implementation we tired to search for the rows/columns with the most zero entries for the co-factor expansion.

What's next for Linear Algebra Calculator

We made the code and implementation open to modification and extension. In the future we want to expand and add to the available computations (like matrix multiplication and finding the inverse of a matrix). Also we want to create a GUI for the application.

Built With

Share this project:

Updates