Skip to content
VidiMaster it, module by module
Module 1/Vector Spaces & Subspaces

Dimension

The dimension of a vector space is the number of vectors in any basis — a single number that counts its independent directions, equals the rank of any spanning set, and is the same no matter which basis you pick.

Before you start — give these a try

Attempting first primes your brain for the lesson — even if you miss. Nothing is graded or saved; it's just a warm-up.

Find the dimension of span⁡{(1,2,1),(2,4,2),(0,1,3)}\operatorname{span}\{(1,2,1),(2,4,2),(0,1,3)\} in R3\mathbb{R}^3.

True or False: In R3\mathbb{R}^3, any set of 44 vectors must be linearly dependent.

What you’ll be able to do

  • Define the dimension of a vector space as the number of vectors in any one of its bases, and state that dim⁡(Rn)=n\dim(\mathbb{R}^n)=n.
  • Explain why dimension is well-defined: any two bases of the same space contain the same number of vectors.
  • Compute the dimension of a span by finding the number of linearly independent vectors (the rank) via row reduction.
  • Determine the dimension of a subspace described by linear equations by counting independent constraints.
  • Use dimension to decide quickly when a set of vectors must be linearly dependent or cannot span.

In your course

· MATH2015 · Linear Algebra & Probability
§2.4 Bases, Dimension, and Coordinates
  • Definition 2.7Dimension, dim⁡(V)=n\dim(V)=n
  • Theorem 2.3Counting vs. the dimension
    If dim⁡V=n\dim V=n: more than nn vectors are always dependent, and fewer than nn can never span — so for exactly nn vectors you only need to check one of spanning / independence.
  • Theorem 2.6All bases have the same size
1

Dimension counts degrees of freedom

Before any formulas, here is the picture to carry in your head: dimension measures how many independent directions a space has, equivalently how many numbers you need to pin down a single point in it.

  • A line through the origin has one direction. Once you fix how far along the line you are (one number), the point is determined. It is 1-dimensional.
  • A plane through the origin has two independent directions. You need two numbers (how far in each direction) to locate a point. It is 2-dimensional.
  • All of Rn\mathbb{R}^n (the set of lists of nn real numbers (x1,…,xn)(x_1,\dots,x_n)) needs exactly nn coordinates, so it is nn-dimensional.

The subtle word is independent. If you offer three directions in a plane, one of them is redundant — it can be built from the other two — so the plane is still 2-dimensional, not 3. Dimension is the number of genuinely independent directions, with every redundancy removed. A basis is exactly a list of directions that is both non-redundant (linearly independent) and complete (spans the whole space), and the dimension is simply how many vectors are in that list.

2

The formal definition

Recall that a basis of a vector space VV is a set of vectors B={v1,…,vk}B=\{\mathbf{v}_1,\dots,\mathbf{v}_k\} that is

  1. linearly independent — no vector in BB is a linear combination of the others (the only way to write c1v1+⋯+ckvk=0c_1\mathbf{v}_1+\cdots+c_k\mathbf{v}_k=\mathbf{0} is c1=⋯=ck=0c_1=\cdots=c_k=0), and
  2. spanning — every vector in VV can be written as some linear combination c1v1+⋯+ckvkc_1\mathbf{v}_1+\cdots+c_k\mathbf{v}_k.

Definition. The dimension of a (finite-dimensional) vector space VV, written dim⁡(V)\dim(V), is the number of vectors in any basis of VV.

Key facts that follow immediately:

  • dim⁡(Rn)=n\dim(\mathbb{R}^n)=n. The standard basis e1=(1,0,…,0), e2=(0,1,0,…,0), …, en=(0,…,0,1)\mathbf{e}_1=(1,0,\dots,0),\ \mathbf{e}_2=(0,1,0,\dots,0),\ \dots,\ \mathbf{e}_n=(0,\dots,0,1) has exactly nn vectors, is independent, and spans Rn\mathbb{R}^n.
  • dim⁡({0})=0\dim(\{\mathbf{0}\})=0. The space containing only the zero vector has the empty set as its basis — zero vectors.
  • A space is called finite-dimensional when it has a basis with finitely many vectors; that number is its dimension. (Spaces that need infinitely many basis vectors are infinite-dimensional, but every example in this lesson is finite-dimensional.)

Notice the definition says "any basis." For this to make sense, every basis must have the same number of vectors — otherwise dim⁡(V)\dim(V) would be ambiguous. That is the content of the next section.

3

Why dimension is well-defined: all bases are the same size

The definition would be useless if one basis of R2\mathbb{R}^2 had 2 vectors and another had 3. Thankfully, this never happens.

Invariance of dimension. In a finite-dimensional vector space, any two bases have exactly the same number of vectors.

The engine behind this is a counting fact you should internalize, because it is useful on its own:

If a space VV has a basis of nn vectors, then any set of more than nn vectors in VV is linearly dependent, and any set of fewer than nn vectors cannot span VV.

Intuitively: a basis of size nn fixes the number of independent directions at nn. You can never fit more than nn independent vectors (so a bigger set must have a redundancy — it is dependent), and you can never reach every point with fewer than nn directions (so a smaller set cannot span). Squeeze these two bounds together and every basis is forced to have exactly nn vectors. (The classical argument that makes this precise is the replacement or exchange lemma, which swaps basis vectors for new ones one at a time.)

Why you care in practice: this gives instant answers.

  • Five vectors in R4\mathbb{R}^4? Must be dependent — 5>4=dim⁡(R4)5>4=\dim(\mathbb{R}^4).
  • Two vectors spanning R3\mathbb{R}^3? Impossible — 2<32<3.
  • Exactly nn vectors in Rn\mathbb{R}^n that are independent? They automatically span, so they are a basis (and vice versa).
4

Computing dimension: it equals the rank

Most problems give you a subspace in one of two forms. Here is how to read off its dimension in each.

Form 1 — a span (a spanning set is given). The subspace is W=span⁡{v1,…,vm}W=\operatorname{span}\{\mathbf{v}_1,\dots,\mathbf{v}_m\}. Then dim⁡(W)=number of linearly independent vectors among the vi=rank⁡.\dim(W)=\text{number of linearly independent vectors among the }\mathbf{v}_i=\operatorname{rank}. The rank is the maximum number of linearly independent vectors in the set. To find it:

  1. Form a matrix using the vectors as its rows.
  2. Row reduce to echelon form (Gaussian elimination).
  3. Count the nonzero rows (equivalently, the pivots). That count is the rank, and it is dim⁡(W)\dim(W).

Row operations never change the row space, so the number of nonzero rows is exactly the number of independent directions. Redundant vectors collapse to zero rows and drop out.

Form 2 — a subspace defined by linear equations. If W⊆RnW\subseteq\mathbb{R}^n is the solution set of a system of kk independent (non-redundant) homogeneous linear equations, then dim⁡(W)=n−k.\dim(W)=n-k. Each independent equation removes one degree of freedom. For example, one nontrivial equation like x+y+z=0x+y+z=0 in R3\mathbb{R}^3 cuts the dimension from 33 down to 3−1=23-1=2 (a plane). Two independent equations cut it to 3−2=13-2=1 (a line). Caution: the equations must be independent — two equations that are multiples of each other count as one constraint.

Sanity checks for any answer: a subspace of Rn\mathbb{R}^n always has dimension between 00 and nn; dimension 00 means W={0}W=\{\mathbf{0}\}, and dimension nn means W=RnW=\mathbb{R}^n.

Dimension (Definition)

For a finite-dimensional vector space VV, the dimension dim⁡(V)\dim(V) is the number of vectors in any basis of VV. In particular dim⁡(Rn)=n\dim(\mathbb{R}^n)=n and dim⁡({0})=0\dim(\{\mathbf{0}\})=0.

Intuition. A basis is a complete, non-redundant list of directions. Counting how many directions it takes to describe the whole space is exactly what 'dimension' should mean.
Invariance of Dimension

Any two bases of a finite-dimensional vector space contain the same number of vectors. Consequently, if dim⁡(V)=n\dim(V)=n, then every set of more than nn vectors in VV is linearly dependent, and every set of fewer than nn vectors fails to span VV.

Intuition. A space has a fixed number of independent directions. You can't pack in more independent vectors than that (extras become redundant), and you can't reach everywhere with fewer. Both pressures force every basis to the same size, so 'dimension' is a single well-defined number.
Dimension of a Span Equals Its Rank

For W=span⁡{v1,…,vm}W=\operatorname{span}\{\mathbf{v}_1,\dots,\mathbf{v}_m\}, the dimension dim⁡(W)\dim(W) equals the rank of the set — the maximum number of linearly independent vectors among the vi\mathbf{v}_i — found by forming the matrix with these vectors as rows and counting the nonzero rows (pivots) after row reduction.

Intuition. Row reduction strips away redundant vectors: dependent ones collapse to zero rows. What survives as nonzero rows is a count of the genuinely independent directions, which is precisely the dimension of what they span.

Worked examples

Example 1

Find the dimension of W=span⁡{v1,v2,v3}W=\operatorname{span}\{\mathbf{v}_1,\mathbf{v}_2,\mathbf{v}_3\} in R3\mathbb{R}^3, where v1=(1,2,3)\mathbf{v}_1=(1,2,3), v2=(2,4,6)\mathbf{v}_2=(2,4,6), and v3=(1,0,1)\mathbf{v}_3=(1,0,1).

  1. 1

    Choose the method. The subspace is given as a span, so by the theorem dim⁡(W)\dim(W) equals the number of linearly independent vectors among v1,v2,v3\mathbf{v}_1,\mathbf{v}_2,\mathbf{v}_3 — i.e. the rank. We find the rank by forming the matrix whose rows are these vectors and row-reducing.

  2. 2

    Set up the matrix. Writing each vector as a row gives A=[123246101].A=\begin{bmatrix} 1 & 2 & 3 \\ 2 & 4 & 6 \\ 1 & 0 & 1 \end{bmatrix}.

  3. 3

    Eliminate below the first pivot (the leading 11 in row 1). Replace row 2 with R2−2R1R_2-2R_1: (2,4,6)−2(1,2,3)=(0,0,0)(2,4,6)-2(1,2,3)=(0,0,0). Replace row 3 with R3−R1R_3-R_1: (1,0,1)−(1,2,3)=(0,−2,−2)(1,0,1)-(1,2,3)=(0,-2,-2). The matrix becomes [1230000−2−2].\begin{bmatrix} 1 & 2 & 3 \\ 0 & 0 & 0 \\ 0 & -2 & -2 \end{bmatrix}.

  4. 4

    Tidy into echelon form. Swap the zero row to the bottom so the pivots step down nicely: [1230−2−2000].\begin{bmatrix} 1 & 2 & 3 \\ 0 & -2 & -2 \\ 0 & 0 & 0 \end{bmatrix}. There are pivots in row 1 (the 11) and row 2 (the −2-2).

  5. 5

    Count the nonzero rows. Two rows are nonzero, so the rank is 22. Therefore dim⁡(W)=2\dim(W)=2.

  6. 6

    Interpret. The zero row came from v2−2v1=0\mathbf{v}_2-2\mathbf{v}_1=\mathbf{0}, i.e. v2=2v1\mathbf{v}_2=2\mathbf{v}_1 is redundant. The surviving independent directions are v1\mathbf{v}_1 and v3\mathbf{v}_3, and {v1,v3}\{\mathbf{v}_1,\mathbf{v}_3\} is a basis of WW. (Sanity check: 2≤32\le 3, so a dimension-2 subspace of R3\mathbb{R}^3 is perfectly reasonable — it is a plane through the origin.)

Answer. dim⁡(W)=2\dim(W)=2.
Example 2

Find the dimension of the subspace W={(x,y,z)∈R3:x+y+z=0}W=\{(x,y,z)\in\mathbb{R}^3 : x+y+z=0\}.

Example 3

Find the dimension of W=span⁡{(1,1,0,0),(0,1,1,0),(0,0,1,1),(1,2,2,1)}W=\operatorname{span}\{(1,1,0,0),(0,1,1,0),(0,0,1,1),(1,2,2,1)\} in R4\mathbb{R}^4.