Home›Courses›Linear Algebra›Week 1 · Lecture 3
← Lecture 2
On this pageRecall·Rank Facts·RREF·Gauss–Jordan·Homogeneous·Linear Combinations·Geometry
Lecture 4 →
MATH-120 · Linear Algebra · Lecture 310 June 2026

RREF, Homogeneous Systems & Linear Combinations

Completing the elimination story — then meeting the two most fundamental ideas in linear algebra

§1Quick Recall

Last two lectures we built the full machinery of Gaussian elimination. Before we push further, let us nail down a few facts that are easy to forget but come up in every problem.

REF
Leading 1s, staircase right, zero rows at bottom. Produced by Gaussian elimination.
Rank
Number of pivots (leading 1s) in REF. Equals the number of nonzero rows.
Consistency
rank(A) = rank(A|b) ⟺ consistent. Unique iff also equals n variables.

§2Rank Bounds & Full Rank

Rank bound

For any $m \times n$ matrix $A$, the rank satisfies $\operatorname{rank}(A) \le \min(m, n)$. The pivots live in distinct rows (at most $m$) AND in distinct columns (at most $n$), so neither limit can be exceeded.

Full rank

A matrix has full rank when $\operatorname{rank}(A) = \min(m, n)$ — as large as possible. A square $n \times n$ matrix with $\operatorname{rank}(A) = n$ is called full rank (or nonsingular). This turns out to be equivalent to it having an inverse — something we will prove properly in a later lecture.

Example 1Reading rank bounds

(a) A $3 \times 5$ matrix: $\operatorname{rank} \le \min(3,5) = 3$. At most 3 pivots, however many columns there are.

(b) A $6 \times 2$ matrix: $\operatorname{rank} \le \min(6,2) = 2$. Tall matrices are always bounded by their column count.

(c) $I_4$ (the $4 \times 4$ identity): rank $= 4 = \min(4,4)$ — full rank. It already is in REF with four pivots.

⚠️
REF is NOT unique — but the pivot count is
Different sequences of row operations on the same matrix can produce different row-echelon forms. The entries outside the pivot positions can vary. However, no matter which valid sequence you choose, you will always land on the same number of pivots in the same columns. The pivot columns — and hence the rank — are an intrinsic property of the matrix, not of the method.

Here is a concrete demonstration. We apply two different elimination strategies to the same matrix and see two valid but different REFs:

Example 2Two different REFs of the same matrix

Start with $A = \begin{pmatrix} 2 & 4 & 6 \\ 1 & 2 & 4 \\ 3 & 6 & 10 \end{pmatrix}$.

Route 1 — scale first: $\tfrac{1}{2}R_1$, then $R_2 - R_1$, $R_3 - 3R_1$, then $R_3 - R_2$:

$$A \xrightarrow{\tfrac{1}{2}R_1} \begin{pmatrix}1&2&3\\1&2&4\\3&6&10\end{pmatrix} \xrightarrow{R_2-R_1,\,R_3-3R_1} \begin{pmatrix}1&2&3\\0&0&1\\0&0&1\end{pmatrix} \xrightarrow{R_3-R_2} \underbrace{\begin{pmatrix}1&2&3\\0&0&1\\0&0&0\end{pmatrix}}_{\textbf{REF}_1}$$

Route 2 — swap first: $R_{12}$, then $R_2 - 2R_1$, $R_3 - 3R_1$, then $-\tfrac{1}{2}R_2$:

$$A \xrightarrow{R_{12}} \begin{pmatrix}1&2&4\\2&4&6\\3&6&10\end{pmatrix} \xrightarrow{R_2-2R_1,\,R_3-3R_1} \begin{pmatrix}1&2&4\\0&0&-2\\0&0&-2\end{pmatrix} \xrightarrow{-\tfrac{1}{2}R_2,\,R_3-R_2} \underbrace{\begin{pmatrix}1&2&4\\0&0&1\\0&0&0\end{pmatrix}}_{\textbf{REF}_2}$$

$\textbf{REF}_1 \ne \textbf{REF}_2$ (different entries in column 3, row 1). But both have pivots in columns 1 and 3 — so rank = 2 in both cases. The pivot count and pivot columns are the same. ✓

Practical tricks for faster row reduction

Gaussian elimination always works, but smart choices save significant effort. Here are the most useful ones:

Example 3Trick 1 — Swap to put the sparsest row on top

Consider $\begin{pmatrix}1&2&13&11&7\\2&-1&1&1&0\\1&0&0&1&3\end{pmatrix}$. Naïvely, we'd use row 1 as the pivot and compute $R_2-2R_1$, $R_3-R_1$ — but row 1 has five nonzero entries, meaning every subtraction touches five numbers.

Better: apply $R_{13}$ (swap rows 1 and 3) first. Now row 1 is $(1,0,0,1,3)$ — three zeros. The operation $R_2-2R_1$ only modifies the two nonzero columns; $R_2 - R_1$ similarly cheap. Fewer nonzeros in the pivot row = fewer multiplications in every subsequent step.

$$\begin{pmatrix}1&2&13&11&7\\2&-1&1&1&0\\1&0&0&1&3\end{pmatrix}\xrightarrow{R_{13}}\begin{pmatrix}1&0&0&1&3\\2&-1&1&1&0\\1&2&13&11&7\end{pmatrix}$$

Eliminating column 1: $R_2-2R_1$ and $R_3-R_1$ now only change 2 and 4 entries respectively, instead of 5. The savings compound as the matrix grows.

★ Challenge 4More tricks to keep in mind

Trick 2 — Avoid fractions as long as possible. If the pivot is $2$, you can scale $R_1 \to \tfrac{1}{2}R_1$ immediately, but this introduces fractions into every other entry. Often it is cleaner to use the operation $R_2 - 2R_1$ to zero out the entry below first, then scale at the end. Only make the pivot a leading 1 when you are ready to move to the next column.

Trick 3 — Look for a row with a 1 entry and put it on top. A pivot of $1$ requires no scaling, saving one entire step per pivot column.

Trick 4 — Use integer multiples before fractions. If you need to zero out entry $3$ in column 1 with pivot $2$: instead of scaling $\tfrac{1}{2}R_1$ and then subtracting, do $2R_3 - 3R_1$ directly (this keeps integers). The operation $R_i \to 2R_i - 3R_j$ is a valid row operation even though it scales $R_i$ — it is a combination of "multiply" and "add a multiple."

Trick 5 — Zero columns are free. A column of all zeros never produces a pivot. Skip it immediately and move to the next column.

§3Reduced Row-Echelon Form — the Overachiever

💪
REF's big brother
If REF is a tidy bedroom, RREF is a bedroom with colour-coded labels on every drawer, Marie Kondo'd to perfection. It does more work than required — but the reward is that the solution reads off instantly, with zero back-substitution.
Reduced Row-Echelon Form (RREF)

A matrix is in reduced row-echelon form (RREF) if it satisfies all three REF conditions, plus:

4. Each leading 1 (pivot) is the only nonzero entry in its entire column — zeros above it as well as below.

Every matrix has a unique RREF — unlike REF. This is one reason RREF is theoretically important: it is a canonical representative of the matrix's row space.

Example 5Recognising RREF — and spotting the difference
In RREF ✓

$$\begin{pmatrix}1&0&0&2\\0&1&0&-3\\0&0&1&5\end{pmatrix}$$

Each pivot column is a standard basis vector. Read off: solution is immediate.

In REF but NOT RREF ✗

$$\begin{pmatrix}1&2&-1&3\\0&0&1&-1\\0&0&0&0\end{pmatrix}$$

REF: staircase ✓, leading 1s ✓. But row 2's pivot (col 3) has nonzero entry above it.

Example 6Benefits of RREF in practice

Benefit 1 — No back-substitution. In RREF, each pivot variable is immediately expressed in terms of free variables. No substitution chain needed.

Benefit 2 — Uniqueness. Every matrix has exactly one RREF. Comparing two matrices' RREFs tells you whether they have the same row space.

Benefit 3 — Reading off the null space. The free-variable columns of RREF directly give the null space of $A$ — fundamental for solving $Ax = 0$, coming shortly.

Benefit 4 — Inverting matrices. The RREF of $(A \mid I)$ gives $(I \mid A^{-1})$ when $A$ is invertible — a clean algorithm we will use in Chapter 2.

§4The Gauss–Jordan Reduction Method

Gauss–Jordan reduction

Gauss–Jordan reduction extends Gaussian elimination: after reaching REF (the forward pass — working top to bottom), continue with a backward pass — working bottom to top, using each pivot to zero out all entries above it (not just below). The result is RREF. The solution then reads off directly: no back-substitution required.

The two passes:

Forward pass (Gaussian)
Left to right, top to bottom. Create each pivot; zero everything below it. Produces REF.
Backward pass (Jordan)
Right to left, bottom to top. Use each pivot to zero everything above it. Produces RREF.
Example 7Gauss–Jordan from start to RREF

Solve $\begin{cases} x + 2y - z = 1 \\ 2x + y + z = 8 \\ x - y + 2z = 5 \end{cases}$ by Gauss–Jordan.

$$\left(\begin{array}{ccc|c}1&2&-1&1\\2&1&1&8\\1&-1&2&5\end{array}\right)\xrightarrow{R_2-2R_1,\,R_3-R_1}\left(\begin{array}{ccc|c}1&2&-1&1\\0&-3&3&6\\0&-3&3&4\end{array}\right)$$

$$\xrightarrow{-\tfrac{1}{3}R_2}\left(\begin{array}{ccc|c}1&2&-1&1\\0&1&-1&-2\\0&-3&3&4\end{array}\right)\xrightarrow{R_3+3R_2}\left(\begin{array}{ccc|c}1&2&-1&1\\0&1&-1&-2\\0&0&0&-2\end{array}\right)$$

The bottom row reads $0 = -2$. No solution — inconsistent. Gauss–Jordan stops here: there is nothing to RREF. Notice: $\operatorname{rank}(A) = 2 < 3 = \operatorname{rank}(A\mid b)$.

Example 8Gauss–Jordan — unique solution
★ Challenge 9Gauss–Jordan — infinite solutions
⚠️ NEVER divide by an unknown during row operations

It is tempting, when a row contains $ax + by = c$ with $a$ unknown, to "divide by $a$" to get a leading 1. Do not do this without knowing $a \ne 0$. If $a = 0$, you have divided by zero — the operation is undefined and everything downstream is garbage.

You may only multiply a row by a nonzero constant. If $a$ is a symbol (like in Exercise 1.3.2), you must consider the case $a = 0$ separately, or avoid dividing altogether until you have established $a \ne 0$. This caution will save you from systematic errors in parametric problems.

§5Homogeneous Systems — Welcome to the Scariest Room

Before we define homogeneous systems properly, I want to show you one first.

The scariest system you have ever seen — what is its solution?

Four variables, extreme coefficients, nested exponentials. Look at the right-hand side very carefully before panicking.

$e^{\pi^{e^{\ln \pi}}} x_1 \;-\; 10^{10^{10}} x_2 \;+\; \sqrt[7]{e^{\pi^2}} \, x_3 \;-\; \dfrac{\pi^e}{e^{\pi}} x_4 \;=\; 0$
$10^{100} x_1 \;+\; e^{e^{e^e}} x_2 \;-\; \pi^{\pi^\pi} x_3 \;+\; \sqrt{2}^{\sqrt{3}} x_4 \;=\; 0$
$\dfrac{e^{\ln 7}}{7^{\ln e}} x_1 \;-\; \pi^{1000} x_2 \;+\; e^{\sqrt{\pi}} x_3 \;+\; 10^{e^\pi} x_4 \;=\; 0$
$\ln(\pi^e) x_1 \;+\; e^{\pi \ln 2} x_2 \;-\; \pi^{e^2} x_3 \;+\; \sqrt[3]{e^{\pi^3}} x_4 \;=\; 0$
Can you tell me one solution to this system — without doing any work?

Look at every equation: the right-hand side is zero in all four. Now try $x_1 = x_2 = x_3 = x_4 = 0$. Every equation becomes $(\text{something}) \cdot 0 + (\text{something}) \cdot 0 + \cdots = 0$. True. Every time. No matter what the coefficients are.

Welcome to the world of homogeneous systems.

Homogeneous system

A system $AX = b$ is homogeneous when $b = 0$ — that is, when every right-hand side is zero. It is written $AX = 0$ and also called the null system of $A$.

The solution $X = 0$ (all variables zero) is called the trivial solution and always exists. Any other solution is called a non-trivial solution.

🔑
No-solution is impossible for a homogeneous system
For $AX = b$ with $b \ne 0$, inconsistency is possible. But $AX = 0$ always has $X = 0$. So the only question is: is $X = 0$ the only solution, or are there non-trivial ones? The trichotomy collapses: a homogeneous system has either exactly one solution ($X = 0$ only) or infinitely many. That is it.

When does $AX = 0$ have a non-trivial solution?

When non-trivial solutions exist

For an $m \times n$ homogeneous system $AX = 0$: a non-trivial solution exists if and only if $\operatorname{rank}(A) < n$ (fewer pivots than variables). Equivalently, the REF has at least one free variable. If $\operatorname{rank}(A) = n$, the only solution is $X = 0$.

📌
Important corollary — more unknowns than equations
If $m < n$ (more unknowns than equations), then $\operatorname{rank}(A) \le m < n$, so rank is automatically less than $n$. Therefore: any homogeneous system with more unknowns than equations has a non-trivial solution.
⚠️ Don't guess — convert to REF first

You might look at a homogeneous system and think "the coefficients are small, probably only the trivial solution." That intuition is unreliable. Always reduce to REF to count pivots. If $\operatorname{rank}(A) = n$, only $X=0$; if $\operatorname{rank}(A) < n$, non-trivial solutions exist. No guessing.

★ Challenge 10Exercise 1.3.2 — For which a does the system have a non-trivial solution?

$$\begin{cases} x - 2y + z = 0 \\ x + ay - 3z = 0 \\ -x + 6y - 5z = 0 \end{cases}$$

§6Linear Combinations

We have been solving systems all lecture. But solving $AX = b$ can be read another way — as asking whether $b$ can be built as a weighted sum of the columns of $A$. This reading leads to one of the most important ideas in all of mathematics.

💡
Motivation — why linear combinations?
Think of vectors as arrows. You have a collection of arrows pointing in different directions. A linear combination asks: by stretching, compressing, flipping, and adding those arrows, can you reach a given target point? The answer determines whether the target is "reachable" from your starting collection — a question that underlies computer graphics, signal processing, machine learning, and quantum mechanics.
Linear combination

Given vectors $\mathbf{v}_1, \mathbf{v}_2, \dots, \mathbf{v}_k$, a linear combination is any expression $c_1\mathbf{v}_1 + c_2\mathbf{v}_2 + \cdots + c_k\mathbf{v}_k$ where $c_1, c_2, \dots, c_k$ are scalars (real numbers). The set of all linear combinations of $\mathbf{v}_1, \dots, \mathbf{v}_k$ is called their span.

Example 11Linear combinations in ℝ²

Let $\mathbf{u} = \begin{pmatrix}1\\0\end{pmatrix}$ and $\mathbf{v} = \begin{pmatrix}0\\1\end{pmatrix}$. Then $3\mathbf{u} + 5\mathbf{v} = \begin{pmatrix}3\\5\end{pmatrix}$. In fact $\begin{pmatrix}x\\y\end{pmatrix} = x\mathbf{u} + y\mathbf{v}$ for any real $x, y$. Every vector in $\mathbb{R}^2$ is a linear combination of $\mathbf{u}$ and $\mathbf{v}$. The pair $\{(1,0)^T,(0,1)^T\}$ is the standard basis — the coordinate axes themselves.

Example 12Not all sets span everything

Let $\mathbf{a} = \begin{pmatrix}1\\2\end{pmatrix}$ and $\mathbf{b} = \begin{pmatrix}2\\4\end{pmatrix} = 2\mathbf{a}$. Since $\mathbf{b}$ is a multiple of $\mathbf{a}$, every linear combination $c_1\mathbf{a} + c_2\mathbf{b} = (c_1+2c_2)\mathbf{a}$ stays on the line through $\mathbf{a}$. You can never reach $\begin{pmatrix}1\\0\end{pmatrix}$, for example. The span is a line, not all of $\mathbb{R}^2$.

Example 13Linear combinations in ℝ³

The standard basis of $\mathbb{R}^3$ is $\mathbf{e}_1=\begin{pmatrix}1\\0\\0\end{pmatrix}$, $\mathbf{e}_2=\begin{pmatrix}0\\1\\0\end{pmatrix}$, $\mathbf{e}_3=\begin{pmatrix}0\\0\\1\end{pmatrix}$. Any vector $\begin{pmatrix}a\\b\\c\end{pmatrix} = a\mathbf{e}_1 + b\mathbf{e}_2 + c\mathbf{e}_3$. The components of a vector are the coefficients in the linear combination with the standard basis. This is why we write vectors in column form: the column shows the coefficients.

🦟
The fly that invented the coordinate plane — René Descartes

The story goes that Descartes, notorious for sleeping until noon, was lying in bed one morning in 1637 when he noticed a fly crawling on the ceiling of his bedroom. He began wondering: how can I describe precisely where that fly is at any moment? He realised that if he knew the fly's distance from two walls, he could pin down its position completely. Two numbers, two walls — that was enough. He published the idea in an appendix to his Discourse on the Method and the coordinate plane — now called the Cartesian plane in his honour — was born.

The moral: the desire to locate a point precisely in space is exactly what linear combinations formalise. Every point in the plane is a linear combination of the two coordinate directions. Every point in space is a linear combination of three. Descartes, thanks to one lazy morning and one annoying fly, gave us the language.

★ Challenge 14Can V be written as a linear combination of X, Y, Z?

Let $X = \begin{pmatrix}2\\1\\-1\end{pmatrix}$, $Y = \begin{pmatrix}1\\0\\1\end{pmatrix}$, $Z = \begin{pmatrix}1\\1\\-2\end{pmatrix}$. Can $V = \begin{pmatrix}0\\1\\3\end{pmatrix}$ be written as $aX + bY + cZ = V$?

Setting up the system: $a\begin{pmatrix}2\\1\\-1\end{pmatrix}+b\begin{pmatrix}1\\0\\1\end{pmatrix}+c\begin{pmatrix}1\\1\\-2\end{pmatrix}=\begin{pmatrix}0\\1\\3\end{pmatrix}$ gives three equations.

§7Geometric Picture — Homogeneous vs Non-Homogeneous

Everything we have done algebraically has a clean geometric picture. Understanding it will make the rest of the course click.

In 2D — two lines

Homogeneous — Ax = 0

Every line $ax + by = 0$ passes through the origin $(0,0)$. The trivial solution $x=y=0$ is always on the line. Two such lines always share the origin, so they are always consistent. They either coincide (infinitely many solutions — a whole line through the origin) or cross only at the origin (unique solution = trivial only).

Non-homogeneous — Ax = b, b ≠ 0

The line $ax + by = c$ with $c \ne 0$ is a shift of the line $ax + by = 0$ — same slope, moved away from the origin. Two non-homogeneous lines may be parallel (no solution), cross at a single point (unique solution), or coincide (infinitely many). Inconsistency is possible — a new phenomenon compared to the homogeneous case.

Here is the same idea drawn out. On the left, two homogeneous lines — both forced through the origin. On the right, two non-homogeneous lines that have floated off the origin:

Homogeneous · both through origin
(0,0)

Both lines must pass through the origin — the trivial solution is always shared. They meet there (unique = trivial only) unless they coincide.

Non-homogeneous · shifted off origin
unique pt

Neither line need pass through the origin. They can cross at one point, run parallel (no solution), or coincide — inconsistency becomes possible.

Now make it move. The slider below controls the constant c in $x - y = c$. Watch the amber line slide while its homogeneous twin (dashed teal) stays pinned at the origin. The purple arrow is the shift — your particular solution $\mathbf{x}_p$:

Interactive · Drag c — watch the line slide off the origin
(0,0)xₚ=(2,0)
x − y = 2
c2

━━ dashed teal: the homogeneous line x − y = 0, locked through the origin.

━━ solid amber: the full line x − y = c. Same slope, shifted.

Set c = 0 and the two lines coincide — the shift vanishes and the full system is the homogeneous one.

This is the whole story of §7 in one picture: a non-homogeneous solution set is just the homogeneous one, picked up and carried by a particular solution. Set $c = 0$ and the carry distance shrinks to nothing — the two lines merge.

Generalisation to higher dimensions

Corresponding homogeneous system

For any system $AX = b$, the corresponding homogeneous system is $AX = 0$ — same coefficient matrix $A$, right-hand side replaced by zero. Geometrically, this is the "translation to the origin" of $AX = b$: every solution set of $AX = b$ (if it exists) is a translated copy of the solution set of $AX = 0$. One is a flat object through the origin; the other is the same flat object shifted by a particular solution.

Simple examples: a line away from the origin in $\mathbb{R}^2$ corresponds to a line through the origin with the same slope. A plane in $\mathbb{R}^3$ not through the origin corresponds to the parallel plane through the origin. The homogeneous version always has more symmetry — it includes the origin.

Closing question — think about this before Lecture 4

If we know a solution to $AX = 0$, can we guess a solution to $AX = b$?

Suppose $\mathbf{x}_0$ is any particular solution to $AX = b$ (we found one by Gaussian elimination), and $\mathbf{x}_h$ is any solution to the homogeneous system $AX = 0$. What is $A(\mathbf{x}_0 + \mathbf{x}_h)$? What does this tell you about the structure of the complete solution set of $AX = b$? Think about it — we will prove the answer rigorously next lecture.

Lecture 3 — complete
MATH-120 · Shoaib Khan · LUMS · June 2026
← Lecture 2Lecture 4 →