Cofactor Matrix Calculator
Find the cofactor matrix by calculating the signed minor associated with each matrix entry. Cofactors use an alternating sign pattern and are fundamental to determinant expansion and the construction of the adjugate matrix.
A
Learn About Matrix Cofactor
Definition of Minors and Cofactors
For any square matrix $\mathbf{A} \in \mathbb{R}^{n \times n}$, every element $a_{ij}$ is associated with a minor and a cofactor:
- Minor ($M_{ij}$): The scalar determinant of the $(n-1) \times (n-1)$ submatrix formed by deleting the $i$-th row and $j$-th column from $\mathbf{A}$.
- Cofactor ($C_{ij}$): The signed minor obtained by multiplying $M_{ij}$ by the alternating parity sign $(-1)^{i+j}$:
The matrix formed by replacing every entry $a_{ij}$ with its cofactor $C_{ij}$ is the cofactor matrix $\mathbf{C} = [C_{ij}]$.
The Checkerboard Sign Rule
The sign factor $(-1)^{i+j}$ generates an alternating checkerboard pattern across matrix entries:
- If the sum of indices $(i + j)$ is even, $(-1)^{i+j} = +1$, so the cofactor equals the minor: $C_{ij} = M_{ij}$.
- If the sum of indices $(i + j)$ is odd, $(-1)^{i+j} = -1$, so the cofactor is the negative of the minor: $C_{ij} = -M_{ij}$.
The Two Primary Applications of Cofactors
- Laplace Expansion for Determinants:
The determinant of $\mathbf{A}$ can be evaluated along any row $i$ or column $j$ by taking the dot product with its cofactors:
- Construction of the Classical Adjugate:
Transposing the cofactor matrix yields the adjugate matrix:
Worked Numerical Example
Find the cofactor matrix for $\mathbf{A} = \begin{bmatrix} 1 & -2 & 3 \\ 0 & 4 & 1 \\ 2 & 1 & 0 \end{bmatrix}$:
- Calculate the 9 Minors ($M_{ij}$):
- $M_{11} = (4)(0) - (1)(1) = -1$
- $M_{12} = (0)(0) - (1)(2) = -2$
- $M_{13} = (0)(1) - (4)(2) = -8$
- $M_{21} = (-2)(0) - (3)(1) = -3$
- $M_{22} = (1)(0) - (3)(2) = -6$
- $M_{23} = (1)(1) - (-2)(2) = 5$
- $M_{31} = (-2)(1) - (3)(4) = -14$
- $M_{32} = (1)(1) - (3)(0) = 1$
- $M_{33} = (1)(4) - (-2)(0) = 4$
- Apply the Checkerboard Signs ($C_{ij} = (-1)^{i+j} M_{ij}$):
- $C_{11} = +(-1) = -1$
- $C_{12} = -(-2) = 2$
- $C_{13} = +(-8) = -8$
- $C_{21} = -(-3) = 3$
- $C_{22} = +(-6) = -6$
- $C_{23} = -(5) = -5$
- $C_{31} = +(-14) = -14$
- $C_{32} = -(1) = -1$
- $C_{33} = +(4) = 4$
- Assemble the Cofactor Matrix $\mathbf{C}$:
1. What is the fundamental difference between a minor and a cofactor?
A minor $M_{ij}$ is purely the determinant of the deleted submatrix without any sign adjustment. A cofactor $C_{ij}$ incorporates the positional parity factor $(-1)^{i+j}$. Thus, a cofactor is simply a signed minor: $C_{ij} = \pm M_{ij}$.
2. Can cofactors be calculated for rectangular matrices?
No. Every minor $M_{ij}$ is computed as the determinant of a submatrix. Because determinants are strictly defined only for square matrices, the deleted submatrix must also be square. Therefore, minors and cofactors exist only for square matrices ($n \times n$).
3. What happens if I multiply the entries of one row by the cofactors of a different row?
You get zero! This property, known as alien cofactor expansion or the Expansion by Alien Factors Theorem, states:
This is because the sum corresponds to evaluating the determinant of a matrix with two identical rows, which is identically zero. This algebraic property proves why $\mathbf{A}\mathbf{C}^T = \det(\mathbf{A})\mathbf{I}_n$.
1. The Levi-Civita Alternating Tensor
The checkerboard sign pattern $(-1)^{i+j}$ is a discrete 2D manifestation of the Levi-Civita permutation symbol ($\epsilon_{ijk}$), the alternating tensor that defines vector cross products and exterior wedge products in multilinear algebra. The alternating signs ensure that swapping adjacent rows negates the volume calculation.
2. Pierre-Simon Laplace and the 1772 Expansion Theorem
Pierre-Simon Laplace formulated the general cofactor expansion in 1772 as a systematic way to compute planetary orbits in celestial mechanics without explicitly writing out the factorial number of permutations. His formulation proved that expanding along any row or column yields the exact same determinant value.