4.2 Vectors and matrices
This lesson is the working dictionary: what a vector is, what a matrix is, and the operations we’ll lean on for the rest of the chapter. It is short and almost-entirely algebraic, but every concept here is used silently in Foundations 5 — ODEs, Foundations 6 — PDEs, and across Sound and Hearing.
Vectors
A vector in is an ordered tuple of real numbers, conventionally written as a column:
In 2-D, is the displacement from the origin to that point. In 3-D, it’s . In higher dimensions the geometric picture stops being literally drawable, but the algebra carries through unchanged.
The two operations that define a vector space:
Addition is componentwise:
Geometrically: place ‘s tail at ‘s tip; the sum is the arrow from the origin to where now ends.
Scalar multiplication scales every component by the same number:
Geometrically: stretch (or compress) the arrow without rotating it. Negative flips direction.
A set of vectors is linearly independent if no one of them can be written as a linear combination of the others. A maximal independent set is a basis for the vector space; the number of vectors in any basis is the dimension. For the standard basis is , where has a 1 in slot and zeros elsewhere.
Matrices
A matrix is a rectangular array of numbers. An matrix has rows and columns; for our purposes the most useful case is the square matrix where :
The entry sits in row , column . A column can be read as a single vector — useful because, as we saw in 4.1, the columns of a matrix tell you where the basis vectors get sent.
Matrix–vector multiplication
The fundamental operation. Given an matrix and a vector , the product is another vector in , defined component-by-component as
In words: the -th component of the output is the dot product of the -th row of with .
For a matrix this gives the formula we already saw:
There is a second interpretation, which is sometimes more useful: is a linear combination of the columns of with coefficients given by :
Both interpretations are correct; they’re the same arithmetic written differently. The “row-by-row” reading is the standard mechanical recipe; the “column-combination” reading is the conceptual one — it says exactly what we said geometrically in 4.1, that the matrix is determined by where it sends the basis.
Matrix–matrix multiplication
Given two square matrices and of the same size, their product is the matrix that composes their transformations: applying to first applies to , then applies to the result. That is, .
In components:
Mnemonic: “row of dot column of .” This is matrix multiplication’s most-memorised recipe and the most-forgotten thing about it: it is composition of transformations, which is why is generally not equal to . The order matters because composing rotation-then-shear is different from shear-then-rotation.
Transpose, identity, inverse
Transpose. The transpose swaps rows and columns: . Geometrically, transposing has no clean interpretation in general; algebraically, it interacts cleanly with the dot product: .
Identity matrix. The matrix has s on the diagonal and s elsewhere: for every . It is the “do nothing” transformation.
Inverse. A square matrix is invertible if there exists a matrix such that . Geometrically: undoes the transformation . Algebraically: is invertible if and only if (no information lost) if and only if the columns of are linearly independent if and only if the equation has a unique solution for every . These “if and only ifs” are central; they will reappear in 4.3.
For a matrix the inverse has an explicit formula:
which fails (denominator zero) exactly when the determinant vanishes. For larger matrices the inverse is computed by row reduction (next lesson) or by other algorithms; explicit formulas exist but are rarely the most efficient route.
The determinant
For a matrix, — the same number that appears in the inverse formula. Geometrically, is the area scaling factor of the transformation: the unit square goes to a parallelogram of area .
In dimensions, is the signed volume scaling factor. The sign tells you whether the orientation is preserved (positive) or flipped (negative). When , the transformation collapses the -dimensional space onto a lower-dimensional subspace.
For larger matrices the determinant is computed by cofactor expansion along any row or column, or — much more efficiently — by row-reducing to upper triangular form and multiplying the diagonal entries (Gaussian elimination, again).
What we use this for
The operations above are the ground floor for everything else in the chapter:
- 4.3 uses matrix–vector multiplication to write linear systems and the inverse / determinant to characterise when they have solutions.
- 4.4 defines eigenvalues using the equation , a matrix–vector product set equal to a scalar multiple of the input.
- 4.5 uses transposes (and the dot product they relate to) to define angles, projections, and orthogonality.
- 4.6 puts the pieces together for self-adjoint matrices and operators — the matrices — which is the algebraic structure underwriting separation of variables in PDEs.
The next lesson actually solves a linear system: given a matrix and a vector , find such that . That is the everyday task of linear algebra, and the algorithm — Gaussian elimination — is one of the oldest and most useful in mathematics.