Bases and orthogonality
Quick answer
A basis is a set of linearly independent vectors that spans a space: every vector in the space has a unique combination of basis vectors. In real Euclidean space, two vectors are orthogonal if their dot product is zero. An orthonormal basis has mutually orthogonal vectors of length one. For a unit direction u, the scalar coordinate of v along u is v · u, and its projection vector is (v · u)u. With a non-unit nonzero direction, use (v · u)/(u · u) as the multiplier. An orthogonal pair of nonzero vectors in two dimensions forms a basis, but not every basis is orthogonal.
Reconstruct coordinates in a familiar basis
The two standard basis directions [1, 0] and [0, 1] let you write a vector as a weighted sum. Scale each direction by its coordinate and add components. The two directions are orthogonal and each has L2 norm one.
e1 = [1, 0]e2 = [0, 1]c1, c2 = 3, -2print([c1*a + c2*b for a, b in zip(e1, e2)])print(sum(a*b for a, b in zip(e1, e2)))Expected output:
[3, -2]0The vector [3, -2] moves three units along the first direction and minus two along the second. Their dot product is zero.
Project onto a non-unit direction
NumPy CPU lab: project v = [3, 1] onto u = [2, 0]. The coefficient is 6/4 = 1.5; multiply by u to get the projected vector. The leftover vector is orthogonal to u. All coordinates here are exactly representable in binary floating point.
import numpy as npv = np.array([3., 1.])u = np.array([2., 0.])projection = ((v @ u) / (u @ u)) * uresidual = v - projectionprint(projection.tolist())print(residual.tolist())print(float(residual @ u))Expected output:
[3.0, 0.0][0.0, 1.0]0.0The projection preserves the component along the horizontal direction and drops the perpendicular component. Projections will help explain dimensionality reduction later.
Common mistakes
The zero vector has dot product zero with every vector but cannot serve as a basis direction. Orthogonality does not by itself mean unit length, statistical independence or lack of correlation in data. For arbitrary nonorthogonal bases, dot products with basis vectors do not directly give coordinates.
Practice and next steps
Project [2, 5] onto [0, 2] and check that the residual is perpendicular to the direction. Complete the chapter milestone, then continue to eigenvalues, SVD and matrix geometry.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Bases and orthogonality — knowledge check
Apply linear algebra to small numerical fixtures.
Which pair is orthogonal?
Why can the zero vector not be a basis vector?
What is the projection of [4,3] onto [0,2]?
What is required for an orthonormal basis in addition to being a basis?
Does orthogonality alone imply statistical independence of random variables?