Matrices
Multiply matrices and compute determinants.
Pen and paper is fine · no calculator needed why?
Opens at level 42. You're level 1. You can read and practice here now.
the idea
A matrix is a grid of numbers. Here it is written as a list of rows: [[1, 2], [3, 4]] has first row (1, 2) and second row (3, 4).
Each entry of a product AB is a dot product: a row of A with a column of B. So AB and BA are usually different.
The determinant of a square matrix measures how much it stretches area or volume; a minus sign means it also flips them over. It is 0 exactly when the matrix squashes space flat.
techniques
Row times column
- For the entry in row i, column j, take row i of A and column j of B.
- A column runs down: column j holds the j-th entry of each row.
- Multiply matching entries and add, as in a dot product.
worked example
A = [[2, −1], [0, 3]] and B = [[4, 1], [5, −2]] (rows listed). What is the entry in row 1, column 2 of AB?
- Row 1 of A is (2, −1). Column 2 of B is (1, −2).
- 2 × 1 + (−1) × (−2) = 2 + 2 = 4.
Answer: 4
2 × 2 determinant: ad − bc
- Multiply down the main diagonal, a × d.
- Multiply the other diagonal, b × c.
- Subtract the second from the first. Keep the signs of negative entries.
worked example
What is the determinant of [[3, −2], [5, 4]]?
- ad = 3 × 4 = 12.
- bc = (−2) × 5 = −10.
- 12 − (−10) = 22.
Answer: 22
3 × 3: expand along the zeros
- Pick the row or column with the most zeros.
- Signs follow a checkerboard: + − + on the top row, − + − in the middle, + − + at the bottom.
- Each nonzero entry gives sign × entry × the 2 × 2 determinant left when you cross out its row and column.
- Add those terms. The zero entries drop out.
worked example
What is the determinant of [[0, 3, 0], [2, 1, 4], [1, 5, 3]]?
- Row 1 has two zeros. Its middle position has sign −.
- Cross out row 1 and column 2: [[2, 4], [1, 3]].
- That determinant is 6 − 4 = 2.
- det = −3 × 2 = −6.
Answer: −6
watch out for
- Multiplying the entries in the same spot of A and B. An entry of AB is a whole row times a whole column.
- Adding the two diagonal products. The determinant subtracts them.
- Forgetting the checkerboard sign. The middle entry of the top row carries a minus.
practice
Matrix product entry
worked example
A = [[−3, 0, −2], [−3, 4, 9]] and B = [[4, −1], [−5, 8], [2, −4]] (rows listed). What is the entry in row 1, column 2 of AB?
Answer: 11
- Row 1 of A is (−3, 0, −2); column 2 of B is (−1, 8, −4).
- (−3) × (−1) + 0 × 8 + (−2) × (−4) = 3 + 0 + 8 = 11.
2 × 2 determinant
worked example
What is the determinant of [[8, 4], [6, −2]]?
Answer: -40
- For [[a, b], [c, d]] the determinant is ad − bc.
- 8 × (−2) − 4 × 6 = −16 − 24 = −40.
3 × 3 determinant
worked example
What is the determinant of [[2, −1, 0], [1, −2, 0], [−2, 1, −3]]?
Answer: 9
- Expand along column 3 (cofactor signs + − +); zero entries drop out.
- det = −3 × (2 × (−2) − (−1) × 1)
- = −3 × (−3) = 9.