# Matrix Multiplication – Mathematics – Linear Algebra – TU Delft

Hi! If I can have a few minutes of your time

I will show you how you can multiply two matrices. On the screen behind me

you see a 2 by 3 matrix and 3 by 4 matrix. When multiplying two matrices it is very important

that the first matrix has as many columns as the second matrix has rows. For the matrices that you see here this is indeed true. The matrix A has 3 columns

and the matrix B has 3 rows. The result of a matrix multiplication is a new matrix. It has as many rows

as the first matrix in the multiplication and as many columns as the second matrix. In the example that we are using this means

that we will end up with a 2 by 4 matrix. How can you find

the entries of the matrix product A times B? The first thing you can do

is use the matrix vector product. The first column of the 2 by 4 matrix that

we are looking for is actually the matrix vector product of A and the first column of B. This means that the first column of A times

B is equal to 3 times the first column of A plus 0 times the second column

of A plus 2 times the third column. The result is the vector with coordinates [12 -1]. So we have found the first column of A times B. The remaining three columns of A times B can

be found in a similar way. To find the second column you

multiply A with the second column of B. For the third column

you multiply A with the third column of B. And finally the fourth column of the matrix

we are looking can be found by computing the matrix vector product of A

and the fourth column of B. There is also an easy way to determine

the rows of A times B. Let’s compute the matrix product again,

but now in a different way. Take the first row of A and the first column of B. If you multiply these numbers pointwise and

add the results, then you obtain the first element on the first row of A times B. This means that we get

2.3+(-1).0+3.2 and this equals 12. By performing the same operation on the first

row of A and the second column of B you get the second element of the first row. In this case we obtain

2.1+(-1).(-1)+3.(-1) which is equal to 0. By repeating this procedure for the third

column of B and the fourth column of B we obtain the entire first row of A times B. I guess you already figured out that you can

find the second row of A times B by performing the same procedure on the second row of A. The benefit of this second method is that

it allows you to determine a specific element of A times B very quickly. Let’s say you want to know the number in

the second row and in the third column. Al you need to do is take the second row of

A and the third column of B and perform the same operation as before. 1.(-1)+0.1+(-2).0 equals -1. So the element in the second row

and third column is equal to -1. That’s it for now. I hope you enjoyed this video

and I hope you learned something. See you soon.