These video lectures of Professor Gilbert Strang teaching 18.06 were recorded in Fall 1999 and do not correspond precisely to the current edition of the textbook. However, this book is still the best reference for more information on the topics covered in each lecture.
Instructor/speaker: Prof. Gilbert Strang
OK, this lecture is like the beginning of the second half of this course because up to now we paid a lot of attention to rectangular matrices. Now, concentrating on square matrices, so we're at two big topics.
The determinant of a square matrix, so this is the first lecture in that new chapter on determinants, and the reason, the big reason we need the determinants is for the Eigen values.
So this is really determinants and Eigen values, the next big, big chunk of 18.06. OK, so the determinant is a number associated with every square matrix, so every square matrix has this number associated with called the, its determinant.
I'll often write it as D E T A or often also I'll write it as, A with vertical bars, so that's going to mean the determinant of the matrix. That's going to mean this one, like, magic number. Well, one number can't tell you what the whole matrix was. But this one number, just packs in as much information as possible into a single number, and of course the one fact that you've seen before and we have to see it again is the matrix is invertible when the determinant is not zero.
The matrix is singular when the determinant is zero.
So the determinant will be a test for invertibility, but the determinant's got a lot more to it than that, so let me start. OK, now the question is how to start. Do I give you a big formula for the determinant, all in one gulp? I don't think so! That big formula has got too much packed in it.
I would rather start with three properties of the determinant, three properties that it has. And let me tell you property one. The determinant of the identity is one. OK.
I... I wish the other two properties were as easy to tell you as that.
But actually the second property is pretty straightforward too, and then once we get the third we will actually have the determinant. Those three properties define the determinant and we can -- then we can figure out, well, what is the determinant? What's a formula for it? Now, the second property is what happens if you exchange two rows of a matrix.
What happens to the determinant? So, property two is exchange rows, reverse the sign of the determinant. A lot of plus and minus signs.
I even wrote here, "plus and minus signs," because this is, like, that's what you have to pay attention to in the formulas and properties of determinants.
So that -- you see what I mean by a property here? I haven't yet told you what the determinant is, but whatever it is, if I exchange two rows to get a different matrix that reverses the sign of the determinant.
And so now, actually, what matrices do we now know the determinant of? From one and two, I now know the determinant. Well, I certainly know the determinant of the identity matrix and now I know the determinant of every other matrix that comes from row exchanges from the identities still.
So what matrices have I gotten at this point? The permutations, right.
At this point I know every permutation matrix, so now I'm saying the determinant of a permutation matrix is one or minus one. One or minus one, depending whether the number of exchanges was even or the number of exchanges was odd. So this is the determinant of a permutation. Now, P is back to standing for permutation. OK. if I could carry on this board, I could, like, do the two-by-two's. So, property one tells me that this two-by-two matrix. Oh, I better write absolute -- I mean, I'd better write vertical bars, not brackets, for that determinant.
Property one said, in the two-by-two case, that this matrix has determinant one.
Property two tells me that this matrix has determinant -- what? Negative one. This is, like, two-by-twos. Now, I finally want to get -- well, ultimately I want to get to, the formula that we all know. Let me put that way over here, that the determinant of a general two-by-two is ad-bc. OK.
I'm going to leave that up, like, as the two by two case that we already know, so that every property, I can, like, check that it's correct for two-by-twos. But the whole point of these properties is that they're going to give me a formula for n-by-n.
That's the whole point. They're going to give me this number that's a test for invertibility and other great properties for any size matrix. OK, now you see I'm like, slowing down because property three is the key property.
Property three is the key property and can I somehow describe it -- maybe I'll separate it into 3A and 3B. Property 3A says that if I multiply one of the rows, say the first row, by a number T -- I'm going to erase that. That's, like, what I'm headed for but I'm not there yet. It's the one we know and you'll see that it's checked out by each property.
OK, so this is for any matrix. For any matrix, if I multiply one row by T and leave the other row or other n-1 rows alone, what happens to the determinant? The factor T comes out. It's T times this determinant.
That's not hard. I shouldn't have made a big deal out of property 3A, and 3B is that, if is, is if I keep -- I'm always keeping this second row the same, or that last n-1 rows are all staying the same.
I'm just working -- I'm just looking inside the first row and if I have an a+a' there and a b+b' there -- sorry, I didn't. Ahh.
Why don't -- I'll use an eraser, do it right. b+b' there. You see what I'm doing? This property and this property are about linear combinations, of the first row only, leaving the other rows unchanged. They'll copy along.
Then, then I get the sum -- this breaks up into the sum of this determinant and this one. I'm putting up formulas.
Maybe I can try to say it in words.
The determinant is a linear function.
It behaves like a linear function of first row if all the other rows stay the same. I not saying that -- let me emphasize. I not saying that the determinant of A plus B is determinant of A plus determinant of B. I not saying that.
I'd better -- can I -- how do I get it onto tape that I'm not saying that? You see, this would allow all the rows -- you know, A to have a bunch of rows, B to have a bunch of rows. That's not the linearity I'm after. I'm only after linearity in each row. Linear for each row.
Well, you may say I only talked about the first row, but I claim it's also linear in the second row, if I had this -- but not, I can't, I can't have a combination in both first and second. If I had a combination in the second row, then I could use rule two to put it up in the first row, use my property and then use rule two again to put it back, so each row is OK, not only the first row, but each row separately. OK, those are the three properties, and from those properties, so that's properties one, two, three. From those, I want to get all -- I'm going to learn a lot more about the determinant.
Let me take an example. What would I like to learn? I would like to learn that -- so here's our property four.
Let me use the same numbering as here.
Property four is if two rows are equal, the determinant is zero. OK, so property four.
Two equal rows lead to determinant equals zero. Right. Now, of course I can -- in the two-by-two case I can check, sure, the determinant of ab ab comes out zero. But I want to see why it's true for n-by-n. Suppose row one equals row three for a seven-by-seven matrix.
So two rows are the same in a big matrix. And all I have to work with is these properties.
The exchange property, which flips the sign, and the linearity property which works in each row separately. OK, can you see the reason? How do I get this one out of properties one, two, three? Because -- that's all I have to work with. Everything has to come from properties one, two, three.
OK, so suppose I have a matrix, and two rows are even.
How do I see that its determinant has to be zero from these properties? I do an exchange.
Property two is just set up for this.
Use property two. Use exchange -- exchange rows. Exchange those rows, and I get the same matrix.
Of course, because those rows were equal. So the determinant didn't change.
But on the other hand, property two says that the sign did change. So the -- so I, I have a determinant whose sign doesn't change and does change, and the only possibility then is that the determinant is zero.
You see the reasoning there? Straightforward.
Property two just told us, hey, if we've got two equal rows we. .
we've got a zero determinant. And of course in our minds, that matches the fact that if I have two equal rows the matrix isn't invertible. If I have two equal rows, I know that the rank is less than n.
OK, ready for property five. Now, property five you'll recognize as P. It says that the elimination step that I'm always doing, subtract a multiple, subtract some multiple l times row one from another row, row k, let's say. You remember why I did that.
In elimination I'm always choosing this multiplier so as to produce zero in that position.
Or row I from row k, maybe I should just make very clear that there's nothing special about row one here.
OK, so that, you can see why I want that one, because that will allow me to start with this full matrix whose determinant I don't know, and I can do elimination and clean it out.
I can get zeroes below the diagonal by these elimination steps and the point is that the determinant, the determinant doesn't change. So all those steps of elimination are OK not changing the determinant.
In our language in the early chapter the determinant of A is going to be the same as the determinant of U, the upper triangular one. It just has the pivots on the diagonal. That's why we'll want this property. OK, do you see where that property's coming from? Let me do the two-by-two case.
Let me do the two-by-two case here.
So, I'll keep property five going along. So what I doing? I'm going to keep -- I'm going to have ab cd, but I'm going to subtract l times the first row from the second row.
And that's the determinant and of course I can multiply that out and figure out, sure enough, ad-bc is there and this minus ALB plus ALB cancels out, but I just cheated, right? I've got to use the properties.
So what property? Well, of course, this is a com -- I'm keeping the first row the same and the second row has a c and a d, and then there's the determinant of the A and the B, and the minus LA, and the minus LB.
So what property was that? 3B.
I kept one row the same and I had a combination in the second, in the other row, and I just separated it out.
OK, so that's property 3. That's by number 3, 3B if you like. OK, now use 3A.
How do you use 3A, which says I can factor out an l, I can factor out a minus l here.
I can factor a minus l out from this row, no problem.
That was 3A. So now I've used property three and now I'm ready for the kill. Property four says that this determinant is zero, has two equal rows.
You see how that would always work? I subtract a multiple of one row from another one.
It gives me a combination in row k of the old row and l times this copy of the higher row, and then if -- since I have two equal rows, that's zero, so the determinant after elimination is the same as before.
Now, let's see -- if I rescue my glasses, I can see what's property six. Oh, six is easy, plenty of space. Row of zeroes leads to determinant of A equals zero. A complete row of zeroes.
So I'm again, this is like, something I'll use in the singular case.
Actually, you can look ahead to why I need these properties.
So I'm going to use property five, the elimination, use this stuff to say that this determinant is the same as that determinant and I'll produce a zero there.
But what if I also produce a zero there? What if elimination gives a row of zeroes? That, that used to be my test for, mmm, singular, not invertible, rank two -- rank less than N, and now I'm seeing it's also gives determinant zero.
How do I get that one from the previous properties? 'Cause I -- this is not a new law, this has got to come from the old ones. So what shall I do? Yeah, use -- that's brilliant. If you use 3A with T equals zero. Right.
So I have this zero zero cd, and I'm trying to show that that determinant is zero.
OK, so the zero is the same is -- five, can I take T equals five, just to, like, pin it down? I'll multiply this row by five. Five, well then, five of this should -- if I, if there's a factor five in that, you see what -- so this is property 3A, with taking T as five. If I multiply a row by five, out comes a five. So why I doing this? Oh, because that's still zero zero, right? So that's this determinant equals five times this determinant, and the determinant has to be zero.
I think I didn't do that the very best way.
You were, yeah, you had the idea better.
Multiply, yeah, take T equals zero.
Was that your idea? Take T equals zero in rule 3B.
If T is zero in rule 3B, and I bring the camera back to rule 3B -- sorry. If T is zero, then I have a zero zero there and the determinant is zero.
OK, one way or another, a row of zeroes means zero determinant. OK, now I have to get serious.
The next properties are the ones that we're building up to.
OK, so I can do elimination. I can reduce to a triangular matrix and now what's the determinant of that triangular matrix? Suppose, suppose I -- all right, rule seven. So suppose my matrix is now triangular. So it's got -- so I even give these the names of the pivots, d1, d2, to dn, and stuff is up here, I don't know what that is, but what I do know is this is all zeroes. That's all zeroes, and I would like to know the determinant, because elimination will get me to this.
So once I'm here, what's the determinant then? Let me use an eraser to get those, get that vertical bar again, so that I'm taking the determinant of U so that, so, what is the determinant of an upper triangular matrix? Do you know the answer? It's just the product of the d's. The -- these things that I don't even put in letters for, because they don't matter, the determinant is d1 times d2 times dn.
If I have a triangular matrix, then the diagonal is all I have to work with. And that's, that's telling us then. We now have the way that MATLAB, any reasonable software, would compute a determinant.
If I have a matrix of size a hundred, the way I would actually compute its determinant would be elimination, make it triangular, multiply the pivots together, the product of the pivots, the product of pivots.
Now, there's always in determinants a plus or minus sign to remember. Where -- where does that come into this rule? Could it be, could the determinant be minus the product of the pivots? The determinant is d1, d2, to dn.
No doubt about that. But to get to this triangular form, we may have had to do a row exchange, so, so this -- it's the product of the pivots if there were no row exchanges. If, if SLU code, the simple LU code, the square LU went right through. If we had to do some row exchanges, then we've got to watch plus or minus.
OK, but though -- this law is simply that.
OK, how do I prove that? Let's see, let me suppose that d's are not zeroes.
The pivots are not zeroes. And tell me, how do I show that none of this upper stuff makes any difference? How do I get zeroes there? By elimination, right? I just multiply this row by the right number, subtract from that row, kills that.
I multiply this row by the right number, kills that, by the right number, kills that. Now, you kill every one of these off-diagonal terms, no problem and I'm just left with the diagonal. Well, strictly speaking, I still have to figure out why is, for a diagonal matrix now, why is that the right determinant? I mean, we sure hope it is, but why? I have to go back to properties one, two, three.
Why is -- now that the matrix is suddenly diagonal, how do I know that the determinant is just a product of those diagonal entries? Well, what I going to use? I'm going to use property 3A, is that right? I'll factor this, I'll factor this, I'll factor that d1 out and have one and have the first row will be that.
And then I'll factor out the d2, shall I shall I put the d2 here, and the second row will look like that, and so on. So I've factored out all the d's and what I left with? The identity. And what rule do I finally get to use? Rule one.
Finally, this is the point where rule one finally chips in and says that this determinant is one, so it's the product of the d's. So this was rules five, to do elimination, 3A to factor out the D's, and, and our best friend, rule one. And possibly rule two, the exchanges may have been needed also.
OK. Now I guess I have to consider also the case if some d is zero, because I was assuming I could use the d's to clean out and make a diagonal, but what if -- what if one of those diagonal entries is zero? Well, then with elimination we know that we can get a row of zeroes, and for a row of zeroes I'm using rule six, the determinant is zero, and that's right. So I can check the singular case. In fact, I can now get to the key point that determinant of A is zero, exactly when, exactly when A is singular.
And otherwise is not singular, so that the determinant is a fair test for invertibility or non-invertibility.
So, I must be close to that because I can take any matrix and get there. Do I -- did I have anything to say? The, the proofs, it starts by saying by elimination go from A to U.
Oh, yeah. Actually looks to me like I don't -- haven't said anything brand-new here, that, that really, I've got this, because let's just remember the reason.
By elimination, I can go from the original A to U. Well, OK, now suppose the matrix is singular.
If the matrix is singular, what happens? Then by elimination I get a row of zeroes and therefore the determinant is zero. And if the matrix is not singular, I don't get zero, so maybe -- do you want me to put this, like, in two parts? The determinant of A is not zero when A is invertible. Because I've already -- in chapter two we figured out when is the matrix invertible.
It's invertible when elimination produces a full set of pivots and now, and we now, we know the determinant is the product of those non-zero numbers.
So those are the two cases. If it's singular, I go to a row of zeroes. If it's invertible, I go to U and then to the diagonal D, and then which -- and then to d1, d2, up to dn.
As the formula -- so we have a formula now.
We have a formula for the determinant and it's actually a very much more practical formula than the ad-bc formula. Is it correct, maybe you should just -- let's just check that.
Two-by-two. What are the pivots of a two-by-two matrix? What does elimination do with a two-by-two matrix? It -- there's the first pivot, fine. What's the second pivot? We subtract, so I'm putting it in this upper triangular form. What do I -- my multiplier is c over a, right? I multiply that row by c over a and I subtract to get that zero, and here I have d minus c over a times b. That's the elimination on a two-by-two. So I've finally discovered that the determinant of this matrix -- I've got it from the properties, not by knowing the answer from last year, that the determinant of this two-by-two is the product of A times that, and of course when I multiply A by that, the product of that and that is ad minus, the a is canceled, bc.
So that's great, provided a isn't zero.
If a was zero, that step wasn't allowed, zero wasn't a pivot. So that's what I -- I've covered all the bases. I have to -- if a is zero, then I have to do the exchange, and if the exchange doesn't work, it's because a is singular.
OK, those are -- those are the direct properties of the determinant. And now, finally, I've got two more, nine and ten. And that's -- I think you can...
Like, the ones we've got here are totally connected with our elimination process and whether pivots are available and whether we get a row of zeroes. I think all that you can swallow in one shot.
Let me tell you properties nine and ten.
They're quick to write down. They're very, very useful. So I'll just write them down and use them. Property nine says that the determinant of a product -- if I multiply two matrices.
So if I multiply two matrices, A and B, that the determinant of the product is determinant of A times determinant of B, and for me that one is like, that's a very valuable property, and it's sort of like partly coming out of the blue, because we haven't been multiplying matrices and here suddenly this determinant has this multiplying property. Remember, it didn't have the linear property, it didn't have the adding property. The determinant of A plus B is not the sum of the determinants, but the determinant of A times B is the product, is the product of the determinants. OK, so for example, what's the determinant of A inverse? Using that property nine. Let me, let me put that under here because the camera is happier if it can focus on both at once. So let me put it underneath.
The determinant of A inverse, because property ten will come in that space. What does this tell me about A inverse, its determinant? OK, well, what do I know about A inverse? I know that A inverse times A is odd. So what I going to do? I'm going to take determinants of both sides. The determinant of I is one, and what's the determinant of A inverse A? That's a product of two matrices, A and B.
So it's the product of the determinant, so what I learning? I'm learning that the determinant of A inverse times the determinant of A is the determinant of I, that's this one. Again, I happily use property one. OK, so that tells me that the determinant of A inverse is one over.
Here's my -- here's my conclusion -- is one over the determinant of A. I guess that that -- I, I always try to think, well, do we know some cases of that? Of course, we know it's right already if A is diagonal. If A is a diagonal matrix, then its determinant is just a product of those numbers.
So if A is, for example, two-three, then we know that A-inverse is one-half one-third, and sure enough, that has determinant six, and that has determinant one-sixth. And our rule checks. So somehow this proof, this property has to -- somehow the proof of that property -- if we can boil it down to diagonal matrices then we can read it off, whether it's A and A-inverse, or two different diagonal matrices A and B. For diagonal -- so what I saying? I'm saying for a diagonal matrices, check. But we'd have to do elimination steps, we'd have to patiently do the, the, argument if we want to use these previous properties to get it for other matrices. And it also tells me -- what, just let's, see what else it's telling me.
What's the determinant of, of A-squared? If I take a matrix and square it? Then the determinant just got squared.
Right? The determinant of A-squared is the determinant of A times the determinant of A. So if I square the matrix, I square the determinant. If I double the matrix, what do I do to the determinant? Think about that one. If I double the matrix, what -- so the determinant of A, since I'm writing down, like, facts that follow, the determinant of A-squared is the determinant of A, all squared. The determinant of 2A is what? That's A plus A. But wait, er, I don't want the answer to determinant of A here. That's wrong. It's not two determinant of A, What is it? what's the number that I have to multiply determinant of A by if I double the whole matrix, if I double every entry in the matrix? What happens to the determinant? Supposed it's an n-by-n matrix. Two to the n, right. Two to the nth.
Now, why is it two to the nth, and not just two? So why is it two to the nth? Because I'm factoring out two from every row. There's a factor -- this has a factor two in every row, so I can factor two out of the first row. I factor a different two out of the second row, a different two out of the nth row, so I've got all those twos coming out.
So it's like volume, really, and that's one of the great applications of determinants.
If I -- if I have a box and I double all the sides, I multiply the volume by two to the nth.
If it's a box in three dimensions, I multiply the volume by 8. So this is rule 3A here.
This is rule nine. And notice the way this rule sort of checks out with the singular/non-singular stuff, that if A is invertible, what does that mean about its determinant? It's not zero, and therefore this makes sense. The case when determinant of A is zero, that's the case where my formula doesn't work anymore.
If determinant of A is zero, this is ridiculous, and that's ridiculous. A-inverse doesn't exist, and one over zero doesn't make sense. So don't miss this property. It's sort of, like, amazing that it can... And the tenth property is equally simple to state, that the determinant of A transposed equals the determinant of A.
And of course, let's just check it on the ab cd guy. We could check that sure enough, that's ab cd, it works.
It's ad - bc, it's ad - bc, sure enough. So that transposing did not change the determinant. But what it does change is -- well, what it does is it lists, so all -- I've been working with rows. If a row is all zeroes, the determinant is zero. But now, with rule ten, I know what to do is a column is all zero.
If a column is all zero, what's the determinant? Zero, again. So, like all those properties about rows, exchanging two rows reverses the sign.
Now, exchanging two columns reverses the sign, because I can always, if I want to see why, I can transpose, those columns become rows, I do the exchange, I transpose back.
And I've done a column operation.
So, in, in conclusion, there was nothing special about row one, 'cause I could exchange rows, and now there's nothing special about rows that isn't equally true for columns because this is the same.
OK. And again, maybe I won't -- oh, let's see. Do we...? Maybe it's worth seeing a quick proof of this number ten, quick, quick, er, proof of number ten.
Er, let me take the -- this is number ten.
A transposed equals A.
Determinate of A transposed equals determinate of A. That's what I should have said. OK.
So, let's just, er.
A typical matrix A, if I use elimination, this factors into LU. And the transpose is U transpose, l transpose. Er...
let me. .
this is to prove. So this is proof, this is proof number ten, using -- well, I don't know which ones I'll use, so I'll put 'em all in, one to nine. OK.
I'm going to prove number ten by using one to nine.
I won't cover every case, but I'll cover almost every case. So in almost every case, A can factor into LU, and A transposed can factor into that.
Now, what do I do next? So I want to prove that these are the same. I see a product here.
So I use rule nine. So, now what I want to prove is, so now I know that this is LU, this is U transposed and l transposed. Now, just for a practice, what are all those determinants? So this is, this is, this is prove this, prove this, prove this, and now I'm ready to do it.
What's the determinant of l? You remember what l is, it's this lower triangular matrix with ones on the diagonals. So what is the determinant of that guy? I- It's one.
Any time I have this triangular matrix, I can get rid of all the non-zeroes, down to the diagonal case. The determinate of l is one. How about the determinant of l transposed? That's triangular also, right? Still got those ones on the diagonal, it's just the non-zeroes flipped to the other side of the diagonal, but they didn't matter anyway.
That's my proof, really, that once I've got triangular matrices, l and l transposed, or U and U transposed, when they're triangular,4 I'm down to the product of the diagonal and if I transpose, who cares? OK, that's not -- I didn't put in every comma and, and cross every T in that proof, but that's really the proof.
That's the, like, concrete proof that, that gets -- get down to triangular matrices and then get down to diagonal matrices.
OK, one more coming, which I I have to make, because all math professors watching this will be waiting for it. OK, so they had to wait until the last minute. What I -- way, way back in property two,4 I said that if you do a row exchange, the determinant changes sign.
So if I do seven row exchanges, the determinant changes sign, but it -- would it be possible t- to produce the same matrix with seven row exchanges and with ten row exchanges? If that were possible, that would be a bad thing, right? If If I could -- why would it be bad? My whole lecture would die, right? Because rule two said that if you do seven row exchanges, then the sign of the determinant reverses. But if you do ten row exchanges, the sign of the determinant stays the same, because minus one ten times is plus one.
OK, so there's a hidden fact here, that every -- like, every permutation, the permutations are either odd or even. I could get the permutation with seven row exchanges, then I could probably get it with twenty-one, or twenty-three, or a hundred and one, if it's an odd one.
Or an even number of permutations, so, but that's the key fact that just takes another little algebraic trick to see, and that means that the determinant is well-defined by properties one, two, three and it's got properties four to ten. OK, that's today and I'll try to get the homework for next Wednesday onto the web this afternoon. Thanks.
This is one of over 2,200 courses on OCW. Find materials for this course in the pages linked along the left.
MIT OpenCourseWare is a free & open publication of material from thousands of MIT courses, covering the entire MIT curriculum.
No enrollment or registration. Freely browse and use OCW materials at your own pace. There's no signup, and no start or end dates.
Knowledge is your reward. Use OCW to guide your own life-long learning, or to teach others. We don't offer credit or certification for using OCW.
Made for sharing. Download files for later. Send to friends and colleagues. Modify, remix, and reuse (just remember to cite OCW as the source.)
Learn more at Get Started with MIT OpenCourseWare