Introduction

A system of mm linear equations in nn unknowns can have exactly one solution, infinitely many, or none. Rank decides which, and Gaussian elimination computes both the rank and the solutions. The rank-nullity theorem then counts how many free parameters a solution set has. These ideas are the core of linear algebra questions: decide for which parameter values a system is consistent, find the rank of a matrix, or count the dimension of a solution space.

Prerequisites

Core concepts

Matrix form

The system ai1x1+⋯+ainxn=bia_{i1}x_1 + \cdots + a_{in}x_n = b_i (i=1,…,mi = 1, \ldots, m) is Ax=bAx = b with coefficient matrix AA (m×nm \times n) and augmented matrix [A∣b][A \mid b] (m×(n+1)m \times (n + 1)). It is homogeneous if b=0b = 0. It is consistent if it has at least one solution.

Linear independence, span and basis

Vectors v1,…,vkv_1, \ldots, v_k are linearly independent if c1v1+⋯+ckvk=0c_1v_1 + \cdots + c_kv_k = 0 forces all ci=0c_i = 0; otherwise dependent. Their span is the set of all linear combinations. A basis of a subspace is an independent spanning set; all bases have the same size, the dimension. In Rn\mathbb{R}^n, more than nn vectors are always dependent.

For an m×nm \times n matrix AA:

  • Column space C(A)⊆RmC(A) \subseteq \mathbb{R}^m: span of the columns; Ax=bAx = b is consistent if and only if b∈C(A)b \in C(A).
  • Null space N(A)⊆RnN(A) \subseteq \mathbb{R}^n: all solutions of Ax=0Ax = 0.
  • Row space: span of the rows.

Elementary row operations and echelon form

Three operations do not change the solution set: swap two rows, multiply a row by a non-zero scalar, add a multiple of one row to another. They also preserve the row space and the rank.

A matrix is in row echelon form (REF) if zero rows are at the bottom and the first non-zero entry (pivot) of each row lies strictly to the right of the pivot above it. It is in reduced row echelon form (RREF) if additionally each pivot is 1 and is the only non-zero entry in its column. The RREF of a matrix is unique; REF is not. Gaussian elimination reaches REF and then solves by back substitution; Gauss-Jordan elimination continues to RREF. Both take O(n3)O(n^3) arithmetic operations for an n×nn \times n system.

Gaussian elimination to echelon form
Figure 1. Gaussian elimination on the augmented matrix of Example 1: two row operations clear column 1, one clears column 2, and back substitution gives z=3z = 3, y=2y = 2, x=1x = 1.

Rank

The rank of AA is any of these equal numbers:

  • the number of pivots in an echelon form of AA;
  • the maximum number of linearly independent rows, which equals the maximum number of linearly independent columns (row rank = column rank);
  • the dimension of the column space (or row space);
  • the order of the largest square submatrix with non-zero determinant (largest non-vanishing minor).

Facts: rank⁡A≤min⁡(m,n)\operatorname{rank} A \le \min(m, n); rank⁡AT=rank⁡A\operatorname{rank} A^T = \operatorname{rank} A; rank⁡(AB)≤min⁡(rank⁡A,rank⁡B)\operatorname{rank}(AB) \le \min(\operatorname{rank} A, \operatorname{rank} B); multiplying by an invertible matrix does not change rank; rank⁡(ATA)=rank⁡A\operatorname{rank}(A^TA) = \operatorname{rank} A for real AA; rank⁡(A+B)≤rank⁡A+rank⁡B\operatorname{rank}(A + B) \le \operatorname{rank} A + \operatorname{rank} B. A non-zero matrix has rank 1 if and only if it is an outer product uvTuv^T of non-zero vectors.

Rank-nullity theorem

For an m×nm \times n matrix AA (note: nn = number of columns = number of unknowns),

rank⁡(A)+nullity⁡(A)=n,nullity⁡(A)=dim⁡N(A).\operatorname{rank}(A) + \operatorname{nullity}(A) = n, \qquad \operatorname{nullity}(A) = \dim N(A).

Each non-pivot column corresponds to a free variable, and the null space has a basis with one vector per free variable.

When does Ax=bAx = b have solutions? (Rouché-Capelli)

Let r=rank⁡Ar = \operatorname{rank} A and r′=rank⁡[A∣b]r' = \operatorname{rank}[A \mid b]. Always r≤r′≤r+1r \le r' \le r + 1.

ConditionOutcome
r<r′r < r'inconsistent: no solution (an echelon row reads 0=c0 = c, c≠0c \ne 0)
r=r′=nr = r' = nexactly one solution
r=r′<nr = r' < ninfinitely many solutions (over R\mathbb{R}), with n−rn - r free parameters
Solution cases by rank
Figure 2. Two equations in two unknowns as lines: intersecting lines (one solution, rank 2), parallel distinct lines (no solution, rank of A is 1, augmented rank 2), and coincident lines (infinitely many solutions, both ranks 1).

Structure of solutions. If xpx_p is any one solution of Ax=bAx = b, then every solution is xp+xhx_p + x_h with xh∈N(A)x_h \in N(A). So the solution set, when non-empty, has the same "size" as the null space.

Homogeneous systems Ax=0Ax = 0 are always consistent (x=0x = 0). They have a non-trivial solution if and only if rank⁡A<n\operatorname{rank} A < n. In particular:

  • if m<nm < n (fewer equations than unknowns), non-trivial solutions always exist;
  • for square AA: non-trivial solution   ⟺  det⁡A=0\iff \det A = 0.

Square systems. For n×nn \times n AA, these are equivalent: det⁡A≠0\det A \ne 0; AA invertible; rank⁡A=n\operatorname{rank} A = n; Ax=0Ax = 0 has only the trivial solution; Ax=bAx = b has a unique solution for every bb. If det⁡A=0\det A = 0, then Ax=bAx = b has either no solution or infinitely many, depending on bb; the determinant alone cannot tell which.

Worked examples

Example 1: Gaussian elimination

x+y+z=6x + y + z = 6, 2x+y−z=12x + y - z = 1, x−y+2z=5x - y + 2z = 5. Augmented matrix and operations:

(111621−111−125)→R3−R1R2−2R1(11160−1−3−110−21−1)→R3−2R2(11160−1−3−1100721).\left(\begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 2 & 1 & -1 & 1 \\ 1 & -1 & 2 & 5 \end{array}\right) \xrightarrow[R_3 - R_1]{R_2 - 2R_1} \left(\begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & -1 & -3 & -11 \\ 0 & -2 & 1 & -1 \end{array}\right) \xrightarrow{R_3 - 2R_2} \left(\begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & -1 & -3 & -11 \\ 0 & 0 & 7 & 21 \end{array}\right).

Back substitution: z=3z = 3; −y−9=−11-y - 9 = -11 so y=2y = 2; x=6−2−3=1x = 6 - 2 - 3 = 1. Rank 3 = nn: unique.

Example 2: parameters

x+y+z=6x + y + z = 6, x+2y+3z=10x + 2y + 3z = 10, x+2y+λz=μx + 2y + \lambda z = \mu. Subtracting gives rows (0,1,2∣4)(0, 1, 2 \mid 4) and (0,0,λ−3∣μ−10)(0, 0, \lambda - 3 \mid \mu - 10). So:

  • λ≠3\lambda \ne 3: unique solution (any μ\mu);
  • λ=3\lambda = 3, μ≠10\mu \ne 10: no solution;
  • λ=3\lambda = 3, μ=10\mu = 10: infinitely many (one free parameter).

Example 3: infinitely many solutions

x+y+z=6x + y + z = 6, x+2y+3z=14x + 2y + 3z = 14, 2x+3y+4z=202x + 3y + 4z = 20. Row 3 = row 1 + row 2, so r=r′=2<3r = r' = 2 < 3. With z=tz = t: y=8−2ty = 8 - 2t, x=−2+tx = -2 + t. The solution set is the line (−2,8,0)+t(1,−2,1)(-2, 8, 0) + t(1, -2, 1).

Example 4: rank and nullity

A=(123424681010)A = \begin{pmatrix} 1 & 2 & 3 & 4 \\ 2 & 4 & 6 & 8 \\ 1 & 0 & 1 & 0 \end{pmatrix}. Row 2 is twice row 1, and rows 1 and 3 are independent: rank 2. Nullity =4−2=2= 4 - 2 = 2, so Ax=0Ax = 0 has a two-parameter family of solutions.

Example 5: homogeneous with a parameter

x+ky=0x + ky = 0, kx+y=0kx + y = 0 has a non-trivial solution if and only if det⁡=1−k2=0\det = 1 - k^2 = 0, that is k=±1k = \pm 1.

Example 6: ranks of patterned matrices

For n≥2n \ge 2, the n×nn \times n matrices with entries aij=i+ja_{ij} = i + j and with entries 1,2,…,n21, 2, \ldots, n^2 filled row by row both have rank 2: every row is a combination of (1,1,…,1)(1, 1, \ldots, 1) and (1,2,…,n)(1, 2, \ldots, n). The matrix with aij=ija_{ij} = ij has rank 1, because row ii is ii times row 1. Rank-nullity then gives null spaces of dimension n−2n - 2 and n−1n - 1.

Example 7: counting solutions over GF(2)

Over GF(2) (arithmetic modulo 2), solve x1+x2+x3=1x_1 + x_2 + x_3 = 1, x2+x3=0x_2 + x_3 = 0. The coefficient matrix has rank 2 and so does the augmented matrix, with n=3n = 3 unknowns, so there are 23−2=22^{3 - 2} = 2 solutions: x3x_3 is free, x2=x3x_2 = x_3, x1=1x_1 = 1, giving (1,0,0)(1, 0, 0) and (1,1,1)(1, 1, 1).

Important properties and observations

  • Row operations preserve the row space and the null space, but not the column space; read independent columns from the original matrix at the pivot positions.
  • Adding the column bb can raise the rank by at most 1.
  • A system with more equations than unknowns may still be consistent; a homogeneous system with more unknowns than equations always has non-trivial solutions.
  • Over a finite field (for example GF(2)), "infinitely many" becomes qn−rq^{n-r} solutions for a field with qq elements.
  • Over R\mathbb{R}, a system cannot have exactly two solutions: if x1≠x2x_1 \ne x_2 both solve Ax=bAx = b, then so does x1+t(x2−x1)x_1 + t(x_2 - x_1) for every real tt.

GATE examination perspective

  • Consistency by parameters: reduce, then compare rank⁡A\operatorname{rank} A and rank⁡[A∣b]\operatorname{rank}[A \mid b].
  • Rank of a given matrix, including patterned or rank-1 matrices.
  • Rank-nullity: dimension of the solution space of Ax=0Ax = 0 is n−rn - r.
  • Trap: concluding "no solution" from det⁡A=0\det A = 0 without checking the augmented rank.
  • Trap: using the number of rows instead of columns in rank-nullity.
  • Patterned matrices. Express rows as combinations of a few fixed vectors to read off the rank (Example 6).
  • Trap: "exactly two solutions" over R\mathbb{R}; the count is 0, 1 or infinite (finite fields aside).

Summary

Sources

  1. G. Strang, Introduction to Linear Algebra, 5th ed., Wellesley-Cambridge Press, 2016: Sections 2.2 (The Idea of Elimination), 3.2 (The Nullspace of A), 3.3 (The Complete Solution to Ax = b) and 3.4 (Independence, Basis and Dimension).
  2. E. Kreyszig, Advanced Engineering Mathematics, 10th ed., Wiley, 2011: Chapter 7 (Linear Algebra: Matrices, Vectors, Determinants. Linear Systems).

Next steps