 Let's continue our look deeper into matrices, and I'm going to talk to you today about elementary matrices You might have seen those that is what is used to solve systems of linear equations to get to reduced row echelon form or at least row form And this is in preparation of something called LU decomposition of a matrix lower upper and we'll talk about what a lower triangle and upper triangular matrix is in the next video, but today we're going to concentrate on Elementary matrices How do we get to reduce row echelon form or just echelon form? Now I'm going to cheat again by just creating a system of linear equations Two equations and two unknowns, and I'm going to let x equals two and y equals one I plug that in with some coefficients I see what the solution is so that I have the system of Equations to work with and I know that x must be two and y must be one and from that I've created my I have created my My augmented matrix here. Let's call this augmented matrix a It's my augmented matrix Now what would we do to this is? We see that we need a zero in this position Zero in this position. How would we do that? Well, I would take minus a quarter times the first row and add that to the second row because minus a quarter times Force minus one minus one plus one is zero and I'll get a zero there But let me do something very special Let me start with the identity matrix and the identity matrix as far as a two by two matrix is concerned would be one zero Zero zero one and Let's see what I would have done here. I would have said Minus a quarter times row one added to row two Let's do that to the identity matrix minus a quarter times row one which will leave this at minus a quarter and Minus a quarter times zero that's zero and I'm going to add that to row two And that is going to be my what I call my first elementary matrix, and I'm going to write that as e So minus a quarter So I'm still having zero and zero and one in the first row But for the second row is going to be minus a quarter times the first row So that's minus a quarter plus zero that leaves me with minus a quarter Minus a quarter times the first row that's still zero plus my one gives me one and I'm going to call this my first Elementary matrix and let's do the following here. Let's do e one times a You want times a will that work? Well, this is two by two and this is two by three Two by two times two by three that's going to work leaving me with a two by three matrix And this is exactly what we are doing when we are doing this this elementary row operation So your elementary matrices start with the identity matrix and we're going to apply an elementary row operation to it So let's do that so we have remember one and zero and negative a quarter and One and I'm going to multiply that by four minus two and six and a one and three and a five so that I can get this Matrix one two three columns one two two rows and three columns so it ends up as two by three exactly what I want So just look at what happens if I take this one and multiply by this It's four plus zero is four. That's minus two. That's six. It leaves that first row absolutely Where it needs to be and that is what we would have done if we did if we just did the elementary row operation in the second one Let's do this Minus a quarter so that gives me minus one plus one is zero, which is exactly what I want Minus a quarter times minus two. That's a half Plus three that's three and a half that leaves me seven over two And minus a quarter times six. So let's just do that minus six over four And that leaves me minus six over four plus five and five that's 20 over four that gives me 14 over four That gives me seven over two So seven over two and that is exactly what we would have done if we had just done normal row operations here And what we did in actual fact is create an elementary matrix From the identity matrix by doing exactly to it what we would have done with gas Jordan elimination We had One of the elementary row operations Minus a quarter times row one plus row two And that's exactly what we do to the identity matrix and we multiply it So now we sit with the following matrix. We have four minus two And six and zero and seven over two and seven over two How would we what would we do in the following way as I said, I don't like fractions but to create these now these Elementary elementary Magesies that are not going to be they're not going to be unique. You can do a variety of things here Don't have to follow the exact same steps So if you follow other steps your elementary matrices will look different, but what I would do here is just multiply row two by Multiply row two by two over seven that will give me a one and a one so that I have a leading one here Which is what I want so if again if I start with the identity matrix if I were to start with the identity matrix and I Multiply row two by two over seven that'll give me my second one So that's still a one and a zero and I multiply by two over seven That's zero there and two over seven there. That's my e2 and let's do that Let's now do e2 Times this e1a and we have zero one zero two over seven and we have our matrix there four minus two and six and zero and seven over two and seven over two and What are we going to get exactly the same in the first row and here we're going to get zero one one As I multiply these and these I get zero one one. So there's my new matrix Let's just clean the board here a little bit Let's just clean the board here a little bit. So now we left with four minus two and six and zero one one Now we can already do back substitution because this says four times x minus two y equals six and one y equals one So y equals one and it's exactly there. I can plug that in and I can solve that but let's carry on Let's carry on with ease. This is clean the board a little bit more There we go a bit more space. So what would I do to this I to get a leading one here I would multiply row one by a quarter. So that's a quarter times row one Let's do exactly that to the identity matrix which gives me three which is a quarter zero zero one And let's do this e3 then times my e3 times my e2 e1 a And let's do that. So that it's going to be a quarter Zero zero one and I'm multiplying it by four minus two six and zero one one That gives me a one that gives me minus a half and That gives me six over four which is three over two zero one one So that's where I am at the moment. Let's put that there. So that gives me one minus a half and three over two and All I need to do I can stop here again with back substitution to substitution but let's get to row reduced reduced row echelon form and So what would I do to get rid of that half? Well, I'll multiply row two. So it's a half times row two plus row one If I have a half times row two That will give me half plus negative a half with which give me a zero That's what I want there and that is what my e4 is going to be. So it's a half times a Half times a row two. So that's a zero and a half So that means I'm not adding that to row one So zero plus one so that's still a one and zero plus a half That's a half and at the bottom. I have still zero and one. So let's do that on this side So we're going to do e4 multiplied by this e3 e2 e1 a that I've got at the moment and that is zero and That is one and a half one Half zero and one and we're going to multiply that by one Minus a half three over two zero one one. Let's do that One times one that leaves me with a one one times negative a half Plus a half negative half plus a half is zero and you have three over two Plus a half that's four over two that leaves me with two and here I still have zero one one if I multiply this zero this one This is still a one and there is my solution x equals two and y equals one x equals two and y equals one. So we know we are Correct there. So what we've done is this creating the series of elementary Matrices and those elementary matrices is this what I wanted to do the elementary row operation I do to an identity matrix which I then multiply by a So if I were to get this e4 e3 e2 e1 if I were to do that multiplication and multiplied by a I was going to get to reduce the row echelon form and it is these elementary elementary Matrices that are going to be important to you've already seen the important in solving systems of linear equations But they're also going to be important when we do LU decomposition lower upper triangular decomposition of a matrix and that is also used for solving these systems for getting the inverses of a matrix and And for getting to the determinant of a matrix and we'll still discuss the determinant So I hope you understand it is just it's very intuitive what the elementary row operation We wanted to do is what we do to the identity matrix to create this if we are every elementary Operation that elementary matrix that you see is taking the identity matrix and applying an elementary row operation to it Please be careful when you do it in the beginning where the pitfalls are that you've got to be aware is When I say a half times row two plus row one so a half times row two Plus row one that means I'm changing row one. I'm changing row one leaving row two exactly where it was So just just be careful what you do. It's not like this is now zero and a half here It is one is I'm changing row one. It's a half times row two plus a row one So it's a change of row one not of row two here was a change of row two not row one a change of row two Not a one a change of row two not row one So just be careful which one you do they say do a few of those just to make absolutely sure that This is this is you know that you do this correctly so that you do and it's only through practice that you're going to get this Right, so say these are relatively pointless exercises on paper But most of you will have to do that for your exams and it becomes important when we just want to have a look at LU decomposition Which is something we will do tomorrow. We're going to use these elementary matrices