Lecture 2 Lesson 1 Book 2
Lecture 2 Lesson 1 Book 2
06_L02
2 times this equation,
Okay. This is it.
The second lecture in linear algebra, and I've put below my main topics for today.
I put right there a system of equations that's going to be our example to work with.
But what are we going to do with it?
We're going to solve it.
And the method of solution will not be determinants.
Determinants are something that will come later.
The method we'll use is called elimination.
And it's the way every software package solves equations.
And elimination, well, if it succeeds, it gets the answer.
And normally it does succeed.
If the matrix A that's coming into that system is a good matrix, and I think this one is, then elimination will work.
We'll get the answer in an efficient way.
But why don't we, as long as we're sort of seeing how elimination works -- it's always good to ask how could it
fail? So at the same time, we'll see how elimination decides whether the matrix is a good one or has problems.
Then to complete the answer, there's an obvious step of back substitution.
In fact, the idea of elimination is -- you would have thought of it, right?
I mean Gauss thought of it before we did, but only because he was born earlier.
It's a natural idea... and died earlier, too.
Okay, and you've seen the idea.
But now, the part that I want to show you is elimination expressed in matrix language, because the whole course - all the key ideas get expressed as matrix operations, not as words.
And one of the operations, of course, that we'll meet is how do we multiply matrices and why?
Okay, so there's a system of equations.
Three equations and three unknowns.
And there's the matrix, the three by three matrix -- so this is the system Ax = b.
This is our system to solve, Ax equal -- and the right-hand side is that vector 2, 12, 2.
Okay.
Now, when I describe elimination -- it gets to be a pain to keep writing the equal signs and the pluses and so on.
It's that matrix that totally matters.
Everything is in that matrix.
But behind it is those equations.
So what does elimination do?
What's the first step of elimination?
We accept the first equation, it's okay.
I'm going to multiply that equation by the right number, the right multiplier and I'm going to subtract it from the
second equation.
With what purpose?
So that will decide what the multiplier should be.
Our purpose is to knock out the x part of equation two.
So our purpose is to eliminate x.
So what do I multiply -- and again, I'll do it with this matrix, because I can do it short.
What's the multiplier here?
Oh, well, you could say wait a minute, what about the right
hand side? Shall I carry -- the right-hand side gets carried along.
Actually MatLab finishes up with the left side before -- and then just goes back to do the right side.
Maybe I'll be MatLab for a moment and do that.
Okay.
I'm leaving a room for a column of b, the right-hand side.
But I'll fill it in later.
Okay.
Now the next step of elimination is what?
Well, strictly speaking... this position that I cleaned up was like the 2, 1 position, row 2, column 1.
So I got a 0 in the 2, 1 position.
I'll use 2,1 as the index of that step.
The next step should be to finish the column and get a 0 in that position.
So the next step is really the 3,1 step, row three, column one.
But of course, I already have 0.
Okay. So the multiplier is 0.
I take 0 of this equation away from this one and I'm all set.
So I won't repeat that, but there was a step there which, MatLab would have to look -- it would look at this number
and, do that step, unless you told it in advance that it was 0.
Okay. Now what?
Now we can see the second pivot, which is what?
The second pivot -- see, we've eliminated -- x is now gone from this equation, right?
I see immediately that the correct value of z is negative And what do I do next?
I go back upwards.
I now know z here.
So, if z is negative 2, that's 4 there, is that right?
And so 2 y plus a 4 is 6, maybe y is 1.
Going -- this is back substitution.
We're doing it on the fly because it's so easy.
And then x is -- so x -- 2y is 2 minus 2, maybe x is 2?
So you see what back substitution is.
It's the simple step solving the equations in reverse order because the system is triangular.
Okay. Good.
So that's elimination and back substitution, and I kept the right-hand side along.
Okay, now what do I -- that, like, is first piece of the
lecture. What's the second piece?
Matrices are going to get in.
So I wrote stuff with x, y-s and z-s in there, then I really, got the right shorthand, just writing the matrix entries, and
now I want to write the operations that I did in matrices, right?
I've carried the matrices along, but I haven't said the operation those elimination steps, I now want to express as
matrices.
Okay.
Here they come.
So now this is elimination matrices.
Okay.
So this is going to be a matrix that's going to subtract 3 times row one from row two, and leaves the other rows the
same. Just in -- I mean, the answer is going to be that.
So whatever matrix this is -- and you're going to, like, tell me what matrix will do it, it's the matrix that leaves the
first row unchanged, leaves the last row unchanged, but takes 3 of these away from this so it puts a 0 there, a 2
there and a minus 2.
Good.
What matrix will do it?
It's these.
It should be a pretty simple matrix, because we're doing a very simple step.
We're just doing this step that changes row two.
So actually, row one is not changing.
So tell me how the matrix should begin.
One -- the first row of the matrix will be 1 0 0, because that's just the right thing that takes one of that row and
none of the other rows, and that's what we want.
What's the last row of the matrix?
0 0 1, because that takes one of the third row and none of the other rows, that's great.
Okay.
Now, suppose I didn't want to do anything at all.
Suppose my row -- well, I guess maybe I had a case here when I already had a 0 and, didn't have to do anything.
What matrix does nothing, like, just leaves you where you were?
If I put in -- if I put in 0 1 0, that would be -- that would be -- that's the matrix -- what's the name of that matrix?
The identity matrix, right.
So it does absolutely nothing.
Can I multiply -- can I cook up some matrix that produces that answer?
You can see from where I put my hand I was really asking can I put a matrix here on the left that will exchange
columns?
And the answer is no.
I'm just bringing out again this point that when I multiply on the left, I'm doing row operations.
So if I want to do a column operation, where do I put that permutation matrix?
On the right.
If I put it here, where I just barely left room for it -- so I'll exchange the two columns of the identity.
Then it comes out right, because now I'm multiplying a column at a time.
This is the first column and says take one -- take none of that column, one of this one and then you
got it. Over here, take one of this one, none of this one and you've got a c.
So, in short, to do column operations, the matrix multiplies on the right.
To do row operations, it multiplies on the left.
Okay, okay, and it's row operations that we're really
doing. Okay.
And of course, I mentioned in passing, but I better say it very clearly that you can't exchange the orders of
matrices.
And that's just the point I was making again here.
A times B is not the same as B times A.
You have to keep these matrices in their Gauss given order here, right?
But you can move the parentheses, so that, in other words, the commutative law, which would allow you to take it
in the other order is false.
So we have to keep it in that order.
Okay.
Inverses.
Okay, and I'm just going to take one example and then we're done.
The example I'll take will be that E.
So my matrix is 1 0 0 minus 3 1 0 0 0 1.
And I want to find the matrix that undoes that step.
So what was that step?
The step was subtract 3 times row one from row two.
So what matrix will get me back?
What matrix will bring back -- you know, if I started with a 2 12 2 and I changed it to a 2 6 2 because of this guy, I
want to get back to the 2 12 I want to find the matrix which -- which undoes elimination, the matrix which multiplies
this to give the identity.
And you can tell me what I should do in words first, and then we'll write down the matrix that does it.
If this step subtracted 3 times row 1 from row 2, what's the inverse step?
I add 3 times row one to row two, right?
I add it back.
The -- what I subtracted away, I add back.
So the inverse matrix in this case is -- I now want to add 3 times row one to row two, so I won't change row one, I
won't change row three and I'll add 3 times row one to row two.
That's a case where the inverse is clear.
It's clear in words what to do, because what this did was simple to express.
It just changed row two by subtracting 3 of row one.
So to invert it, I go that way.
And if you -- if we do that calculation, 3 times this row plus 1 times this row, comes out the right row of the identity.
Okay, so inverses are an -- so if this matrix was E and this matrix is I for identity, then what's the notation for this
guy?
E to the minus one.
E inverse.
Okay. Let's stop there for today.
That's a little jump on what's coming on Monday.
So, see you Monday.