Quiz 2

Determinants: Computation, Properties & Cofactors

2966 words
15 min read
Python Week 1: the first filter for runtime behavior
Visual companion
Python
Type and operator map

Python Week 1: the first filter for runtime behavior

View
Revision summary

What this note is really saying

Short form

# Determinants: Computation, Properties & Cofactors ## 🎯 Learning Objectives After this topic you will be able to: - Compute the determinant of $2 \times 2$ and $3 \times 3$ matrices - Use Sarrus's rule for $3 \times 3$ determinants - Compute determinants by cofactor expansion along any row or column - List and app...

Determinants: Computation, Properties & Cofactors

🎯 Learning Objectives

After this topic you will be able to:
  • Compute the determinant of 2×22 \times 2 and 3×33 \times 3 matrices
  • Use Sarrus's rule for 3×33 \times 3 determinants
  • Compute determinants by cofactor expansion along any row or column
  • List and apply the key properties of determinants
  • Use the determinant to test whether a matrix is invertible
  • Compute minors and cofactors

📋 Prerequisites

  • Matrices Introduction (this week) — you need to be comfortable with matrix notation and dimensions
  • Basic algebra — arithmetic, factorisation
  • Determinants are a bridge between matrices (Week 1) and solving linear systems (Week 2)

1. What is a Determinant?

1.1 Intuition: The "Scaling Factor" of a Matrix

A determinant answers the question: by what factor does this matrix scale areas (or volumes)? Imagine a 2×22 \times 2 matrix as a transformation that maps the unit square to a parallelogram. The absolute value of the determinant is the area of that parallelogram. If the determinant is zero, the parallelogram collapses — the transformation squishes everything into a lower dimension. (Diagram) A zero determinant means the matrix is singular (non-invertible) — it destroys information. A non-zero determinant means the matrix is invertible — the transformation can be reversed.

1.2 Formal Definition

Definition (Determinant). The determinant is a function det:Rn×nR\det : \mathbb{R}^{n \times n} \to \mathbb{R} that assigns to each square matrix AA a real number det(A)\det(A), satisfying:
  • det(In)=1\det(I_n) = 1
  • det(AB)=det(A)det(B)\det(AB) = \det(A)\det(B)
  • det\det is alternating multilinear in the columns (or rows) We'll compute it concretely below before worrying about the abstract properties.

2. Computing Determinants

2.1 2×22 \times 2 Determinant

For
>A=[abcd]>> A = \begin{bmatrix} a & b \\ c & d \end{bmatrix} >
, the determinant is:
>det(A)=abcd=adbc>> \det(A) = \begin{vmatrix} a & b \\ c & d \end{vmatrix} = ad - bc >
Example 1: 2×2 determinant
>det(3142)=3(2)1(4)=64=10>> \det\begin{pmatrix} 3 & 1 \\ 4 & -2 \end{pmatrix} = 3(-2) - 1(4) = -6 - 4 = -10 >

2.2 3×33 \times 3 Determinant — Sarrus's Rule

For 3×33 \times 3 matrices, Sarrus's rule is a handy shortcut (but only works for 3×33 \times 3!).
For
>A=[a11a12a13a21a22a23a31a32a33]>> A = \begin{bmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33} \end{bmatrix} >
:
  1. Copy the first two columns to the right
  2. Sum of products along the three downward diagonals (blue)
  3. Minus sum of products along the three upward diagonals (red)
>det(A)=a11a22a33+a12a23a31+a13a21a32a13a22a31a11a23a32a12a21a33>> \det(A) = a_{11}a_{22}a_{33} + a_{12}a_{23}a_{31} + a_{13}a_{21}a_{32} - a_{13}a_{22}a_{31} - a_{11}a_{23}a_{32} - a_{12}a_{21}a_{33} >
Example 2: Sarrus's rule
>A=[123456789]>> A = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{bmatrix} >
Copy columns and compute:
>123124564578978>> \begin{matrix} 1 & 2 & 3 & | & 1 & 2 \\ 4 & 5 & 6 & | & 4 & 5 \\ 7 & 8 & 9 & | & 7 & 8 \end{matrix} >
>det(A)=159+267+348357168249=45+84+961054872=0>> \begin{aligned} \det(A) &= 1\cdot5\cdot9 + 2\cdot6\cdot7 + 3\cdot4\cdot8 \\ &\quad - 3\cdot5\cdot7 - 1\cdot6\cdot8 - 2\cdot4\cdot9 \\ &= 45 + 84 + 96 - 105 - 48 - 72 \\ &= 0 \end{aligned} >
This matrix is singular (determinant = 0). Example 3: Sarrus with a non-zero determinant
>A=[102131021]>> A = \begin{bmatrix} 1 & 0 & 2 \\ -1 & 3 & 1 \\ 0 & 2 & -1 \end{bmatrix} >
>det(A)=1(3)(1)+0(1)(0)+2(1)(2)2(3)(0)1(1)(2)0(1)(1)=3+04020=9>> \begin{aligned} \det(A) &= 1(3)(-1) + 0(1)(0) + 2(-1)(2) \\ &\quad - 2(3)(0) - 1(1)(2) - 0(-1)(-1) \\ &= -3 + 0 - 4 - 0 - 2 - 0 \\ &= -9 \end{aligned} >

2.3 Cofactor Expansion (General Method)

For larger matrices (n4n \geq 4), Sarrus doesn't work. We use cofactor expansion (also called Laplace expansion).
Definition (Minor and Cofactor).
  • Minor MijM_{ij}: the determinant of the (n1)×(n1)(n-1) \times (n-1) matrix obtained by deleting row ii and column jj from AA.
  • Cofactor Cij=(1)i+jMijC_{ij} = (-1)^{i+j} M_{ij}. Cofactor Expansion Theorem. For any square matrix AA,
>det(A)=j=1naijCij(expand along row i)>> \det(A) = \sum_{j=1}^{n} a_{ij} C_{ij} \quad \text{(expand along row $i$)} >
or equivalently along any column jj:
>det(A)=i=1naijCij>> \det(A) = \sum_{i=1}^{n} a_{ij} C_{ij} >
The sign pattern (1)i+j(-1)^{i+j} is a checkerboard:
[++++++++]\begin{bmatrix} + & - & + & - & \dots \\ - & + & - & + & \dots \\ + & - & + & - & \dots \\ - & + & - & + & \dots \\ \vdots & \vdots & \vdots & \vdots & \ddots \end{bmatrix}
Example 4: Cofactor expansion along row 1
Compute det(A)\det(A) for
>A=[210321102]>> A = \begin{bmatrix} 2 & 1 & 0 \\ -3 & 2 & 1 \\ 1 & 0 & -2 \end{bmatrix} >
.
Step 1: Identify a11=2a_{11} = 2, a12=1a_{12} = 1, a13=0a_{13} = 0.
Step 2: Compute minors and cofactors.
>M11=det[2102]=2(2)1(0)=4>> M_{11} = \det\begin{bmatrix} 2 & 1 \\ 0 & -2 \end{bmatrix} = 2(-2) - 1(0) = -4 >
, C11=(+1)(4)=4C_{11} = (+1)(-4) = -4
>M12=det[3112]=(3)(2)1(1)=61=5>> M_{12} = \det\begin{bmatrix} -3 & 1 \\ 1 & -2 \end{bmatrix} = (-3)(-2) - 1(1) = 6 - 1 = 5 >
, C12=(1)(5)=5C_{12} = (-1)(5) = -5
>M13=det[3210]=(3)(0)2(1)=2>> M_{13} = \det\begin{bmatrix} -3 & 2 \\ 1 & 0 \end{bmatrix} = (-3)(0) - 2(1) = -2 >
, C13=(+1)(2)=2C_{13} = (+1)(-2) = -2
Step 3: det(A)=2(4)+1(5)+0(2)=85+0=13\det(A) = 2(-4) + 1(-5) + 0(-2) = -8 - 5 + 0 = -13
Check: Use Sarrus to verify: 2(2)(2)+1(1)(1)+0(3)(0)0(2)(1)2(1)(0)1(3)(2)2(2)(-2) + 1(1)(1) + 0(-3)(0) - 0(2)(1) - 2(1)(0) - 1(-3)(-2) =8+1+0006=13= -8 + 1 + 0 - 0 - 0 - 6 = -13Example 5: Smart expansion — choose the row with the most zeros
Compute det(A)\det(A) for
>A=[3020120100102113]>> A = \begin{bmatrix} 3 & 0 & 2 & 0 \\ 1 & 2 & 0 & 1 \\ 0 & 0 & -1 & 0 \\ 2 & 1 & 1 & 3 \end{bmatrix} >
.
Expand along row 3 (has three zeros, only one non-zero entry at column 3):
a31=0a_{31} = 0, a32=0a_{32} = 0, a33=1a_{33} = -1, a34=0a_{34} = 0.
det(A)=(1)C33\det(A) = (-1) \cdot C_{33} where C33=(+1)M33C_{33} = (+1) \cdot M_{33} (since 3+3=63+3=6, even).
>M33=det[300121213]>> M_{33} = \det\begin{bmatrix} 3 & 0 & 0 \\ 1 & 2 & 1 \\ 2 & 1 & 3 \end{bmatrix} >
(delete row 3, column 3)
Expand again along row 1:
>M33=3det[2113]0+0=3(61)=15>> M_{33} = 3 \cdot \det\begin{bmatrix} 2 & 1 \\ 1 & 3 \end{bmatrix} - 0 + 0 = 3(6 - 1) = 15 >
Therefore det(A)=115=15\det(A) = -1 \cdot 15 = -15.

3. Properties of Determinants

These properties are essential for simplifying computations and for proofs.
PropertyStatementExample
P1: Identitydet(In)=1\det(I_n) = 1
P2: Row swapSwapping two rows changes signdetcdab=(adbc)\det\begin{vmatrix} c & d \\ a & b \end{vmatrix} = -(ad - bc)
P3: Scalar multiple of a rowIf a row is multiplied by cc , det\det multiplies by ccdetcacbcd=c(adbc)\det\begin{vmatrix} ca & cb \\ c & d \end{vmatrix} = c(ad - bc)
P4: Add multiple of one row to anotherdet\det unchangedThis is why row reduction preserves determinants
P5: Zero row/columndet(A)=0\det(A) = 0 if any row or column is all zeros
P6: Identical rowsdet(A)=0\det(A) = 0 if two rows are identical
P7: Triangulardet(A)=aii\det(A) = \prod a_{ii} for triangular matricesProduct of diagonal entries
P8: Productdet(AB)=det(A)det(B)\det(AB) = \det(A)\det(B)
P9: Transposedet(AT)=det(A)\det(A^T) = \det(A)
P10: Inversedet(A1)=1/det(A)\det(A^{-1}) = 1/\det(A)Only when det(A)0\det(A) \neq 0
P11: Row linearitydet\det is linear in each rowdet(row1+row1,)=det(row1,)+det(row1,)\det(\text{row}_1 + \text{row}'_1, \dots) = \det(\text{row}_1, \dots) + \det(\text{row}'_1, \dots)
Example 6: Using properties to simplify
Compute
>det123246357>> \det\begin{vmatrix} 1 & 2 & 3 \\ 2 & 4 & 6 \\ 3 & 5 & 7 \end{vmatrix} >
.
Notice row 2 is twice row 1: 2×(1,2,3)=(2,4,6)2 \times (1, 2, 3) = (2, 4, 6).
By P6 (or by P3 + P11), since rows 1 and 2 are linearly dependent, the determinant is 00.

4. Determinant and Invertibility

Theorem (Invertibility Criterion). An n×nn \times n matrix AA is invertible if and only if det(A)0\det(A) \neq 0. This is arguably the most important property of determinants. It tells us:
  • det(A)0\det(A) \neq 0 \Longleftrightarrow AA is invertible \Longleftrightarrow Ax=bA\mathbf{x} = \mathbf{b} has a unique solution for every b\mathbf{b}
  • det(A)=0\det(A) = 0 \Longleftrightarrow AA is singular \Longleftrightarrow Ax=bA\mathbf{x} = \mathbf{b} has either no solution or infinitely many
Proof sketch: Why det ≠ 0 ⇔ invertible
AA is invertible iff its RREF is InI_n. Row operations only multiply the determinant by non-zero scalars (or flip sign). So det(A)0\det(A) \neq 0 iff det(RREF(A))0\det(\text{RREF}(A)) \neq 0. But the only n×nn \times n matrix in RREF with non-zero determinant is InI_n, whose determinant is 1. Therefore det(A)0\det(A) \neq 0 iff RREF(A)=In(A) = I_n iff AA is invertible.

5. Minors and Cofactors — Formal Definitions

Definition (Minor). Given An×nA_{n \times n}, the minor MijM_{ij} is the determinant of the submatrix formed by deleting row ii and column jj. Definition (Cofactor). Cij=(1)i+jMijC_{ij} = (-1)^{i+j} M_{ij}. The cofactor matrix (matrix of cofactors) and its transpose — the adjugate (or classical adjoint) — will appear in Week 2 when we compute inverses and use Cramer's rule. Example 7: Finding all minors and cofactors for a 3×3 matrix
>A=[123014212]>> A = \begin{bmatrix} 1 & 2 & 3 \\ 0 & -1 & 4 \\ 2 & 1 & -2 \end{bmatrix} >
>M11=det[1412]=(1)(2)4(1)=24=2>> M_{11} = \det\begin{bmatrix} -1 & 4 \\ 1 & -2 \end{bmatrix} = (-1)(-2) - 4(1) = 2 - 4 = -2 >
, C11=(+1)(2)=2C_{11} = (+1)(-2) = -2
>M12=det[0422]=0(2)4(2)=8>> M_{12} = \det\begin{bmatrix} 0 & 4 \\ 2 & -2 \end{bmatrix} = 0(-2) - 4(2) = -8 >
, C12=(1)(8)=8C_{12} = (-1)(-8) = 8
>M13=det[0121]=0(1)(1)(2)=2>> M_{13} = \det\begin{bmatrix} 0 & -1 \\ 2 & 1 \end{bmatrix} = 0(1) - (-1)(2) = 2 >
, C13=(+1)(2)=2C_{13} = (+1)(2) = 2
>M21=det[2312]=2(2)3(1)=43=7>> M_{21} = \det\begin{bmatrix} 2 & 3 \\ 1 & -2 \end{bmatrix} = 2(-2) - 3(1) = -4 - 3 = -7 >
, C21=(1)(7)=7C_{21} = (-1)(-7) = 7
... and so on.

6. Edge Cases & Gotchas

SituationWhat Happens
** 1×11 \times 1 matrix**det([a])=a\det([a]) = a
** 0×00 \times 0 matrix**Convention: det=1\det = 1 (vacuously)
Row swapFlips the sign. A common exam trick: do an odd number of swaps
**Determinant of cAcA **det(cA)=cndet(A)\det(cA) = c^n \det(A) , not cdet(A)c\det(A) — because every row gets multiplied by cc
** det(A+B)\det(A+B) **det(A+B)det(A)+det(B)\det(A+B) \neq \det(A) + \det(B) in general. This is a common trap

7. Common Pitfalls

❌ Pitfall 1: Forgetting the alternating sign in cofactor expansion

Students often forget (1)i+j(-1)^{i+j}. Remember the checkerboard: top-left is ++.

❌ Pitfall 2: Applying Sarrus to 4×44 \times 4 or larger

Sarrus only works for 3×33 \times 3. For larger matrices, use cofactor expansion or row reduction.

❌ Pitfall 3: Thinking det(A+B)=det(A)+det(B)\det(A+B) = \det(A) + \det(B)

Determinants are not linear in addition; they are linear in each row. det(A+B)\det(A+B) is almost never equal to det(A)+det(B)\det(A) + \det(B).

8. Formula Summary Table

ConceptFormulaNotes
2×2 determinantadbcad - bc
3×3 determinant (Sarrus)a11a22a33+a12a23a31+a13a21a32a13a22a31a11a23a32a12a21a33a_{11}a_{22}a_{33} + a_{12}a_{23}a_{31} + a_{13}a_{21}a_{32} - a_{13}a_{22}a_{31} - a_{11}a_{23}a_{32} - a_{12}a_{21}a_{33}Only for 3×33 \times 3
CofactorCij=(1)i+jMijC_{ij} = (-1)^{i+j} M_{ij}MijM_{ij} = minor
Cofactor expansiondet(A)=jaijCij\det(A) = \sum_j a_{ij} C_{ij}Along any row or column
Triangular determinantiaii\prod_i a_{ii}Product of diagonal entries
Invertibility testdet(A)0\det(A) \neq 0     \iff AA is invertible

9. 📝 Practice Questions

Q1: 2×2 determinant
Compute
>det(5234)>> \det\begin{pmatrix} 5 & -2 \\ 3 & 4 \end{pmatrix} >
.
Strategy: adbcad - bc.
Solution: det=5(4)(2)(3)=20+6=26\det = 5(4) - (-2)(3) = 20 + 6 = 26. Q2: 3×3 determinant using Sarrus
>det(101213021)>> \det\begin{pmatrix} 1 & 0 & -1 \\ 2 & 1 & 3 \\ 0 & -2 & 1 \end{pmatrix} >
Strategy: Use Sarrus or cofactor expansion.
Solution (Sarrus):
>det=1(1)(1)+0(3)(0)+(1)(2)(2)(1)(1)(0)1(3)(2)0(2)(1)=1+0+40+60=11>> \begin{aligned} \det &= 1(1)(1) + 0(3)(0) + (-1)(2)(-2) \\ &\quad - (-1)(1)(0) - 1(3)(-2) - 0(2)(1) \\ &= 1 + 0 + 4 - 0 + 6 - 0 = 11 \end{aligned} >
Q3: Determinant using row operations
Use row operations to simplify then compute
>det(1234567810)>> \det\begin{pmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 10 \end{pmatrix} >
.
Strategy: Subtract 4×row1 from row2, 7×row1 from row3. Determinant unchanged by these operations.
Solution:
>1234567810=1230360611>> \begin{vmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 10 \end{vmatrix} = \begin{vmatrix} 1 & 2 & 3 \\ 0 & -3 & -6 \\ 0 & -6 & -11 \end{vmatrix} >
Now expand along column 1:
>=1det(36611)=(3)(11)(6)(6)=3336=3>> = 1 \cdot \det\begin{pmatrix} -3 & -6 \\ -6 & -11 \end{pmatrix} = (-3)(-11) - (-6)(-6) = 33 - 36 = -3 >
Q4: Triangular determinant
Compute
>det(2000310045301204)>> \det\begin{pmatrix} 2 & 0 & 0 & 0 \\ 3 & -1 & 0 & 0 \\ 4 & 5 & 3 & 0 \\ 1 & -2 & 0 & 4 \end{pmatrix} >
.
Strategy: For a lower triangular matrix, multiply diagonal entries.
Solution: det=2(1)(3)(4)=24\det = 2(-1)(3)(4) = -24. Q5: Cofactor expansion
Compute det(A)\det(A) by expanding along column 2:
>A=(102345012)>> A = \begin{pmatrix} 1 & 0 & 2 \\ 3 & 4 & 5 \\ 0 & -1 & 2 \end{pmatrix} >
.
Strategy: det=iai2Ci2\det = \sum_i a_{i2} C_{i2}.
Solution: a12=0a_{12} = 0, a22=4a_{22} = 4, a32=1a_{32} = -1.
>C12=(1)1+2M12=det(3502)=(60)=6>> C_{12} = (-1)^{1+2} M_{12} = -\det\begin{pmatrix} 3 & 5 \\ 0 & 2 \end{pmatrix} = -(6 - 0) = -6 >
>C22=(+1)M22=det(1202)=20=2>> C_{22} = (+1) M_{22} = \det\begin{pmatrix} 1 & 2 \\ 0 & 2 \end{pmatrix} = 2 - 0 = 2 >
>C32=(1)3+2M32=det(1235)=(56)=1>> C_{32} = (-1)^{3+2} M_{32} = -\det\begin{pmatrix} 1 & 2 \\ 3 & 5 \end{pmatrix} = -(5 - 6) = 1 >
det=0(6)+4(2)+(1)(1)=0+81=7\det = 0(-6) + 4(2) + (-1)(1) = 0 + 8 - 1 = 7 Q6: Determinant of a product
If det(A)=3\det(A) = 3 and det(B)=2\det(B) = -2, find det(AB)\det(AB) and det(2A)\det(2A) for A,BA, B 3×33 \times 3.
Strategy: Use det(AB)=det(A)det(B)\det(AB) = \det(A)\det(B) and det(cA)=cndet(A)\det(cA) = c^n \det(A).
Solution: det(AB)=3(2)=6\det(AB) = 3(-2) = -6. det(2A)=233=83=24\det(2A) = 2^3 \cdot 3 = 8 \cdot 3 = 24. Q7: Row swap effect
If det(A)=10\det(A) = 10 and BB is obtained by swapping rows 1 and 3 of AA, what is det(B)\det(B)?
Solution: Swapping two rows changes the sign. det(B)=10\det(B) = -10. Q8: Determinant of inverse
If AA is 4×44 \times 4 and det(A)=5\det(A) = -5, find det(A1)\det(A^{-1}).
Solution: det(A1)=1/det(A)=1/5\det(A^{-1}) = 1/\det(A) = -1/5. Q9: Singular matrix
Find kk so that
>A=(k23k1)>> A = \begin{pmatrix} k & 2 \\ 3 & k-1 \end{pmatrix} >
is singular.
Strategy: Set det(A)=0\det(A) = 0.
Solution: det(A)=k(k1)6=k2k6=(k3)(k+2)=0\det(A) = k(k-1) - 6 = k^2 - k - 6 = (k-3)(k+2) = 0. So k=3k = 3 or k=2k = -2. Q10: Volume via determinant
Find the volume of the parallelepiped spanned by a=(1,0,2)\mathbf{a} = (1,0,2), b=(0,1,1)\mathbf{b} = (0,1,1), c=(2,1,0)\mathbf{c} = (2,1,0).
Strategy: Volume = det([a  b  c])|\det([\mathbf{a}\; \mathbf{b}\; \mathbf{c}])|.
Solution:
>det(102011210)=1(1011)0+2(0112)=1(1)+2(2)=14=5>> \det\begin{pmatrix} 1 & 0 & 2 \\ 0 & 1 & 1 \\ 2 & 1 & 0 \end{pmatrix} = 1(1\cdot0 - 1\cdot1) - 0 + 2(0\cdot1 - 1\cdot2) = 1(-1) + 2(-2) = -1 - 4 = -5 >
Volume = 5=5|-5| = 5.

🔗 Cross-References

Document outline

Keep your place and jump directly to a heading.

Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.