- Hands-On Mathematics for Deep Learning
- Jay Dawani
- 672字
- 2024-10-30 02:24:30
Determinant
Earlier, we got a quick glimpse of the determinant of a square 2x2 matrix when we wanted to determine whether a square matrix was invertible. The determinant is a very important concept in linear algebra and is used frequently in the solving of systems of linear equations.
Notationally, the determinant is usually written as either or .
Let's take an arbitrary n×n matrix A, as follows:
We will also take its determinant, as follows:
The determinant reduces the matrix to a real number (or, in other words, maps A onto a real number).
We start by checking if a square matrix is invertible. Let's take a 2x2 matrix, and from the earlier definition, we know that the matrix applied to its inverse produces the identity matrix. It works no differently than when we multiply a with (only true when ), which produces 1, except with matrices. Therefore, AA-1 = I.
Let's go ahead and find the inverse of our matrix, as follows:
A is invertible only when , and this resulting value is what we call the determinator.
Now that we know how to find the determinant in the 2x2 case, let's move on to a 3x3 matrix and find its determinant. It looks like this:
This produces the following:
I know that probably looks more intimidating, but it's really not. Take a moment to look carefully at what we did and how this would work for a larger n×n matrix.
If we have an n×n matrix and if it can be triangularly factorized (upper or lower), then its determinant will be the product of all the pivot values. For the sake of simplicity, we will represent all triangularly factorizable matrices with T. Therefore, the determinant can be written like so:
Looking at the preceding 3×3 matrix example, I'm sure you've figured out that computing the determinant for matrices where n > 3 is quite a lengthy process. Luckily, there is a way in which we can simplify the calculation, and this is where the Laplace expansion comes to the rescue.
When we want to find the determinant of an n×n matrix, the Laplace expansion finds the determinant of (n×1)×(n×1) matrices and does so repeatedly until we get to 2×2 matrices. In general, we can calculate the determinant of an n×n matrix using 2×2 matrices.
Let's again take an n-dimensional square matrix, where . We then expand for all , as follows:
- Expansion along row i:
- Expansion along row j:
And is a sub-matrix of , which we get after removing row i and column j.
For example, we have a 3×3 matrix, as follows:
We want to find its determinant using the Laplace expansion along the first row. This results in the following:
We can now use the preceding equation from the 2×2 case and calculate the determinant for A, as follows:
.
Here are some of the very important properties of determinants that are important to know:
There is one other additional property of the determinant, and it is that we can use it to find the volume of an object in whose vertices are formed by the column vectors in the matrix.
As an example, let's take a parallelogram in with the vectors and . By taking the determinant of the 2×2 matrix, we find the area of the shape (we can only find the volume for objects in or higher), as follows:
You are welcome to try it for any 3×3 matrix for yourselves as practice.