Computing the determinant recursively

In my never-ending effort to translate all of that linear algebra I toiled over in college into functioning Java code (make fun of it on github), I came across one operation that gave me a perfect opportunity to use recursion: computing the determinant of a square matrix.

First, we’re going to talk a little bit about the determinant, so we know what computation we’re dealing with. After that, we’ll implement it recursively in Java in theMatrix class––this version is readable, but computationally expensive for large matrices. If you want to cut to the chase and see the code, feel free to check it the full Matrix class on github. …

About

Dan Hales

Data Scientist, Math Enthusiast, Programmer and General Nerd. www.linkedin.com/in/danhalesprogramming

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store