Math 33A Week 3: Determinants

Determinants are a bit tricky to discuss in a first linear algebra course, so we will just talk about how to compute them and some properties.

Consider an n×nn\times n matrix AA. Geometrically, we can imagine that AA transforms the unit cube (which has "volume" 1) into a "parallelpiped" determiend by the columns of AA. The determinant is signed "volume" of this "parallelpiped", or rather the signed "volume"-scaling factor of a matrix.

Thus intuitively, we should have det⁡(In)=1\det(I_n)=1 and more generally:

Determinant of triangular matrices

We say a matrix is triangular if all its values above (or below) the diagonal are 0. If AA is triangular, then det⁡(A)=a11⋯ann,\det(A)= a_{11}\cdots a_{nn},
which is the product of the diagonal entries of AA.

If we want to compute the determinant of a general matrix AA, then we should try to make it triangular (via Gaussian elimination). So we need to know how the row operations in Gaussian elimination affect the determinant.

Row operations and determinants.
  1. Row swap: if we swap two rows of a matrix, then the determinant changes by a factor of −1-1. More specifically,det⁡(swap two rows of A)=−1det⁡(A)\det(\text{swap two rows of } A)= -1\det(A)Geometrically, swapping rows reflects the transformed unit cube across some hyperplane (preserves volume, changes sign).
  2. Adding a multiple of one row to another row: if we do a row operation like Rj←Rj+cRiR_j \leftarrow R_j + cR_i, then the determinant doesn't change. More specifically,det⁡(add multiple of row to another A)=det⁡(A)\det(\text{add multiple of row to another } A)= \det(A)Geometrically, we are shearing the transformed unit cube (preserves volume and sign).
  3. Scaling a row: if we scale a row by a scalar kk, then the determinant gets scaled by kk. More specifically, det⁡(scale row of A by k)=kdet⁡(A)\det(\text{scale row of } A \text{ by } k) = k\det(A)Geometrically, we are stretching (and possibly reflecting) the transformed unit cube in one direction which scales the volume with the same proportion and possibly switches the sign.

These three facts give us a way to compute the determinant of a matrix from its rref⁡(A)\operatorname{rref}(A). In particular:

Determinant and RREF

Suppose in the process of computing rref⁡(A)\operatorname{rref}(A), we do ss row swaps and rr (nonzero) row scalings k1,…,krk_1,\dots, k_r. Then we have that
det⁡(rref⁡(A))=(−1)sk1⋯krdet⁡(A)\det(\operatorname{rref}(A))= (-1)^sk_1\cdots k_r \det(A)or ratherdet⁡(A)=1(−1)sk1⋯krdet⁡(rref⁡(A))\det(A) = \frac{1}{(-1)^sk_1\cdots k_r}\det(\operatorname{rref}(A))

Other conventions

The textbook will state that
det⁡(A)=(−1)sk1⋯krdet⁡(rref⁡(A))\det(A)= (-1)^sk_1\cdots k_r \det(\operatorname{rref}(A))
This is true when in the process of Gaussian elimination, we divded rows by k1,…krk_1,\dots k_r. Be careful that you know if you are dividing rows or multiplying rows!

We have some easy consequences of this fact:

Invertibility and determinant

AA is invertible if and only if rref⁡(A)=In\operatorname{rref}(A)=I_n if and only if det⁡(rref⁡(A))=1\det(\operatorname{rref}(A))=1 if and only if det⁡(A)≠0\det(A)\neq 0.

Inverse and determinant

If AA has inverse A−1A^{-1}, then det⁡(A−1)=1det⁡(A)\det(A^{-1})= \frac{1}{\det(A)}

Determine invertibility

For what value(s) of kk is A=(1102k04k2k)A= \begin{pmatrix}1 & 1 & 0 \\2 & k & 0 \\ 4 & k^2 & k\end{pmatrix}
invertible.

Solution: If we use the Gaussian elimination method, then we can find that AA is invertible when k≠0,2k\neq 0,2, but it is a little tedious. Is there a way we can compute this determinant faster?.

Computing Determinant with Cofactor Expansion

Let AA be some n×nn\times n matrix. The i,ji,jth cofactor of AA is Cij=(−1)i+jdet⁡(A without ith row and jth column)C_{ij}= ({-1})^{i+j}\det(A \text{ without $i$th row and $j$th column})Then for any row ii, we havedet⁡(A)=∑j=1nAijCij\det(A) = \sum_{j=1}^n A_{ij}C_{ij} and for any row jj, we have det⁡(A)=∑i=1nAijCij\det(A) = \sum_{i=1}^n A_{ij}C_{ij}

When to use Cofactor Expansion?

Notice that if a row or column of AA has a lot of zeros, then many of the terms in the cofactor expansion will be 0, so it makes the determinant calculation faster.

Let's revisit this example:

Determine invertibility

For what value(s) of kk is A=(1102k04k2k)A= \begin{pmatrix}1 & 1 & 0 \\2 & k & 0 \\ 4 & k^2 & k\end{pmatrix}
invertible.

Solution: If we do Cofactor expansion down the last row, we have
det⁡(A)=0(−1)1+3det⁡(2k4k2)+0(−1)2+3det⁡(114k2)+k(−1)3+3det⁡(112k)=k(k−2)\begin{align*}\det(A) &= 0(-1)^{1+3}\det\begin{pmatrix}2 & k \\ 4 & k^2\end{pmatrix} \\ &+ 0 (-1)^{2+3}\det\begin{pmatrix}1 & 1 \\ 4 & k^2\end{pmatrix} \\&+ k(-1)^{3+3}\det\begin{pmatrix}1 & 1 \\ 2 & k\end{pmatrix}\\ &=k(k-2)\end{align*} Thus, AA is invertible if and only if det⁡(A)≠0\det(A)\neq 0 if and only if k≠0,2k\neq 0,2.

Some other properties of determiant are:

Properties of determinant
  1. det⁡(AB)=det⁡(A)⋅det⁡(B)\det(AB)=\det(A)\cdot\det(B)
  2. det⁡(A⊤)=det⁡(A)\det(A^\top)= \det(A)