 In the previous video, we learned about the elementary row operations and we learned how we can use them to solve systems of equations. But it turned out systems of equations have way too much fluff in them. And so to make the algorithm more efficient, we should become more efficient in our notation itself. And so for this reason, we're going to introduce the augmented matrix. Well, what is a matrix? I'm not talking about red pill or blue pill or anything like that. A matrix is a rectangular array of numbers. If we have two positive integers M and N, we say an M by N matrix is a rectangular array with M rows and N columns. Be aware that when we talk about matrices, we always first mention the rows and then we mention the columns. This is reverse alphabetical order. An M by N matrix means there are M rows and N columns. So for example, the following matrix 1, 2, 3 is the first row, 5, 0, negative 3 is the second row. There are two rows, three columns. We see two rows right here and we see three columns right here. So we call this a two by three matrix. That's all there is to a matrix. It's a rectangular array of numbers. It's like a vector is like a linear array, a matrix could have multiple rows, multiple columns. Of course, every vector we've talked about is an example of a matrix, right? If you have the vector 1, 2, 3, this is just an example of a 3 by 1 matrix. The vectors we've introduced are really just one column matrices. So continuing with that, the reason we're introducing matrices now is that we want to talk about the coefficient and augmented matrix of a system of equations. So if you have a linear system, much like this example we were playing with in the previous video. We have this linear system of equations. If you organize things correctly, you're going to put all of the variables lined up into columns. So there's a column for x1, there's a column for x2, there's a column for x3 and make sure all of the constant terms are on the right hand side of the equations. Using this, we can then construct what we call the coefficient matrix. The coefficient matrix then keeps track of all of the coefficients of the variables in the linear system. Let me explain. So if you look at the variable x1, the first column of the coefficient matrix will be the coefficients of x1 in the system. So you don't see anything in front of x1 in the first one, that's because its coefficient is a 1. So we record a 1 in the matrix in the first row. In the second equation, you don't even see an x1 and that's because its coefficient is a 0. So we put a 0 into the second position there. And then the third row, the third equation, the coefficient is negative 4, so we record that in the matrix. The first column corresponds to x1. The second column will correspond to x2. Since you have a minus 2x2, make sure you put a minus sign right here. Don't forget the negative sign. Because you have a plus 2x2, you'll put a 2 in the second row. And then a 6x2 puts a 6 in the third row. And then finally, the third column will correspond to x3. The first equation has a 2x3, so you put a 2 in the first row. The second equation has a negative 8x3, so you put a negative 8 in the second row. And then the third equation has a 2 as the coefficient, so you record the coefficient of 2 in the third row, third column. And I should mention that when you have an entry in a matrix, you always refer to the position. So this right here, you always refer to the row then the column. So this is the 1, 3 entry of the matrix. First row, third column. This right here is the 3, 2 entry of the matrix, third row, second column. So we can reference the address of an entry. This is the coefficient matrix. It just keeps track of the coefficients of the variables here. The augmented matrix, what you do to create it, is you take the coefficient matrix. So this is just the coefficient matrix we had right here. But then you augment one extra column, the last column. This will correspond to the right-hand side of the system of equations. So when you look at this friend right here, you take just the entries in the same order, 0, negative 8, 10. And this then becomes this augmented column. We put another column at the end there. We also like to add this vertical line to separate the coefficient matrix from this augmented column. And this vertical line, we associate to the location of the equal signs. And so this matrix right here, this augmented matrix, is just an encoding of the linear system of equations. This matrix encodes all the information we need. There's a column for the first variable, second variable, third variable. We know where the equal sign is. And then each row gives us an equation. We have all the information we actually need encoded in this system of equations. We could unravel it to solve the system of equations if we so chose to. Now let me show you an example. Let's take another system of equations. It's another 3 by 3 example right here. Let's construct the augmented matrix. Looking at the first row, the first row would be 0, 3, 3, 11. The second row would be 2, negative 3, 3, negative 4. And then the final row would be 1, 1, 4, 3. Now make sure your variables are in the right order. If someone like tricked you and did x2 plus x1 plus 4x3, you do need to put them in the right order. So watch out for that diabolical, it's like a leprechaun trick or something like that. So we get right here the augmented matrix. It has all of the information we need for the system of equations. What if we were to start playing around with this augmented matrix? For example, what if we wanted to perform the elementary row operation of interchange? What if we interchange rows, I'm actually going to interchange rows 1 and 3. The first becomes the last and the last becomes the first. If you interchange the rows, you end up with a matrix like the following. And then the next thing I want to do after interchange is I'm going to take the second row and subtract from it 2 times the first row. And using the convention we did before, we're going to times the first row by negative 2. This gives us a negative 2, a negative 2, a negative 8, and a negative 12 right there. Combining those entries together, you're going to get 0, negative 5, negative 5, and negative negative. Did I do that one last? Oh, I'm sorry, I did. Where did that come from? I did a negative 12, I did 3 times 4, I needed to do 3 times negative 2. Sorry about that, that gaff right there. 3 times negative 2 is negative 6, and then negative 6 plus negative 4 is negative 10. So you want to make sure you check your arithmetic here. So we get 0, negative 5, negative 5, and negative 10. It's reasons like this, you don't want to do too much of the arithmetic in your head. It can be very difficult to do. At this stage, right, I'm looking at the second row, I'm going to multiply everything in the second row by negative 1 fifth. That is, I'm going to do the scaling operation. And so you divide everything by negative 5, the second row will become 0, 1, 1, 2. And then at that moment, I'm going to do another replacement operation. I'm going to take row 3 and subtract from it 3 times row 2. That's what I want to do. Again, don't worry so much on why I'm doing things, what I'm doing. Focus right now on what I'm doing. So we're going to take 1 times negative 3, which is negative 3. We're going to take 1 times negative 3, we did that one. 2 times negative 3, I'm going to get this one right this time, it's a negative 6. You'll notice I ignored this column right here because 0 plus negative 3 times 0 is going to be 0. It's not going to change because of the 0s there. And so what happens is you're going to get 3 minus 3, which is 0. You're going to get 3 minus 3, which is 0, and you're going to get 11 minus 6, which is 5. And so this is our matrix right here. Notice again, it's like, aha, I see those stairs of 0s you made right there. Ah, I see that's why you did it. Now this augmented matrix represents a system of equations. If we switch it back to the associated linear system, you see the following. The first equation, which is now going to be x1 plus x2 plus 4x3 equals 3. The second equation is going to be x2 plus x3 equals 2. And the third equation is going to be 0 equals 5. This system of equations is equivalent to the one we started with. They're not equal, but they're equivalent. This system will have the same solution that the original system had. So look at that last equation, 0 equals 5. This is what we call a contradiction. It's impossible. There's no choice of x1, x2, and x3 that will force the equation 0 equals 5 to be true. I mean, if we're working mod 5, then this would be fine. In z5, this would be perfectly fine, but we're working over the real numbers. If ever you have a linear system and it doesn't specify the field, you may assume the field is r, the field of real numbers. So this is impossible to do. 0 does not equal 5 over the real numbers. And since it's impossible to solve this system, that means there's no solution. This is what we previously called inconsistent. So when we represent a system of equations as a matrix, as an augmented matrix, we are more efficient in our notation, and we can combine that with the row operations we had before. This is actually why they're called the elementary row operations. We are doing operations to the rows of the augmented matrix. So combining the augmented matrix with the elementary row operations, we now have the tools necessary to start solving systems of equations. But to compare ourselves to the Karate Kid, right now we've learned wax on wax off. Daniel Son has learned, he's learned just the muscle memory of the Karate Moves he needs to know from Mr. Miyagi, right? We haven't yet applied, we're just practicing the skills. We yet don't have this strategy. That'll come in the next section.