Transcript

Okay, 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've got 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 igen values. So this is really determinants and igen values the next big big chunk of 1806. Okay. So the determinant is a number associated with every square matrix. So every square matrix has this number associated with it called its determinant.

Uh I'll I'll often write it as deta or often also I'll write it as uh 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 that's the determinant will be a test for invertability. But the determin's got a lot more to it than that.

So let me start. Okay. 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 three properties that it has. And and let me tell you property one. The determinant of the identity is one. Okay, 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? Okay, can I tell you the second property? This that just like scales the determinant so that the identity matrix has determinant one. Now the second property is what happens if you exchange two rows of a matrix? What happens to the determinant? So, 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 I I'm 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 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 identity still. So what matrices have I got 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. Okay. So if if I I could carry on this board, I could like do the 2x twos. So property one tells me that this 2x two matrix Oh, I better write absolute I mean I better write vertical bars not brackets for that determinant. Property one said in the 2x two case that this matrix has determinant one. Property two tells me that this matrix has determinant what negative 1. This is like 2x two. And now I finally want to get well ultimately I want to get to a the formula that we all know. Let me put that way over here. That the determinant of a general 2x two is a d minus b c.

Okay, I I I'm going to leave that up like as one as as the 2 by two case that we already know so that every property I can like check that it's correct for 2 by twos. But the whole point of these properties is that they're going to give me a formula for n byn. That's the whole point. they're going to give me this number that that's a test for invertability and other great properties for any size matrix. Okay, 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 3 A and 3B. Property 3A says that if I have that if I multiply one of the rows, say the first row by a number T.

I'm going to erase that. That that that's like what I'm headed for, but I'm not there yet. Uh that's the one we know. and you'll see that it's checked out by by each uh property. Okay. Now, what's so this is for any matrix? For any matrix, if I multiply one row by T and leave the other row or or other N minus one 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 the last n minus one rows are all staying the same.

I'm just working I'm just looking inside the first row. And if I have an a plus a prime there and a b + b prime there. Sorry, I didn't ah why don't I'll use an eraser to do it right. B + B prime there. Do 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 they'll they'll copy along. Then then I get the sum this breaks up into the sum of this determinant and this one. If I'm putting up formulas, maybe I can try to say it in words. The determinant is a linear function. It it behaves like a a linear function of the first row if all the other rows stay the same.

I am not saying that the I am let me emphasize I am not saying that the determinant of a plus b is determinant of A plus determinant of B. I am not saying that. I better Can I How do I get it onto tape that I'm not saying that? You see, this would allow uh 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 row.

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 use my property and then use rule two again to put it back. So each row is okay, not only the first row but each row separately. Okay, those are the three properties. And from those properties, so that's properties one, two, three. from those I want to get all I want to learn a lot more about the determinant let me take an example what what would I like to learn I would like to learn that so here's a property four let me use the same numbering as here property four is if two rows are equal the determinant is zero.

Okay. So, property four, two equal rows lead to determinant equals zero. Right? Now of course I can in the 2x two case I can check sure the determinant of ab comes out zero but I want to see why it's true for n byn suppose row one equals row 3 for a 7 by7 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 is works in each row separately. Okay, can you see the reason? How do I 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.

Okay. So suppose I have a matrix and two rows are equal. 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 ility 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 um 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. Okay, ready for property five? Now, property five you'll recognize as a key. 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 that in elimination I'm I'm always choosing this multiplier so as to produce zero in that in that position or or row i from row k maybe I should just make very clear that there's nothing special about row one here.

Okay. 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 zeros below the diagonal by these elimination steps. And the point is that the that the determinant the determinant doesn't change. So all those steps of elimination are are okay not changing the determinant in our in our language in in the early chapter. The determinant of a is going to be the same as the determinant of u, the upper triangular one that just has the pivots on the diagonal. That's why we'll want this property.

Okay, do you see where that property is coming from? Let let me do the 2x two case. Let me do the 2 x two case here. So, uh I'll I'll keep property five going along. So, what am 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 a D minus BC is there. And this minus ALB plus A alb cancels out. But I just cheated, right? I've got to use the property. 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 L A 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. Okay. So that's property three. This is by number three. 3B if you like. Okay. Now use 3A. How 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.

Do you see how that would always work? I subtract off 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 a higher row. And then if I since I have two equal rows, that's zero. So the determinant after elimination is the same as before. Good. Okay. Now let's see if I rescue my glasses I can see what's property six. Oh six is easy pl of space row of zeros leads to determinant of a equals zero a complete row of zeros. So I'm I'm again this is like uh something that I'll use in the singular case. Actually you can 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 zeros? Then I that that used to be my test for singular not invertible rank two rank less than n and now I'm seeing it's also gives determinant zero. Uh how do I get that one from the previous properties because I this is not a new law this has got to come from the old one. So what what shall I do? 3. Yeah, use that's brilliant. Use 3A with T equals Z. Right. So I have this I have this Z 0 CD and I'm trying to show that that determinant is zero.

Okay. So but zero is the same as five. Can I take T equal 5 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 3 a with with taking as five if I multiply a row by five outcomes a five so why am I why the heck am I doing this oh because that's still 0 0 So that's this determinant equals 5 * this determinant and the determinant has to be zero. I I think I I didn't do that the very best way. You were Yeah, you had the idea better. Multiply. Yeah. Yeah. Take T equals Z. Was that your idea?

Yeah. Better. Take T equals Z. in rule 3B. If T is zero in rule 3B, can I bring the camera back to rule 3B? Sorry. If if T is zero, then I have a Z 0 there and the determinant is zero. Okay? One way or another, a row of zeros mean zero determinant. Okay? Now I have to get serious. the the next properties are the ones that we we're building up to. Okay, 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 zero. That's all zero. And I would like to know the determinant because elimination will get me to this. So once I'm here, what's the determinant? 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 * d2 * dn. If I have a triangular matrix, then the diagonal is all I have to look at.

And that's that's telling us then we now have the way that mat lab any reasonable software would compute a determinant. If I have a a matrix of size 100 the way I would actually compute its determinant would be elimination make it triangular multiply the pivots together the product of the pivots. product of pivots. Now, there's always in determinance a plus or a minus sign to remember. Where does that come in to 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, just square LU went right through. If we had to do some row exchanges, then we've got to watch plus or minus. Okay, but the this law is simply that. Okay, how do I prove that? Let's see. Let me suppose that these are not zero. The pivots are not zero. And tell me how do I show that none of this upper stuff makes any difference? How do I get zeros 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. I can 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 1 2 3. 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 am I going to use? I'm going to use property 3A. Is that right? I'll I'll 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.

Should I can I put the D2 here and the second row will look like that and so on. So I factored out all the D's and what am 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 that determinant is one so it's the product of the D's. So this was rules rules five to do elimination 3 a to factor out the d's and and our best friend rule one and possibly rule two the exchanges may have been needed also. Okay, 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 it 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 zeros. And for a row of zeros, I'm using rule six. The determinant is zero. And that's right. So, 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 single and otherwise it's not zero. So that the determinant is a fair test for invertability or non-invertability. Okay. 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 proof that 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 reasoning by elimination I can go from the original A to U. Well, okay. Now suppose the matrix is is is singular. Okay. If the matrix is singular, what what happens? Then by elimination, I get a row of zeros 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 inverted. because I 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 nonzero numbers. So those are the two cases the if it's singular I go to a row of zeros. 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 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 minus BC formula. Is it correct? I maybe should just let's just check that 2x two. What are the pivots of a 2x two matrix? What what does elimination do with that 2x2 matrix?

it. There's the first pivot. Fine. What's the second pivot? We subtract. So, so, so I'm putting it in its upper triangular form. What do I, my multiplier is C over A, right? I multiply that row by C / A and I subtract to get that zero. And here I have D minus C / A time B. That's the elimination on a 2x two. So I've finally discovered that the determinant of this matrix I' I've just I've got it from the properties not by knowing the answer from last year that the determinant of this 2x two is the product of a times that and of course when I multiply a by that the product of that and that is a d minus the a's cancel 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've I've covered all the bases. I have to if if A is zero, then I have to do the exchange. And if the exchange doesn't work, it's because A is singular. Okay, those are the those are the direct properties of the determinant. And now finally, I've got two more nine and 10. And that's I I think you can like uh the ones we've got here are so are are totally connected with our elimination process and and what whether pivots are available and whether or whether we get a row of zeros. I think all that you can swallow in one shot.

Let me tell you properties nine and 10. 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 determinant but the determinant of a times b is the product of it is the product of it. Okay. 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 I I won't and the property 10 will come uh in that space. What what does this tell me about a inverse its determinant? Okay. Well, what do I know about a inverse? I know that a inverse time a is odd.

So, what am 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 am 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. Okay. 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 it's determined as just a product of those numbers. So if if a is for example 2 3 then we know that a inverse is 12 1/3 and sure enough that has determinant six and that has determinant 16 and our rule checks. So somehow this proof this property has to somehow the proof of 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 am I saying? I'm saying for diagonal matrices, check. But we'd have to do elimination steps.

We'd have to patiently do the the uh argument if we want to use these previous properties to get it for other matrices. It it also tells me what just let's see what else it's telling me. What's the determinant of of a squ? 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 time 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. If I double the matrix, So the determinant of a so I'm writing down like facts that follow the determinant of a squared is the determinant of a all squared the determinant of 2 a is what that's a + a but wait there I 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 what's the number that I have to multiply determinant of A by? If I if I double the whole matrix. If I double every entry in the matrix, what happens to the determinant? It suppose it's an N byN matrix. 2 to the N, right? Two to the nth. Now, why is it 2 to the nth and not just two? So, why is it 2 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 it's It's like volume really. And that's the that's one of the great applications of determinant. If I if if if I have a box and I double all the sides, I multiply the volume by 2 to the n. If it's a box in three dimensions, I've multiplied the volume by 8. And that's so that's this is rule 3A here. This is rule nine. And notice the way this rule sort of checks out with a singular non-s singular stuff. That 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 this is ridiculous. And that's ridiculous. A inverse doesn't exist. And one over zero doesn't make sense. Okay, so don't miss this property. It's sort of like amazing that it can. And the 10th property is equally simple to state that the determinant of a transpose 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 a d minus bc. It's a d minus bc. Sure enough. So that that transposing did not change the determinant. But what it does change is uh well what it what it does is it lists so all I've been working with rows.

If a if a row is all zeros the determinant is zero. But now with rule 10, I know what to do. If 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 in conclusion, there was nothing special about row one because I could exchange rows. And now there's nothing special about rows that that isn't equally true for columns because this is the same.

Okay. And again, maybe I won't Oh, let's see. Do we maybe it's worth seeing a quick proof of this number 10? A quick a quick uh proof of number 10. Let me take the this is number 10. A transpose equals a determinant of a transpose equals determinant of a. That's what I should have said. Okay. So let let's just uh um let a typical matrix A if I use elimination is factors into LU and the transpose is U transpose LRPOSE. This is let me this is to prove So this is this is prove this is prove number 10 using well I don't know which ones I'll use so I'll put them all in one to nine. Okay I'm going to prove number 10 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 arpose 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 I now I know that this is L u this is U transpose and LRPOS. Now just for 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 diagonal. So what is the determinant of that guy?

It's one. Anytime I have this triangular matrix, I can get rid of all the nonzeros down to the diagonal case. The determinant of L is one. How about the determinant of L transpose? That's triangular also, right? Still got those ones on the diagonal. It's just the nonzeros flip 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 transpose or U and U transpose when they're triangular I'm down to the product of the diagonal and if I transpose who cares okay so that's not I didn't put in every comma and and cross every E in that proof.

But that's really the proof. That's the like concrete proof that that get get down to triangular matrices and then get down to diagonal matrices. Okay, one more comment which I I have to make because all math professors watching this will be waiting for it. Okay, so they had to wait until the last minute. What I way way back in property two 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 to to produce the same matrix with seven row exchanges and with 10 row exchanges. If that were possible, that would be a bad thing, right?

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 10 row exchanges, the sign of the determinant stays the same because minus one 10 times is + one. Okay? 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 21 or 23 or 101 if it's an odd one or an even number of permutations. So, but that's the key fact that this takes another little algebraic trick to see.

And that means that the determinant is well defined by properties 1 2 3 and it's got properties 4 to 10. Okay, that's today and I'll try to get the homework for next Wednesday onto the web. Thank you for coming.