Matrices
A matrix is a rectangular array of numbers arranged in rows and columns, written . Matrices encode and manipulate systems of linear equations, geometric transformations, and data tables. They are added entrywise but multiplied by a special row-times-column rule that is not commutative. Used everywhere from computer graphics to economics; the modern theory was crystallized by Arthur Cayley in 1858.
A matrix is a rectangular grid of numbers (its entries or elements) organized into horizontal rows and vertical columns, giving an matrix. Matrices matter because they package an entire system of linear relationships into a single object that can be added, scaled, multiplied, inverted, and transformed according to precise algebraic rules. They are the natural language of Linear Algebra, turning geometric operations like rotation and projection into arithmetic. The surprising fact that trips up every beginner: matrix multiplication is not commutative — in general , and sometimes only one of those products even exists.
The Core Insight
A matrix is simultaneously two things: a static table of data and a dynamic operation. The single rule of matrix multiplication — "each entry is a row dotted with a column" — is the mechanism that lets a matrix act on vectors, compose transformations, and solve equations all at once. Master that one rule and most of the subject follows.
Formal Statement
Matrix and Basic Notation
An matrix over the real numbers is an array
Here is the number of rows, the number of columns, and is the entry in row , column . The pair is the order or dimension. A matrix with is square. A matrix is a row vector; an matrix is a column vector.
Addition and Scalar Multiplication
For two matrices and , and a scalar :
Matrix Multiplication
If is and is , then the product is the matrix with entries
The number of columns of must equal the number of rows of for the product to be defined.
Identity and Inverse
The identity matrix has 1's on the main diagonal and 0's elsewhere: (the Kronecker delta). A square matrix is invertible (nonsingular) if there exists with
Determinant of a 2×2 Matrix and Inverse Criterion
For , the determinant is
Why It Holds / Derivation
Why the 2×2 Inverse Formula Works
We seek with .
Step 1. Write out using rule [3]:Arthur Cayley | 1821–1895
The English mathematician Arthur Cayley founded the abstract theory of matrices in his 1858 Memoir on the Theory of Matrices, where he first treated a matrix as a single algebraic object with its own arithmetic — defining addition, multiplication, and inverses. He recognized that matrix multiplication is non-commutative and stated (verifying for and ) what is now the Cayley–Hamilton theorem: every square matrix satisfies its own characteristic equation. A lawyer for fourteen years who published over 200 papers in his spare time before taking a Cambridge chair, Cayley also developed invariant theory and contributed to group theory and geometry.
Building Intuition
Think of a matrix as a machine that transforms vectors. Feed in a column vector , and comes out as a new vector — possibly rotated, stretched, sheared, or projected. The columns of tell you exactly where the basis vectors land: column is the image of the -th unit vector. Multiplying two matrices means "do first, then " — composing two transformations into one. This is why order matters: rotating then reflecting is generally different from reflecting then rotating. Addition, by contrast, is gentle and commutative because it just superimposes two tables entry by entry.
A matrix as a transformation: the unit square mapped by a shear matrix
<svg viewBox="0 0 420 280" xmlns="http://www.w3.org/2000/svg">
<rect width="420" height="280" fill="#0a0e17"/>
<line x1="20" y1="240" x2="400" y2="240" stroke="#94a3b8" stroke-width="1.5"/>
<line x1="60" y1="260" x2="60" y2="20" stroke="#94a3b8" stroke-width="1.5"/>
<text x="405" y="244" fill="#e2e8f0" font-size="12">x</text>
<text x="52" y="18" fill="#e2e8f0" font-size="12">y</text>
<!-- original unit square -->
<polygon points="60,240 140,240 140,160 60,160" fill="none" stroke="#94a3b8" stroke-width="1.5" stroke-dasharray="4 3"/>
<text x="80" y="200" fill="#94a3b8" font-size="11">unit square</text>
<!-- sheared parallelogram (shear x by 1) -->
<polygon points="60,240 140,240 220,160 140,160" fill="none" stroke="#d4a853" stroke-width="2.5"/>
<text x="160" y="150" fill="#d4a853" font-size="11">A·(square)</text>
<!-- basis vector images -->
<line x1="60" y1="240" x2="140" y2="240" stroke="#e2e8f0" stroke-width="2"/>
<line x1="60" y1="240" x2="140" y2="160" stroke="#d4a853" stroke-width="2"/>
<text x="100" y="256" fill="#e2e8f0" font-size="11">e₁→(1,0)</text>
<text x="146" y="200" fill="#d4a853" font-size="11">e₂→(1,1)</text>
<text x="220" y="40" fill="#e2e8f0" font-size="13">A = [ 1 1 ; 0 1 ] (shear)</text>
<text x="220" y="60" fill="#94a3b8" font-size="11">columns = images of e₁, e₂</text>
</svg>
Worked Examples
Multiplying Two Matrices
Given: and . Compute . Step 1 — check dimensions. is , is ; inner dimensions match, so is . Step 2 — apply rule [3], each entry = row · column.(Check non-commutativity: computing gives .)
Inverting a Matrix and Solving a System
Given: Solve using a matrix inverse. Step 1 — write as . , . Step 2 — determinant (eq [5]). , so exists. Step 3 — inverse (eq [6]).(Check: ✓ and ✓.)
Common Misconceptions
Matrix multiplication is NOT commutative. In general , and sometimes only one product is even defined (a times a works one way only). Never "cancel" or reorder factors freely. Likewise, there is no matrix division — you multiply by an inverse, and you must be careful whether it goes on the left () or the right (), since these differ.The familiar fact "if then or " fails for matrices. Take
Connections
Matrices are the computational engine behind nearly all of Linear Algebra. Each matrix represents a Linear Transformations once bases are chosen, with its columns giving the images of basis vectors. The Determinant measures how a matrix scales area/volume and detects invertibility. Solving is the matrix form of Systems of Linear Equations, usually carried out by Gaussian Elimination rather than computing inverses. The deeper structure of a square matrix is captured by its Eigenvalues and Eigenvectors, which reveal directions that the matrix merely stretches. Matrices also realize the abstract notion of a Vector Spaces of linear maps under addition and composition.
Real-World Applications
- Computer graphics & game engines: transformation matrices rotate, scale, and translate 3D models; the GPU multiplies millions of vertex vectors per frame.
- Google PageRank: the web is a giant stochastic matrix, and the ranking of pages is its dominant Eigenvalues and Eigenvectors.
- Cryptography (Hill cipher): blocks of letters are encrypted by multiplying with an invertible matrix mod 26 and decrypted with its inverse.
- Economics (Leontief input–output models): a matrix relates the output of each industry to the inputs it draws from others; solving predicts production needs.
- Engineering & physics: stress tensors, the moment of inertia tensor, and circuit equations are all matrix relations; structural analysis solves huge linear systems.
- Machine learning: neural-network layers are matrix multiplications followed by nonlinearities; image data and feature sets are stored and transformed as matrices.
- Markov chains: transition probabilities form a matrix whose powers predict long-run behavior of weather, queues, or board games.
Historical Development
- c. 200 BCE: The Chinese text Nine Chapters on the Mathematical Art solves linear systems with a method essentially equivalent to Gaussian elimination on a numerical array.
- 1683: Seki Takakazu in Japan and, independently, 1693 Gottfried Leibniz in Europe introduce determinants to analyze systems of equations.
- 1750: Gabriel Cramer publishes Cramer's Rule, expressing solutions of linear systems via determinants.
- 1812: Augustin-Louis Cauchy proves the multiplicative property and systematizes determinant theory.
- 1844–1850: James Joseph Sylvester coins the word "matrix" (Latin for "womb"), viewing it as the array from which determinants (minors) are born.
- 1858: Arthur Cayley's Memoir on the Theory of Matrices establishes matrix algebra as an independent subject and states the Cayley–Hamilton theorem.
- 1878: Ferdinand Georg Frobenius develops the theory of canonical forms, rank, and the characteristic polynomial rigorously.
- 1925: Werner Heisenberg, Max Born, and Pascual Jordan formulate matrix mechanics, the first complete version of quantum theory, founded on non-commuting matrices.
- 1947–present: John von Neumann, Alan Turing, and others develop numerical linear algebra (LU decomposition, condition numbers), making matrices the workhorse of digital computation.
Subtleties & Limits
Computing matrix products fast is a surprisingly deep open question. The schoolbook rule [3] costs about multiplications for matrices. In 1969 Volker Strassen shocked everyone by doing it in roughly operations, and successive refinements (Coppersmith–Winograd and beyond) have pushed the exponent below . But the true minimal exponent — the smallest number such that multiplication is possible in time — is unknown; many conjecture , which would be essentially optimal, but no proof exists. Separately, the numerical stability of inversion is subtle: nearly-singular matrices (small but nonzero determinant) amplify rounding errors dramatically, quantified by the condition number, so in practice one almost never forms explicitly.