Linear Algebra (source: Gilbert Strang notes) · 20 / 37

Lecture 19: Determinant Formulas and Cofactors

This summary is based on the same lecture's transcript from an OCW mirror.

Goal: Derive explicit formulas for \(\det A\) from the three defining properties.

  1. The big formula: a sum of \(n!\) terms.
  2. The cofactor formula: \(\det A\) in terms of determinants one size smaller.
  3. An application to a family of tridiagonal matrices.

Strang's remark: determinants used to be the big subject and linear algebra the small one. Now determinants are a neat, small part of linear algebra.


1. Deriving the \(2\times2\) formula from the properties

Use linearity (Property 3) on one row at a time, keeping the other row fixed.

Split row 1:

\[\begin{vmatrix} a & b \\ c & d \end{vmatrix} = \begin{vmatrix} a & 0 \\ c & d \end{vmatrix} + \begin{vmatrix} 0 & b \\ c & d \end{vmatrix}\]

Split row 2 in each piece. This gives four determinants:

\[\begin{vmatrix} a & 0 \\ c & 0 \end{vmatrix} + \begin{vmatrix} a & 0 \\ 0 & d \end{vmatrix} + \begin{vmatrix} 0 & b \\ c & 0 \end{vmatrix} + \begin{vmatrix} 0 & b \\ 0 & d \end{vmatrix}\]

Evaluate the four pieces.

  • The first and last have a zero column, so they are 0.
  • The second is diagonal, so it equals \(ad\).
  • The third becomes diagonal after one row exchange, so it equals \(-bc\).

Result: \(ad - bc\).

The method generalizes. For \(n\times n\), splitting every row gives \(n^n\) pieces. Almost all are zero.


2. Which pieces survive

A piece is nonzero only if it takes exactly one entry from each row and each column. If any column is unused, that piece has a zero column and contributes 0.

The \(3\times3\) case

There are \(3^3 = 27\) pieces, and 6 survive. Each survivor is a permutation matrix with entries of \(A\) in place of the 1s. Factor out the three entries (Property 3), then the sign comes from the permutation (Property 2).

Columns used, rows 1→3 Term Exchanges Sign
1, 2, 3 \(a_{11}a_{22}a_{33}\) 0 \(+\)
1, 3, 2 \(a_{11}a_{23}a_{32}\) 1 \(-\)
2, 1, 3 \(a_{12}a_{21}a_{33}\) 1 \(-\)
2, 3, 1 \(a_{12}a_{23}a_{31}\) 2 \(+\)
3, 1, 2 \(a_{13}a_{21}a_{32}\) 2 \(+\)
3, 2, 1 \(a_{13}a_{22}a_{31}\) 1 \(-\)

The diagonal mnemonic. For \(3\times3\) only, the "+" terms run down-right along diagonals and the "−" terms run down-left. This does not extend to \(4\times4\). There, the anti-diagonal term (columns 4, 3, 2, 1) has sign \(+\), because two exchanges (rows 1↔4, then 2↔3) restore the identity.


3. The big formula

\[\det A = \sum_{\text{all permutations } (\alpha, \beta, \dots, \omega)} \pm\, a_{1\alpha}\,a_{2\beta}\,a_{3\gamma}\cdots a_{n\omega}\]

Column indices. \((\alpha, \beta, \dots, \omega)\) is a permutation of \((1, \dots, n)\), so each column is used exactly once.

Sign. \(+\) for an even permutation, \(-\) for an odd one.

Number of terms: \(n!\).

  • Row 1 has \(n\) choices of column.
  • Row 2 then has \(n - 1\) choices.
  • And so on.

That gives 2, 6, 24, 120, … terms. Half carry \(+\) and half carry \(-\).

Why Strang didn't start here. This formula packs too much in at once. All ten properties could in principle be derived from it.

  • \(\det I = 1\) follows easily. Only the identity permutation gives a nonzero product.
  • \(\det(AB) = \det A \det B\) does not. Proving it this way would take far too long.

Example: a \(4\times4\) matrix with many zeros

The transcript doesn't record the board entries. Here is a matrix consistent with everything Strang says about it:

\[A = \begin{bmatrix} 0 & 0 & 1 & 1 \\ 0 & 1 & 1 & 0 \\ 1 & 1 & 0 & 0 \\ 1 & 0 & 0 & 1 \end{bmatrix}\]

Count the surviving terms.

  • Row 1 has only two nonzero entries, in columns 3 and 4.
  • Once row 1's column is chosen, every later row is forced.
  • So only 2 of the 24 terms are nonzero:
    • Columns \((4,3,2,1)\): two exchanges, so \(+1\).
    • Columns \((3,2,1,4)\): one exchange, so \(-1\).

Result: \(\det A = 1 - 1 = 0\).

Confirming the matrix is singular. Row 1 + row 3 = \((1,1,1,1)\) = row 2 + row 4. So

\[\text{row}_1 - \text{row}_2 + \text{row}_3 - \text{row}_4 = 0\]

The lesson. Many zeros make the big formula practical.


4. Cofactors

The idea. Group the \(n!\) terms of the big formula by which entry they use from row 1.

For \(3\times3\):

\[\det A = a_{11}(a_{22}a_{33} - a_{23}a_{32}) + a_{12}(-a_{21}a_{33} + a_{23}a_{31}) + a_{13}(a_{21}a_{32} - a_{22}a_{31})\]

What each bracket is. Each bracket is the determinant of the \(2\times2\) matrix left after striking out row 1 and the entry's column, with a sign attached.

Why. Once \(a_{1j}\) is chosen, row 1 and column \(j\) are used up. All remaining ways to pick one entry per row and column are exactly the terms of the smaller determinant.

Definition

The cofactor of \(a_{ij}\) is

\[C_{ij} = (-1)^{i+j}\det M_{ij}\]
where \(M_{ij}\) is the \((n-1)\times(n-1)\) matrix with row \(i\) and column \(j\) removed.

  • The unsigned \(\det M_{ij}\) is called a minor.
  • The sign is \(+\) when \(i + j\) is even and \(-\) when it is odd. This gives a checkerboard pattern:
    \[\begin{bmatrix} + & - & + & \cdots \\ - & + & - & \cdots \\ + & - & + & \cdots \\ \vdots & & & \ddots \end{bmatrix}\]

The cofactor formula

\[\boxed{\det A = a_{i1}C_{i1} + a_{i2}C_{i2} + \cdots + a_{in}C_{in}}\]

Any row \(i\) works. By \(\det A^\top = \det A\), any column works too.

\(2\times2\) check. Expand along row 1:

\[a\cdot(d) + b\cdot(-c) = ad - bc\]

An alternative starting point. You could build the theory of determinants from this formula, reducing size \(n\) down to \(1\times1\) step by step.


5. Three ways to compute a determinant

Formula Character
Product of the pivots (with sign for row exchanges) All the complexity is absorbed efficiently by elimination. This is what software uses.
Big formula (\(n!\) terms) Everything spread out explicitly.
Cofactor formula In between: simple entries times smaller determinants.

6. Application: tridiagonal matrices of 1s

\(A_n\) is the \(n\times n\) matrix with 1s on the main diagonal and on the diagonals just above and below it. For example:

\[A_4 = \begin{bmatrix} 1 & 1 & 0 & 0 \\ 1 & 1 & 1 & 0 \\ 0 & 1 & 1 & 1 \\ 0 & 0 & 1 & 1 \end{bmatrix}\]

Small cases

  • \(|A_1| = 1\).
  • \(|A_2| = 1 - 1 = 0\).
  • \(|A_3| = -1\). Strang shows two ways to get this:
    • Big formula: the only nonzero terms are \(+1\) (main diagonal) and two \(-1\) terms. The anti-diagonal term is 0.
    • Row operation, then cofactors: subtracting row 3 from row 2 zeroes out the middle row except one entry. Expanding along that row gives \(-1\).

The recurrence

Expand \(|A_n|\) along row 1. It has only two nonzero entries.

First entry. \(a_{11} = 1\), in a \(+\) position. Its minor is exactly \(A_{n-1}\). This contributes \(+|A_{n-1}|\).

Second entry. \(a_{12} = 1\), in a \(-\) position. Its minor has only one nonzero entry in its first column. Expanding the minor down that column leaves \(A_{n-2}\). This contributes \(-|A_{n-2}|\).

Why stop there. The other entries in that column are multiplied by zeros, so their cofactors don't need computing.

\[\boxed{|A_n| = |A_{n-1}| - |A_{n-2}|}\]

The sequence repeats with period 6

\(n\) 1 2 3 4 5 6 7 8 …
\(\lvert A_n\rvert\) 1 0 −1 −1 0 1 1 0 …

Example. \(|A_{61}| = |A_1| = 1\), since \(61 = 60 + 1\) and 60 is a multiple of 6.

Strang calls this a non-trivial result that you probably wouldn't have guessed.


Big ideas from Lecture 19

  1. Survivors. Splitting rows by linearity leaves only terms with one entry from each row and column.
  2. Big formula. \(\det A\) is a sum of \(n!\) terms \(\pm a_{1\alpha}a_{2\beta}\cdots a_{n\omega}\), with the sign given by the parity of the permutation.
  3. The \(3\times3\) diagonal mnemonic fails for \(n \geq 4\).
  4. Cofactors. \(C_{ij} = (-1)^{i+j}\det M_{ij}\), and \(\det A = \sum_j a_{ij}C_{ij}\) along any row or column.
  5. Three formulas: pivots (practical), big formula (explicit), cofactors (recursive).
  6. Tridiagonal 1s: \(|A_n| = |A_{n-1}| - |A_{n-2}|\), and the values repeat with period 6.