Matrices
“A matrix product pairs 'left rows' with 'right columns' and adds.”
The formula
(AB)ᵢⱼ = Σₖ aᵢₖ bₖⱼHow to read it: each entry of a matrix product multiplies row i of the left matrix by column j of the right, then adds the results
- A, B
- — matrices — numbers arranged in a rectangle
- (AB)ᵢⱼ
- — the entry in row i, column j of the product AB
- aᵢₖ, bₖⱼ
- — the entries of A's row i and B's column j that get paired
The hook
A matrix is just numbers arranged in a box, yet one multiplication rule lets it handle rotations, transformations, and systems of equations all at once.
In plain words
A matrix arranges numbers in rows and columns. To multiply two matrices, you pair a 'row of the left' with a 'column of the right', multiply, and add.
The intuition
Addition and scaling are easy — you just handle matching positions. Multiplication is the special one: a row of the left matrix 'lands on' a column of the right, multiplying entry by entry and summing. That rule lets you transform many equations in a single stroke.
How it's built
The entry aᵢⱼ means row i, column j. The (i,j) entry of AB multiplies all of A's row i by all of B's column j, in order, and adds. So the left matrix's column count must equal the right matrix's row count for the product to exist.
Example
[[1,2],[3,4]]×[[5,6],[7,8]], entry (1,1) = (1·5)+(2·7) = 5+14 = 19. Doing the rest the same way gives [[19,22],[43,50]].
Common mistake
AB and BA are usually different — matrix multiplication is not commutative. Swap the order and the result changes, or the product may not even be defined.
Where it's used
Rotations and scaling in computer graphics, solving linear systems, data transforms in statistics, the arithmetic inside neural networks — almost anywhere you transform many numbers together.
Where it came from
Cayley formalized matrices in the 1800s; the name 'matrix' comes from a Latin word for 'womb', something from which other things are born.
Prerequisites
Quick check
What do you get when you multiply a matrix A by the identity matrix I?
- The zero matrix
- A unchanged✓
- The transpose of A
- Always I
Practice
Find the (1,2) entry of [[2,1],[0,3]] + [[1,4],[5,2]].
Answer: 5
- Addition is entry-by-entry
- (1,2) entry: 1 + 4 = 5
Takeaway: Matrix addition adds matching positions.
Find the (2,2) entry of 3 × [[1,−2],[0,4]] (scalar multiple).
Answer: 12
- Scalar multiplication multiplies every entry
- (2,2) entry: 3·4 = 12
Takeaway: A scalar multiplies every cell equally.
Find the (2,2) entry of [[1,2],[3,4]] × [[0,1],[1,0]].
Answer: 3
- Pair row 2 (3,4) with column 2 (1,0)
- 3·1 + 4·0 = 3
Takeaway: A product multiplies row-by-column, entry by entry, and sums.
For A=[[1,0],[0,0]] and B=[[0,1],[0,0]], compute AB and BA and show they differ.
Answer: undefined
- AB = [[0,1],[0,0]]
- BA = [[0,0],[0,0]]
- AB ≠ BA — the order of the product matters
Takeaway: Swapping the order of a matrix product changes the result.