What is a Matrix?
Vectors were arrows. Now we arrange numbers into rectangles and unlock the power to describe entire systems at once. Welcome to the world of matrices.
A Grid of Numbers
A matrix is a rectangular array of numbers arranged in rows and columns. Think of it as a spreadsheet: each cell holds one number, and position matters.
Matrix Dimensions
An m × n matrix has m rows and n columns. Always rows first, columns second. A 3×2 matrix has 3 rows and 2 columns — 6 entries total.
Matrix Notation
We name matrices with bold uppercase letters: A, B, M. Individual entries use lowercase with subscripts: aij is the entry in row i, column j.
Columns as Vectors
Every matrix is a collection of column vectors standing side by side. A 3×2 matrix packs two column vectors, each with 3 components. This perspective is key to understanding matrix-vector multiplication.
Rows as Vectors
Flip it: a matrix is also a stack of row vectors. Each row captures one equation, one data point, or one constraint. Rows and columns offer dual perspectives on the same data.
The Identity Matrix
The identity matrix I has 1s on the diagonal and 0s everywhere else. It is the “do nothing” matrix: multiply any matrix by I and nothing changes. It is the matrix equivalent of multiplying by 1.
Zero & Diagonal
The zero matrix has all entries equal to 0 — the matrix equivalent of the number zero. A diagonal matrix has nonzero entries only on the main diagonal. Diagonal matrices are simple yet powerful: they scale each coordinate independently.
- Zero matrix: A + 0 = A
- Diagonal: scales each axis
- Identity: special diagonal (all 1s)
Symmetric Matrices
A matrix is symmetric if it equals its own transpose: A = AT. The entry in row i, column j equals the entry in row j, column i. Symmetric matrices appear everywhere: distance tables, covariance matrices, graph adjacency.
The Transpose
The transpose AT flips a matrix over its diagonal: rows become columns and columns become rows. An m×n matrix becomes an n×m matrix. It is like rotating the grid 90° and mirroring.
Matrices Everywhere
Every digital image is a matrix of pixel values. Every neural network layer is a matrix multiplication. Every spreadsheet is a matrix. Once you see them, you cannot unsee them.
- Images: pixel grids (height × width)
- ML: weight matrices in neural nets
- Graphics: transformation matrices
- Physics: stress tensors, inertia
- Data: rows = samples, cols = features
Next: Matrix Operations
Now that we know what a matrix is, we will learn what we can do with them — addition, scalar multiplication, and the all-important matrix-vector product.