If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

# Intro to matrix multiplication

## Video transcript

let's say that we've got two matrices and I'll just for simplicity I'll start with two two-by-two matrices so let's say that this first one right over here is 2 negative 2 5 and let's say 5 and 3 and then I have this matrix right over here that it's also going to be 2x2 and let's say it's negative 1 4 let's say 7 and negative 6 and what I want to go through in this video what I want to introduce you to is the is the convention the mathematical convention for multiplying two matrices like this and I want to stress that because mathematicians could have come up with a bunch of different ways to define matrix multiplication but the convention that I'm going to show you is is the way that it is done and it's done this way as especially as you go into deeper linear algebra classes where you start doing computer graphics or even modeling different types of phenomena you'll see why this type of matrix multiplication which I'm about to show you why it has the most applications but I really want to stress this is a human construct humans have found defining matrix multiplication the way I'm about to show you to be useful so let's just think about how this could how this could be and once again I want to stress it's a human construct there's several ways that you could have thought about multiplying two two-by-two matrices you could have done it the same way that you add matrices when you add matrices both matrices have to have the same dimensions and you just add the corresponding entries in the matrices so why don't we one convention could have been why don't we just for the for product right over here why don't we why don't we just multiply corresponding entries so two times negative one would put a negative two here negative two times four put a negative eight here that's how we did addition we added corresponding entries but that is not the convention for multiplying matrices that is not the standard convention the standard convention for multiplying matrices is we're essentially going to take to get this to get this top left entry right over here we're going to take the product of this row of that row with this column right over you now what does it mean to take the product of a row and a column and if you are familiar with vector dot products this might ring a bell where you take the product of the corresponding terms the product of the first terms products of the second terms and then add those together and so that's essentially what we're going to be doing we're going to be taking the dot product of this first row in this first column to get this top left entry right over here if the word dot product makes no sense to you I will show you what that actually means so actually let me let me give let's get some more real estate here just so I think it will be useful especially this very first time that we attempt to multiply to multiply matrices so this top left entry it's going to be 2 times negative 1 so 2 times negative 1 plus negative 2 plus negative 2 times 7 plus negative 2 times 7 so notice I took the product first entry in the row first entry in the column those two products then the product of second entry in the row second entry in the column that's right over there and then I added them together and that's essentially taking the dot product of this row vector and this column vector that doesn't make sense to you if it's not familiar with vectors and dot products don't worry about it we just took the first end product to the first entry product of the second entry added them together to get this is going to give us some number and we'll calculate that in a few seconds but let's think about the other ones so to get this to get this entry right over here we're going to take the first row from this matrix and the second column from from this matrix and that kind of makes sense because this is we're still in the first row but we're in the second column of the first row right here first row second column so it's going to be 2 times 4 2 times 4 plus negative 2 plus negative 2 times negative 6 and at this point I encourage you to pause the video seeing what you just saw see if you could complete this see if you can figure out the bottom left entry and the bottom right entry and I'll give you a clue it has something to do with this second row here so I'm assuming you've given a go at it now let's just let's just power through it together sometimes matrix multiplication can get a little bit intense so we're now in the second row so we reuse the second row of this first matrix and for this entry second row first column second row first column five times negative 1 5 times negative 1 plus 3 times 7 plus 3 times 7 and then finally we're in the homestretch now to get to get this to get this bottom row second column or second row second column we multiply this row essentially by this column right over here so it is going to be 5 times 4 5 times 4 plus 3 times negative 6 plus 3 times negative 6 now what is all of this what does all of this simplify to so this is going to be equal to let's see so negative 2 plus negative 14 that's going to be negative 16 that right over there is negative 16 and then we have 8 plus 12 so that's going to be 20 and then we have negative 5 plus 21 which is going to be 16 positive 16 did I do that right yep positive 16 and then finally you're going to have 20 minus 18 so that's just going to be 2 so the product of these two matrices we deserve a little bit of a drumroll at this point when we multiply this 2 by 2 matrix times this 2 by 2 matrix we are going to get negative 16 20 twenty sixteen and sixteen and two and we are done