Linear AlgebraVector Spaces

Dimension and Rank

Every basis has the same size; rank is the dimension of the column space.

Not started Jump to practice

A plane has many different bases, but every one of them has two vectors. That number, the same for every basis, measures the size of a subspace.

Key idea

Every basis of a subspace $H$ has the same number of vectors, called the dimension of $H$, $\dim H$. The rank of a matrix is $\dim \operatorname{Col} A$, the number of pivot columns; $\dim \operatorname{Nul} A$ is the number of free variables.

Why it works

Why can't one basis have 2 vectors and another 3? The key fact: if $p$ vectors span $H$, then any set of more than $p$ vectors in $H$ is dependent. Write each of the bigger set's vectors in terms of the $p$ spanning vectors; their weight vectors are more than $p$ vectors in $\mathbb{R}^p$, so they are dependent (more columns than rows), and the same dependence relation holds for the original vectors. So a basis (independent) can never be bigger than another basis (spanning), in either direction. They must be the same size.
Some dimensions.
SpaceDimension
$\mathbb{R}^n$$n$
A line through the origin$1$
A plane through the origin$2$
$\{\mathbf{0}\}$$0$ (the empty set is its basis)
$\mathbb{P}_n$, polynomials of degree at most $n$$n + 1$
$m \times n$ matrices$mn$

Worked example: Rank and nullity of a matrix

Find $\operatorname{rank} A$ and $\dim \operatorname{Nul} A$ for $A = \begin{bmatrix} 1 & 2 & -1 & 0 \\ 0 & 1 & 1 & 2 \\ 1 & 3 & 0 & 2 \end{bmatrix}$.
  1. Row reduce: $\begin{bmatrix} 1 & 0 & -3 & -4 \\ 0 & 1 & 1 & 2 \\ 0 & 0 & 0 & 0 \end{bmatrix}$.
  2. Two pivot columns: $\operatorname{rank} A = 2$.
  3. Four columns, two pivots, so two free variables: $\dim \operatorname{Nul} A = 2$.

Answer: Rank 2, nullity 2.

Worked example: Dimension of a span

Find the dimension of $$\operatorname{Span}\left\{\begin{bmatrix} 1 \\ 0 \\ 1 \end{bmatrix}, \begin{bmatrix} 2 \\ 1 \\ 3 \end{bmatrix}, \begin{bmatrix} -1 \\ 1 \\ 0 \end{bmatrix}, \begin{bmatrix} 0 \\ 2 \\ 2 \end{bmatrix}\right\}.$$
  1. These are the columns of the matrix in the first example, which has 2 pivots.
  2. So the span is 2-dimensional: a plane in $\mathbb{R}^3$, with basis $\{(1, 0, 1), (2, 1, 3)\}$ (the pivot columns).

Answer: $2$

Worked example: Dimension of a solution space

What is the dimension of the subspace of $\mathbb{R}^5$ given by $$x_1 - x_3 + 2x_5 = 0 \quad\text{and}\quad x_2 + x_4 = 0?$$
  1. It is the null space of $\begin{bmatrix} 1 & 0 & -1 & 0 & 2 \\ 0 & 1 & 0 & 1 & 0 \end{bmatrix}$, already in RREF.
  2. Two pivots, five columns: three free variables, so dimension $3$.

Answer: $3$

For a subspace given as a span, the dimension is the rank of the matrix whose columns are the spanning vectors. For a subspace given by equations, it is the number of free variables. These are the two ways subspaces usually appear, and both reduce to counting pivots.

Two consequences you can use right away. In a $p$-dimensional space, any $p$ independent vectors automatically span (so they form a basis), and any $p$ vectors that span are automatically independent. And a subspace of $\mathbb{R}^n$ never has dimension bigger than $n$.

The span of the four vectors in the second example is this plane: dimension 2, however many vectors you list.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 2 XP.

Loading practice…

Builds on

Leads to

Sources and further reading

  • Margalit and Rabinoff, Interactive Linear Algebra (Georgia Tech), §2.7 Basis and Dimension
  • MIT OpenCourseWare 18.06 Linear Algebra (Gilbert Strang, Spring 2010), Lecture 9: Independence, Basis, and Dimension
@teddyrookbook GitHub