Linear Algebra · Theory · M3
M3-T7 — Basis and Dimension
A basis is the smallest set of directions that describes a space. The number of them is its dimension, the number of degrees of freedom.
How many independent ways can a robot move? How many numbers describe its pose? Those counts are dimensions, and a basis is a concrete set of independent directions that realises the count. This lesson makes both precise and ties them to the degrees of freedom of arms and bodies.
Learning objectives
After this lesson, you should be able to:
- Define a basis as an independent, spanning set and compute coordinates of a vector in a given basis.
- Show that coordinates in a basis are unique and that every basis of a space has the same number of vectors.
- Define dimension and relate it to degrees of freedom of mechanisms.
- Explain why a good basis choice (such as an orthonormal one) simplifies computation.
Introduction and motivation
Every description of a robot picks a set of directions and uses numbers to say how far to go along each: x and y on a map, joint angles on an arm, forward and left in the robot frame. Those directions are a basis. Whether the description is complete and whether it is wasteful is a question about independence and span, and the number of directions needed, the dimension, is the number of degrees of freedom.
The intuition
To describe every location on a map you need two arrows that are not parallel: any point is some number of steps along the first plus some number along the second. Two arrows that reach everything and have nothing redundant form a basis of the plane. Different choices of arrows give different coordinate grids, skewed or tilted, but each point still gets exactly one pair of coordinates.
Interactive figure. Two basis vectors b1 and b2 and a vector v. A skewed grid built from the basis shows the coordinates of v: the numbers of steps along b1 and b2 that reach v. If the basis vectors are parallel the grid collapses and they are not a basis. This figure needs JavaScript to be interactive.
Geometric and physical interpretation
Geometric view. A basis for a subspace is a minimal set of vectors that reaches every point of it: independent (nothing redundant) and spanning (nothing missing). The dimension is how many it takes: 1 for a line, 2 for a plane, 3 for space. All bases of the same space have the same number of vectors, even though the vectors differ. Physical view. The number of independent coordinates needed to specify the configuration of a robot is its number of degrees of freedom: 6 for a free rigid body, 3 for a rigid body on a plane (x, y, heading), 3 for the joint space of a planar three-joint arm.
The mathematics
- b₁, …, bk
- a basis of a subspace V.
- c₁, …, ck
- the coordinates of a vector v with respect to the basis: v = c₁b₁ + … + ckbk.
- dim V
- the dimension of V: the number of vectors in any basis.
Basis
b1, ..., bk is a basis of V ⇔ (1) they span V and (2) they are linearly independent
What it means. Span means every vector of V is some combination; independence means no vector in the set is redundant. Together they give each vector exactly one set of coordinates.
Coordinates are unique
v = c1 b1 + ... + ck bk with unique c1, ..., ck [b1 ... bk] c = v (solve for c)
What it means. Putting the basis vectors in the columns of a matrix B, the coordinates solve B c = v. When B is square and invertible, c = B⁻¹v, the change-of-basis computation that reappears in Module 7 as a change of frame.
Dimension and counting
dim V = number of vectors in any basis of V dim of R^n = n r = dim C(A)
What it means. Every basis of the same space has the same size. Rank is therefore the dimension of the column space, and rank-nullity says dim N(A) = n − r.
A basis is independent and spanning; coordinates in it are unique; the number of basis vectors is the dimension, the count of degrees of freedom.
Step-by-step derivation: uniqueness of coordinates, and why every basis has the same size
Coordinates are unique. Suppose v = c₁b₁ + … + ckbk = d₁b₁ + … + dkbk.
- Subtract the two expressions:
(c₁ − d₁)b₁ + … + (ck − dk)bk = 0. - By linear independence the only combination giving zero is the trivial one, so every
ci − di = 0. - Hence
ci = difor every i: the coordinates are unique. (Spanning guarantees that coordinates exist at all.)
Every basis has the same number of vectors. Let b₁, …, bk span a space and let w₁, …, wp be independent vectors in it with p > k. Write each wj in terms of the b's: this gives a k × p matrix C with W = B C. A k × p matrix with p > k has a non-trivial null space (more unknowns than equations), so some c ≠ 0 has C c = 0, giving W c = B C c = 0, a non-trivial combination of the w's equal to zero. That contradicts their independence. So independent sets cannot be larger than spanning sets; applying this to two bases in both directions shows they have the same size.
Computing coordinates. Put the basis in the columns of B and solve B c = v by elimination. For a 2D basis: c₁ = (v × b₂)/(b₁ × b₂) and c₂ = (b₁ × v)/(b₁ × b₂) using the 2D cross product, which fails exactly when b₁ × b₂ = 0, that is when the basis vectors are parallel.
A worked example: coordinates in a skewed basis, and counting degrees of freedom
Coordinates. Let b₁ = (1, 1) and b₂ = (−1, 2), and v = (3, 0).
- Is it a basis?
b₁ × b₂ = 1·2 − 1·(−1) = 3 ≠ 0, so the vectors are independent and, being two in the plane, span it. - Solve
c₁b₁ + c₂b₂ = v:c₁ − c₂ = 3andc₁ + 2c₂ = 0. Subtract:3c₂ = −3, soc₂ = −1andc₁ = 2. - Check.
2·(1, 1) + (−1)·(−1, 2) = (2 + 1, 2 − 2) = (3, 0)✓. In this basis v has coordinates (2, −1).
A non-basis. (1, 2) and (2, 4) are dependent: their cross product is 1·4 − 2·2 = 0. They span only a line, so (1, 0) has no coordinates in them.
Dimensions of mechanisms. A planar arm with three revolute joints has a three-dimensional joint space; its hand position in the plane is two-dimensional, so the arm has one extra degree of freedom (redundancy). A rigid body in space has 6 degrees of freedom: a basis of six independent motions (three translations, three rotations). A differential-drive robot has a 3D pose but only a 2D space of instantaneous velocities.
Robotics application
Frames are bases. The axes of a robot frame, camera frame or sensor frame form a basis of the space. Converting a vector from one frame to another is changing the basis, which is the content of Module 7. A good basis (orthonormal axes) makes coordinates trivial to compute, as Module 4 shows.
Degrees of freedom. Counting dimensions answers design questions: is a 6-joint arm enough to place and orient a hand arbitrarily in space (6 task dimensions, 6 joints: yes, generically), and what does a 7th joint add (one dimension of self-motion, Module 8)? A mobile base with 3 pose dimensions but 2 velocity dimensions cannot move sideways instantaneously, though it can reach any pose by manoeuvring (see robot motion models).
State representation. A state vector with more entries than the system has degrees of freedom contains redundant, dependent entries, which makes the covariance singular. SLAM and VIO systems spend effort choosing minimal parametrisations; see the rotation parameter discussion in rotation matrices, quaternions and poses.
Modal and principal directions. Choosing a basis adapted to the problem (the principal axes of a point cloud, the eigenvectors of a covariance) turns a coupled problem into independent one-dimensional ones; that is the payoff of Modules 4 and 6.
Engineering implications and limitations
Practical rules
- Prefer orthonormal bases. With perpendicular unit basis vectors, coordinates are dot products (no linear solve) and numerical error does not blow up. Use a skewed basis only when the problem demands it.
- Check that your basis is a basis. The determinant (or the smallest singular value) of the matrix of basis vectors must be safely non-zero. Nearly parallel basis vectors give coordinates that amplify any measurement error.
- Do not over-parametrise. Using nine numbers for a rotation (which has three degrees of freedom) is fine if you keep the constraints, but estimating all nine independently produces an invalid rotation. Use a minimal or constrained parametrisation (Modules 7 and 10).
- Count degrees of freedom before designing. Compare task dimensions with joint dimensions: fewer joints than task dimensions means some tasks are unreachable; more means redundancy to be managed.
- Dimension is not the number of entries. A 3 × 3 skew-symmetric matrix has nine entries but only three degrees of freedom.
Limits
The dimension of a linear space is exact. The degrees of freedom of a real mechanism are the dimension of a curved configuration space (a joint angle wraps around, for example), and counting them is a local statement; Module 10 treats such spaces properly.
Common misconceptions
“A basis is a particular set of vectors, so a space has one basis.”
A space has infinitely many bases. What is fixed is the number of vectors: the dimension.
“Any k vectors in a k-dimensional space form a basis.”
Only if they are independent (equivalently, span). Two parallel vectors in the plane are not a basis.
“The dimension is the number of entries of the vectors.”
The dimension of a subspace can be smaller: a line in R³ is one-dimensional though its vectors have three entries.
“More coordinates always describe a robot better.”
Extra, dependent coordinates are redundant and create constraints that estimators must respect. Degrees of freedom are the minimal count.
Engineering takeaways
- A basis is an independent set that spans the space: no redundancy and nothing missing.
- Coordinates in a basis are unique because independence forbids two different combinations of the basis vectors giving the same vector.
- Every basis of a space has the same number of vectors, the dimension; rank is the dimension of the column space.
- Dimension counts degrees of freedom: 6 for a free rigid body, 3 for the joint space of a planar three-link arm.
- Orthonormal bases are the best-behaved choice, which motivates Module 4.
References and further reading
Primary papers and authoritative documentation.
- MIT 18.06SC Linear Algebra (OCW): lectures on independence, basis and dimension
- 3Blue1Brown, Essence of Linear Algebra: span, basis and linear independence
- Immersive Linear Algebra: chapters on vectors and linear mappings
- Modern Robotics (Lynch and Park), free preprint: chapter 2: configuration space and degrees of freedom
Knowledge check
Three conceptual questions. Write an answer, then reveal the explanation. Your answers stay in your browser.
Question 1
Show that (2, 1) and (1, 3) form a basis of the plane and find the coordinates of (5, 5) in it.
Explanation
The 2D cross product (2·3 − 1·1) = 5 ≠ 0, so the vectors are independent and span the plane. Solve c₁(2, 1) + c₂(1, 3) = (5, 5): 2c₁ + c₂ = 5 and c₁ + 3c₂ = 5. From the second c₁ = 5 − 3c₂; substitute: 10 − 6c₂ + c₂ = 5 gives c₂ = 1 and c₁ = 2. Check: 2·(2, 1) + (1, 3) = (5, 5). The coordinates are (2, 1).
Question 2
A planar arm with four revolute joints positions its hand in the plane. How many degrees of freedom does it have, how many does the task need, and how many extra does it have? What would a fifth joint add?
Explanation
The joint space has dimension 4. The hand position in the plane needs 2 (and 3 if orientation is included). So the arm has 4 − 2 = 2 extra degrees of freedom for position alone (or 1 if the hand orientation is also specified). A fifth joint adds one more redundant dimension, which can be used for secondary goals such as avoiding obstacles (null-space control, Module 8).
Question 3
A colleague uses the basis b₁ = (1, 0) and b₂ = (1, 0.0001) for a calibration. Why is this a bad idea even though the vectors are independent?
Explanation
The determinant (1·0.0001 − 0·1 = 10⁻⁴) is tiny: the vectors are nearly parallel, so coordinates in this basis are huge and extremely sensitive. For example reaching (0, 1) needs c₂ = 10⁴ and c₁ = −10⁴, so a measurement error of 10⁻³ in the second coordinate changes the coordinates by about 10. An orthonormal (or at least well-separated) basis avoids this amplification.
What’s next
With bases and dimension in hand, the module closes by answering the original question completely: when does A x = b have a solution, and what does the full set of solutions look like when there are many?
Related content
Nothing below is required to finish this lesson.
- BeforeM3-T6: Row Space and Left Null Space
Complete the four fundamental subspaces and use them to understand redundancy and consistency of measurements.
Get notified when the next lesson and new labs are released.
One email per new lesson or lab.