Module 2 · Lesson 1
Stories Mode

What is a Matrix?

11 min read
Article

A matrix is one of the most powerful and ubiquitous structures in mathematics. At the most basic level, it's just a rectangular array of numbers arranged in rows and columns. But this simple idea encodes something far richer: a matrix represents a linear transformation — a rule for moving, rotating, scaling, or shearing all points in space simultaneously.

Notation and Anatomy

A matrix A with m rows and n columns is called an m × n matrix. Its entries are written as a_{ij}, where i is the row index and j is the column index:

Matrix Notation
A=\begin{pmatrix}a_{11}&a_{12}&\cdots&a_{1n}\\a_{21}&a_{22}&\cdots&a_{2n}\\\vdots&\vdots&\ddots&\vdots\\a_{m1}&a_{m2}&\cdots&a_{mn}\end{pmatrix}
A is an m×n matrix. Entry a_{ij} is in row i, column j. The shape (m, n) is called the matrix's dimensions.

A few special names: a square matrix has m = n. A matrix with one column (n = 1) is a column vector. A matrix with one row (m = 1) is a row vector. A 1×1 matrix is a scalar.

Reading a Matrix as Data

The most tangible way to understand matrices is as organized data. Each row might represent an observation; each column a feature. A spreadsheet with 1,000 rows and 50 columns is a 1000×50 matrix.

Example — student grades: Suppose you have 4 students, each with scores in 3 subjects (Math, Physics, English). A 4×3 matrix holds all the data. Row 2 contains student 2's scores. Column 3 contains all students' English scores. Matrix notation gives you a concise language for this structure.

Matrices as Linear Transformations

Here's the deeper view: every m×n matrix A defines a function that takes n-dimensional vectors as input and produces m-dimensional vectors as output. This function is linear — it preserves addition and scalar multiplication.

Multiplication of matrix A by vector x gives a new vector Ax. This is the fundamental operation of linear algebra:

Matrix-Vector Product
(Ax)_i=\sum_{j=1}^{n}a_{ij}x_j
Each entry of the output vector is a dot product of a row of A with x. An m×n matrix takes an n-vector input and produces an m-vector output.

Special Matrices

The Identity Matrix I

The identity matrix has 1s on the diagonal and 0s elsewhere. Multiplying any matrix A by I leaves A unchanged — just like multiplying a number by 1. For any vector x, I·x = x. The identity is the "do nothing" transformation.

3×3 Identity Matrix
I_3=\begin{pmatrix}1&0&0\\0&1&0\\0&0&1\end{pmatrix}
The identity matrix I_n is n×n with ones on the diagonal. For any n×n matrix A: A·I = I·A = A.

The Zero Matrix

The zero matrix has all entries equal to 0. Multiplying any vector by the zero matrix gives the zero vector — everything collapses to the origin. Adding the zero matrix to any matrix A gives A.

Diagonal Matrices

A diagonal matrix has nonzero entries only on the main diagonal. Multiplying a diagonal matrix by a vector scales each component independently — it's the simplest non-trivial transformation.

Symmetric Matrices

A matrix A is symmetric if A = Aᵀ (it equals its own transpose). Many important matrices in physics and ML are symmetric: covariance matrices, adjacency matrices of undirected graphs, positive definite matrices.

The Transpose

The transpose of matrix A, written Aᵀ, swaps rows and columns: entry (i,j) of A becomes entry (j,i) of Aᵀ. If A is m×n, then Aᵀ is n×m.

Transpose properties: (A+B)ᵀ = Aᵀ + Bᵀ, (cA)ᵀ = cAᵀ, (AB)ᵀ = BᵀAᵀ (note reversed order!), (Aᵀ)ᵀ = A. The reversed-order rule for products is often surprising to newcomers.

Why Matrices Matter

Matrices appear in virtually every quantitative field because they efficiently encode relationships between multiple quantities simultaneously:

Computer Graphics
Rotation, scaling, translation, and perspective projection are all matrix operations applied to 3D coordinate vectors.
Machine Learning
Neural network layers are matrix multiplications. Training data is a matrix. Weight updates are matrix operations.
Physics
Quantum states are vectors; observables are matrices (operators). Rotation groups are matrix groups.
Engineering
Systems of differential equations, control theory, circuit analysis — all reduce to matrix equations.
Statistics
Covariance matrices, linear regression, PCA, and ANOVA are all fundamentally matrix operations.
Graph Theory
The adjacency matrix and Laplacian matrix encode graph structure. Graph properties translate to matrix properties.

Key Takeaways

Vector Spaces and Subspaces Overview Matrix Operations