determin.ant
03-systems / 3.4

Module 3: Systems of Equations

Solution Types

Where you'll see this: in machine learning, an overdetermined system (more equations than unknowns) has no exact solution — that's why we use least squares. In control systems, an underdetermined system has infinite solutions — that's the space of valid control inputs. Knowing which case you're in determines your entire approach.

Every system of linear equations falls into one of exactly three categories. Understanding which one you're dealing with before you start solving saves enormous effort — and reveals something deep about the underlying transformation.

The three cases

Unique solution — det ≠ 0

The coefficient matrix is invertible. The transformation it represents is a bijection — every output point came from exactly one input. You can always solve it: x=A1b\mathbf{x} = A^{-1}\mathbf{b}.

No solution — det = 0, inconsistent

The matrix is singular. The transformation collapses the plane onto a line (or a point). The right-hand side b\mathbf{b} doesn't lie on that collapsed image, so no vector maps to it. Gaussian elimination will produce a row like 0=k0 = k where k0k \neq 0.

Infinite solutions — det = 0, consistent

The matrix is singular, but b\mathbf{b} does lie in the image. There's an entire line of solutions — the null space of AAshifted to one particular solution. Gaussian elimination produces a row of all zeros.

The singular cases (det = 0) are not just edge cases — they come up constantly in practice. Redundant sensors, correlated features in ML data, degenerate geometry in graphics. Recognising them fast matters.

Rank: the precise measure

The rank of a matrix is the number of independent rows (or columns) it has. For a 2×2 matrix:

  • Rank 2 → unique solution
  • Rank 1 → either no solution or infinitely many
  • Rank 0 → trivial (zero matrix)

We'll explore rank properly in the Vector Spaces module. For now: rank = how much information the matrix carries.

In code

import numpy as np

A = np.array([[1, 2], [2, 4]])   # rank 1

# Check rank
print(np.linalg.matrix_rank(A))  # 1 — singular

# np.linalg.solve will raise LinAlgError for singular A
# For least-squares (best approximate solution):
b = np.array([3, 7])
x, _, _, _ = np.linalg.lstsq(A, b, rcond=None)
print(x)  # least-squares solution
LU DecompositionArea Scaling
(1.33, 1.67)Lines cross at one point

The two equations have different slopes, so the lines meet at exactly one point. There is a unique solution.

det(A) ≠ 0