# Posts tagged ‘Determinants’

Back from a quick break and back to matrix math. As I showed with a 2×2 matrix we get the determinant of it by multiplying the first element of the first row by the last element of the last row; and subtracting this from the first element of the last row multiplied by the last element of the first row.

This if you will is our ‘atomic’ function that we’ll always use to find the determinant of a square matrix. Crucially when we deal with matrices larger than 2×2, we recursively break the matrix down into smaller matrices until we can pass our atomic function to each piece. Finally we use a similar approach as when we were finding the cross product using successive +, -, +.. etc. Lets get started. Given a 3×3 matrix:

1 5 3
2 4 7
4 6 2

First, we use the first row to break the matrix into 3 successive 2×2 matrices – lets create a 2×2 matrix using the first element:

1 5 3
2 4 7
4 6 2

It’s determinant -34 = (4*2) – (6*7). The second matrix for the second element of the first row:

1 5 3
2 4 7
4 6 2

It’s determinant -24 = (2*2) – (4*7). And finally the third matrix for last element of the first  row:

1 5 3
2 4 7
4 6 2

It’s determinant -4 = (2*6) – (4 * 4). Back to our initial row 1 5 3, we multiple each element by its determinant we found above to give us:

(1 * -34) = -34
(5 * -24) = -120
(3 * -4) = -12

Finally using our sign rule (+ – + – …) we add/subtract the parts: -34 – -120 + -12 giving us 74, the determinant of the 3×3 matrix.

Ok so we’ve cover matrix transpose and multiplication, we’re now going to get into determinants. I’ll spread this into multiple posts as we’ll be eventually dealing with recursive functions. Determinants are a crucial glue in matrix math which allow you to find the inverse, which is akin to the reciprocal.

With the a 2 x 2 matrix, the determinant is single function – once we deal 3 x 3 and greater sized matrices we essentially recursively break them down to 2 x 2 and pass the base function. For a 2 x 2 matrix:

A B
C D

All we need to do is multiply the first element of the first row by the last element of the last row (A*D), and first element of the last row by the last element of the first row (C * B). Then take these away from each other (AD) – (CD) to give us our determinant:

1 2
4 1

(1*1) = 1
(4*2) = 8
(1-8) = -7
= -7

We’ll dig into 3 x 3 matrices next and then onto recursive methods…