๐Ÿงฎ Linear Algebra Kingdom ยท Linear Algebra

Determinants

One number that says whether a matrix flattens space: compute a 2 by 2 and a 3 by 3 determinant, use row operations and a triangular form to make it quick, apply the rules for a product, a scalar multiple and a transpose, read the determinant as an area, and solve a small system with it.

In short

  • det A = ad - bc for a 2 by 2, in that order: reversing the subtraction turns the sign over.
  • det A = 0 means a direction has been flattened away, so A has no inverse and its rows are dependent.
  • A cofactor expansion alternates plus, minus, plus by position, and any row or column may be used โ€” pick the one with the most zeros.
  • det(AB) = (det A)(det B), det(kA) = kn det A, det of a transpose is unchanged, and a determinant is the area a pair of vectors spans.

One number that says whether a direction survived

Millwright Orin keeps the Array Mill running on plates of numbers, and before he does anything else with a plate he checks one value: its determinant. It is a single number, written det A or |A|, and it answers one question โ€” has this matrix flattened anything away?

Think of a 2 by 2 matrix as a machine that takes the unit square and pushes it into a parallelogram. The determinant is the signed area of what comes out. If it is 12, the machine multiplies every area by 12. If it is -12, it does the same but turns the plane over on its way, like reading a page through the back of the paper. And if it is 0, the square has been squashed flat onto a line: a whole direction has been lost, and nothing can bring it back.

That last case is the one the whole kingdom turns on. det A = 0 means A is not invertible, its rows have fallen onto one another, and a system built on it does not have exactly one solution.

For a 2 by 2 the formula is short enough to memorise, and it is worth memorising:

A = [[a, b], [c, d]] => det A = ad - bc

Multiply the main diagonal (top left to bottom right) and take away the product of the other diagonal (top right to bottom left). The order of that subtraction is not decorative: swapping it to bc - ad turns the sign over, and the sign is real information about whether the plane was flipped.

det [[4, 1], [2, 5]] = (4)(5) - (1)(2) = 20 - 2 = 18 det [[3, 6], [1, 2]] = (3)(2) - (6)(1) = 6 - 6 = 0

The second one is flat. Look at its rows: [1, 2] is exactly one third of [3, 6]. Two rows that are multiples of one another always give a determinant of 0.

Three by three, and the alternating sign

A 3 by 3 determinant is built out of 2 by 2 determinants. Pick a row โ€” the first will do โ€” and for each entry in it, strike out that entry's row and its column. What is left is a 2 by 2, and its determinant is called that entry's minor.

det A = (a11)(M11) - (a12)(M12) + (a13)(M13)

Look hard at the middle sign. The signs alternate: plus, minus, plus. That minus belongs to the *position*, not to the entry, so it applies on top of whatever sign the entry already carries. Forgetting it is the most common slip in the whole topic, and it is easy to spot afterwards because the answer usually comes out far too large.

The sign pattern for a 3 by 3 is a chessboard starting with a plus in the top left:

+ - + - + - + - +

You may expand along any row or any column, and every one of them gives the same answer. So choose the line with the most zeros: an entry of 0 contributes nothing at all, however big its minor turns out to be, and a row with two zeros in it turns a nine-term calculation into a three-term one.

Two shortcuts are worth having as well.

  • A triangular matrix's determinant is the product of its diagonal. If everything below the main diagonal is 0 (or everything above it is), just multiply the diagonal entries and stop.
  • Row operations behave predictably. Adding a multiple of one row to another changes nothing. Swapping two rows turns the sign over. Multiplying a row by k multiplies the determinant by k. So you may reduce a matrix towards triangular form, keeping a tally of the swaps, and then read the diagonal.

The rules, and what a determinant is good for

Once you can compute one, four rules do most of the work, and none of them needs you to build a single matrix:

  • det(AB) = (det A)(det B). A product of matrices gives a product of numbers. Notice it is a product, not a sum: det(A + B) is not det A + det B, and there is no useful rule of that shape.
  • det(kA) = kn * det A for an n by n matrix. Every one of the n rows is scaled, and every row contributes its own factor of k. Using k once instead of n times is the classic error here.
  • det(A transpose) = det A. Swapping rows for columns changes nothing.
  • det(A inverse) = 1 / det A, which follows from the first rule: A times its inverse is the identity, whose determinant is 1.

And two things a determinant measures directly.

Area. The parallelogram spanned by u = (u1, u2) and v = (v1, v2) has area |det [[u1, v1], [u2, v2]]|. Take the absolute value, because the sign only records which way round the two vectors sit. The triangle with the same two sides is half of that, so its area is |det| / 2.

Solutions. Cramer's rule solves a 2 by 2 system with three determinants. Write the coefficient matrix A and the right-hand side b. Then

x = det(A with its FIRST column replaced by b) / det A y = det(A with its SECOND column replaced by b) / det A

The column you replace is the column belonging to the unknown you want. And the rule needs det A to be non-zero โ€” which is the same sentence, again, about a direction that has to survive.

Worked examples

Example 1

A = [[5, -2], [3, 4]]. Find det A.

  1. det A = ad - bc, with a = 5, b = -2, c = 3, d = 4.
  2. The main diagonal product is ad = (5)(4) = 20.
  3. The other diagonal product is bc = (-2)(3) = -6.
  4. det A = 20 - (-6) = 26. Subtracting a negative added, so the answer grew rather than shrank.

Example 2

A = [[2, 0, 1], [3, 1, 4], [1, 2, 2]]. Find det A by expanding along the first row.

  1. The first row is 2, 0, 1, and the middle entry is 0, so that whole term disappears whatever its minor is.
  2. Strike out row 1 and column 1: M11 = det [[1, 4], [2, 2]] = (1)(2) - (4)(2) = -6.
  3. Strike out row 1 and column 3: M13 = det [[3, 1], [1, 2]] = (3)(2) - (1)(1) = 5.
  4. Assemble with signs plus, minus, plus: det A = (2)(-6) - (0)(M12) + (1)(5) = -12 + 5 = -7.

Example 3

The vectors u = (4, 1) and v = (1, 3) are drawn from the origin. What is the area of the triangle whose corners are the origin, the tip of u and the tip of v?

  1. Put u and v in as the columns of a matrix: [[4, 1], [1, 3]].
  2. det = (4)(3) - (1)(1) = 12 - 1 = 11. That is the signed area of the parallelogram the two vectors span.
  3. Take the absolute value: the parallelogram has area 11.
  4. The triangle is half of the parallelogram, so its area is 11/2.

Practice problems, with solutions

Three problems of increasing difficulty, each with the full working. In the game these are generated fresh every time; these three are fixed so this page always shows the same ones.

Problem 1

Difficulty 1 of 5

Millwright Orin chalks a plate on the wall of the Array Mill. A = [[4, 2], [4, 3]] Find det A.

Answer: 4

  1. det A = ad - bc, with a = 4, b = 2, c = 4, d = 3.
  2. ad = 4*3 = 12.
  3. bc = 2*4 = 8.
  4. det A = 12 - 8 = 4.

Problem 2

Difficulty 3 of 5

A = [[4, 4, -3], [-2, 4, -4], [-2, 2, 1]] Expand along the first row to find det A.

Answer: 76

  1. Expanding along the first row: det A = (a11)(M11) - (a12)(M12) + (a13)(M13), where Mij is the 2 by 2 determinant left when row i and column j are struck out.
  2. M11 = det [[4, -4], [2, 1]] = 12.
  3. M12 = det [[-2, -4], [-2, 1]] = -10.
  4. M13 = det [[-2, 4], [-2, 2]] = 4.
  5. det A = 4*12 - 4*(-10) + (-3)*4 = 76.

Problem 3

Difficulty 4 of 5

A = [[0, -4, -5], [0, 2, 1], [-4, 4, -1]] Use row operations to reach a triangular form, then find det A.

Answer: -24

  1. Swap R1 and R3. A row swap turns the sign of the determinant over.
  2. R3 -> R3 + 2*R2. Adding a multiple of one row to another leaves the determinant alone.
  3. The triangular form is [[-4, 4, -1], [0, 2, 1], [0, 0, -3]].
  4. Its determinant is the product of its diagonal: (-4)*2*(-3) = 24.
  5. A swap was used on the way, so the sign turns over: det A = -(24) = -24.

Common mistakes

  • Subtracting the two products the wrong way round, bc - ad instead of ad - bc, which gives the right size with the wrong sign.
  • Forgetting the alternating sign in a cofactor expansion and adding all three terms.
  • Multiplying the diagonal of a matrix that is not yet triangular โ€” that shortcut only works once every entry below the diagonal is zero.
  • Reporting a negative number as an area, or forgetting to halve a parallelogram to get the triangle inside it.

What you should be able to do

  • Compute the determinant of a 2 by 2 matrix and of a 3 by 3 matrix by cofactor expansion.
  • Use row operations or a triangular form to compute a determinant, and apply the rules for det(AB), det(kA) and det of a transpose.
  • Find the value of a parameter that makes a determinant zero.
  • Use a determinant as the area of a parallelogram or triangle, and solve a 2 by 2 system by Cramerโ€™s rule.

Where this fits in the curriculum

Common Core

  • HSN-VM.C.10

    High school โ€” Understand that the zero and identity matrices play a role in matrix addition and multiplication similar to the role of 0 and 1 in the real numbers; the determinant of a square matrix is nonzero if and only if the matrix has a multiplicative inverse.

    HSN-VM.C.10 is a (+) standard โ€” beyond the college- and career-ready threshold, i.e. precalculus rather than Algebra II. Cofactor expansion for a 3 ร— 3, the row-operation rules and Cramer's rule are techniques behind this standard rather than standards of their own.

  • HSN-VM.C.12

    High school โ€” Work with 2 ร— 2 matrices as transformations of the plane, and interpret the absolute value of the determinant in terms of area.

    HSN-VM.C.12 is a (+) standard โ€” beyond the college- and career-ready threshold, i.e. precalculus rather than Algebra II.

Learn these first

This leads on to