skip to content

What does the rank-nullity theorem give for a 5x3 matrix of rank 2?

level: middleimportance: must knowfreq 55%

answer

  1. count columns, not rows
  2. rank plus nullity equals n
  3. rank is the column space dimension
  4. three minus two leaves one line
  5. ceiling is min of the two shapes

basics

~20 s

Rank-nullity says rank plus nullity equals the number of columns. A 5x3 matrix of rank 2 therefore has nullity 3 - 2 = 1: the vectors it sends to zero form a line through the origin in three-dimensional space.

solid answer

~50 s

The rank-nullity theorem states that for an m x n matrix A, rank(A) + dim(null(A)) = n, the number of **columns** - not the number of rows. Rank is the dimension of the column space, the span of the columns, which sits inside R^m; the nullspace is the set of x with Ax = 0 and sits inside R^n. For a 5 x 3 matrix of rank 2 the nullity is 3 - 2 = 1, so exactly one independent direction of the input space collapses to zero, and the columns span a two-dimensional plane inside R^5. The theorem also carries the ceiling rank <= min(m, n), since you cannot have more independent columns than columns, nor more than rows. A wide 3 x 5 matrix therefore has rank at most 3 and nullity at least 5 - 3 = 2.

go deeper

for a junior

Memorise the statement that rank plus nullity equals the number of columns and be able to substitute numbers such as 3 - 2 = 1 without hesitating over which dimension to use.

for a middle

Explain which space each term measures - column space in R^m, nullspace in R^n - and why the column count is the total being split between them.

for a senior

Use the theorem as an instant sanity check on data shapes: fewer independent directions than features guarantees a nullspace and a non-unique answer, not a bug to hunt.

for a principal

Frame it as a design constraint: when the effective number of independent directions falls short of the parameter count, the team chooses between reducing parameters, gathering data, or accepting that some quantities are not identifiable.

## The two spaces being counted An m x n matrix A is a map from R^n to R^m: it eats a vector with n entries and returns a vector with m entries. Two subspaces describe what that map does. - The **column space** (or image) is the span of A's columns: every vector of the form Ax. It lives in R^m. Its dimension is the **rank** of A. - The **nullspace** (or kernel) is the set of all x with Ax = 0. It lives in R^n. Its dimension is the **nullity**. The rank-nullity theorem ties them together: ``` rank(A) + dim(null(A)) = n = number of columns ``` ## Why it is the column count Both terms are budgeted out of the *input* side. Start with the n input directions. Some of them survive the map and produce independent output directions - that count is the rank. Every remaining input direction must be sent to zero, because there is nowhere else for it to go without adding to the rank. The two counts therefore partition n exactly. Nothing in this argument mentions m, which is why the row count never appears in the formula. The row count enters only through the ceiling rank <= m. This is the single most common slip in interviews: with a 5 x 3 matrix, candidates reach for 5 because it is the bigger number. The formula uses 3. ## The 5 x 3 example A is 5 x 3 with rank 2. - n = 3, so rank + nullity = 3. - nullity = 3 - 2 = 1. The nullspace is a **line** through the origin in R^3: one vector v (and all its multiples) satisfies Av = 0. - The column space has dimension 2. The three columns of A live in R^5 but span only a plane there - one of them is a combination of the other two. - Because the nullspace is non-trivial, A cannot be one-to-one: distinct inputs x and x + v produce the same output. ## The wide case: 3 x 5 Now A is 3 x 5, so n = 5 and rank <= min(3, 5) = 3. Rank-nullity gives ``` nullity = 5 - rank >= 5 - 3 = 2 ``` So the nullspace is at least a plane. This proves a fact worth carrying around: **a homogeneous system with more unknowns than equations always has non-zero solutions.** Five unknowns constrained by three equations cannot be pinned down; at least two directions of freedom remain, whatever the numbers are. ## Why rank <= min(m, n) Rank is the number of independent columns, so it cannot exceed n - there are only n columns to choose from. A theorem that surprises people the first time is that **row rank equals column rank**: the dimension of the span of the rows equals the dimension of the span of the columns. Since the rows are vectors in R^n and there are m of them, the same argument bounds the rank by m. Together: rank <= min(m, n). A matrix achieving that bound is called **full rank**; anything less is **rank deficient**. Row rank equalling column rank also means the row space and the column space always have the same dimension even though they usually live in different spaces (R^n versus R^m). ## A geometric reading Think of A as flattening R^n. The nullity counts how many directions get crushed to nothing; the rank counts how many survive as independent directions in the output. Flattening cannot create directions, only destroy them, and every input direction is either crushed or preserved. That accounting is the whole theorem. ## Using it as a sanity check Given only the shape of a matrix and its rank, you immediately know: whether the map can be one-to-one (only if nullity is 0, which needs rank = n), whether it can be onto R^m (only if rank = m), and how large the family of solutions to a consistent system will be (a set of dimension equal to the nullity). Those three readings cover most of what an interviewer is probing when they ask you to state the theorem and then hand you a shape and a rank.

  • Why does the theorem use the number of columns rather than the number of rows?
    Because both quantities it counts are budgeted out of the input side. The matrix maps R^n to R^m, so the nullspace is a subspace of R^n and the rank counts how many of the n input directions survive. Every input direction is either preserved or collapsed to zero, so the two counts must add to n. The row count only caps the rank.
  • What does the nullity of a 3x5 matrix tell you about solutions of Ax = 0?
    Rank is at most 3, so nullity is at least 5 - 3 = 2. There is at minimum a whole plane of non-zero vectors x with Ax = 0. That is the general fact: a homogeneous system with more unknowns than equations always has infinitely many solutions, so it can never determine a unique answer.
  • Can the row space and the column space of a matrix have different dimensions?
    No. Row rank always equals column rank, and that shared number is the rank. For a 5 x 3 matrix of rank 2, the column space is a plane in R^5 and the row space is a plane in R^3 - different ambient spaces, same dimension of two.

saying these in an interview costs you the question

  • Uses the row count in rank plus nullity
  • Says a rank-2 matrix has nullity 2 regardless of shape
  • Thinks row space and column space have different dimensions
  • Claims a tall matrix cannot have a nullspace

context