Skip to content
Tutorials Center
My learning

Topics

Lesson 46 of 68 ยท Linear Algebra and Numerical Methods

Special Matrices, Determinants, the Adjoint and Cramer's Rule

Recognize symmetric, skew-symmetric, orthogonal, idempotent, involutory and nilpotent matrices, use minors and cofactors, find inverses with the adjoint, and solve systems with Cramer's rule.

Matrices and Linear Systems covered the working skills: multiplication, elimination, determinants, inverses. Engineering exams and many applications also expect you to recognize named kinds of matrix, to know the properties of determinants by heart, and to compute inverses and solutions in closed form with the adjoint and Cramer's rule. This lesson collects that toolkit. Every claim is checked numerically in code.

A zoo of special matrices

All matrices below are square. A^T is the transpose, I the identity.

Name Defining property Consequences
Diagonal zero off the diagonal determinant = product of diagonal entries
Upper / lower triangular zeros below / above the diagonal determinant = product of diagonal entries
Symmetric A^T = A real eigenvalues; orthogonal eigenvectors
Skew-symmetric A^T = -A zero diagonal; odd-size ones have det = 0; eigenvalues purely imaginary or 0
Orthogonal Q^T Q = I, i.e. Q^-1 = Q^T det = +1 or -1; preserves lengths and angles (rotations, reflections)
Idempotent A^2 = A projections; eigenvalues only 0 or 1
Involutory A^2 = I A^-1 = A; eigenvalues only +1 or -1 (reflections)
Nilpotent A^k = 0 for some k all eigenvalues are 0; never invertible
Singular det(A) = 0 no inverse; columns dependent
Non-singular det(A) != 0 invertible; Ax = b has exactly one solution

Two handy facts. Every square matrix is the sum of a symmetric and a skew-symmetric matrix: A = (A + A^T)/2 + (A - A^T)/2. And if A is symmetric then A^T A, A A^T and any B^T A B are symmetric too.

Python Recognize and test special matrices

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Minors, cofactors and the adjoint

For an n x n matrix A:

  • The minor M_ij is the determinant of the (n-1) x (n-1) matrix left after deleting row i and column j.
  • The cofactor is C_ij = (-1)^(i+j) M_ij. The signs follow a checkerboard: + - + ... on the first row, - + - ... on the second.
  • Cofactor expansion gives the determinant along any row i: det(A) = sum over j of a_ij * C_ij. Pick the row or column with the most zeros.
  • The adjoint (also called the adjugate) adj(A) is the transpose of the cofactor matrix: adj(A)_ij = C_ji.

The adjoint has a beautiful property: A * adj(A) = det(A) * I. Dividing by the determinant gives a closed form for the inverse:

Text
A^-1 = adj(A) / det(A)         (only when det(A) != 0)

For a 2 x 2 matrix [[a, b], [c, d]] the adjoint is [[d, -b], [-c, a]], which is the familiar inverse formula. For large matrices this approach is far too slow (use elimination or np.linalg.solve), but it is exact, it is the right tool for symbolic work, and it proves useful identities such as det(adj(A)) = det(A)^(n-1).

Determinant properties worth memorizing

  1. det(A^T) = det(A).
  2. det(AB) = det(A) det(B); so det(A^-1) = 1/det(A) and det(A^k) = det(A)^k.
  3. Swapping two rows (or columns) flips the sign.
  4. Multiplying one row by c multiplies the determinant by c; so det(cA) = c^n det(A).
  5. Adding a multiple of one row to another does not change the determinant. This is why elimination works.
  6. A zero row, or two equal rows, or one row a multiple of another, gives det = 0.
  7. Triangular and diagonal matrices: the determinant is the product of the diagonal.
  8. det(A) = 0 if and only if the rows (equivalently columns) are linearly dependent.
Python Cofactors, adjoint, inverse and determinant rules in SymPy

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Cramer's rule

For a square system A x = b with det(A) != 0, Cramer's rule gives each unknown as a ratio of determinants:

Text
x_i = det(A_i) / det(A)

where A_i is A with its i-th column replaced by b. It follows directly from x = A^-1 b = adj(A) b / det(A).

Cramer's rule is wonderful for 2 x 2 and 3 x 3 systems by hand, and for symbolic answers (for example, a circuit's current as a formula in the resistances). It is not an efficient algorithm: computing n + 1 determinants costs far more than one elimination, and it is numerically less stable. When det(A) = 0 the rule does not apply, because there is no unique solution.

Rank, dependence and the three outcomes

The rank of a matrix is the number of linearly independent rows (equivalently columns), the size of the largest non-zero minor. A set of vectors is linearly dependent if some non-trivial combination is the zero vector; for n vectors in n dimensions that is exactly det = 0.

For A x = b with n unknowns, compare rank(A) with the rank of the augmented matrix [A | b]:

Condition Outcome
rank(A) < rank([A | b]) inconsistent: no solution
rank(A) = rank([A | b]) = n unique solution
rank(A) = rank([A | b]) < n infinitely many solutions (free variables)
Python Cramer's rule and the three outcomes

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. Which matrix equation defines an orthogonal matrix Q?

    Orthogonal means the transpose is the inverse: Q^T Q = I. Q^2 = Q is idempotent, Q^T = -Q skew-symmetric and Q^k = 0 nilpotent.
  2. 2. A skew-symmetric matrix of odd size has determinant:

    det(A) = det(A^T) = det(-A) = (-1)^n det(A). For odd n this gives det(A) = -det(A), so det(A) = 0.
  3. 3. If A is 3 x 3 with det(A) = 4, what is det(2A)?

    det(cA) = c^n det(A) = 2^3 x 4 = 32.
  4. 4. What is the correct formula for the inverse using the adjoint?

    A adj(A) = det(A) I, so dividing the adjoint by the determinant gives the inverse (when det is non-zero).
  5. 5. A system has rank(A) = 2, rank([A | b]) = 2 and 3 unknowns. How many solutions?

    The system is consistent and rank(A) = 2 < 3 unknowns, leaving one free variable, so there are infinitely many solutions.

Summary

  • Know the families: symmetric, skew-symmetric, orthogonal, idempotent, involutory, nilpotent, singular and non-singular, each defined by a short identity.
  • Minors and cofactors give the determinant by expansion; the adjoint is the transpose of the cofactor matrix and A^-1 = adj(A) / det(A).
  • Key determinant rules: det(AB) = det(A) det(B), det(cA) = c^n det(A), a row swap flips the sign, row addition changes nothing, dependent rows give zero.
  • Cramer's rule x_i = det(A_i)/det(A) is exact and handy for small or symbolic systems but not an efficient algorithm.
  • Compare rank(A) and rank([A | b]) to decide between no, one or infinitely many solutions.

Next: LU Decomposition and Iterative Solvers.