Gaussian Elimination & Row Reduction
00 · Symbol Glossary
Row equivalence. means matrix was obtained from by a sequence of elementary row operations. Row-equivalent matrices have the same solution set — they encode the same system.
The -th row of a matrix. Used in row operation notation: means replace row 2 with row 2 minus 3 times row 1.
The number of pivot positions in the row echelon form of . Equals the dimension of the column space — the number of linearly independent columns. A fundamental measure of how much information carries.
The number of free variables in , where is the number of columns and . Called the nullity of . The rank-nullity theorem states .
01 · Row Echelon Form
Chapter 3 introduced row operations informally. Gaussian elimination is the systematic algorithm that applies them to reach a standard form where the solution is easy to read off.
A matrix is in row echelon form (REF) when it has a "staircase" pattern of leading nonzero entries descending from upper-left to lower-right.
A matrix is in row echelon form if:
- All zero rows are at the bottom.
- Each row's leading entry (leftmost nonzero entry) is strictly to the right of the leading entry of the row above it.
- All entries below a leading entry in its column are zero.
— any nonzero value. Bold entries are pivot positions — the leading nonzero entries forming the staircase. The bottom row of all zeros indicates a free variable or dependent equation.
A matrix is in reduced row echelon form if it satisfies all REF conditions plus:
- Each pivot (leading entry) equals exactly 1.
- Each pivot is the only nonzero entry in its column.
RREF is unique — every matrix has exactly one RREF. REF is not unique — different row operation sequences may produce different REFs for the same matrix.
Gaussian elimination produces REF, then back-substitution solves. Gauss-Jordan elimination continues further to produce RREF, from which the solution can be read directly without back-substitution. Both give the same answer; RREF requires more computation but eliminates the back-substitution step.
02 · Gaussian Elimination Algorithm
Gaussian elimination proceeds column by column, left to right. In each column it creates zeros below the current pivot position.
A pivot position is a location in a matrix corresponding to a leading entry in the REF. A pivot column is any column that contains a pivot position. Free columns are columns with no pivot — they correspond to free variables.
Locate the first pivot column: column 1 has the leftmost nonzero entry. Current column 1 entries: . The top entry is 0 — swap rows to put a nonzero entry in position .
: matrix becomes .
Eliminate below pivot : zero out entries in column 1 below row 1.
: .
Matrix: . Row 1 is the pivot row — it is now frozen.
Move to column 2, row 2. Pivot position . Eliminate below:
: .
Matrix (REF): .
Read off the REF: three pivots (positions , , ). No free variables. .
Back-substitute to solve: From row 3: . The came from the augmented column; dividing by (the pivot) gives .
From row 2: .
From row 1: .
Assemble the solution:
When applying , the augmented column entry must also be updated: . Applying the operation only to the coefficient columns while leaving unchanged introduces an error that propagates silently through all subsequent steps. The resulting "solution" satisfies the modified system, not the original one.
03 · Gauss-Jordan Elimination and RREF
Gauss-Jordan continues where Gaussian elimination stops, eliminating upward as well to reach RREF.
Scale row 1 to create pivot = 1: : .
Matrix: .
Eliminate below pivot :
: . : .
Matrix: .
Row 3 is all zeros — it contributes no constraint and indicates a free variable.
Eliminate above pivot (Gauss-Jordan step):
: .
RREF: .
Identify pivots and free variables: pivots in columns 1 and 2. Column 3 has no pivot — is a free variable.
Write solution directly from RREF: row 1: . Row 2: .
04 · Rank and the Rank-Nullity Theorem
The rank of a matrix is the number of pivot positions in its REF (or RREF — both give the same count). It measures how much of the output space the matrix can reach.
For :
Rank-Nullity Theorem:
The total number of columns equals the number of pivot columns plus the number of free columns.
is already in RREF.
Pivot positions: and — columns 1 and 3. .
Free columns: 2 and 4 — so and are free variables. .
Check: ✓ ( has 4 columns).
A zero row (all entries zero, including the augmented column) means a redundant equation — it adds no constraint and contributes no free variable. It is the zero rows that the rank-nullity theorem counts through the pivot columns, not through the zero rows themselves. The number of free variables equals , counting columns, not rows.
05 · Consistency via Rank
The rank of compared to the rank of determines whether the system is consistent.
If , then the augmented column introduced a new pivot — meaning cannot be expressed as a linear combination of 's columns — and the system is inconsistent.
When consistent: if (no free variables), the solution is unique. If , there are free variables and infinitely many solutions.
A risk factor model has 3 factors and 4 constraints on factor exposures. The exposure matrix row-reduces to . Two of the 4 constraints are redundant. The nullity is — one degree of freedom remains in factor allocation. Every basis portfolio that satisfies the constraints lies on a one-dimensional affine subspace.
06 · Practice Exercises
Work column by column. In each column, find the pivot (first nonzero entry from the top in that column). Eliminate all entries below it. Move to the next column.
Augmented: .
: . : .
Matrix: .
(convenient): .
: . REF reached.
Back-sub: . . .
Solution: .
Apply Gaussian elimination to reach REF, then back-substitute: ; ; . Show every row operation.
After reaching REF, continue with upward elimination to clear entries above each pivot. Then scale each pivot row so the pivot equals 1.
Start: .
: . : . : .
: . This gives row , i.e. . Inconsistent.
The system has no solution. — the augmented column introduced a new pivot.
Apply Gauss-Jordan elimination to reach RREF: ; ; . Show every step. If the system is inconsistent, identify which row reveals the contradiction.
Row reduce to RREF. Identify pivot columns (they determine the basic variables) and free columns (they determine the free variables). Each free variable gets its own parameter .
.
: . Matrix: .
: . Scale by : .
: . RREF: .
Pivots in columns 1, 3. Free variables: , . Row 2: . Wait — this is the homogeneous augmented form with .
For : RREF of . Same row ops. from . . Free: .
, . Check: ✓.
For : (a) Find the RREF of . (b) State and . (c) Verify the rank-nullity theorem.
For the system to have a unique solution, (no free variables) and the system must be consistent. Row reduce and find the condition on .
.
: . : .
For unique solution: row 3 must give a pivot, so .
If : row 3 is — free variable, infinitely many solutions. If : three pivots, unique solution.
Condition for unique solution: .
For what values of does the system ; ; have a unique solution? Row reduce and identify the condition on .
The rank of a matrix equals the number of pivot columns. Count pivots in the RREF. Compare the rank to the number of columns and rows.
. Rows 2 and 3 are and times row 1.
: . : . : . RREF: .
. . The null space has dimension 2.
: , so with , free. .
Find the rank and nullity of . Then find a basis for .
A factor model is a system where is the factor exposure matrix and is the target factor return vector. Row reduce the augmented matrix .
, .
Augmented: . : . : .
RREF: . free. . .
Solution: . The free parameter represents a portfolio in the null space of — a factor-neutral overlay. Any value of achieves the same factor exposures. A risk manager would choose to minimise residual variance.
A three-factor model assigns factor exposures via where and target exposures . Find all weight vectors achieving these exposures. Interpret the free parameter.
07 · Summary
| Term | Definition |
|---|---|
| REF | Staircase pattern: each leading entry to the right of the one above. Zeros below each pivot. |
| RREF | REF plus: each pivot equals 1, and is the only nonzero in its column. Unique for every matrix. |
| Pivot | Leading nonzero entry in a row of the REF. Determines a basic variable. |
| Free variable | Unknown corresponding to a non-pivot column. Can take any value . |
| Rank | Number of pivots in REF/RREF. . |
| Nullity | . Number of free variables. Dimension of . |
| Rank-nullity | (number of columns). Always. |
| Consistency | Consistent . |
| Unique solution | Consistent and . No free variables. |
Next: Determinants — the single number attached to a square matrix that reveals whether it is invertible and measures the scaling of volume under the linear transformation it represents.