Module 5: Vector Spaces
A vector exists independently of any coordinate system. When you write [3, 2], you've implicitly chosen a basis. Change the basis, and the same vector gets different numbers — but the arrow in space doesn't move.
If your new basis vectors are the columns of matrix P, then the coordinates of vector v in the new basis are:
And to convert back: vstandard=Pvnew. P converts from new-basis coordinates to standard coordinates. P⁻¹ converts the other way.
Two matrices A and B represent the same linear transformation in different bases when:
This is called a similarity transformation. Diagonalization is exactly this — finding a basis (the eigenvector basis) where the matrix becomes diagonal.
The standard basis [1,0] and [0,1] is just one choice. Any two independent vectors form a valid basis. Picking the right basis — one aligned with the structure of your problem — often makes computations dramatically simpler. Eigenvectors, singular vectors, and Fourier modes are all "right" bases for specific problems.
Drag e₁ and e₂ to change the basis. The faint grid shows the new coordinate lines. Drag v to move the vector. Notice: [3, 2] in standard coordinates becomes something completely different in the new basis — same arrow, new numbers.
import numpy as np
# New basis vectors as columns of P
P = np.array([[2., 1.], [0., 2.]])
v_standard = np.array([4., 2.])
# Convert to new basis
v_new = np.linalg.solve(P, v_standard)
print(v_new) # coordinates in new basis
# Convert back
print(P @ v_new) # should recover v_standardStandard basis
v = [3, 2]
New basis {e₁, e₂}
v = 1·e₁ + 1·e₂ → [1, 1]new
The green grid lines show the new coordinate system. Same vector v, different numbers depending on the basis.