Course contentsShow
← Machine Learning and Deep Learning
Lesson 13 of 3,5381. Mathematical Foundations for Machine LearningFree lesson

Rank of a Matrix

Learn matrix rank definition, how to compute it, and its relationship to linear independence.

Rank of a Matrix

What you'll learn: How to understand and compute the rank of a matrix, and why it matters for measuring information content.

What Is Matrix Rank?

The rank of a matrix is the maximum number of linearly independent column vectors (or row vectors) it contains. Think of rank as measuring how much "unique information" the matrix holds.

If you have a 4×5 matrix, you might think it contains 5 separate pieces of information (one per column). But if some columns are just combinations of others, the actual unique information is less. The rank tells you exactly how many truly independent columns exist.

Understanding Through Column Space

Remember that the column space is all possible linear combinations of a matrix's columns. The rank equals the dimension of this column space—literally counting how many basis vectors you need to span it.

For example:

  • If a 3×3 matrix has rank 3, all three columns are independent (full rank)
  • If it has rank 2, one column is a combination of the other two
  • If it has rank 1, all columns point in essentially the same direction

The Rank-Nullity Connection

Here's a powerful relationship: For an m×n matrix A:

rank(A) + dimension of null space = n

This means the columns either contribute to the column space (counted by rank) or they contribute redundancy (captured in the null space).

Why It Matters

In machine learning, rank reveals:

  • Whether your system of equations has a unique solution
  • If your data features are redundant
  • Whether a matrix inverse exists (only if rank equals matrix dimension)

Key Takeaway: The rank of a matrix counts its linearly independent columns, measuring how much non-redundant information it contains—critical for understanding solution uniqueness and data quality.