What is a matrix?

A matrix is a rectangular array of numbers called elements. A matrix with rows and columns is an matrix (rows first, then columns). Change the size below and read off the names.

rows 2 columns 3
The special names
If…it is calledexample
(square)a square matrix
1 columna column matrix (vector)
1 rowa row matrix
Where do matrices come from?

Anywhere you have a table of numbers. The simultaneous equations become .

Or a shopping list. Amy buys 2 cakes, 1 doughnut, 1 eclair; Bob buys 4, 0, 2. That is the matrix - one row per person, one column per item.

Two matrices you will meet everywhere

Zero matrix : every element 0, and .

Identity matrix : 1s down the diagonal, 0 elsewhere. It is the "1" of matrices - .   ,   .

Add, subtract and scalar multiply

You can only add or subtract matrices of the the same size - just add matching elements. A scalar multiplies every element. Type your own numbers; the answer updates live.

size:
Matrix A
Matrix B
scalar k
Is matrix addition commutative? associative?

Yes to both, because it is just element-by-element ordinary addition. and . (Multiplication is a different story - see the next tab.)

Multiplying matrices

To multiply, the columns of A must match the rows of B: an times an gives an . Each entry is a row of A dotted with a column of B. Click a result cell to see exactly which row and column made it.

A is 2×2 rows cols B is 2×2 cols
Matrix A
×
Matrix B
=
A B
Does order matter? (is it commutative?)

Usually yes, order matters: in general . Sometimes is not even a valid size. Swap A and B above (make them both square) and compare - this is why for transformations the matrix you apply first is written on the right.

Determinant and inverse of a 2×2

For the determinant is . It is the area scale factor of the transformation. The inverse undoes the matrix: swap the diagonal, negate the other two, and divide by the determinant.

Matrix A
What if the determinant is zero?

If the matrix is singular and has no inverse - geometrically it squashes the whole plane onto a line (area scale factor 0), so the move cannot be undone.

The formula

Check it works: always (the box above shows it for your numbers).

Determinant and inverse of a 3×3

For a 3×3 we use minors and cofactors. Strike out a row and column to get a 2×2 minor; attach the sign from the + − + grid to get the cofactor. Expand along the top row for the determinant, then transpose the cofactor matrix and divide by it for the inverse.

Matrix A
cofactor signs
+++++
Step 1 - the cofactor matrix
Step 2 - transpose to the adjugate, then divide by the determinant