 Okay, let's talk about matrices. Now we've seen the augmented matrix where we take the coefficients of our system of linear equations and we augment that by the solution on the right-hand side and that's a matrix. But matrices are so much more than that. It's such a brilliant thing. Let's say matrix. Let's create a matrix. I'm just going to call my matrix A and this is the way that you would see it in many textbooks maybe in your lecture A11, A12, A13 to indicate that these are coefficients and they have an address just like you have an address where you stay. So these little things A21, A22, A23 and A31, A32 and A33. Suppose we should put little commas in between there just to show that these things that does not say 33 it's a 3 and 3. The reason why and how we address this is that they are columns. So there's a column. That's a column. That's a column. That's a column. Column 1, column 2, column 3 and here are rows. This would be row number 3. So we have row 1, row 2, row 3. So the address of this value right there would be row 3 and column 2. Always row then column. That's just a convention. Row column. And later on we'll see we can talk about column spaces. We can talk about the row spaces. There's so many other things. And I want you to see the matrix just as you would see something like the set of natural numbers. So there are sets of specific matrices. Just as we have integers. Just as we have rational numbers. Just as we have real numbers. Just as we have complex numbers. Just as we have the set of all polynomials. Say polynomials of order 2. So you x square, a x square plus b x plus c equals d or whatever the case may be. Each of these things lays an element inside of a set and the same goes for matrix. So a matrix is just the same thing in some sense as a single number or as an equation or something. And what can I do with these things? Well first of all I can note that I can do operations between two of them. So just as I can say of the natural numbers 1 plus 1 is 2. 1 plus 3 is 4. I can do addition. And remember subtraction is just the form of addition. So we don't do subtraction. It's just addition. We can do multiplication. Multiplication. And so as we can do with two integers so we can multiply under certain circumstances two matrices. Specific matrices. We have associativity. Associativity of these operations. If I were to have two matrices I can say a plus b. Can add them. Certain ones. If I had a c as well and I had another a plus b plus c. Associativity. Would it be the same if I do this? Would those two be the same? If I multiply them would those be the same? What about what about commutivity? What about the distributive laws? And we you know we will have to look if we multiply two matrices. AB equals BA. Is that the same thing? Is that the same thing? Are the identity elements? Identity elements. If we take addition the identity element is of self the integers is 0 because if I take something and I add 0 to it I'm just left with that something. The identity matrices, the identity element under multiplication is this 1. If I multiply negative 3 by 1 I still get negative 3. Do we have matrices that do have the exact same property? So these are these are exciting things. This this matrix here matrices with a certain number of rows and certain number of columns they exist as this abstract idea other than just part of being a system of linear equations. And the first thing we obviously we are going to look at is this notion of matrix addition. When can I add two matrices? So that's going to be the first thing that we look at and I'm going to tell you now. The way that you add two matrices is element by element so the same address element in the 1 or the same address element in the 2. So if I had to have this matrix A1 2 A1 1 A1 1 A1 2 and I had A2 1 A2 2 and A3 1 and A3 2 so that's one column two column. The column is the second name rows are the first number, so row 1, row 2, row 3, and I had, that's my matrix A, and I had another matrix. I add the addresses together. It's these people who live in the same address. They get added together, and that means I must have a matrix with the same number of rows and the same number of columns. Otherwise there are people going to be with one address that don't, that don't exist in the second one. So yeah, I better have b11, b12, b21, b22, and b31, and b32. There we go. So this b and that a, they have the exact same address, and I can add them. So if I don't have the number of rows and columns, so this would be three rows and two columns. So we would write something like this. This is a 3 by 2 matrix. This is also a 3 by 2 matrix. Three rows by two columns. Three rows by two columns. Same address, same address, so I can add them. And if I were to add them together, then I'm going to get something like this. I'm going to have a11 plus b11 for that one, a row 1 column 2 plus b row 1 column 2, and I'm going to have a21 plus b21, and I'm going to have a22 plus b22, and I'm going to have a row 3 column 1 plus b row 3 column 1 and a row 3 column 2 plus b row 3 column 2, and that is going to be my matrix. And this is going to be a plus b. And you can well imagine that these things do commute because that'll be exactly the same as doing b plus a. So first thing to learn, these things have got to have the same dimensions we call them. Let's go to Mathematica and let's go have a look how to do this just addition of matrices. Okay, here we are in Mathematica. Now let's do something. I'm going to hold down command or control or alt I should say. I'm going to hold the key or the option key and I'm going to hit 1. This changes the cell to this title in this title format. So let's write matrices. Oh, matrices. There we go. Down arrow key, I'm automatically inside of a new cell. I'm going to hold down option or alt and I'm going to have 4. That gives me a little subtitle. Let's call this addition. So we're going to look at matrix addition. Down arrow key, I'm back to where I am. Let's create a matrix. I'm going to create a matrix. I'm going to call it a because I want to uppercase just the convention. I'm going to call it a and remember how we do matrices. We do each row inside of its own set of square brackets. So let's have one, three, one. That's my first row and my second row would be three, comma, negative two, comma one. I'm going to close that row and close that row. If I put a semicolon after that and hold down shift and hit enter or return, it won't be printed to the screen. This is the suppression of the output to the screen. So let's have a look at A, but we're going to look at A in matrix form. So let's do matrix form and let's do that and we see there beautiful one, three, one in the first row, three, negative one and one in the second or if I looked at the column, it would be one and three in column one, three negative two in column two, one and one in column three. How big is this matrix? Well it's laughable. It's two rows and three columns, but there is a function for that dimensions of A. Let's have a look at the dimensions of A. We see two rows, three columns. As I said that's easy, but if you have a very large matrix that you're importing, it might not just be, you might just not be able to look at it. You quickly want to see what the dimensions of this matrix is. You get back this list with two elements. First one being the row, second one being the columns, two rows, three columns. That's how you know. So let's let me create a column, a matrix B and matrix B is going to be, let's make this just symbolic. I'm going to make it a D and an R and an S. I don't know. Let's make it an S and an F and a G. This is the beauty of Math America. It's a computer language for mathematics. So it is going to see these things as, it's going to see these things just as mathematical symbols. Okay, I'm going to hit shift and enter. So to suppress that output to the screen, let's have B in matrix form and there we see. Beautiful. And now we can say A plus B. A plus B as simple as that. Shift, enter, shift, return and there we go. We see the two rows there. Let's make it pretty. Let's make it matrix form. So this time around, I'm going to put matrix form in the front as it's supposed to be proper. So this is a proper notation instead of doing the post fix. And there we go. And indeed we see that it was addition. It was element wise addition. I take the first element which was one row, one column one and I add it to D which was in row one column one of the second matrix. So they have to be of the same dimension. So if I looked at the dimensions of my matrix B, I'd see that's exactly the same. We can even, we can even ask that question. We can say, is the dimensions of A equal to, and that's two equal signs. Two equal signs ask a Boolean question. A Boolean question is going to return two or false. And is that equal to the dimensions of B? And of course it's going to be two. So very simply two. And that is how matrix addition works. You've got to have someone living in the same address in both of the matrices or in the three matrices. Let's just have a quick look at this. I'm going to just do the following. I'm going to say B plus A. And I'm going to ask, is that equal to, and you can see I'm just putting these in parentheses just to have clarity. You don't have to do that. Is B plus A equal to A plus B? Well, in this instance, it is. It doesn't matter what these values take. It's exactly the same thing. So we do have commutivity here. We really do have commutivity. Now, let's look at a matrix that might be the identity matrix under addition. And I'm going to call that matrix I, and I'm going to show you what it is. It's 0, 0, 0, because this one has three columns. And then the second row, 0, 0, 0. And I'm going to do that. Let's suppress that to the screen. Oh, I can't use I. Now that's a very good thing. I is a protected symbol. It is the imaginary number I. So I can't use I. So I'm going to just call it I.D. I.D. for identity. Let's do that. And if I now say the matrix form of I.D. There we go. I see, I see the exact same thing. So if I now have A plus I.D. I'm going to get, and let's do that in matrix form, matrix form. And I see I get exactly A back. And I can even ask is A plus I.D. Is that equal to A? And it's 2. It's exactly the same. And I can do I.D. time plus A. And that is going to be exactly the same as A as A as well. 2. So we do have an identity element as long as the dimensions of that identity element is exactly the same as the dimensions of the matrix 2 which you're doing the addition. So you can well imagine that there are many identity matrices under addition as long as they are the same size as what you are trying to achieve. Let's have C in this instance. And let's just create another matrix. So we're just going to have 4 and 3 and 1. A 2 I should say there and this 3 and 3 and 1. That's my second one. So we have C there. C is a protected symbol. So just remember that. Let's just call it CC. So these protected symbols mean one of the 6000 plus functions that you have or symbols that you have. So just watch out. You can't use that as a computer variable name to store something in. So just by the by this is a computer variable name. Something that you choose as long as it's within the rules of what you can choose you do. It creates a little space in memory and it holds an object. In this instance it holds a list object and we've constructed the list such that it can be viewed as a matrix. Now let's have a look at this. I have A. Let's do this A plus B plus C. I'm going to ask the question is that the same as having A plus and B plus C. Is that the exact same thing? And it is true. So we know we have associativity. So under the binary operation here of addition we do have an identity element and we do have associativity. There's special kind of binary operation here because we also have commutivity. But just as we had different things three quarters is not a natural number. Just as if I look at the set of these matrices that I can add to each other they all have to have the same dimension. They then make a set under which I can have this thing called addition and under those circumstances we'll have associativity, we'll have commutivity we'll have this special identity element for everyone. If I'm talking five by four matrices, those are different sets of matrices as long as they're all five by four. You get it. Addition of matrices quite simple.