Elimination gets from A to U — this lecture packages the whole process into one equation, A = LU, the most basic factorization of a matrix. The multipliers from elimination drop straight into L with no extra work. Along the way, inverses and transposes of products, the n-cubed-over-three cost of elimination, and the permutation matrices that handle row exchanges.
Unfinished business from last time: if A and B are both invertible, what is the inverse of AB? You multiply the separate inverses — but in reverse order:
The check is just moving parentheses around. In AB⋅B−1A−1, do the middle multiplication first: BB−1=I, then AIA−1=AA−1=I. On the other side, B−1A−1⋅AB — this time the inner pair A−1A squeezes down to the identity, and B−1B finishes the job.
Strang apologizes in advance for the example in the book, but it sticks: you take off your shoes, then your socks — so the way to invert that process is socks back on first, then shoes. Inverses come in reverse order.
While we’re at it, one fact about transposes, since the next lecture is full of them. Start from AA−1=I and transpose both sides. The identity doesn’t notice being transposed — it’s symmetric. And a product transposes in reverse order, so
(A−1)TAT=I
That equation answers the question “what is the inverse of AT?” — it’s sitting right there on the left:
From EA = U to A = LU
Now the main event. Elimination takes A to U — we know the steps. Today’s lecture is the right way to look at those steps: as a factorization A=LU. Strang calls this “the most basic factorization of a matrix” — and adds a worry: please don’t think this course is all elimination. It’s just the right algebra to do first. Throughout, assume the nice case: no row exchanges, all pivots fine.
Start with a 2×2. Take
A=[2817]
The first pivot is 2, so the multiplier is 4 — and the 7 was chosen so the matrix isn’t singular (a 4 in that corner would have killed the second pivot). One elimination step, carried out by the elementary matrix E21, produces U in one shot:
E21[1−401][2817]=U[2013]
But what Strang is shooting for is A alone on one side and everything else on the other. Multiply through by E21−1 — and elimination matrices are easy to invert: the inverse of subtracting 4 of row one is adding back4 of row one, so the sign just flips.
Sometimes it’s nicer to pull the pivots out into their own diagonal matrix D, leaving ones on both triangular diagonals. Divide row one of U by 2 and row two by 3:
A=[1401][2003][10211]
That balanced form is A=LDU. MATLAB would produce either one; Strang basically stays with LU.
Three by three: why L beats E
For a 2×2 this was easy — one E, and the only difference between E and L was a minus sign versus a plus sign. With 3×3 there’s a more significant difference. Elimination now takes three steps:
E32E31E21A=U
first a zero in the (2,1) position, then (3,1), then (3,2). Moving everything to the right side means inverting the whole bunch — separate inverses, opposite order:
A=E21−1E31−1E32−1U=LU
So L is a product of inverses. But why prefer the inverses? Why is that product nicer than the product of the E‘s themselves? Strang makes the point with a typical case: suppose E21 has multiplier 2, suppose E31 happens to be the identity (a zero was already sitting in the (3,1) position), and E32 has multiplier 5. Multiply the E‘s in elimination order:
Everything above the diagonal stays zero — elimination only subtracts rows from lower rows, nothing moves upward as it did in Gauss–Jordan. But look at that 10. Where did it come from? “I don’t like that ten,” Strang says — it’s right, but he doesn’t want it there. It appeared because two of row one got removed from row two, and then five of that new row two got removed from row three — so altogether ten of row one got thrown into row three. The multipliers interfere.
Now do it in the reverse direction, inverses in opposite order:
A happy result: the 2 and the 5 don’t interfere to produce any 10. In the right order, the multipliers just sit in the matrix L.
The unattractive matrix is E, the product of elimination matrices — you can’t see what it is without multiplying. Put the inverses on the other side, in the opposite order, and L comes out just right. That’s the new insight elimination gains from being done in matrix form: EA=U, whereas A=LU.
How expensive is elimination?
Today is a practical day, so a practical question: how many operations does elimination cost on an n×n matrix? Can we solve a system of order a thousand in a second, a minute, a week? Suppose there are no convenient zeros — count a multiply-and-subtract pair as one operation.
Take n=100. The first stage of elimination fixes the first row and clears the first column, changing essentially every entry of the matrix — about 1002 operations, since 1002 is the total number of entries and only the insignificant first row is left alone. The second stage works on the remaining 99×99 block: about 992. Then 982, 972, all the way down to 22 and 12. The big numbers come first; the problem keeps shrinking. So the total is
n2+(n−1)2+(n−2)2+⋯+22+12≈31n3
Is it proportional to n? Certainly not. Is it n! — a hundred times longer each time n grows by one? No (Strang puts in “a bad mark against determinants,” where n! really does show up). There are n terms and the biggest is n2, so the worst it could be is n3 — and the shrinking brings in the factor 31. Strang allows exactly one mention of calculus: summing x2 is like integrating it, and ∫1nx2dx=31n3. Calculus is like sums, except it’s continuous; algebra is discrete.
That gap is why the factorization matters in practice: pay the 31n3 price once to split A into L and U, then process every new right-hand side at the low n2 cost. This is the most fundamental algorithm for a system of equations.
Permutations: allowing row exchanges
Finally, drop the nice-case assumption. When do we need row exchanges? When a zero shows up in the pivot position. The matrices that do the exchanging are permutation matrices — the identity matrix with its rows rearranged.
For 3×3 there is a nice little family of them — all six ways to rearrange the rows of I. The identity itself (exchanges nothing), the three single exchanges,
Multiply any two of these together and the answer is on the list — doing some row exchanges and then some more row exchanges is, all together, row exchanges. Invert any one and you’re still inside the family. “Group is the right name for this subject”: the six matrices form a group.
How many 4×4 permutation matrices? Twenty-four. The next lecture puts them to work.
Problems
Work these before revealing the solutions — everything you need is in the lecture.
Problem 4.1Inverses in reverse order
Let
A=[1501],B=[1021]
Write down A−1 and B−1 (no computation needed — these are elimination-type matrices). Then compute (AB)−1 using the reverse-order rule and verify it against AB.
Show solution
Flip the signs of the off-diagonal entries: A−1=[1−501], B−1=[10−21].
Record the multipliers as you go, and check your factorization by multiplying LU back together.
Show solution
Multiplier ℓ21=3: subtract 3 of row one from row two.
1002241−21
The (3,1) entry is already zero, so ℓ31=0. Multiplier ℓ32=2: subtract 2 of the new row two from row three.
U=1002201−25
The multipliers go directly into L:
L=130012001
Check row three of LU: 0⋅(1,2,1)+2⋅(0,2,−2)+(0,0,5)=(0,4,1). ✓ Row two: 3(1,2,1)+(0,2,−2)=(3,8,1). ✓
Problem 4.3Why E is worse than L
Suppose E21 subtracts 3 times row one from row two, E31=I, and E32 subtracts 4 times row two from row three (all 3×3). Compute the product E=E32E21 and the product L=E21−1E32−1. Which entry of E is “interference,” and why is it absent from L?
The 12 in the (3,1) position is the interference: three of row one was removed from row two, then four of that new row two from row three, so twelve of row one got thrown into row three.
In reverse order with plus signs:
L=130010001100014001=130014001
No 12: in this order the multipliers 3 and 4 don’t interact — they just sit in their own positions. That is exactly why A=LU is the preferred form: L is free.
Problem 4.4Operation counts
Elimination on a 1000×1000 matrix takes roughly how many operations? If you then need to solve Ax=b for 50 different right-hand sides b, roughly what does that add? Finally: if n doubles, by what factor does the cost of elimination on A grow?
Show solution
Cost on A: about 31n3=31(1000)3≈3.3×108 operations.
Each right-hand side costs about n2=106 operations, so 50 of them add about 5×107 — still much less than the one-time cost of factoring A. That’s the payoff of A=LU: factor once, then every new b is cheap.
Doubling n multiplies 31n3 by 23=8: a 2000×2000 system costs about eight times as much as a 1000×1000 one.
Problem 4.5The permutation group
Let
P=001100010
(the cycle that moves row two up to row one, row three up to row two, and row one down to row three). Find P−1, verify that P−1=PT, and say how many 5×5 permutation matrices there are.
Show solution
To undo the cycle, send each row back where it came from: row one back down to row two, row two down to row three, row three up to row one. That is the other cycle:
P−1=010001100
Check: PP−1 — row one of P picks out row two of P−1, which is (1,0,0); row two picks out row three, (0,1,0); row three picks out row one, (0,0,1). So PP−1=I. ✓
Transposing P (exchange rows and columns) gives exactly the same matrix as P−1 above, confirming P−1=PT.
The number of n×n permutation matrices is the number of ways to rearrange n rows: n!. For n=5 that is 120.