| [ | |
| { | |
| "text": " OK, this is linear algebra lecture four, and the first thing I have to do is something that was on the list for last time, but here it is now." | |
| }, | |
| { | |
| "text": "What's the inverse of a product?" | |
| }, | |
| { | |
| "text": "If I multiply two matrices together and I know their inverses, how do I get the inverse of A times B?" | |
| }, | |
| { | |
| "text": "So I know what inverses mean for a single matrix A and for a matrix B." | |
| }, | |
| { | |
| "text": "What matrix do I multiply by to get the identity if I have A here?" | |
| }, | |
| { | |
| "text": "OK, that'll be simple but so basic." | |
| }, | |
| { | |
| "text": "Then I'm going to use that to -." | |
| }, | |
| { | |
| "text": "I will have a product of matrices, and the product that we'll meet will be these elimination matrices, and the net result of today's lecture is the Bayes formula for elimination." | |
| }, | |
| { | |
| "text": "So the net result of today's lecture is this great way to look at Gaussian elimination." | |
| }, | |
| { | |
| "text": "We know that we get from A to U by elimination." | |
| }, | |
| { | |
| "text": "We know the steps, but now we get the right way to look at it, A equal LU." | |
| }, | |
| { | |
| "text": "So that's the high point for today." | |
| }, | |
| { | |
| "text": "OK. Can I take the easy part, the first step first?" | |
| }, | |
| { | |
| "text": "So suppose A is invertible, and of course, it's going to be a big question, when is the matrix invertible, but let's say A is invertible and B is invertible, then what matrix gives me the inverse of AB?" | |
| }, | |
| { | |
| "text": "So that's the direct question." | |
| }, | |
| { | |
| "text": "What's the inverse of AB?" | |
| }, | |
| { | |
| "text": "Do I multiply those separate inverses?" | |
| }, | |
| { | |
| "text": "Yes." | |
| }, | |
| { | |
| "text": "I multiply the two matrices A inverse and B inverse, but what order do I multiply?" | |
| }, | |
| { | |
| "text": "In reverse order." | |
| }, | |
| { | |
| "text": "And you see why, so that the right thing to put here is B inverse A inverse." | |
| }, | |
| { | |
| "text": "That's the inverse I'm after." | |
| }, | |
| { | |
| "text": "We can just check that AB times that matrix gives the identity." | |
| }, | |
| { | |
| "text": "OK." | |
| }, | |
| { | |
| "text": "So why?" | |
| }, | |
| { | |
| "text": "Once again, it's this fact that I can move parentheses around." | |
| }, | |
| { | |
| "text": "I can, actually, I can just erase them all and do the multiplications any way I want to." | |
| }, | |
| { | |
| "text": "So what's the right multiplication to do first?" | |
| }, | |
| { | |
| "text": "B times B inverse." | |
| }, | |
| { | |
| "text": "This product here is the identity." | |
| }, | |
| { | |
| "text": "Then A times the identity is the identity, and then finally A times A inverse gives the identity." | |
| }, | |
| { | |
| "text": "So forgive the dumb example in the book, it's just why do you do the inverse things in reverse order, it's just like taking, you take off your shoes, you take off your socks, then the good way to invert that process is socks back on first, then shoes." | |
| }, | |
| { | |
| "text": "Sorry." | |
| }, | |
| { | |
| "text": "OK." | |
| }, | |
| { | |
| "text": "I'm sorry that's on tape, but all right." | |
| }, | |
| { | |
| "text": "And of course, on the other side, we should really just check on the other side, I have B inverse A inverse, that does multiply AB, and this time it's these guys that give the identity, squeeze down, they give the identity, we're in shape." | |
| }, | |
| { | |
| "text": "OK." | |
| }, | |
| { | |
| "text": "So there's the inverse." | |
| }, | |
| { | |
| "text": "Good." | |
| }, | |
| { | |
| "text": "While we're at it, let me do a transpose." | |
| }, | |
| { | |
| "text": "Because the next lecture has got a lot to do, it involves transposes." | |
| }, | |
| { | |
| "text": "So how do I, if I transpose a matrix, I'm talking about square invertible matrices right now, if I transpose one, what's its inverse?" | |
| }, | |
| { | |
| "text": "Well, the nice formula is, let's see, let me start from A A inverse equal the identity." | |
| }, | |
| { | |
| "text": "And let me transpose both sides." | |
| }, | |
| { | |
| "text": "That will bring a transpose into the picture." | |
| }, | |
| { | |
| "text": "So if I transpose the identity matrix, what do I have?" | |
| }, | |
| { | |
| "text": "The identity, right?" | |
| }, | |
| { | |
| "text": "If I exchange rows and columns, the identity is a symmetric matrix that doesn't know the difference." | |
| }, | |
| { | |
| "text": "If I transpose these guys, that product, then again, it turns out that I have to reverse the order." | |
| }, | |
| { | |
| "text": "I can transpose them separately, but when I multiply, those transposes come in the opposite order." | |
| }, | |
| { | |
| "text": "So it's A inverse transpose times A transpose, giving the identity." | |
| }, | |
| { | |
| "text": "So that's this equation, it just comes directly from that one." | |
| }, | |
| { | |
| "text": "But this equation tells me what I wanted to know." | |
| }, | |
| { | |
| "text": "Namely, what is the inverse of this guy A transpose?" | |
| }, | |
| { | |
| "text": "What's the inverse of that, if I transpose a matrix, what's the inverse of the result?" | |
| }, | |
| { | |
| "text": "And this equation tells me that here it is." | |
| }, | |
| { | |
| "text": "This is." | |
| }, | |
| { | |
| "text": "This is the inverse, this is the inverse of A transpose." | |
| }, | |
| { | |
| "text": "Inverse of A transpose." | |
| }, | |
| { | |
| "text": "Of A transpose." | |
| }, | |
| { | |
| "text": "I just, so I'll put a big circle around that, because that's the answer, that's the best answer we can hope for." | |
| }, | |
| { | |
| "text": "That if you want to know the inverse of A transpose, and you know the inverse of A, then you just transpose that." | |
| }, | |
| { | |
| "text": "So in a, to put it another way, transposing and inversing, you can do in either order, for a single thing." | |
| }, | |
| { | |
| "text": "OK." | |
| }, | |
| { | |
| "text": "So that, these are like basic facts that we can now use." | |
| }, | |
| { | |
| "text": "All right." | |
| }, | |
| { | |
| "text": "So now I put it to use." | |
| }, | |
| { | |
| "text": "I put it to use by thinking we're really completing the subject of elimination." | |
| }, | |
| { | |
| "text": "Actually, I, the thing about elimination is it's the right way to understand what the matrix has got." | |
| }, | |
| { | |
| "text": "This A equal LU is the most basic factorization of a matrix." | |
| }, | |
| { | |
| "text": "I always worry that you will think this course is just, is all elimination." | |
| }, | |
| { | |
| "text": "It's just row operations." | |
| }, | |
| { | |
| "text": "And please don't." | |
| }, | |
| { | |
| "text": "It's, it will be beyond that." | |
| }, | |
| { | |
| "text": "But it's the right, it's the right algebra to do first." | |
| }, | |
| { | |
| "text": "OK." | |
| }, | |
| { | |
| "text": "So now I'm coming near the end of it, but I want to get it in a decent form." | |
| }, | |
| { | |
| "text": "So my decent form is matrix form." | |
| }, | |
| { | |
| "text": "I have a matrix A." | |
| }, | |
| { | |
| "text": "Let's suppose it's a good matrix, I can do elimination, no row exchanges, so no row exchanges for now." | |
| }, | |
| { | |
| "text": "Pivots all fine, nothing zero in the pivot position, I get to the very end, which is U." | |
| }, | |
| { | |
| "text": "So I get from A to U." | |
| }, | |
| { | |
| "text": "And I want to know what's the connection." | |
| }, | |
| { | |
| "text": "How is A related to U?" | |
| }, | |
| { | |
| "text": "And this is going to tell me that there's a matrix L that connects them." | |
| }, | |
| { | |
| "text": "OK. Can I do it for a two by two first?" | |
| }, | |
| { | |
| "text": "OK. Two by two, elimination." | |
| }, | |
| { | |
| "text": "OK." | |
| }, | |
| { | |
| "text": "So I'll do it under D. So let my matrix A be, let's just, we'll keep it simple." | |
| }, | |
| { | |
| "text": "Say two and an eight, so we know that the first pivot is a two, and the multiplier is going to be a four, and then let me put a one here, and what number do I not want to put there?" | |
| }, | |
| { | |
| "text": "Four." | |
| }, | |
| { | |
| "text": "I don't want a four there because in that case, the second pivot would not, we wouldn't have a second pivot, the matrix would be singular, general, screw up." | |
| }, | |
| { | |
| "text": "OK." | |
| }, | |
| { | |
| "text": "So let me put some other number here like seven." | |
| }, | |
| { | |
| "text": "OK. OK. Now I want to operate on that with my elementary matrix." | |
| }, | |
| { | |
| "text": "So what's the elementary matrix?" | |
| }, | |
| { | |
| "text": "Strictly speaking, it's E two one, because it's the guy that's going to produce a zero in that position." | |
| }, | |
| { | |
| "text": "And it's going to produce U in one shot, because it's just a two by two matrix." | |
| }, | |
| { | |
| "text": "So two one, and I'm going to take four of those away from those, produce that zero, and leave a three there." | |
| }, | |
| { | |
| "text": "And that's U." | |
| }, | |
| { | |
| "text": "And what's the matrix that did it?" | |
| }, | |
| { | |
| "text": "Quick review, then." | |
| }, | |
| { | |
| "text": "What's the elimination elementary matrix E two one?" | |
| }, | |
| { | |
| "text": "It's one zero, thanks, and negative four one." | |
| }, | |
| { | |
| "text": "Right." | |
| }, | |
| { | |
| "text": "Good." | |
| }, | |
| { | |
| "text": "OK." | |
| }, | |
| { | |
| "text": "So that's, I, I, you see the difference between this and what I'm shooting for." | |
| }, | |
| { | |
| "text": "I'm shooting for A on one side and the other matrices on the other side of the equation." | |
| }, | |
| { | |
| "text": "OK." | |
| }, | |
| { | |
| "text": "So I can do that right away." | |
| }, | |
| { | |
| "text": "Now I'm, now here's going to be my A equal LU." | |
| }, | |
| { | |
| "text": "And you won't have any trouble telling me what, so A is still two one eight seven." | |
| }, | |
| { | |
| "text": "L is what you're going to tell me." | |
| }, | |
| { | |
| "text": "And U is still two one zero three." | |
| }, | |
| { | |
| "text": "OK." | |
| }, | |
| { | |
| "text": "So what's L in this case?" | |
| }, | |
| { | |
| "text": "Well, first, so how is L related to this E guy?" | |
| }, | |
| { | |
| "text": "It's the inverse." | |
| }, | |
| { | |
| "text": "Because I want to multiply through by the inverse of this, which will put the identity here, and the inverse will show up there and I'll call it L. So what is the inverse of this?" | |
| }, | |
| { | |
| "text": "Remember that those elimination matrices are easy to invert." | |
| }, | |
| { | |
| "text": "The inverse matrix for this one is one zero four one." | |
| }, | |
| { | |
| "text": "It's, it has the plus sign because it adds back what this removes." | |
| }, | |
| { | |
| "text": "OK. Do you want, so if we did the numbers right, we must, this should be correct." | |
| }, | |
| { | |
| "text": "OK. And, of course it is." | |
| }, | |
| { | |
| "text": "That says the first row is right, four times the first row plus the second row is eight seven." | |
| }, | |
| { | |
| "text": "Good." | |
| }, | |
| { | |
| "text": "OK. That's simple." | |
| }, | |
| { | |
| "text": "Two by two." | |
| }, | |
| { | |
| "text": "But it already shows the form that we're headed for." | |
| }, | |
| { | |
| "text": "It shows, so what's the L stand for?" | |
| }, | |
| { | |
| "text": "Why the letter L?" | |
| }, | |
| { | |
| "text": "If U stood for upper triangular, then, of course, L stands for lower triangular." | |
| }, | |
| { | |
| "text": "And actually it has ones on the diagonal." | |
| }, | |
| { | |
| "text": "Where this thing has the pivots on the diagonal." | |
| }, | |
| { | |
| "text": "Oh, sometimes we may want to separate out the pivots." | |
| }, | |
| { | |
| "text": "So can I just mention that sometimes we could also write this as, we could have this one zero four one." | |
| }, | |
| { | |
| "text": "I'll just show you how I would divide out this matrix of pivots." | |
| }, | |
| { | |
| "text": "Two three." | |
| }, | |
| { | |
| "text": "There's a diagonal matrix." | |
| }, | |
| { | |
| "text": "And I've just, whatever is left is here." | |
| }, | |
| { | |
| "text": "Now what's left?" | |
| }, | |
| { | |
| "text": "If I divide this first row by two to pull out the two, then I have a one and a one half." | |
| }, | |
| { | |
| "text": "And if I divide the second row by three to pull out the three, then I have a one." | |
| }, | |
| { | |
| "text": "So that's the, if this is L U, this is maybe called L D for pivot U." | |
| }, | |
| { | |
| "text": "And now it's a little more balanced because we have ones on the diagonal here and here." | |
| }, | |
| { | |
| "text": "And the diagonal matrix in the middle." | |
| }, | |
| { | |
| "text": "So both of those, Matlab would produce either one." | |
| }, | |
| { | |
| "text": "I'll basically stay with L U." | |
| }, | |
| { | |
| "text": "Okay." | |
| }, | |
| { | |
| "text": "Now I have to think about bigger than two by two." | |
| }, | |
| { | |
| "text": "Right now this was just like an easy exercise." | |
| }, | |
| { | |
| "text": "And to tell the truth, that this one with the minus sign and this one with the plus sign, I mean, that's the only difference." | |
| }, | |
| { | |
| "text": "But with three by three, there's a more significant difference." | |
| }, | |
| { | |
| "text": "Let me show you how that works." | |
| }, | |
| { | |
| "text": "Let me move up to a three by three, let's say, some matrix A." | |
| }, | |
| { | |
| "text": "Okay." | |
| }, | |
| { | |
| "text": "And just imagine it's three by three." | |
| }, | |
| { | |
| "text": "I won't write numbers down for now." | |
| }, | |
| { | |
| "text": "So what's the first elimination step that I do, the first matrix I multiply it by, what letter will I use for that?" | |
| }, | |
| { | |
| "text": "It's the, it'll be E two one." | |
| }, | |
| { | |
| "text": "Because it's the first step will be to get a zero in that two one position." | |
| }, | |
| { | |
| "text": "And then the next step will be to get a zero in the three one position." | |
| }, | |
| { | |
| "text": "And the final step will be to get a zero in the three two position." | |
| }, | |
| { | |
| "text": "That's what elimination is, and it produces U." | |
| }, | |
| { | |
| "text": "And again, no row exchanges." | |
| }, | |
| { | |
| "text": "We will, I'm taking the nice case now, the typical case, too, when I don't have to do any row exchange, all I do is these elimination steps." | |
| }, | |
| { | |
| "text": "Okay." | |
| }, | |
| { | |
| "text": "Now, suppose I want that stuff over on the right-hand side, as I really do." | |
| }, | |
| { | |
| "text": "That's, like, my point here." | |
| }, | |
| { | |
| "text": "I can multiply these together to get a matrix E, but I want it over on the right." | |
| }, | |
| { | |
| "text": "I want its inverse over there." | |
| }, | |
| { | |
| "text": "So what's the right expression now?" | |
| }, | |
| { | |
| "text": "If I write A and U, what goes there?" | |
| }, | |
| { | |
| "text": "Okay." | |
| }, | |
| { | |
| "text": "So I've got the inverse of this, I've got three matrices in a row now." | |
| }, | |
| { | |
| "text": "And it's their inverses that are going to show up, because each one is easy to invert." | |
| }, | |
| { | |
| "text": "Question is, what about the whole bunch?" | |
| }, | |
| { | |
| "text": "How easy is it to invert the whole bunch?" | |
| }, | |
| { | |
| "text": "So that's what we know how to do." | |
| }, | |
| { | |
| "text": "We know how to invert, we should take the separate inverses, but they go in the opposite order." | |
| }, | |
| { | |
| "text": "So what goes here?" | |
| }, | |
| { | |
| "text": "E three two inverse, right, because I multiply from the left by E three two inverse, that'll pop it up next to U." | |
| }, | |
| { | |
| "text": "And then will come E three one inverse." | |
| }, | |
| { | |
| "text": "And then this'll be the only guy left standing, and that's gone when I do an E two one inverse." | |
| }, | |
| { | |
| "text": "So there is L. That's L U. L is this product of inverses." | |
| }, | |
| { | |
| "text": "Now you still can ask why is this guy preferring inverses?" | |
| }, | |
| { | |
| "text": "And let me explain why." | |
| }, | |
| { | |
| "text": "Let me explain why is this product nicer than this one?" | |
| }, | |
| { | |
| "text": "This product turns out to be better than this one." | |
| }, | |
| { | |
| "text": "Let me take a typical case here." | |
| }, | |
| { | |
| "text": "Let me take a typical case." | |
| }, | |
| { | |
| "text": "So let me, I have to do three by three for you to see the improvement." | |
| }, | |
| { | |
| "text": "Two by two, there was just one E, no problem." | |
| }, | |
| { | |
| "text": "But let me go up to this case." | |
| }, | |
| { | |
| "text": "Suppose my matrices E two one, suppose E two one has a minus two in there." | |
| }, | |
| { | |
| "text": "Suppose that, and now suppose, oh, I'll even suppose E three one is the identity." | |
| }, | |
| { | |
| "text": "So I'll just, I'm just going to, I'm going to make the point with just a couple of these." | |
| }, | |
| { | |
| "text": "OK, now this guy will have do something, now let's suppose minus five." | |
| }, | |
| { | |
| "text": "What?" | |
| }, | |
| { | |
| "text": "OK." | |
| }, | |
| { | |
| "text": "There's a typical." | |
| }, | |
| { | |
| "text": "That's a typical case in which we didn't need an E three one." | |
| }, | |
| { | |
| "text": "Maybe we already had a zero in that three one position." | |
| }, | |
| { | |
| "text": "OK. Let me see if that, is that going to be enough to show my point." | |
| }, | |
| { | |
| "text": "Let's, let me do that multiplication." | |
| }, | |
| { | |
| "text": "OK, so if I do that multiplication, this is, it's like good practice to multiply these matrices." | |
| }, | |
| { | |
| "text": "Tell me what's above the diagonal when I do this multiplication." | |
| }, | |
| { | |
| "text": "All zeros." | |
| }, | |
| { | |
| "text": "When I do this multiplication, I'm going to get ones on the diagonal and zeros above." | |
| }, | |
| { | |
| "text": "Because, what does that say?" | |
| }, | |
| { | |
| "text": "That says that I'm subtracting rows from lower rows." | |
| }, | |
| { | |
| "text": "So nothing is moving upwards as it did last time in Gauss-Jordan." | |
| }, | |
| { | |
| "text": "OK. Now, so really, what I have to do is check this, minus two one zero." | |
| }, | |
| { | |
| "text": "Now this is, so what am I, what's that number?" | |
| }, | |
| { | |
| "text": "That, this is the number that I'm really have in mind." | |
| }, | |
| { | |
| "text": "That number is ten." | |
| }, | |
| { | |
| "text": "And this one is, what goes here?" | |
| }, | |
| { | |
| "text": "Row three against column two looks like the minus five." | |
| }, | |
| { | |
| "text": "What, it's that ten." | |
| }, | |
| { | |
| "text": "How did that ten get in there?" | |
| }, | |
| { | |
| "text": "I don't like that ten." | |
| }, | |
| { | |
| "text": "I mean, of course, I don't want to erase it, because it's right, but I don't want it there." | |
| }, | |
| { | |
| "text": "It's because the ten got in there, because I subtracted two of row one from row two, and then I subtracted five of that new row two from row three." | |
| }, | |
| { | |
| "text": "So doing it in that order, how did row one affect row three?" | |
| }, | |
| { | |
| "text": "Well, it did, because two of it got removed from row two, and then five of those got removed from row three." | |
| }, | |
| { | |
| "text": "So altogether, ten of row one got thrown into row three." | |
| }, | |
| { | |
| "text": "Now my point is in the reverse direction." | |
| }, | |
| { | |
| "text": "So now I can do, now I'll do, below it I'll do the inverse." | |
| }, | |
| { | |
| "text": "OK. And of course, opposite order." | |
| }, | |
| { | |
| "text": "Reverse order." | |
| }, | |
| { | |
| "text": "Reverse order." | |
| }, | |
| { | |
| "text": "OK." | |
| }, | |
| { | |
| "text": "So now this is going to, this is the E that goes on the left side." | |
| }, | |
| { | |
| "text": "Left of A." | |
| }, | |
| { | |
| "text": "Now I'm going to do the inverses in the opposite order, so what's the, so the opposite order means I put this inverse first, and what is its inverse?" | |
| }, | |
| { | |
| "text": "What's the inverse of E two one?" | |
| }, | |
| { | |
| "text": "Same thing with a plus sign, right?" | |
| }, | |
| { | |
| "text": "For the individual matrices, instead of taking away two, I add back two of row one to row two." | |
| }, | |
| { | |
| "text": "So, no problem." | |
| }, | |
| { | |
| "text": "And now in reverse order, I want to invert that." | |
| }, | |
| { | |
| "text": "Just, right, I'm doing just this, this." | |
| }, | |
| { | |
| "text": "So now the inverse is, again, the same thing, but add in the five." | |
| }, | |
| { | |
| "text": "And now I'll do that multiplication, and I'll get a happy result." | |
| }, | |
| { | |
| "text": "I hope." | |
| }, | |
| { | |
| "text": "Did I do it right so far?" | |
| }, | |
| { | |
| "text": "Yes?" | |
| }, | |
| { | |
| "text": "OK. Let me do the multiplication." | |
| }, | |
| { | |
| "text": "I believe this comes out." | |
| }, | |
| { | |
| "text": "So row one of the answer is one zero zero." | |
| }, | |
| { | |
| "text": "Oh, I know that all this is going to be that, right?" | |
| }, | |
| { | |
| "text": "Then I have two one zero." | |
| }, | |
| { | |
| "text": "So I get two one zero there, right?" | |
| }, | |
| { | |
| "text": "And what's the third row?" | |
| }, | |
| { | |
| "text": "What's the third row in this product?" | |
| }, | |
| { | |
| "text": "Just read it out to me, the third row." | |
| }, | |
| { | |
| "text": "Zero five one." | |
| }, | |
| { | |
| "text": "Because I, one way to say is, this is saying take one of the last row and there it is." | |
| }, | |
| { | |
| "text": "And this is my matrix L, and it's the one that goes to the left, it goes on the left of U." | |
| }, | |
| { | |
| "text": "It goes into, this is, what do I mean here?" | |
| }, | |
| { | |
| "text": "Maybe rather than saying left of A, left of U, let me write down again what I mean." | |
| }, | |
| { | |
| "text": "EA is U, whereas A is LU." | |
| }, | |
| { | |
| "text": "OK. Let me make the point now in words." | |
| }, | |
| { | |
| "text": "The order that the matrices come for L is the right order." | |
| }, | |
| { | |
| "text": "The two and the five don't sort of interfere to produce this ten." | |
| }, | |
| { | |
| "text": "In the right order, the multipliers just sit in the matrix L. That's the point." | |
| }, | |
| { | |
| "text": "That the, so that if I want to know L, I've no work to do." | |
| }, | |
| { | |
| "text": "I just keep a record of what those multipliers were." | |
| }, | |
| { | |
| "text": "And that gives me L. So I'll draw the, so what's the order?" | |
| }, | |
| { | |
| "text": "So let me state it." | |
| }, | |
| { | |
| "text": "So this is the A equal LU." | |
| }, | |
| { | |
| "text": "So if no row exchanges, the multipliers, those numbers that we multiplied rows by and subtracted when we did an elimination step, the multipliers go directly into L. OK." | |
| }, | |
| { | |
| "text": "So L is, this is the way to look at elimination." | |
| }, | |
| { | |
| "text": "That the, you go through the elimination steps, and actually, if you do it right, you can throw away A as you create L and U." | |
| }, | |
| { | |
| "text": "If you think about it, those steps of elimination, as you, when you've done, when you've finished with row two of A, you've created a new row two of U, which you have to save, and you've created the multipliers that you used, which you have to save, and then you can forget A." | |
| }, | |
| { | |
| "text": "So the, because it's all there in L and U." | |
| }, | |
| { | |
| "text": "So that's, that's like, I mean, this may, this moment is maybe the, the new insight in elimination that comes from matrix, doing it in matrix form." | |
| }, | |
| { | |
| "text": "So it was, the product of, of Es is, we can't see what that product of Es is." | |
| }, | |
| { | |
| "text": "The matrix E is not particularly attractive." | |
| }, | |
| { | |
| "text": "What's great is when we put them on the other side, they're inverses in the opposite order, there the L comes out just fine." | |
| }, | |
| { | |
| "text": "OK. Now, oh gosh, so today is a sort of like practical day." | |
| }, | |
| { | |
| "text": "Can I, can we think together how expensive is elimination?" | |
| }, | |
| { | |
| "text": "How much, how many operations do we do?" | |
| }, | |
| { | |
| "text": "So I, so this is now a kind of new topic, which I didn't list as on the program, but here it came." | |
| }, | |
| { | |
| "text": "Here it comes." | |
| }, | |
| { | |
| "text": "How many operations on an n by n matrix A?" | |
| }, | |
| { | |
| "text": "I mean, it's a very practical question." | |
| }, | |
| { | |
| "text": "Can we, can we solve systems of order a thousand in a second or a minute or a week?" | |
| }, | |
| { | |
| "text": "Can we solve systems of order a million in a second or an hour or a week?" | |
| }, | |
| { | |
| "text": "I mean, what's the, if it's n by n, we, we often want to take n bigger." | |
| }, | |
| { | |
| "text": "I mean, we put in more information." | |
| }, | |
| { | |
| "text": "We make the, the whole thing is more accurate for the bigger matrix." | |
| }, | |
| { | |
| "text": "But it's more expensive, too, and the question is, how much more expensive?" | |
| }, | |
| { | |
| "text": "If I go, if I have, matrices of order a hundred." | |
| }, | |
| { | |
| "text": "Let's say a hundred by a hundred." | |
| }, | |
| { | |
| "text": "Let me, let me take n to be a hundred." | |
| }, | |
| { | |
| "text": "Say n equal a hundred." | |
| }, | |
| { | |
| "text": "How many steps are we doing?" | |
| }, | |
| { | |
| "text": "How many operations are we actually doing that we, that we're, or not we." | |
| }, | |
| { | |
| "text": "The, and let's suppose there aren't any zeros." | |
| }, | |
| { | |
| "text": "Because of course if the, if the matrix has got a lot of zeros in good places, we don't have to do those operations, and it'll be much faster." | |
| }, | |
| { | |
| "text": "But, so just think for a moment about the first step." | |
| }, | |
| { | |
| "text": "So here's our matrix A, hundred by a hundred, and the first step will be that column has got zeros down here." | |
| }, | |
| { | |
| "text": "So it's, it's down to ninety-nine by ninety-nine." | |
| }, | |
| { | |
| "text": "Right?" | |
| }, | |
| { | |
| "text": "That, that, that's really like the first, stage of elimination." | |
| }, | |
| { | |
| "text": "To get from this hundred by hundred non-zero matrix to this stage where the first pivot is sitting up here and the first row's okay and the first column is okay." | |
| }, | |
| { | |
| "text": "So, essentially, I, what the, how many steps did that take?" | |
| }, | |
| { | |
| "text": "You see, I'm, I'm trying to get an idea." | |
| }, | |
| { | |
| "text": "Is the answer proportional to n?" | |
| }, | |
| { | |
| "text": "Is the, is the total number of steps in elimination, the total number, is it proportional to n?" | |
| }, | |
| { | |
| "text": "In which case if I double n from a hundred to two hundred, does it take me twice as long?" | |
| }, | |
| { | |
| "text": "Does it square, so it would take me four times as long?" | |
| }, | |
| { | |
| "text": "Does it cube, so it would take me eight times as long?" | |
| }, | |
| { | |
| "text": "Or is it n factorial, so it would take me a hundred times as long?" | |
| }, | |
| { | |
| "text": "I, I think, you know, from a practical point of view, we have to have some idea of the cost here." | |
| }, | |
| { | |
| "text": "So, so these are the questions." | |
| }, | |
| { | |
| "text": "So let me ask those questions again." | |
| }, | |
| { | |
| "text": "Is it proportional, does it go like n, like n squared, like n cubed, like some higher power of n, like n factorial, where, where every step up multiplies by a hundred and then by a hundred and one and then by a hundred and two, which is it?" | |
| }, | |
| { | |
| "text": "Okay, so that's the only way I know to answer that is to, is to think through what we actually had to do." | |
| }, | |
| { | |
| "text": "Okay." | |
| }, | |
| { | |
| "text": "So how much, what was the cost here?" | |
| }, | |
| { | |
| "text": "Well, let's see, what do I mean by an operation?" | |
| }, | |
| { | |
| "text": "I guess I mean, well, an addition or, yeah, no big deal." | |
| }, | |
| { | |
| "text": "I guess I mean an addition or a subtraction or a multiplication or a division." | |
| }, | |
| { | |
| "text": "Okay." | |
| }, | |
| { | |
| "text": "And actually, what operation am I doing all the time?" | |
| }, | |
| { | |
| "text": "I'm, when I multiply row one by a multiplier L and I subtract from row six, what's happening there individually?" | |
| }, | |
| { | |
| "text": "What's the, what's going on?" | |
| }, | |
| { | |
| "text": "If I multiply, I do a multiplication by L and then a subtraction." | |
| }, | |
| { | |
| "text": "So I guess operation, can I count that for the moment as, like, one operation or you may want to count them separately." | |
| }, | |
| { | |
| "text": "The typical operation is multiply plus subtract." | |
| }, | |
| { | |
| "text": "So if I count those together, my answer's going to come out half as many as if, if I count them separately, I'd have a certain number of multiplies, certain number of subtracts." | |
| }, | |
| { | |
| "text": "That's really what I want to do." | |
| }, | |
| { | |
| "text": "Okay." | |
| }, | |
| { | |
| "text": "How many have I got here?" | |
| }, | |
| { | |
| "text": "So I think, let's see." | |
| }, | |
| { | |
| "text": "It's about, well, how many roughly?" | |
| }, | |
| { | |
| "text": "How many operations to get from here to here?" | |
| }, | |
| { | |
| "text": "Well, maybe one way to look at it is all these numbers had to get changed." | |
| }, | |
| { | |
| "text": "The first row didn't get changed, but all the other rows got changed at this step." | |
| }, | |
| { | |
| "text": "So this step, well, I guess maybe, shall I say, it cost about, this cost about a hundred squared." | |
| }, | |
| { | |
| "text": "I mean, if I had changed the first row, then it would have been exactly a hundred squared, because that's how many numbers are here." | |
| }, | |
| { | |
| "text": "A hundred squared numbers is the total count of the entries, and all but this insignificant first row got changed." | |
| }, | |
| { | |
| "text": "So I would say about a hundred squared." | |
| }, | |
| { | |
| "text": "Okay." | |
| }, | |
| { | |
| "text": "Now what about the next step?" | |
| }, | |
| { | |
| "text": "So now the first row is fine." | |
| }, | |
| { | |
| "text": "The second row is fine." | |
| }, | |
| { | |
| "text": "And I'm changing, and these zeros are all fine." | |
| }, | |
| { | |
| "text": "So what's up at the second step?" | |
| }, | |
| { | |
| "text": "And then you're with me." | |
| }, | |
| { | |
| "text": "Roughly what's the cost?" | |
| }, | |
| { | |
| "text": "If this first step cost a hundred squared, about, operations, then this one, which is really working on this guy to produce this, cost about what?" | |
| }, | |
| { | |
| "text": "How many operations to fix?" | |
| }, | |
| { | |
| "text": "About ninety-nine squared." | |
| }, | |
| { | |
| "text": "Or ninety-nine times ninety-eight." | |
| }, | |
| { | |
| "text": "But less, right?" | |
| }, | |
| { | |
| "text": "Less, because our problem's getting smaller." | |
| }, | |
| { | |
| "text": "About ninety-nine squared." | |
| }, | |
| { | |
| "text": "And then I go down and down, and the next one will be ninety-eight squared, the next ninety-seven squared, and finally I'm down around one squared, or where?" | |
| }, | |
| { | |
| "text": "It's just like, just little numbers." | |
| }, | |
| { | |
| "text": "The big numbers are here." | |
| }, | |
| { | |
| "text": "So the number of operations is about n squared plus that was n, right?" | |
| }, | |
| { | |
| "text": "n was a hundred." | |
| }, | |
| { | |
| "text": "It n squared for the first step, then n minus one squared, then n minus two squared, finally down to three squared and two squared and even one squared." | |
| }, | |
| { | |
| "text": "No way I should have written that, squeezed that in." | |
| }, | |
| { | |
| "text": "Let me try it." | |
| }, | |
| { | |
| "text": "So the count is n squared plus n minus one squared plus all the way down to one squared." | |
| }, | |
| { | |
| "text": "That's a pretty decent count." | |
| }, | |
| { | |
| "text": "Admittedly, we didn't catch every single tiny operation, but we got the right leading term here." | |
| }, | |
| { | |
| "text": "And what do those add up to?" | |
| }, | |
| { | |
| "text": "Okay, so now we're at, we're coming to the punch of this question, this operation count." | |
| }, | |
| { | |
| "text": "So this is the operations on the left side, on the matrix A, to finally get to U." | |
| }, | |
| { | |
| "text": "And anybody, so which of, which of these quantities is the right ballpark for that count?" | |
| }, | |
| { | |
| "text": "If I add a hundred squared to ninety-nine squared to ninety-eight squared, ninety-seven squared, all the way down to two squared and one squared, what, what, what am I, what have I got about?" | |
| }, | |
| { | |
| "text": "It's one of these, so count, let's identify it first." | |
| }, | |
| { | |
| "text": "Is it n?" | |
| }, | |
| { | |
| "text": "Certainly not." | |
| }, | |
| { | |
| "text": "Is it n factorial?" | |
| }, | |
| { | |
| "text": "No." | |
| }, | |
| { | |
| "text": "If it was n factorial, we would, with determinants it is n factorial." | |
| }, | |
| { | |
| "text": "I'll put in a bad mark against determinants, because that, that, okay, so what is it?" | |
| }, | |
| { | |
| "text": "It's n, well, this is the answer." | |
| }, | |
| { | |
| "text": "It's, it's, it's, it's this order, n cubed." | |
| }, | |
| { | |
| "text": "It's like I have n terms, right?" | |
| }, | |
| { | |
| "text": "I've got n terms in this sum, and the biggest one is n squared, so the, the worst it could be would be n cubed, but it's not as bad as, it's n cubed times, there's a, it's about one third of n cubed." | |
| }, | |
| { | |
| "text": "That's the, that's the magic, operation, okay." | |
| }, | |
| { | |
| "text": "Somehow that one third takes account of the fact that the, the numbers are getting smaller." | |
| }, | |
| { | |
| "text": "If they weren't getting smaller, we would have n terms times n squared would be exactly n cubed." | |
| }, | |
| { | |
| "text": "But our numbers are getting smaller." | |
| }, | |
| { | |
| "text": "Actually, do you remember where, where does one third come in this, I'll, I'll even allow a mention of calculus." | |
| }, | |
| { | |
| "text": "So calculus can be mentioned, integration can be mentioned now in the next minute and, and not again for weeks." | |
| }, | |
| { | |
| "text": "It's not that I don't like eighteen oh one, but eighteen oh six is better." | |
| }, | |
| { | |
| "text": "Okay." | |
| }, | |
| { | |
| "text": "So, so what's, what's the calculus formula that that looks like?" | |
| }, | |
| { | |
| "text": "It looks like a sum is like, if we were in calculus, instead of summing stuff, we would integrate, so I would integrate x squared and I would get one third x cubed." | |
| }, | |
| { | |
| "text": "So, so if that was like an integral from one to n of x squared dx, it, the answer would be one third n cubed." | |
| }, | |
| { | |
| "text": "And it's correct for the sum also, because that's like the whole point of calculus." | |
| }, | |
| { | |
| "text": "The whole point of calculus is, oh, I don't want to tell you, I mean, you know the whole point of calculus." | |
| }, | |
| { | |
| "text": "Calculus is like sums except it's continuous." | |
| }, | |
| { | |
| "text": "Okay." | |
| }, | |
| { | |
| "text": "And we're, and algebra is discrete." | |
| }, | |
| { | |
| "text": "Okay." | |
| }, | |
| { | |
| "text": "So the answer is one third n cubed." | |
| }, | |
| { | |
| "text": "Now I'll just, let me, let me say one more thing about operations." | |
| }, | |
| { | |
| "text": "What about the right-hand side?" | |
| }, | |
| { | |
| "text": "This was what it cost on the left side." | |
| }, | |
| { | |
| "text": "Count." | |
| }, | |
| { | |
| "text": "This is on A." | |
| }, | |
| { | |
| "text": "Because this is A that we're working with." | |
| }, | |
| { | |
| "text": "But what's the cost on the extra column vector B that we're hanging around here?" | |
| }, | |
| { | |
| "text": "So B, B costs a lot less, obviously." | |
| }, | |
| { | |
| "text": "Because it's just one column." | |
| }, | |
| { | |
| "text": "We carry it through elimination and then actually we do back substitution." | |
| }, | |
| { | |
| "text": "Let me just tell you the answer there." | |
| }, | |
| { | |
| "text": "It's n squared." | |
| }, | |
| { | |
| "text": "So the cost for every right-hand side is n squared." | |
| }, | |
| { | |
| "text": "So let me, I'll just fit that in here." | |
| }, | |
| { | |
| "text": "For the right, for the cost of B, of B, turns out to be n squared." | |
| }, | |
| { | |
| "text": "So you see, if we have, as we often have, a matrix A and several right-hand sides, then we pay the price on A, the higher price on A, to get it split up into L and U, to do elimination on A, but then we can process every right-hand side at low cost." | |
| }, | |
| { | |
| "text": "Okay." | |
| }, | |
| { | |
| "text": "So the, that's, we really have discussed the most fundamental algorithm of, of, for a system of equations." | |
| }, | |
| { | |
| "text": "Okay." | |
| }, | |
| { | |
| "text": "So, I'm ready to allow row exchanges." | |
| }, | |
| { | |
| "text": "Ready to allow, now, what happens to this whole today's lecture if there are row exchanges?" | |
| }, | |
| { | |
| "text": "When would there be row exchanges?" | |
| }, | |
| { | |
| "text": "There are row, we need to do row exchanges if a zero shows up in the pivot position." | |
| }, | |
| { | |
| "text": "So I'm, I'm moving then into the final section of this chapter, which is about transposes." | |
| }, | |
| { | |
| "text": "Well, we've already seen some transposes." | |
| }, | |
| { | |
| "text": "And, so what's the, the title of this section is?" | |
| }, | |
| { | |
| "text": "Transposes and permutations." | |
| }, | |
| { | |
| "text": "Okay." | |
| }, | |
| { | |
| "text": "So can I say now where does a permutation come in?" | |
| }, | |
| { | |
| "text": "Let me talk a little about permutations." | |
| }, | |
| { | |
| "text": "So that'll be up here, permutations." | |
| }, | |
| { | |
| "text": "So these are the matrices that I need to do row exchanges." | |
| }, | |
| { | |
| "text": "And I may have to do two row exchanges." | |
| }, | |
| { | |
| "text": "Is it, can you invent a matrix where I would have to do two row exchanges and then it would come out fine?" | |
| }, | |
| { | |
| "text": "Yeah, let's just, for the heck of it, so I'll put it here." | |
| }, | |
| { | |
| "text": "Let me do three by threes." | |
| }, | |
| { | |
| "text": "Actually, why don't I just plain list all the three by three permutation matrices?" | |
| }, | |
| { | |
| "text": "They're a nice little group of them." | |
| }, | |
| { | |
| "text": "What are all the matrices that exchange no rows at all?" | |
| }, | |
| { | |
| "text": "Well, I'll include the identity." | |
| }, | |
| { | |
| "text": "So that's a permutation matrix that doesn't do anything." | |
| }, | |
| { | |
| "text": "Now what's the permutation matrix that exchanges, what is P one two?" | |
| }, | |
| { | |
| "text": "The permutation matrix that exchanges rows one and two would be zero one zero one zero zero, right?" | |
| }, | |
| { | |
| "text": "I just exchanged those rows of the identity and I've got it." | |
| }, | |
| { | |
| "text": "Okay." | |
| }, | |
| { | |
| "text": "Actually, I'll, yeah." | |
| }, | |
| { | |
| "text": "Let me not clutter this up." | |
| }, | |
| { | |
| "text": "Okay." | |
| }, | |
| { | |
| "text": "Give me a complete list of all the row exchange matrices." | |
| }, | |
| { | |
| "text": "So what are they?" | |
| }, | |
| { | |
| "text": "They're all the ways I can take the identity matrix and rearrange its rows." | |
| }, | |
| { | |
| "text": "How many will there be?" | |
| }, | |
| { | |
| "text": "How many three by three permutation matrices?" | |
| }, | |
| { | |
| "text": "Shall we keep going and get the answer?" | |
| }, | |
| { | |
| "text": "So tell me some more." | |
| }, | |
| { | |
| "text": "Zero, okay, what are you going to do now?" | |
| }, | |
| { | |
| "text": "Switch row one and three." | |
| }, | |
| { | |
| "text": "One and three, okay." | |
| }, | |
| { | |
| "text": "One and three." | |
| }, | |
| { | |
| "text": "Leaving two alone." | |
| }, | |
| { | |
| "text": "Okay." | |
| }, | |
| { | |
| "text": "Now what else?" | |
| }, | |
| { | |
| "text": "Switch, what will be the next easy one is switch two and three." | |
| }, | |
| { | |
| "text": "Good." | |
| }, | |
| { | |
| "text": "So I'll leave one zero zero alone and I'll switch, I'll move number three up and number two down." | |
| }, | |
| { | |
| "text": "Okay." | |
| }, | |
| { | |
| "text": "Those are the ones that just exchange single, a pair of rows." | |
| }, | |
| { | |
| "text": "This guy, this guy and this guy exchanges a pair of rows." | |
| }, | |
| { | |
| "text": "But now there are more possibilities." | |
| }, | |
| { | |
| "text": "What are the, what's left?" | |
| }, | |
| { | |
| "text": "So tell me, there is another one here." | |
| }, | |
| { | |
| "text": "What's that?" | |
| }, | |
| { | |
| "text": "It's going to move, it's going to change all rows, right?" | |
| }, | |
| { | |
| "text": "Where shall we put them?" | |
| }, | |
| { | |
| "text": "So give me a first row." | |
| }, | |
| { | |
| "text": "Zero one zero." | |
| }, | |
| { | |
| "text": "Okay, now a second row, say zero zero one and the third guy one zero zero." | |
| }, | |
| { | |
| "text": "So that is like a cycle." | |
| }, | |
| { | |
| "text": "That puts row two moves up to row one, row three moves up to row two, and row one moves down to row three." | |
| }, | |
| { | |
| "text": "And there's one more, which is, let's see, what's left?" | |
| }, | |
| { | |
| "text": "Is it zero zero one, okay." | |
| }, | |
| { | |
| "text": "One zero zero, okay." | |
| }, | |
| { | |
| "text": "Zero one zero, okay." | |
| }, | |
| { | |
| "text": "Great." | |
| }, | |
| { | |
| "text": "Six." | |
| }, | |
| { | |
| "text": "Six of them." | |
| }, | |
| { | |
| "text": "Six P. L. And they're sort of nice, because what happens if I like multiply two of them together?" | |
| }, | |
| { | |
| "text": "If I multiply two of these matrices together, what can you tell me about the answer?" | |
| }, | |
| { | |
| "text": "It's on the list." | |
| }, | |
| { | |
| "text": "If I do some row exchanges and then I do some more row exchanges, then all together I've done row exchanges." | |
| }, | |
| { | |
| "text": "So if I multiply, but I don't know." | |
| }, | |
| { | |
| "text": "And if I invert, then I'm just doing row exchanges to get back again, so the inverses are all there." | |
| }, | |
| { | |
| "text": "It's a little family of matrices that, like, they've got their own, if I multiply, I'm still inside this group, if I invert, I'm inside this group." | |
| }, | |
| { | |
| "text": "Actually, group is the right name for this." | |
| }, | |
| { | |
| "text": "It's a group of six matrices." | |
| }, | |
| { | |
| "text": "And what about the inverses?" | |
| }, | |
| { | |
| "text": "What's the inverse of this guy, for example?" | |
| }, | |
| { | |
| "text": "What's the inverse, if I exchange rows one and two, what's the inverse matrix?" | |
| }, | |
| { | |
| "text": "Just tell me fast." | |
| }, | |
| { | |
| "text": "The inverse of that matrix is, if I exchange rows one and two, then what I should do to get back to where I started is?" | |
| }, | |
| { | |
| "text": "The same thing." | |
| }, | |
| { | |
| "text": "So this thing is its own inverse." | |
| }, | |
| { | |
| "text": "This is, that's probably its own inverse." | |
| }, | |
| { | |
| "text": "This is probably not, actually, I think these are inverses of each other." | |
| }, | |
| { | |
| "text": "Oh yeah, actually, the inverse is the transpose." | |
| }, | |
| { | |
| "text": "There's a curious fact about permutation matrices, that the inverses are the transpose." | |
| }, | |
| { | |
| "text": "And final moment, how many are there if I, how many four by four permutations?" | |
| }, | |
| { | |
| "text": "So let me take four by four, how many P's?" | |
| }, | |
| { | |
| "text": "Well, okay." | |
| }, | |
| { | |
| "text": "Make a good guess." | |
| }, | |
| { | |
| "text": "Twenty-four, right." | |
| }, | |
| { | |
| "text": "Twenty-four P's." | |
| }, | |
| { | |
| "text": "Okay." | |
| }, | |
| { | |
| "text": "So we've got these permutation matrices, and in the next lecture we use them." | |
| }, | |
| { | |
| "text": "So the next lecture finishes Chapter Two and moves to Chapter Three." | |
| }, | |
| { | |
| "text": "Thank you." | |
| } | |
| ] |