Hexa Scholar

Solving Ax = b: one, none, or infinitely many

Three translucent slabs in cream, gold and terracotta cross one another in a dark space and meet at a single small gold bead.
Three slabs that share one point.

The question

Three equations in three unknowns describe three planes in space. Do they share exactly one point, infinitely many points, or none?

Sort six systems; the page draws the planes after each answer.

  1. 1 SeeSort six systems by their solutions.
  2. 2 TryMove the right side, predict the outcome.
  3. 3 ProveBuild the rank test, line by line.
  4. 4 ApplySix problems, two with bond prices.
Before you start · 3 quick checks on a matrix times a vector, rank and the null space, about 3 min

Two ideas before you start

2 ideas

Each equation draws a line, or in space a plane

Figure: the solid line x + y = 2 and a dashed second line, with their common point when there is exactly one. It needs JavaScript.

Second equation:

Solid: x + y = 2 Dashed: x − y = 0

Common points: One common point: (1, 1).

A solution has to satisfy every equation at once, so it is a point on every line. Two lines can cross once, run parallel, or be the same line.

Exact definition

A linear system. A system of \(m\) linear equations in \(n\) unknowns \(x_1, \dots, x_n\) is

\[\begin{aligned} &a_{i1}x_1 + \dots + a_{in}x_n = b_i, \\ &i = 1, \dots, m, \end{aligned}\]

with real numbers \(a_{ij}\) and \(b_i\). With the \(m \times n\) coefficient matrix \(A = (a_{ij})\), the unknown vector \(x \in \mathbb{R}^n\) and the right side \(b \in \mathbb{R}^m\), it is \(Ax = b\). A solution is a vector \(x\) that satisfies all \(m\) equations; the solution set is the set of all solutions.

The row picture. An equation whose coefficients are not all 0 describes a line when \(n = 2\) and a plane when \(n = 3\). A solution is a point that lies on all of them. An equation \(0x_1 + \dots + 0x_n = c\) holds for every \(x\) when \(c = 0\) and for no \(x\) when \(c \ne 0\).

Elimination ends in 0 = 0 or 0 = c

Figure: the solid line x + y = 2 and the second equation after one elimination step. It needs JavaScript.

Second equation:

Row 2 − row 1: −2y = −2

rank A = 2 rank [A | b] = 2

Subtracting a multiple of one equation from another keeps the same solutions. When the left side vanishes, the row reads 0 = 0, true everywhere (shaded), or 0 = c with c not 0, true nowhere.

Exact definition

Row operations. The augmented matrix \([A \mid b]\) is \(A\) with \(b\) added as a last column. Elimination uses three row operations: swap two rows, multiply a row by a nonzero number, and add a multiple of one row to another. Each can be undone by another row operation, so the system before and after has the same solutions.

Echelon form and rank. Elimination can always reach the reduced row echelon form: the first nonzero entry of each nonzero row, its pivot, is 1, it lies to the right of the pivot above, it is the only nonzero entry of its column, and rows of zeros come last. Row operations keep every linear relation among the columns, so they keep the rank, the dimension of the column space. The rank is therefore the number of pivots. The same reduction of \([A \mid b]\) gives \(\operatorname{rank} A\), the pivots left of the bar, and \(\operatorname{rank}\,[A \mid b]\), all the pivots.

Fine print: names and notation

A system with at least one solution is called consistent, and one with none inconsistent. A system with \(b = 0\) is called homogeneous; it always has the solution \(x = 0\). The unknowns that get no pivot in the reduced form are called free.

All numbers on this page are real numbers. In the figures, \(x\), \(y\) and \(z\) name the three unknowns, and each plane is drawn only where it passes through a box around the origin; the box is part of the drawing, not of the math.

1 See

Sort six systems

How the game works

There are six systems, each with three equations in the unknowns \(x\), \(y\) and \(z\). After Check, the page reduces the augmented matrix \([A \mid b]\) exactly, with fractions, shows the reduced form, the rank of \(A\) and the rank of \([A \mid b]\), and draws the three planes. A slider turns the 3D view. Next system moves on; after the sixth, a table lists your answers. Start over clears everything.

2 Try

Change only the right side

A prediction first. The explorer below it opens once it is answered.

Two equations, three unknowns

3 Prove

Why two ranks decide everything

Theorem

Assumptions. \(A\) is a real \(m \times n\) matrix with \(m, n \ge 1\) and columns \(a_1, \dots, a_n\), and \(b \in \mathbb{R}^m\). Write \(r = \operatorname{rank} A\) and \(r' = \operatorname{rank}\,[A \mid b]\).

Conclusion. If \(b \in \operatorname{Col}(A)\), then \(r' = r\); if \(b \notin \operatorname{Col}(A)\), then \(r' = r + 1\). So \(Ax = b\) has a solution exactly when \(r' = r\). When it has a solution, it has exactly one if \(r = n\), and infinitely many if \(r \lt n\).

Facts the proof uses.

  • \(Ax = x_1a_1 + \dots + x_na_n\), so \(Ax = b\) has a solution exactly when \(b \in \operatorname{Col}(A)\), the span of the columns;
  • if \(x_p\) is one solution, the solutions are exactly the vectors \(x_p + v\) with \(v \in \operatorname{Null}(A)\), because \(Ax - b = A(x - x_p)\);
  • rank–nullity: \(r + \dim \operatorname{Null}(A) = n\) (lesson on column space, null space and rank);
  • the rank of a matrix is the dimension of its column space, the number of vectors in any basis of it.

Each line starts from one case. Pick the option that is true for every matrix \(A\) and every \(b\) in that case. A step that fails for even one such \(A\) and \(b\) cannot be part of the proof.

What else follows
  • The four cases. Lines 1 and 2 cover every \(b\), and lines 3 and 4 every solvable system, so the outcome is always one of: no solution (\(r' = r + 1\)), exactly one (\(r' = r = n\)), or infinitely many (\(r' = r \lt n\)). Two or five solutions never happen.
  • Fewer equations than unknowns. \(r \le m\), the number of rows. If \(m \lt n\), then \(r \lt n\), so a solvable system has infinitely many solutions.
  • Square systems. If \(m = n\) and \(r = n\), then \(\operatorname{Col}(A) = \mathbb{R}^n\), so every \(b\) gives exactly one solution, \(x = A^{-1}b\). If \(r \lt n\), some \(b\) give none and the others infinitely many; that is when the determinant is 0.
  • No solution is not the end. When \(b \notin \operatorname{Col}(A)\), least squares replaces \(b\) by the closest point of \(\operatorname{Col}(A)\) and solves that system instead; see projection onto a subspace.
4 Apply

Problems

Each problem has hints and a full solution.

Key point Reduce \([A \mid b]\) and count pivots. A pivot after the bar means no solution. Otherwise there are \(n - \operatorname{rank} A\) free unknowns: none means exactly one solution, any means infinitely many.
Level Intro Prerequisites column space, null space and rank, a matrix as a map Time ~35 min

Further reading