Matrices & Their Operations
Grids of numbers, and the surprisingly strict multiplication rule.
The explanation
A matrix is a rectangular grid of numbers, described by its size: rows × columns.
Adding and subtracting: only for matrices of identical size, done entry by entry.
Scalar multiplication: multiply every entry.
Matrix multiplication is the odd one. To multiply A (m×n) by B (p×q), you need n = p, and the result is m×q. Each entry is a row of A paired with a column of B: multiply matching elements and add.
Order matters. AB and BA are usually different, and often only one of them is even defined.
Matrices are the compact way to store and solve systems of equations, and they are how graphics and machine learning represent transformations of data.
A matrix is an m × n array. Addition and scalar multiplication are entrywise and require identical dimensions; matrix multiplication is defined by (AB)_{ij} = Σ_k A_{ik}B_{kj}, so the inner dimensions must agree and the product is m × q.
This definition is not arbitrary: it makes matrix multiplication correspond to composition of linear transformations, which is why it is associative but not commutative — composing two transformations in the other order generally gives a different result.
The identity matrix I has ones on the diagonal and zeros elsewhere, satisfying AI = IA = A. A square matrix A has an inverse A⁻¹ with AA⁻¹ = I exactly when its determinant is nonzero; for 2 × 2 matrices, det = ad − bc and A⁻¹ = (1/det)·[[d, −b], [−c, a]].
A linear system written as AX = B then solves as X = A⁻¹B, which is the matrix route to solving systems. A zero determinant signals that the system is either inconsistent or dependent — the same trichotomy met in Algebra 1, now detected by a single number.
Worked example
Multiply [[1, 2], [3, 4]] by [[5], [6]], and find the determinant of the first.
- Sizes: 2×2 times 2×1 gives 2×1.
- Row 1: 1(5) + 2(6) = 17.
- Row 2: 3(5) + 4(6) = 39.
- Determinant: (1)(4) − (2)(3) = −2.
Answer: [[17], [39]], determinant −2
Common mistakes
- Multiplying matrices entry by entry as if it were addition.
- Assuming AB = BA.