The second lecture solves by elimination, the method every software package uses, and expresses it in matrix language (transcript, p. 1). Gauss thought of it first, Strang says, but only because he was born earlier (p. 1). It continues the geometry of linear equations.
Forward elimination#
The example (transcript, pp. 1–2):
In words
x plus 2 y plus z equals 2, 3 x plus 8 y plus z equals 12, 4 y plus z equals 2; capital A equals 1 2 1; 3 8 1; 0 4 1, b equals 2; 12; 2
Keep the first equation, and subtract a multiple of it from the second to knock out (p. 2). The 1 in the top left is the first pivot (pp. 2–3). The multiplier is 3: subtracting 3 times row 1 from row 2 leaves (p. 3). That clears position (2, 1); position (3, 1) already holds 0, so its multiplier is 0 (pp. 3–4). Now is gone from the last two equations, and the second pivot is the 2. Subtracting 2 times row 2 from row 3 clears position (3, 2) and leaves the third pivot, 5 (p. 4):
In words
capital A equals 1 2 1; 3 8 1; 0 4 1 goes to 1 2 1; 0 2 minus 2; 0 4 1 goes to 1 2 1; 0 2 minus 2; 0 0 5 equals U
is upper triangular; getting from to is the most common calculation in scientific computing (p. 5). Pivots may not be 0, and here they are 1, 2, 5; their product is the determinant, 10 (p. 5).
How elimination can fail (pp. 5–7). A 0 in a pivot position is not the end: exchange rows with a lower equation that has a nonzero entry there (pp. 5–6). Changing the 8 to a 6 would make the second pivot position 0, but the 4 below would allow an exchange (p. 6). Changing the coefficient of in the third equation from 1 to , however, would turn the third pivot into 0 with nothing below: complete failure, and the matrix would not be invertible (pp. 6–7).
Back substitution#
Carry the right-hand side along as an extra column, the augmented matrix (transcript, p. 7). The steps change to and then to (p. 8). (On p. 7 the transcript says "2 of the first equation"; the multiplier is 3.) The equations are (p. 9)
In words
x plus 2 y plus z equals 2, 2 y minus 2 z equals 6, 5 z equals minus 10
Solve from the bottom up, since the system is triangular: , then gives , then gives (p. 9).
Rows and columns of a product#
A matrix times a column is a combination of the matrix's columns: is 3 times column 1 plus 4 times column 2 plus 5 times column 3 (transcript, p. 10). The parallel fact for rows, which matters because elimination works on rows (pp. 10–11):
In words
1 2 7 capital A equals 1 ( row 1) plus 2 ( row 2) plus 7 ( row 3)
Elimination matrices#
The first step, subtracting 3 times row 1 from row 2, is a multiplication by the elimination matrix (transcript, pp. 11–13). Rows 1 and 3 stay, so their rows of are and ; leaving everything alone would be the identity matrix (p. 12). Row 2 must take of row 1 plus 1 of row 2 (pp. 12–13):
In words
E two one equals 1 0 0; minus 3 1 0; 0 0 1, E three two equals 1 0 0; 0 1 0; 0 minus 2 1
One entry of a product can be checked by a dot product: row 2 of with column 3 of gives (p. 13). The whole of elimination is then (p. 15)
In words
E three two ( E two one capital A ) equals U equals ( E three two E two one ) capital A
The parentheses can be moved, the associative law, though it takes work to prove; so the single matrix does all of elimination at once (pp. 15–16). Strang notes that there is a better way to see it, going from back to , which is the next lecture but one (pp. 18–19).
Permutations (pp. 16–18). A permutation matrix exchanges rows: do the exchange to the identity matrix and use the result, , so (p. 17). To exchange columns, the same matrix must multiply on the right: matrices on the left act on rows, on the right on columns (pp. 17–18). The order matters, in general: the commutative law is false, though the associative law holds (p. 18).
A first inverse (pp. 19–20). What undoes ? It subtracted 3 times row 1 from row 2, so the inverse adds it back (p. 20):
In words
E two one to the power minus 1 equals 1 0 0; 3 1 0; 0 0 1, E two one to the power minus 1 E two one equals capital I
Eliminate and back-substitute
Solve , , by elimination; give the pivots, the elimination matrices, and the determinant.
Column 1
Pivot 1. Subtract 2 times row 1 from row 2: with right side 2, with having in position (2, 1). Add row 1 to row 3 (multiplier ): with right side 9, with having in position (3, 1).
Column 2
Pivot 3. Subtract row 2 from row 3: with right side 7, with having in position (3, 2). The pivots are 1, 3, 7, so the determinant is 21.
Back substitution
gives ; gives ; gives . Check the third equation: .
Summary#
- Elimination subtracts multiples of pivot rows to reach an upper triangular ; pivots cannot be 0. Row exchanges cure a zero pivot position when a nonzero lies below.
- Carry along (the augmented matrix) to get , then back-substitute.
- Each step is an elimination matrix: , by the associative law; .
- Rows: matrices on the left; columns: on the right. The inverse of an elimination step adds back what it subtracted.