Vector Spaces, Span, Basis & Dimension

Linear Algebra Fundamentals

Chapter 8 · Vector Spaces, Span, Basis & Dimension

This chapter is the most abstract in the course, so it stays deliberately concrete: no axioms, no formal proofs — just the four ideas (span, linear independence, basis, dimension) explained through the same kind of worked, checkable examples used throughout, reusing Chapter 6's row reduction and Chapter 7's determinant as the actual tools that answer these questions.

Linear Combinations & Span

A linear combination of vectors is just Chapter 2's addition and scalar multiplication, applied together: c₁v₁ + c₂v₂ + ... for any scalars c₁, c₂, .... The span of a set of vectors is the set of every linear combination reachable from them — everywhere those vectors, scaled and combined in every possible way, can reach.

VectorsTheir span
A single nonzero vector, e.g. [2, 1]The entire line through the origin and [2, 1] — every scalar multiple of it
Two non-parallel vectors, e.g. [2, 1] and [1, 3]The entire 2D plane — any point [x, y] can be reached by some combination
Two parallel vectors, e.g. [2, 4] and [1, 2]Still just a line — the second vector adds nothing new, since [1, 2] = 0.5 × [2, 4]

Linear Independence — Testing With Chapter 7's Determinant

A set of vectors is linearly independent if none of them is redundant — none can be written as a combination of the others. For exactly two vectors in 2D, Chapter 7's determinant gives an instant test: nonzero determinant means independent (and their span is the whole plane); zero determinant means dependent (redundant — their span collapses to a line).

Pairdet (as a matrix of rows)Independent?
v₁ = [2, 1], v₂ = [1, 3]2(3) − 1(1) = 5Yes — spans all of R²
w₁ = [2, 4], w₂ = [1, 2]2(2) − 4(1) = 0No — w₂ = 0.5 × w₁, redundant

Linear Independence for More Vectors — Chapter 6's Row Reduction

The determinant shortcut only works for exactly two vectors in 2D. For any other number of vectors, or higher dimensions, the general tool is exactly Chapter 6's row reduction: stack the vectors as rows of a matrix and eliminate. Every row that reduces to all zeros represents a vector that added no new information — it was already reachable from the others. The number of surviving nonzero rows is called the rank of the set.

Worked example: u₁ = [1, 2, 1], u₂ = [0, 1, 2], u₃ = [1, 3, 3]. Notice first that u₁ + u₂ = [1, 3, 3] = u₃ exactly — a strong hint this set is dependent.

StepRows
Start[1,2,1] / [0,1,2] / [1,3,3]
R3 → R3 − R1[1,2,1] / [0,1,2] / [0,1,2]
R3 → R3 − R2[1,2,1] / [0,1,2] / [0,0,0]

Row 3 reduced to all zeros — confirming u₃ really was redundant. The rank is 2, not 3: this set of three vectors spans only a 2D plane sitting inside 3D space, not the full 3D space.

Basis

A basis for a space is a set of vectors that is both linearly independent and spans the entire space — the minimal, non-redundant "building block" set that reaches everywhere. The simplest example is the standard basis: i = [1, 0] and j = [0, 1] for the 2D plane — independent (det = 1 ≠ 0), and obviously spanning everything, since any point [x, y] = x·i + y·j.

Testing whether c = [1, 0, 0], d = [0, 1, 0], e = [1, 1, 1] form a basis for 3D space, by row reduction:

StepRows
Start[1,0,0] / [0,1,0] / [1,1,1]
R3 → R3 − R1[1,0,0] / [0,1,0] / [0,1,1]
R3 → R3 − R2[1,0,0] / [0,1,0] / [0,0,1]

All three rows survive — rank 3, fully independent. Since there are exactly three independent vectors in 3D space, they automatically span all of it: {c, d, e} is a valid basis.

Dimension

A fact worth stating plainly, without a full proof
Every basis for a given space has exactly the same number of vectors — this number is the space's dimension. The 2D plane always needs exactly 2 independent vectors for a basis, never 1 (too few to reach everywhere) or 3 (the third is guaranteed redundant, per this chapter's own row reduction argument). This is why "dimension" isn't a vague description — it's a precise, countable property of a space, computed directly from its own basis size.
Rank vs. dimension — a distinction worth keeping straight
Dimension describes the space itself (2D, 3D, ...). Rank describes how many independent vectors a particular set actually contributes — which can be less than the space's own dimension, exactly as Chapter 8's own {u₁, u₂, u₃} example showed (rank 2, inside a 3-dimensional space). A set's rank is always less than or equal to the dimension of the space it lives in.

Span, Basis & Rank in Code

import numpy as np vectors = np.array([[1, 2, 1], [0, 1, 2], [1, 3, 3]]) print(np.linalg.matrix_rank(vectors)) # 2 — matches the hand row-reduction above basis_candidate = np.array([[1, 0, 0], [0, 1, 0], [1, 1, 1]]) print(np.linalg.matrix_rank(basis_candidate)) # 3 — full rank, a genuine basis for R^3

Hands-On Exercises

Exercise 1

Given a = [3, 1] and b = [6, 2], use the Chapter 7 determinant shortcut to determine whether they're linearly independent. If they're not, express b as a scalar multiple of a, and state what their span actually is (a line, or the whole plane).

📄 View solution
Exercise 2

Given p = [1, 1, 0], q = [0, 1, 1], r = [1, 2, 1], use row reduction (stacking them as rows and eliminating) to find the rank of this set. State whether they're linearly independent, and if not, express the redundant vector as a combination of the other two.

📄 View solution
Exercise 3

Given m = [2, 5] and n = [-1, 3], determine whether {m, n} forms a basis for the 2D plane. Show the calculation, and explain in one sentence why exactly two independent vectors are both necessary and sufficient for a basis of a 2-dimensional space — no more, no fewer.

📄 View solution

Chapter 8 Quick Reference

  • Linear combination: c₁v₁ + c₂v₂ + ...; span is the set of every linear combination reachable from a set of vectors
  • Linear independence, 2 vectors in 2D: nonzero determinant (Ch.7) — independent; zero determinant — dependent, redundant
  • Linear independence, general case: row-reduce (Ch.6) the vectors as rows; a row reducing to all zeros means that vector was redundant
  • Rank: the number of surviving nonzero rows after elimination — how many genuinely independent vectors a set actually contains
  • Basis: a linearly independent set that also spans the whole space — the minimal non-redundant building blocks
  • Dimension: the number of vectors in any basis for a space — always the same number, regardless of which basis is chosen
  • Rank ≤ dimension of the space; a set's rank being less than the space's dimension means that set doesn't span everything
  • Next chapter: Eigenvalues and eigenvectors