II.7 · Linear Algebra
When do two directions give unique coordinates?
Hold a target fixed and move the two basis vectors. Its coordinates change, its position does not, and singular directions reveal the difference between reachability and uniqueness.
Move the basis; keep the target fixed
These two directions form a basis. Each target has exactly one coordinate pair (a, b); the target stays fixed when you move only the basis.
- first direction
- (2, 1)
- second vector
- (1, 2)
- target in standard coordinates
- (3, 0)
- two-direction determinant
- 3
- first basis coordinate
- 2
- second basis coordinate
- −1
- reconstructed target
- (3, 0)
- relative separation of directions
- 0.600000
Exact expressions use =. Rounded computations use ≈. All arrows use these same quantities.
These two directions form a basis. Each target has exactly one coordinate pair (a, b); the target stays fixed when you move only the basis.
from −4 to 4, up to 2 decimal places
from −4 to 4, up to 2 decimal places
from −4 to 4, up to 2 decimal places
from −4 to 4, up to 2 decimal places
from −4 to 4, up to 2 decimal places
from −4 to 4, up to 2 decimal places
Start with target . Predict whether its two weights change when you move only . Then choose Collinear directions: the target remains where it was, but the unique coordinate rows become undefined. Move the target onto that line to see why being reachable still does not produce a unique pair.
Intuition: coordinates depend on a measuring frame
The standard components describe a point relative to one horizontal and one vertical unit direction. A different pair of directions can describe the same target with different weights. Coordinates are instructions for reconstructing a vector from a chosen basis; they are not an intrinsic pair attached to the target independently of the frame.
A useful basis supplies enough directions to reach every target and avoids redundant directions that would give multiple descriptions. The stage holds fixed when a basis tip moves, so the changing coordinates reveal a change of description rather than a motion of the target.
Definition
Two vectors are linearly independent when
A basis of is an ordered pair of independent vectors that spans the plane. In two dimensions, two independent vectors already span the plane. For a chosen ordered basis , the coordinates of are the unique pair satisfying
Order matters: swapping the basis vectors swaps their coordinate roles. Orthogonality and unit lengths are convenient but are not required. A slanted, unequal-length independent pair is still a basis.
Mechanics: reconstruction and singularity
The blue and green basis arrows show the two directions. The head-to-tail weighted arrows reconstruct the target. Grid lines correspond to fixed basis coefficients, so moving the basis changes the coordinate grid. The inspector keeps the standard target components separate from the solved basis coordinates.
The stage’s independence test is the exact two-dimensional quantity
This is the determinant of the two basis columns. Here it is a practical independence test; its full area, orientation, and higher-dimensional interpretation belongs to II.12. If , the pair is singular and cannot be a basis of the plane. The stage then tests whether the target lies in the surviving span, and distinguishes no representation from infinitely many representations. It never supplies a fabricated unique coordinate pair.
Derivation: an independent pair has unique weights
The component equations are
Multiply the first by , the second by , and subtract. The terms cancel, leaving . Eliminate similarly. For ,
These formulas give a representation for every target. To prove uniqueness, suppose another pair gives the same target. Subtract the two representations: . Independence forces both differences to vanish.
If the two directions are collinear, a nonzero combination can cancel them. For instance, gives , proving dependence. Any reachable target then has infinitely many representations because adding a multiple of this cancelling pair changes the coefficients without changing the vector. A zero basis vector immediately creates such redundancy.
Worked examples
For , , and , the determinant is . The formulas yield and , checked by . The target’s standard components and its basis coordinates describe the same vector in different frames.
Inspect the worked calculation
For u = (2, 1), v = (1, 2), p = (3, 0), Δ = 4 − 1 = 3.
- first direction
- (2, 1)
- second vector
- (1, 2)
- target in standard coordinates
- (3, 0)
- two-direction determinant
- 3
- first basis coordinate
- 2
- second basis coordinate
- −1
- reconstructed target
- (3, 0)
- relative separation of directions
- 0.600000
For and , target is reachable with any , including and . Target is unreachable because every combination has equal components. A singular pair can therefore fail through nonuniqueness or through nonexistence, depending on the target.
Executable reference code
The pedagogical code implements the elimination formulas with exact decimal fractions and checks reconstruction. The NumPy example forms an array with basis vectors as columns and solves for the weights. This small practical bridge follows the book’s column-vector convention; a general systems chapter is still ahead. A singular solve raises an error rather than returning unique coordinates.
from fractions import Fraction
def coordinates(u, v, p):
if any(len(w) != 2 for w in (u, v, p)):
raise ValueError('Expected two components per vector')
u, v, p = (tuple(Fraction(str(x)) for x in w) for w in (u, v, p))
determinant = u[0]*v[1] - u[1]*v[0]
if determinant == 0:
raise ValueError('Singular directions: unique coordinates do not exist')
a = (p[0]*v[1] - p[1]*v[0]) / determinant
b = (u[0]*p[1] - u[1]*p[0]) / determinant
assert tuple(a*x + b*y for x, y in zip(u, v)) == p
return a, b
if __name__ == '__main__':
assert coordinates((2, 1), (1, 2), (3, 0)) == (2, -1)import numpy as np
u = np.array([2.0, 1.0])
v = np.array([1.0, 2.0])
p = np.array([3.0, 0.0])
columns = np.column_stack((u, v))
# solve raises LinAlgError for a singular matrix; never invent coordinates.
coordinates = np.linalg.solve(columns, p)
reconstructed = coordinates[0] * u + coordinates[1] * v
assert np.allclose(coordinates, [2, -1])
assert np.allclose(reconstructed, p)
# For nearly dependent columns, check sensitivity as well as the residual.
condition = np.linalg.cond(columns)Explore
Try the standard basis and confirm that the weights match the target’s components. Then double only the first basis vector: the first weight halves while the target stays fixed. Swap the two basis vectors with numeric entry and inspect the swapped coordinate roles. Make one basis vector zero, then both zero, and compare which targets remain reachable.
Choose Almost collinear. The exact determinant is , so the pair remains independent. Reconstructing a target away from the narrow direction can require very large weights of opposite signs. The plane fits those actual weighted arrows; the small target may consequently occupy very little screen space. Reset returns to a comfortably separated pair.
Common mistakes
Two nonzero vectors can still be dependent. Two perpendicular nonzero vectors are independent, but perpendicularity is sufficient rather than necessary. A reachable target does not prove the pair spans the plane, and a small reconstruction residual alone does not prove the computed coordinates are accurate. Also distinguish basis change from moving the target: changing the measuring frame changes the numbers describing the same vector.
Numerical considerations
Exact independence asks whether is zero. Numerical reliability asks how sensitive the coordinates are to errors in the vectors and target. The stage reports the relative directional separation , which removes the vectors’ overall scale. Below it warns about sensitivity; this warning never changes exact independence. The threshold is a teaching cue for this bounded scene, not a general solver’s rank decision.
Near dependence, large weighted moves nearly cancel. Rounding can then alter the final target substantially, even when each large move changes only slightly. NumPy’s condition estimate previews this issue; practical rank and solver tolerances require the scale and uncertainty of actual data. Exact arithmetic on entered decimals certifies the intended reconstruction but cannot repair inaccurate measurements. The stage rejects invalid numeric input and shows fractions exactly, while rounded decimal companions use .
Engineering and ML connections
A basis is a coordinate system for signals, motions, or features. Redundant directions can create multiple parameter settings with the same output; changing a basis changes the weights without necessarily changing the represented object. The column convention also prepares a transformation view of matrices: specify where the standard basis directions go, and every other vector follows by the same weighted-combination rule.
Exercises
Summary and checkpoints
Independent directions supply unique weights; a basis makes those weights coordinates. Check that you can derive the two-coordinate formulas, distinguish unreachable from nonunique singular targets, and explain why exact independence can coexist with numerical sensitivity. You are ready for II.8, where a matrix will describe a transformation by its effect on basis directions.