TL;DR
A basis of a vector space is a small set of vectors from which every vector in the space can be built, and each vector in the set is needed. Because of that, every vector has exactly one recipe, so the recipe can be written as a list of numbers. Bases are how linear algebra turns geometry into arithmetic.
Builds on: Vector Space, Linear Independence · Leads to: Basis Expansion, Linear Transformation
Where it's used
Coordinates in computer graphics. A 3D model is stored as points, and the renderer moves them with matrices. Each point is described by its coordinates in a chosen basis, such as the axes of an object or the camera. Changing the basis changes the numbers but not the object, which is why game engines convert between local and world frames all the time.
Feature design in regression. When a model fits a curve, its inputs are functions such as 1, x and x squared. Those functions form a basis for all quadratic curves, so any quadratic can be written as three numbers, and fitting the curve means finding those three numbers. This is the idea behind polynomial regression, which builds on Linear Regression.
Compression and signal processing. A signal sampled at many points can be written in a basis of waves, as in the Fourier transform, which uses sine and cosine waves as its basis. A few large coefficients then describe most of the signal, so the rest can be discarded. JPEG images and MP3 audio rely on this kind of change of basis, with close relatives of the Fourier basis.
How it works
Start with a plain question: how few vectors do you need to reach every point in the flat plane, where each point is a pair of numbers? A linear combination of vectors is a sum of scaled copies, such as with numbers and . The set of all linear combinations of some vectors is their span. The question is which vectors span the plane, and which of those are necessary.
- Try the standard pair. Take and . Any point equals . Check: for , . The pair spans the plane.
- Try a different pair. Take and . To build we need , which means and . Adding the equations gives , so and . Check: . This pair also spans the plane, and the same point gets different numbers.
- Try a pair that is too small. Take and . Any combination is , whose second entry is always 0. So can never be reached. This pair does not span the plane.
- Try a pair that is too big. Add to the standard pair. Now can be built as , or as . Check the second one: . Two recipes for one point means one of the vectors is redundant, since .
- Conclude. A basis is a set that spans the plane and has no redundancy, which is the linear independence test. Steps 1 and 2 pass both tests. Step 3 fails the spanning test, and step 4 fails the redundancy test. Any basis of the plane has exactly two vectors, and each point of the plane has exactly one pair of coordinates in it.
The procedure, as a decision:
flowchart TD
A["Candidate set of vectors"] --> B{"Do they span the space?"}
B -- no --> X["Not a basis: add vectors"]
B -- yes --> C{"Is any vector a combination of the others?"}
C -- yes --> Y["Not a basis: remove the redundant vector"]
C -- no --> D["Basis: every vector has unique coordinates"]
The number of vectors in a basis is the dimension of the space. The plane has dimension 2.
The math
Condition (1) is "no gaps". Condition (2) is "no redundancy", as defined in Linear Independence. The numbers in condition (1) are the coordinates of in this basis.
Step 1 and 2 in symbols
The standard basis of is , , and every point . For the basis , , finding the coordinates of means solving
which gives and . For this is and , as in the walkthrough.
Step 3 in symbols
Independence fails when a nontrivial combination gives zero. Here with coefficients and , not both zero, so and are dependent.
Step 4 in symbols
For the three vectors , , , the combination has nonzero coefficients, which is the redundancy. Because such a relation exists, the coordinates of a point are not unique.
Why the coordinates are unique
Suppose are two recipes for the same . Subtracting gives . Independence forces every , so . This is the reason a basis gives each vector exactly one set of coordinates.
Worked examples
- Let be the set of all multiples of . It is a line through the origin, and it is a vector space.
- Candidate basis: the single vector .
- Spanning: any point of the line has the form , so reaches all of them.
- Independence: forces , since the first entry is .
- So is a basis, and the dimension of is 1.
- Coordinates of : , so the coordinate is .
Interpretation: a line needs one vector, and the coordinate tells you how far along the line the point is, measured in units of .
- Candidate basis of : , , .
- Independence: . So , , .
- From the first, . From the second, . Then the third says , so , and so . Independent.
- Spanning: solve the same three equations with a target on the right instead of zeros. The solution is , , , and it exists for every target. So the three vectors span , and with step 3 they form a basis.
- Coordinates of : put , , into step 4. That gives , and .
- Check: .
Interpretation: the point has ordinary coordinates , but in this basis its coordinates, the weights on , and , are .
In curve fitting, a model can use the functions , and as its building blocks. Every quadratic is a combination of them, so spans the quadratics, and it is independent because a polynomial that is zero everywhere has all coefficients zero. The coordinates of are , which is exactly what a regression estimates.
Now use a different basis, .
- Target: .
- Write .
- Match the term: . Match the term: . Match the constant: , so .
- Check: .
Try it: what are the coordinates of in the basis , and why are they different from the answer above? Answer: . The same polynomial has coordinates in the second basis, because the second basis has where the first has , so the recipe changes while the polynomial does not.
Common mistakes and tradeoffs
It is tempting to think a basis must be the standard vectors and . In fact any independent set with the right number of vectors is a basis. The standard basis is just the most convenient one, and a good choice of basis often makes a hard problem easy.
It is tempting to think any set that spans the space is a basis. In fact a basis must also be independent. Extra vectors still span, but they make the coordinates of a point non-unique, as step 4 of the walkthrough showed.
It is tempting to think any vectors in form a basis. In fact they do only if they are independent. Three copies of are three vectors in , but they span only a line.
Use a basis when you need coordinates, when you want to change the description of a problem, or when a matrix is simpler in a good basis, as in the singular value decomposition. Do not expect a basis to remove the underlying geometry: the same object has different coordinates in different bases. In infinite-dimensional spaces, such as spaces of functions, the definition still applies, but a basis may be impossible to write down, so people use other tools instead.
History
Hermann Grassmann introduced linear combinations and the idea of a set of independent generators in his 1844 book Die lineale Ausdehnungslehre. The idea was mostly ignored at first. In 1888 Giuseppe Peano gave the first modern axiomatic definition of a vector space, which made the basis definition easy to state in general terms. The word "basis" and the dimension theorem, that all bases of a space have the same size, became standard in the early twentieth century, as linear algebra was organised into a subject of its own.
Recap
- A linear combination scales vectors and adds them. The span of a set is every combination it can make.
- A basis spans the space and is linearly independent, so every vector has exactly one recipe.
- Coordinates are those recipes, and changing the basis changes the coordinates but not the vector.
- The number of vectors in any basis is the dimension of the space.
Read next: Basis Expansion for expressing functions in a basis, Linear Transformation for maps that act on coordinates, and Matrix Rank for how many independent directions a matrix can reach.
Check yourself
QuestionRecall: what two conditions must a set of vectors meet to be a basis of a vector space?Show answer
QuestionComputation: using the basis , , find the coordinates of .Show answer
QuestionWhy: why does a basis give every vector a unique set of coordinates?Show answer
QuestionApplied: a dataset has three input columns, and the third column is exactly twice the first. Do the three columns form a basis for the space they describe?Show answer
Sources
- "Basis (linear algebra)", Wikipedia. https://en.wikipedia.org/wiki/Basis_(linear_algebra)
- "Vector space", Wikipedia. https://en.wikipedia.org/wiki/Vector_space