Matrix Determinants
The determinant is a unique number associated with a square matrix. In this lesson, we show how to compute the determinant for any square matrix, and we introduce notation for matrix determinants.
Notation for a Determinant
There are at least three ways to denote the determinant of a square matrix.
 Denote the determinant by vertical lines around the matrix name; thus, the determinant of matrix A would be indicated by A.
 Another approach is to enclose matrix elements within vertical straight lines, as shown below.
A = 

 And finally, some references refer to the deteriminant of A as Det A. Thus, A = Det A.
On this website, we will use the first option; that is, we will refer to the determinant of A as A.
How to Compute the Determinant of a 2 x 2 Matrix
Suppose A is a 2 x 2 matrix with elements A_{i}_{j}, as shown below.
A = 

We compute the determinant of A according to the following formula.
A = ( A_{1}_{1} * A_{2}_{2} )  ( A_{1}_{2} * A_{2}_{1} )
How to Compute the Determinant of an n x n Matrix
The formula for computing the determinant of a 2 x 2 matrix (shown above) is actually a special case of the general algorithm for computing the determinant of any square matrix.
A = Σ ( + ) A_{1}_{q}A_{2}_{r}A_{3}_{s} . . . A_{n}_{z}
This algorithm requires some explanation. Here are the key points.
 The determinant is the sum of product terms made up of elements from the matrix.
 Each product term consists of n elements from the matrix.
 Each product term includes one element from each row and one element from each column.
 The number of product terms is equal to n! (where n! refers to n factorial).
 By convention, the elements of each product term are arranged in ascending order of the lefthand (or rowdesignating) subscript.
 To find the sign of each product term, we count the number of inversions needed to put the righthand (or columndesignating) subscripts in numerical order. If the number of inversions is even, the sign is positive; if odd, the sign is negative.
Unless you are a computer, this explanation is probably still confusing, so let's work through an example. Suppose A is a 3 x 3 matrix with elements A_{i}_{j}, as shown below.
A = 

To begin, let's list each product term. In constructing this list, we will arrange elements of each product term in ascending order of their rowdesignating subscript. Our list of product terms appears below.
A = Σ ( + )
A_{1}_{q}A_{2}_{r}A_{3}_{s}
. . . A_{n}_{z}
A =
+
A_{1}_{1}A_{2}_{2}A_{3}_{3}
+
A_{1}_{2}A_{2}_{3}A_{3}_{1}
+
A_{1}_{3}A_{2}_{1}A_{3}_{2}
+
A_{1}_{3}A_{2}_{2}A_{3}_{1}
+
A_{1}_{2}A_{2}_{1}A_{3}_{3}
+
A_{1}_{1}A_{2}_{3}A_{3}_{2}
Note that we have 3! or 6 product terms, each consisting of one element from each row and one element from each column. The task remaining is to find the sign for each product term. To do this, we count the number of inversions needed to put elements in ascending order of their columndesignating subscript.
To demonstrate how to count inversions, let's look at two of the product terms.
 Consider the second product term in the list: A_{1}_{2}A_{2}_{3}A_{3}_{1}. To put all of the columndesignating subscripts in ascending order, we need to move A_{3}_{1} from the end of the term to the front of the term, which results in: A_{3}_{1}A_{1}_{2}A_{2}_{3}. This movement counts as two inversions, since we moved A_{3}_{1} two positions to the left. Since two is an even number, the sign of that product term should be positive.
 Consider the last product term in the list: A_{1}_{1}A_{2}_{3}A_{3}_{2}. To put all of the columndesignating subscripts in ascending order, we need to interchange the second and third elements, which results in: A_{1}_{1}A_{3}_{2}A_{2}_{3}. This counts as one inversion, since we moved A_{3}_{2} one position to the left. Since one is an odd number, the sign of that product term should be negative.
If we repeat this process for each of the other product terms, we get the following formula for the determinant of a 3 x 3 matrix.
A = Σ ( + )
A_{1}_{q}A_{2}_{r}A_{3}_{s}
. . . A_{n}_{z}
A =
+
A_{1}_{1}A_{2}_{2}A_{3}_{3}
+
A_{1}_{2}A_{2}_{3}A_{3}_{1}
+
A_{1}_{3}A_{2}_{1}A_{3}_{2}

A_{1}_{3}A_{2}_{2}A_{3}_{1}

A_{1}_{2}A_{2}_{1}A_{3}_{3}

A_{1}_{1}A_{2}_{3}A_{3}_{2}
We can employ the same process to compute the determinant for any size matrix. However, as the matrix gets larger, the number of product terms increases very quickly. For example, a 4 x 4 matrix would have 4! or 24 terms; a 5 x 5 matrix, 120 terms; a 6 x 6 matrix, 720 terms, and so on. A 10 x 10 matrix would have 3,628,800 terms. You would not want to calculate the determinant of a large matrix by hand.
Test Your Understanding
Problem 1
What is the determinant of matrix A?
A = 

(A) 7
(B) 28
(C) 7
(D) 28
(E) None of the above
Solution
The correct answer is (D), based on the matrix determinant algorithm shown below.
A = Σ ( + )
A_{1}_{q}A_{2}_{r}A_{3}_{s}
. . . A_{n}_{z}
Because A is a 2 x 2 matrix, we know that the determinant algorithm has 2! or 2 product terms. And each product term includes one element from each row and one element from each column. We list the product terms below, with the elements of each product term arranged in ascending order of the lefthand (or rowdesignating) subscript.
A = + A_{1}_{1}A_{2}_{2} + A_{1}_{2}A_{2}_{1}
To determine whether each product term is preceded by a plus or minus sign, we count the inversions needed to put all of the columndesignating subscripts in ascending order.
 The columndesignating subscripts for the first term, A_{1}_{1}A_{2}_{2}, are already in ascending order; so the first term needs zero inversions. Since zero is an even number, the sign of the first term is positive.
 For the second term, A_{1}_{2}a_{2}_{1}, we must move the second element A_{2}_{1} one position to the left; that is, we need one inversion to put the columndesignating subscripts in ascending order. Since one is an odd number, the sign of the second term is negative.
The formula for the determinant of a 2 x 2 matrix is thus:
A = + A_{1}_{1}A_{2}_{2}  A_{1}_{2}A_{2}_{1}
So the determinant of matrix A is:
A = ( 5 * 6 )  ( 1 * 2 ) = 30  2 = 28