Math 2270 - Lecture 27: Calculating Determinants: Dylan Zwick Fall 2012
Math 2270 - Lecture 27: Calculating Determinants: Dylan Zwick Fall 2012
Determinants
Dylan Zwick
Fall 2012
X n
Y
det(A) = sgn(σ) aiσ(i) .
σ∈Sn i=1
1
1 Calculating the Determinant from the Pivots
In practice, the easiest way to calculate the determinant of a general matrix
is to use elimination to get an upper-triangular matrix with the same de-
terminant, and then just calculate the determinant of the upper-triangular
matrix by taking the product of the diagonal terms, a.k.a. the pivots.
If there are no row exchanges required for the LU decomposition of A,
then A = LU, and det(A) = det(L)det(U). Both L and U are triangular, and
all the terms on the diagonal of L are 1, so det(L) = 1. The terms on the
diagonal of U, d1 , d2 , . . . , dn , are the pivots, and det(U) = d1 d2 · · · dn . So,
det(A) = d1 · · · dn . If a permutation is necessary then we have P A = LU,
and det(P ) = ±1. So, in general, det(A) = ±d1 · · · dn where the sign is
determined by the permutation matrix P .
Example - Use elimination to calculate the determinant of the matrix
2 4 −2
A= 4 9 −3
−2 −3 7
2
det(Ak ) = d1 · · · dk
det(Ak )
dk = .
det(Ak−1 )
So, we can use pivots to calculate determinants, but we can also (as-
suming we don’t need row exchanges) use determinants to calculate piv-
ots!
X n
Y
det(A) = sgn(σ) aiσ(i) .
σ∈Sn i=1
How do we get this? Well, let’s start with the 2 × 2 case. We can use
linearity twice to get:
a b a 0 0 b
= +
c d c d c d
a 0 a 0 0 b 0 b
= + + +
c 0 0 d c 0 0 d
In the final sum, the first and last matrices have columns with all 0s,
and so those determinants are 0. Therefore, the determinant is
a 0 0 b
= ad 1 0 + bc 0 1
+ = ad − bc.
0 d c 0 0 1 1 0
3
0 1
Now, we know = −1 as its formed by switching (transposing)
1 0
columns 1 and 2 of the identity matrix. So, by properties 1 and 2 of the
determinant, its value must be −1.
Now, we can do essentially the same thing for a square matrix of any
size. In the n = 3 case we split it up into 33 = 27 matrices where for each
matrix in the split each row has only one non-zero term. If a column choice
is repeated, the the matrix has determinant 0. So, the only ones that matter
are when the nonero terms come from different columns. For the 3 ×3 case
there are six such terms:
a11 a12 a13 a11 a12 a13
a21 a22 a23 = a22 + a23
+ a21
a31 a32 a33 a33 a31 a32
a11 a12 a13
+ a23 + a21
+
a22
a32 a33 a31
a11 a22 a33 + a12 a23 a31 + a13 a21 a32 − a11 a23 a32 − a12 a21 a33 − a13 a22 a31 .
4
Now, the sign of a permutation σ is the parity of the number of transpo-
sitions required to get it from the identity. It is either even of odd. We say
sgn(σ) = ±1 depending on if it requires an even or odd number of tran-
positions to get it from the identity. The sign of the first three permutation
matrices above are all +1, as they require an even number of tranpositions
(0, 2, and 2), while the sign of the last three permutation matrices are all
−1, as they require an odd number of transpositions (1,1, and 1). If P is a
permutation matrix coming from the permutation σ, then det(P ) = sgn(σ),
and from this we get our big formula:
X n
Y
det(A) = sgn(σ) aiσ(i) .
σ∈Sn i=1
2 4 −2
A= 4 9 −3
−2 −3 7
5
3 Determinants by Cofactors
Finally, we note that if we do some algebra to the formula derived above
for the 3 × 3 determinant we get:
det(A) = a11 (a22 a33 − a23 a32 ) − a12 (a23 a31 − a21 a33 ) + a13 (a21 a32 − a22 a31 ).
a22 a23 a21 a23 a21 a22
, ,
a32 a33 a31 a33 a31 a32
And, in fact, this formula holds for any row and for any n × n matrix
A.
We can also use the formula moving down a column instead of along
a row
6
Example - For the matrix
2 4 −2
A= 4 9 −3
−2 −3 7