LINEAR ALGEBRA • MATRIX DECOMPOSITIONS & STRUCTURE

Rank & Nullity — Rank and Nullity

Discover how the rank and nullity of a matrix reveal everything about its solutions.

Historical Context & Motivation

When mathematicians first started working with systems of equations — sets of equations that share the same unknowns — they needed a way to figure out how many solutions existed. Could you find exactly one answer? Infinitely many? None at all? The ideas of rank and nullity grew out of this basic question. These two numbers tell you how "powerful" a matrix is and how much freedom the solutions have.

1750s
Early Systems of Equations
Mathematicians like Gabriel Cramer developed rules for solving systems of linear equations, laying the groundwork for understanding when solutions exist.
1840s
Cayley & Matrices
Arthur Cayley formalized the idea of a matrix — a rectangular grid of numbers. This gave mathematicians a compact tool for representing entire systems of equations at once.
1879
Sylvester Coins "Rank"
James Joseph Sylvester introduced the term rank to describe the number of truly independent rows or columns in a matrix.
1884
Nullity Emerges
Sylvester also defined nullity as the companion to rank, capturing the dimension of the set of solutions that map to zero.
1900s–Today
The Rank–Nullity Theorem
The elegant relationship rank + nullity = number of columns became a cornerstone theorem used in computer graphics, data science, engineering, and machine learning.

The central question these mathematicians faced still drives us today: given a matrix, what information does it actually carry, and what does it lose? Rank and nullity give us a precise answer.

Core Principles & Definitions

Before we dive in, let's make sure you're comfortable with a few key ideas. This lesson assumes you are familiar with vectors, systems of linear equations, and basic elementary row operations (swapping rows, scaling rows, and adding multiples of one row to another). A matrix is a rectangular grid of numbers arranged in rows (horizontal) and columns (vertical). When we talk about "solving" a matrix equation, we mean finding the values of unknowns that satisfy a system of linear equations. Rank and nullity are two numbers that describe what a matrix can and cannot do.

1

Rank

The rank of a matrix is the number of linearly independent rows (equivalently, linearly independent columns). A row is independent if it cannot be written as a combination of the other rows. Rank tells you how much "useful information" the matrix carries.
2

Nullity

The nullity counts the number of free variables — directions in which the matrix "collapses" inputs to zero. A higher nullity means more flexibility (more free parameters) in the solutions.
3

Null Space (Kernel)

The null space (also called the kernel) is the set of all vectors x satisfying Ax = 0 — every vector that the matrix sends to zero. Its dimension (the number of linearly independent vectors needed to describe it) equals the nullity.
4

Row Echelon Form

To find rank, we transform the matrix into row echelon form (REF) using elementary row operations. The result has a staircase pattern where each leading nonzero entry (called a pivot) lies to the right of the pivot in the row above. The number of nonzero rows equals the rank.
5

The Rank–Nullity Theorem

The big idea: Rank + Nullity = Number of Columns. This always holds for any matrix. If you know two of these three values, you can find the third.
KEY TAKEAWAY
Think of a matrix like a highway interchange. The rank is the number of lanes that actually carry traffic to different destinations. The nullity is the number of lanes that loop back to the starting point — they carry cars but don't go anywhere new. Together, rank + nullity always equals the total number of lanes (columns).

Visual Explanation

The following diagram shows how a 3×3 matrix transforms vectors. Some directions get mapped to meaningful outputs (those count toward the rank), while others get squashed to zero (those live in the null space and count toward the nullity).

The input space has three directions (e₁, e₂, e₃). After the matrix multiplies them, two directions produce real outputs (rank = 2), but one direction (e₃) gets squashed to the zero vector (nullity = 1). Notice that 2 + 1 = 3, the number of columns.

In the diagram, the left box represents all possible inputs (the domain has 3 dimensions because the matrix has 3 columns). The right box shows what the matrix produces as output. Two of the three input directions survive and produce distinct outputs — that's the rank. The third direction gets completely flattened to the origin (the zero vector). That collapsed direction belongs to the null space, and since one direction was lost, the nullity is 1.

Mathematical Framework

Let's put the ideas into precise formulas. Suppose you have a matrix A with m rows and n columns. We write this as an m × n matrix.

RANK DEFINITION
rank(A) = number of pivot columns in REF of A
A pivot column is a column that contains a leading nonzero entry (called a pivot) after you row-reduce the matrix. REF stands for Row Echelon Form.
NULLITY DEFINITION
nullity(A) = n − rank(A)
Here, n is the number of columns. The nullity equals the number of free variables — columns without pivots.
RANK–NULLITY THEOREM
rank(A) + nullity(A) = n
This always holds for any m × n matrix. The total number of columns is split between pivot columns (rank) and free columns (nullity).

To find the rank in practice, you row-reduce the matrix using elementary row operations: swapping rows, multiplying a row by a nonzero constant, or adding a multiple of one row to another. Once the matrix is in row echelon form (a staircase pattern where each leading entry is to the right of the one above it), you count the nonzero rows. That count is the rank. The leftover columns — the ones without leading entries — correspond to free variables, and their count is the nullity.

💡 Remember
Row operations do not change the rank or nullity of a matrix. You're rearranging the information, not destroying it. That's why row reduction is a reliable way to compute these values.

Finding Rank & Nullity Step by Step

The best way to understand rank and nullity is to see row reduction in action. The diagram below walks through the transformation of a 3 × 4 matrix into row echelon form, highlighting pivot positions and free variables at each stage.

A 3 × 4 matrix is row-reduced in three steps. The final row echelon form reveals 2 pivot columns (rank = 2) and 2 free columns (nullity = 2), confirming 2 + 2 = 4 columns.

Notice how the staircase pattern in the row echelon form tells the whole story. Each step in the staircase marks a pivot, and each column that doesn't have a stair step is free. The bottom row of all zeros means that the third original row was just a linear combination of the first two — it carried no new information.

Worked Example

Let's find the rank and nullity of the following matrix and verify the Rank–Nullity Theorem.

Finding Rank and Nullity of a 3 × 3 Matrix
1
Step 1 — Write the MatrixConsider the matrix A = ⎡ 1 2 3 ⎤ ⎢ 2 4 6 ⎥ ⎣ 1 3 5 ⎦. This is a 3 × 3 matrix, so it has n = 3 columns.
2
Step 2 — Perform Row Reduction (R₂ − 2R₁ and R₃ − R₁)Subtract 2 times Row 1 from Row 2, and subtract Row 1 from Row 3. This gives: ⎡ 1 2 3 ⎤ ⎢ 0 0 0 ⎥ ⎣ 0 1 2 ⎦. Notice that Row 2 became all zeros — that means the original Row 2 was exactly twice Row 1.
3
Step 3 — Swap Rows to Get Proper StaircaseSwap Row 2 and Row 3 to put the nonzero row higher: ⎡ 1 2 3 ⎤ ⎢ 0 1 2 ⎥ ⎣ 0 0 0 ⎦. Now the matrix is in row echelon form with a clear staircase pattern.
4
Step 4 — Count Pivots and Free VariablesThere are 2 nonzero rows, with pivots in Column 1 and Column 2. Column 3 has no pivot, so it corresponds to a free variable.
Rank = 2 (2 pivot columns)
5
Step 5 — Calculate Nullity and VerifyNullity = n − rank = 3 − 2 = 1. There is one free variable (Column 3), meaning the null space is one-dimensional — any solution to Ax = 0 can be written as a scalar multiple of a single vector.
Nullity = 1 and 2 + 1 = 3 = n ✓

Rank vs. Nullity — What Each Tells You

Rank and nullity are two sides of the same coin. One measures what a matrix preserves, while the other measures what it destroys. Understanding both helps you predict solutions to systems of equations.

Comparing the roles of rank and nullity
FeatureRankNullity
What it countsLinearly independent rows/columns (pivot columns)Free variables (non-pivot columns)
MeaningHow much information the matrix carriesHow much freedom the solutions have
If it equals n (columns)Matrix has full column rank; Ax = b has at most one solutionNot possible (nullity can't exceed n)
If it equals 0Matrix is the zero matrixOnly the trivial solution x = 0 exists
High value means…The matrix is "powerful" — maps to many directionsMany solutions — lots of inputs get crushed to zero
🔑 WHY THIS MATTERS
When you solve a system of equations Ax = b, the rank tells you whether a solution exists, and the nullity tells you how many solutions there are. If the nullity is 0, there's at most one unique solution. If the nullity is greater than 0, there are infinitely many solutions (a whole family of them). Think of it like a lock: rank 0 nullity means one key fits, but positive nullity means a master key exists.

Connections to Advanced Ideas

Rank and nullity are foundational ideas that connect to many advanced topics in linear algebra and beyond. The table below shows how these concepts extend into more powerful tools you will encounter in college-level courses. Each advanced topic requires additional prerequisites — the table is a preview of where these ideas lead, not an expectation that you master them now.

From basics to advanced linear algebra
Concept You KnowAdvanced ExtensionWhat Changes
Rank (number of pivots)Dimension of Column Space (image)Same count, but now interpreted as the dimension of the subspace spanned by the columns of A in the output
Nullity (free variables)Dimension of the Kernel (null space)Studied as a vector subspace; a basis for it gives all solutions to Ax = 0
Rank–Nullity TheoremFundamental Theorem of Linear AlgebraFour subspaces are linked: column space, null space, row space, and left null space
Row echelon formSingular Value Decomposition (SVD)A more powerful factorization that reveals not just rank but how much each independent direction is scaled by the matrix

In data science and machine learning, rank tells you how many truly independent features your dataset contains, which helps reduce complexity. In computer graphics, rank determines whether a transformation (like a rotation or projection) preserves all three dimensions or flattens objects. The Rank–Nullity Theorem is one of those ideas that keeps showing up everywhere once you know where to look.

Practice Problems

PROBLEM 1CONCEPTUAL
A 4 × 6 matrix has rank 3. What is its nullity? Explain in your own words what the nullity tells you about the solutions to the system Ax = 0.
PROBLEM 2BASIC CALCULATION
Find the rank and nullity of the matrix A = ⎡ 1 0 2 ⎤ ⎢ 0 1 3 ⎥ ⎣ 0 0 0 ⎦. (This matrix is already in row echelon form.)
PROBLEM 3INTERMEDIATE
Row-reduce the matrix B = ⎡ 1 3 5 7 ⎤ ⎢ 2 6 10 14 ⎥ ⎣ 0 1 2 3 ⎦ and find its rank and nullity.
PROBLEM 4APPLIED
A network of three sensors monitors temperature, humidity, and wind speed. Their readings over four time periods produce the data matrix D (3 × 4). After row reduction, you find rank(D) = 2. What does this tell you about the sensors? How many independent pieces of data do the four time periods really provide?
PROBLEM 5CRITICAL THINKING
Can a 5 × 3 matrix have rank 4? Can it have nullity 4? Explain your reasoning for each case using the Rank–Nullity Theorem.

Lesson Summary

The rank of a matrix is the number of pivot columns (or nonzero rows) in its row echelon form, representing how many linearly independent pieces of information the matrix contains. The nullity counts the free variables — columns without pivots — telling you how many dimensions get "crushed" to zero and how much freedom the solutions to Ax = 0 have.

The Rank–Nullity Theorem ties everything together: rank + nullity = n (the number of columns). To find these values, row-reduce the matrix, count the pivots for rank, and subtract from n for nullity. This theorem connects to the Fundamental Theorem of Linear Algebra and appears throughout data science, engineering, and computer graphics whenever we need to understand how transformations preserve or destroy information.

Varsity Tutors • Linear Algebra • Rank & Nullity