Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Same place, different directions
Your friend’s house is “3 blocks east, 2 blocks north”. But in a city where the streets run diagonally, the same house might be “2 blocks along Main Street, 1 block along Park Avenue”. The house hasn’t moved. Only the way you describe it has changed.
A set of directions you use to describe every place is called a basis, and the numbers you give are the coordinates.
How many directions do you need?
- On a line, like a railway track: 1 direction (forwards and backwards).
- On a flat map: 2 directions.
- In the air, for a drone: 3 directions.
That number is the dimension. You can’t describe a flat map with just one direction, and a third direction on a flat map would be wasted.
- 1. How many numbers do you need to describe any spot on a flat football field?
- 2. A submarine moving underwater needs how many directions?
- 3. If you change the directions you use, does the house move?
Level 1: Beginner
★★☆☆☆ Basic⏱ 15 minSecondary-school mathematics: arithmetic and elementary algebra.The standard basis
In , the standard basis is and . The point is , so its coordinates are just its components.
A different basis
Take and . To find the coordinates of , solve:
So : “2 steps along , 1 step along ”. It’s the same point with different numbers. Move the sliders and watch the tilted grid:
What makes a basis
A basis must (1) span the space, so it can reach everything, and (2) be independent, so no direction is wasted. Two parallel vectors aren’t a basis of the plane. Three vectors in the plane are too many.
- 1. Coordinates of (4, 6) in the basis (2, 0), (0, 3)?
- 2. Is {(1, 2), (2, 4)} a basis of ℝ²?
- 3. How many vectors are in any basis of ℝ⁴?
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 35 minUndergraduate students and practising engineers.Basis, coordinates and dimension
A basis of is a list that is linearly independent and spans . Every can then be written in exactly one way as . The numbers are its coordinates. The dimension is the number of basis vectors.
The change-of-basis matrix
Put the basis vectors into the columns of a matrix . Then
If the basis is orthonormal (unit vectors at right angles to each other), then . Each coordinate is then just a dot product, . No equations to solve, and no loss of accuracy. That’s why orthonormal bases are loved in numerical work (A2.4).
Many useful bases
| Basis | Space | Used for |
|---|---|---|
| Standard | raw features, pixels | |
| One-hot vectors | categories | class labels, token IDs |
| or | polynomials | regression, Taylor series (A3) |
| Sines and cosines | signals | Fourier analysis, audio, vibration (A10) |
| Principal components | data | PCA: the directions of greatest variance (D9) |
| A rotation matrix’s columns | 3D space | a robot’s body frame (R2) |
A robot at position facing angle carries its own basis: “forward” and “left” . These are the columns of the rotation matrix . A landmark the camera sees at in the robot frame is at in the world, and . Practice Code 5 implements this.
- 1. P = [[1, 1], [1, −1]] and [x]_B = (2, −1). Then x = ?
- 2. For an orthonormal basis Q, the coordinates of x are…
- 3. dim{x ∈ ℝ⁴ : x₁ + x₂ + x₃ + x₄ = 0} = ?
Level 3: Advanced
★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.Why dimension is well defined
All bases of a finite-dimensional space have the same number of vectors.
Proof. Let and be bases with and vectors. is independent and lies in , so by the exchange lemma (A2.1-3). Swapping roles gives . ∎
Coordinates with respect to a basis are unique.
Proof. If , then . Independence forces . ∎
Building bases
- Every spanning list contains a basis. Remove vectors that are combinations of earlier ones. The span doesn’t change, and what’s left is independent.
- Every independent list extends to a basis. Keep adding vectors not already in the span (Practice Code 4).
- So in an -dimensional space: any independent vectors form a basis, and so do any vectors that span.
Dimension of a sum
For subspaces of a finite-dimensional space: .
This is the subspace version of inclusion–exclusion (A1-1). Two planes through the origin in have , so they must share at least a line.
Changing the basis of a linear map
If a linear map has matrix in the standard basis, its matrix in the basis is . Matrices related this way are called similar: they describe the same map in different coordinates. The search for a basis where is as simple as possible, ideally diagonal, leads to eigenvectors (A2.3).
Exercise 3.1: What is the dimension of the space of symmetric 3 × 3 matrices?
A symmetric matrix is fixed by its diagonal (3 entries) and its upper triangle (3 entries), so the dimension is 6. A basis: .
- 1. Two distinct planes U, W through the origin in ℝ³. dim(U + W) = ?
- 2. dim of the solution space of y″ + y = 0?
- 3. A′ = P⁻¹AP means A and A′…
Level 4: Expert
★★★★★ Expert⏱ 30 minResearchers: original papers and open problems.Learning the basis: sparse coding
Instead of fixing a basis, we can learn one in which data looks simple. Olshausen and Field (1996) learned a dictionary of image patches in which each natural image patch is a sparse combination of a few atoms. The atoms that emerged look like the edge detectors in the primary visual cortex, and like the first-layer filters of CNNs. Such dictionaries are often overcomplete, with more atoms than dimensions (for example, 256 atoms for 64-pixel patches). Representations are then no longer unique, and sparsity picks one. The same idea underlies sparse autoencoders used to interpret LLMs today (F15).
A bad basis amplifies errors
If two basis vectors are almost parallel, solving for coordinates becomes ill-conditioned. A tiny error in can produce a huge change in . The worst-case amplification is , and the condition number measures it relative to (A2.4). This matters for:
- sensor fusion and calibration, where nearly collinear measurement directions make estimates unreliable;
- regression with nearly collinear features, where coefficients swing wildly;
- robot kinematics near singularities, where the Jacobian’s columns become nearly dependent and joint velocities explode (S5).
Frames in robotics: choosing a basis on purpose
The Denavit–Hartenberg convention (1955) attaches a coordinate frame to every link of a robot arm, chosen so each joint is described by just 4 numbers. Modern alternatives (product of exponentials, R3) avoid some of its pitfalls, but the principle is the same: a well-chosen basis makes the kinematics simple. In estimation, writing errors in the robot’s body frame rather than the world frame often makes filters behave much better, as in the “invariant” EKF (Barrau and Bonnabel, 2017; T5).
References
- J. Denavit and R. Hartenberg (1955). “A kinematic notation for lower-pair mechanisms based on matrices.” Journal of Applied Mechanics, 22.
- B. Olshausen and D. Field (1996). “Emergence of simple-cell receptive field properties by learning a sparse code for natural images.” Nature, 381.
- A. Barrau and S. Bonnabel (2017). “The invariant extended Kalman filter as a stable observer.” IEEE Transactions on Automatic Control, 62(4).
- S. Axler (2024). Linear Algebra Done Right, 4th ed. Chapter 2.
- G. Strang (2016). Introduction to Linear Algebra, 5th ed. Chapters 3.5 and 8.