Matrices & Systems

Strip the letters from a system of equations and what is left is a grid of numbers that can be solved mechanically.

Write out three equations in three unknowns and look at them.

Every one has an x term, then a y term, then a z term, then an equals sign. Always in that order.

the letters were never doing any work 2x + 3y − z = 7x − y + 2z = 43x + 2y + z = 13 2 3 −1 │ 7 1 −1 2 │ 4 3 2 1 │ 13 every x, y and z is in the same column every time so drop them, and keep the grid of numbers

The letters never move. They are column headings, doing no arithmetic at all.

So cross them out. What is left is a rectangle of numbers, and nothing was lost.

That rectangle is a matrix. Once the bookkeeping is separated from the arithmetic, a computer can solve a system of a thousand equations without ever seeing a letter.

When two matrices can be multiplied, and the size of the result the inside numbers must match; the outside ones give the size 2 × 3 first · 3 × 4 second = 2 × 4 these must agree

Reading and adding

Dimensions are always rows first, then columns. A 2 × 3 matrix has two rows of three.

Adding is done entry by entry, so the two matrices must be exactly the same shape.

Multiplying by a number multiplies every entry, exactly as it does with a vector.

Rows before columns

The entry a23 sits in row 2, column 3. The order is fixed, and every convention in the unit follows it.

Multiplying, and why the shapes must fit

To multiply, take a row of the first and a column of the second, multiply term by term and add — a dot product.

So the row and column must be the same length: the columns of the first must match the rows of the second.

A 2 × 3 times a 3 × 4 works and gives a 2 × 4. The inside numbers agree, and the outside ones give the answer.

Order changes the answer

AB and BA are usually different, and often one of them does not even exist. Matrix multiplication is not commutative, unlike every product before this unit.

The determinant

For a 2 × 2 matrix, det = ad - bc. It measures how much the matrix stretches area.

A determinant of zero means the matrix collapses the plane onto a line or a point, and flattening cannot be undone.

So a zero determinant is exactly the signal that no inverse exists.

What zero means for a system

A system whose determinant is zero has either no solution or infinitely many — never exactly one. The geometry and the algebra agree.

Inverses, and solving a system in one step

If Ax = b, then x = A-1b — the whole system solved by one multiplication.

For 2 × 2, A-1 = 1ad-bc[d-b-ca]: swap the diagonal, flip the signs off it, divide by the determinant.

This is why a calculator can solve a system instantly, and why it refuses when the determinant is zero.

Check by multiplying back

Multiply A by your A-1 and you should get the identity. Anything else means a sign slipped, and the check costs one line.

Row reduction

Write the coefficients and the constants as one augmented matrix, then use row operations to simplify.

You may swap rows, multiply a row by a non-zero number, or add a multiple of one row to another — each is a legal move on the equations themselves.

Drive it towards ones on the diagonal and zeros below, and the last row reads off a value you can back-substitute.

Nothing new is happening

Every row operation is something you would do to the equations anyway. The matrix just saves rewriting the letters each time.

Worked examples

Multiplying

Find [1230][45].

  1. Shapes: 2 × 2 times 2 × 1. The inside 2s agree, so the answer is 2 × 1. Check before calculating.
  2. Row one with the column: 1(4)+2(5) = 14. Multiply matching entries and add.
  3. Row two with the column: 3(4)+0(5) = 12. Same move, next row.

[1412]

A determinant

Find the determinant of [5324] and say whether it has an inverse.

  1. det = ad - bc = 5(4) - 3(2). Down the diagonal minus up the diagonal.
  2. = 20 - 6 = 14. Not zero.
  3. A non-zero determinant means the inverse exists. The matrix does not flatten the plane.

14; yes

Solving a system

Use the determinant to decide how many solutions 2x+3y=7, 4x+6y=1 has.

  1. The coefficient matrix is [2346]. Strip the letters.
  2. det = 2(6)-3(4) = 12-12 = 0. Zero, so there is no unique solution.
  3. The second equation is twice the first on the left but not on the right, so the lines are parallel. Parallel and distinct means no solution at all.

No solution

Words to know

Matrix
A rectangular array of numbers, described by its rows then columns.
Dimensions
Rows × columns. A 2 × 3 matrix has two rows and three columns.
Identity matrix
The square matrix with ones down the diagonal; it leaves everything unchanged.
Determinant
A single number computed from a square matrix; zero means it has no inverse.
Augmented matrix
The coefficients with the constants attached as a final column.

Mistakes to watch for

Assuming AB = BA. Matrix multiplication depends on order, and often only one of the two products is even defined. Checking the shapes first catches this immediately.

Multiplying entry by entry. That is how addition works, not multiplication — each entry of a product is a whole row dotted with a whole column.

Mismatching dimensions. A 2 × 3 can multiply a 3 × 4 but not a 4 × 3. The inside numbers must agree, and no arithmetic can rescue it if they do not.

Dividing by a zero determinant. A determinant of zero means no inverse exists, so the system has either no solution or infinitely many. Pressing on gives a division by zero.

Forgetting the sign flips in the 2 × 2 inverse. The diagonal entries swap and the other two change sign. Multiplying back to check the identity catches any slip in one line.

The word "matrix" in this sense is Sylvester’s, from 1850 — he meant it as a womb from which determinants are born.

Google’s original PageRank was one enormous matrix problem: find the vector that the web’s link matrix leaves unchanged.

Rotating, scaling and skewing an image are all matrix multiplications, which is why a graphics chip is essentially a machine for multiplying small matrices very fast.

Browse all courses