 Hi, I'm Zor. Welcome to Unisor education. I would like to continue talking about the definition of the matrix product and just a couple of words to remind what was in the previous lecture. In the previous lecture, I was talking about two by two matrices and their multiplication. Today, I will talk about three by three and I would like to come up with the same result, generally speaking, which I will explain right now, and that would be the foundation for a definition in a common case. All right, so what was the result of the two by two matrix? matrix multiplication. If I have a matrix A applied to vector U two-dimensional, because that's what I was talking about, and the matrix B later on was applied to result of the first transformation. Then I got some vector which can be actually produced by multiplying matrices B and A in this order according to a certain rule of multiplication. And the result of this multiplication of two by two matrix and two by two matrix is another two by two matrix. And if that matrix is applied to the same original vector U, it would exactly the same result, produce exactly the same result as in this case. So what is this rule of multiplication? Very simple. So if my matrix C result of this multiplication is defined by the following rule C, i, j. So the element on i's, rho, and j's column, and there are only two rows and two columns, equals to B, i, star, which is i's, rho vector of the matrix B. So I just take the i's, rho as a vector, multiply it as a scalar product by A j's column vector. So this is column, my j is in the second on the second place, and this i is in the first place. So this is the row and this is the column. So it's all elements along the j's column. This is all elements along the i's row, and you multiply them as a scalar product of two vectors. So that would be the result of this. Now, in the future, I'm going to make it a general definition, but before doing that, I would like to repeat exactly the same calculations I did for two by two case in three by three case. So this will probably justify even, even more that this is the right way to define the product of two matrices. All right, so let me just completely go through through the calculations of the three by three case. It's a little tedious. I have to warn you. It's important for me not to make any mistake on the way, but in any case, the notes for this lecture at Unisor.com contains basically exactly the same thing. So you can follow the notes in case you're, if you cannot really follow whatever I was just doing. All right, so I have exactly the same situation. I don't know this yet. I'll put it actually somewhere on the side. So we will all see that this is the formula. But I will just try to do this. So I will transform my vector U, three-dimensional now, with a three-dimensional matrix A, and then I will transform it with another three-dimensional square matrix B, and then I'll see what kind of coefficient at U1, U2, U3 will be. And these coefficients should be the same as this. But let's just do it. So my vector U is U1, U2, U3. My matrix A, which is three by three matrix, would be A11, A12, A13, A21, A22, A23, A31, A32, A33. So the first index is a row, the second index is a column. Now B matrix is similar to this. Now I will apply this matrix to this vector, and I will get V1 equals to A11, U1 plus A12, U2 plus A13, U3. That's my application of the matrix A to vector U, to get vector V. So that's the first transformation. U is transformed to AU. That's where it is. So 2, 1, 2, 2, 2, 3, 3, 1, 3, 2, 3, 3. Okay, so we have transformed vector U into vector V using my first matrix, matrix A. Now let's do exactly the same with matrix B, which transforms this into, that's A. So first we multiply A by U, which is this, and then we multiply B by the result. So matrix B applied to V1, V2, V3 will give me W1, W2, and W3. So it's V11, V1 plus V12, V2 plus V13, V3 equals to, okay, V1 times V1. Now V2 times V2 and V3 times V3. So if I would like to combine together everything related to U1, I have to combine B1 and A11, B2, B11, V1 plus B12 from the V2, I have another U1 and B13, A31. And that would be a coefficient at U1, right? Plus. Now let me gather all coefficients at U2. I will have B11 here, I will have B11 from here, so it would be B11, A12 plus B12, A22 plus B13, A32. That would be U2 plus. And now I will have B11, A13, B12, A23 and B13, A33, U3. So that's my W1. Now that actually made the first three elements in the first row of the resulting matrix which transforms U into W, right? So this is all W1. So this is the top coefficients. These are top coefficients which transform U into W, from U to W. So it's something which I consider to be a future product of these two matrices. So the first row, the top row of the matrix B times A is this. Okay, now let's do the second row. W2 is equal to, now I will have to multiply B2, B21, B22 and 23, right? So it's B21, V1 plus B22, V2 plus B23, V3. That's the definition of my second component of the vector which will be the transformation of vector V using the matrix B, all right? The third component will be 31, 32 and 33, right? Okay, so the second component now which is equal to, let's do exactly the same thing. Let's combine together everything with U1. Well, it would be very similar to this one but I will just replace B11 here with B21, for instance, and similarly B12 with 22 and B13 with B23, right? So that would be the result. B21, A11 plus B22, A21 plus B23, A31, U1, right? From V1 we get this one, from V2 we get this one and from V3 we get this one. So A11, A21 and A23, the A31, they should be multiplied by B21, B22 and B23. That's U1 plus B21, A12 plus B22, A22 plus B23, A32, that would be U2. And the third one would be B21, A13. Now we are gathering everything with U3 which is this, this and this, multiplied by this, this and this, plus B22, A23 plus B23, A33, U3. All right, so we have W1, we have W2 and now W3, I will put here, it's B31, let me start with V first, B31 V1 plus B32 V2 plus B33 V3 which is equal to all right. So now we have the third row of the matrix B which is 3, 1, 3, 2 and 3, 3. So the coefficient at U1 would be multiplication of this times this plus this times this plus this times this right. So it's B31, A11 plus B32, A21 plus B33, A31, U1 plus B31, A. Now multiplying for the U2 we get this one, A12, A22 and A32 and these are the same. So it's A12 plus A22 plus A32 that's U2 and finally U3 would be B31, A13, B32, A23 plus B33, A33, U3. Okay, now we have completed all the coefficients of the matrix which we are looking for which transforms, which transforms vector U into vector W. So we have W1, W2 and W3 as a linear function from U1, U2 and U3. So what would be the matrix itself? Well, the matrix which is a product of D times A would have the coefficient at, let me write it in this way. So this is my, this is my ultimate matrix which converts vector U into vector W. Coefficient C11 is this one. Coefficient C12 is this one. Coefficient C13 is this. C21 is this. This, this is C22 and this is C23 and finally these coefficients that you want U2 and U3 are correspondingly C31, C32 and C33. Now, and here is my point exactly as before, this point. If you take a look at this, you will see that this is still exactly the same rule just out of curiosity. Let's check this one for instance. This is the second coefficient for W1 which is at U2, which is this one. Now, C12, according to this rule it should be, this is one. So it's first row times second column. Let's try and see. Is this a first row times second column? You see, one, one, one. These are three elements of the second, of the first row of the B matrix. Now, the second, the second index at A is two. So it's two, two and two. It's one, two, two, two and three, two, which means it's one column. So as, as exactly as I said this is a scalar product of the first row vector in the B matrix times second column vector of the A matrix. Now, same thing everywhere else. Let's take this one for instance. This is coefficient at U3 in W3, which is this one. So this is 3, 3, which means it should be third row of the B matrix times third column of the A matrix. Well, let's check. 3, 1, 3, 2 and 3, 3, 3. These are three elements in the third row of the B. Because the first index is always the row and it's always three. Now, the second index is column and this is one, three. This is two, three and this is three, three. So the A matrix has three elements in the third column. So exactly the same formula is here as well. Now, why did I go through all these calculations again? Why didn't I just say, okay, guys, this is a definition, basically, of the matrix multiplication? Well, I don't know, but it seems to me that when you are with your own hands, just make sure that this is the right way to do, then you don't have any questions. Why? Because if I will just tell you, okay, this is a definition, the reasonable question is why? And then I would start explaining, well, you know, because, et cetera, et cetera. Here, I just derived, basically, this formula from basically doing the calculations myself, how the transformation, one transformation and then another transformation really occurred. And that's the result. I mean, there is nothing you can do about it because this is exactly what happens if you transform once and then another using one matrix like A and then another matrix B. So I don't think I made any mistakes, although the calculations were quite extensive and tedious, I should admit that. But in any case, let me just inculcate another one more time, how we multiply matrix to multiply one matrix by another. We get some other third matrix and ij element of the result is a scalar product of i's row vector of the left matrix which we are multiplying times j's column of the right matrix. This is B times A. Well, that's basically it. That's all I wanted to present today. And so everything related to general multiplication of matrix would be in the next lecture, which I hope would be the last one, like theoretical one about multiplication. There might be some problems, obviously. But as far as the theory, I do plan to have another lecture where I will just tell generally what is a multiplication of matrix, how it looks like, what its properties, etc., etc. So meanwhile, let me finish on this. Thanks very much for your attention. I do recommend you to go through notes on unizord.com for this lecture. Notes are basically about the same which the same I did on the board. But I mean, it's a good exercise, so I do recommend you to do it. And I also strongly recommend you to take part in the educational process as it is facilitated by unizord.com. You can sign in as a student and then somebody else or maybe you under a different name can sign in as your supervisor or a parent. So the parent or a supervisor can enroll the student under his supervision into any of the course. And this enrollment actually will result in not only ability to do exactly the same theoretical learning, but also to take exam. Now, exams are probably a very good way to just verify yourself, to check your knowledge and how well you actually absorbed the material. So I do recommend you very strongly. Okay, that's it. Thanks very much and good luck.