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

Current time:0:00Total duration:8:37

what I want to do in this video is show that matrix multiplication is associative at least I'll show it for 2 by 2 matrices and what I do in this video you could extend it to really n any dimension of matrices for which the matrix multiplication is actually defined so let's look at three matrices so let's say this first matrix is a b c and d and this second matrix is e f g h and then finally this third matrix this third matrix is i j and that's not the imaginary unit I just just letter I i J and this isn't e this is just letter e JK and L and I want to look at two scenarios so let me actually just copy and paste this so copy and paste so I want to look at the scenario where first I multiply the orange and the yellow matrix so then I multiply that times the purple matrix and then another scenario where first I multiply the yellow and the purple and multiply that times the orange and if these two products based on how I which ones I do first come out the same then I've just shown that at least four three two by two matrices that multiplication of mate matrix multiplication is associative we already see that it's not commutative let's see whether it's associative and actually I'll I'll give you the punchline it is but let's work through it I encourage you to actually pause the video yourself and try to work through it with these letters and then see if if you've got the the result that I just said that you you you should be getting all right so let's multiply these first two so this product and I'm going to make it a little bit big so it's going to be a e plus B G is going to a E+ be G then AF plus BH a F plus BH and then it's going to be C E Plus D G C plus D G and then find it's going to be C F Plus D H C F plus D H and we're going to multiply it times the matrix the matrix i j k and l and what does this give us that I'll just give us some space to do this with so this will give us I give myself an ample amount of space so it's going to be this stuff times I so we could write this as I and actually let me just distribute the I I a plus I B G Plus this stuff times k plus K a f+ k be H I'm already going to run out of space here so let me clear this let me just keep going and then we're going to multiply this essentially we're consider this row in this column first row second column and so you are going to have you are going to have j AE plus j BG + + l AF l AF + l bh so these matrices are bigger than i expected they would be and then you're going to have over here you're going to have this times this Plus this times this so I see e plus i DG + kc f plus k d h and then finally this times this Plus this Plus this or this times that Plus this times that so j c e+ j DG + l c f+ l d h alright now let's see if we can power through this one over here so what is what is this product going to be this product if I multiply these two first it's going to be e i + FK + FK + ej and not need you sign up + this is the next entry ej + FL ej + FL ej x + FL then G I plus G and then we have G I plus HK g i+ HK and then finally we have GJ GJ + HL it's all going to be multiplied times ABCD a b c and d and i'm going to need some real estate to do this so let me do it down here I'll do it in green so let me do a little arrow to show that this is actually I could just Orca to scroll over a little bit that actually might work out better so what am I going to get so a times this plus B times this so a e i+ a FK plus b g i+ b HK and then you're going to have this row in this column so it's a e j + a FL + b GJ + b g j + b HL + b HL close the brackets now you're going to have C times this Plus D times this so C e i+ c FK + D G I + D H K and then finally homestretch C times that plus D times this so c ej + c f l + c f l and then you're going to have plus plus d GJ + d HL d HL now are these two things equivalent well let's look entry by entry so I I II this is equivalent to a II I because we know scalar multiplication is commutative now i bj r ib g ib g you see it there and you see it there k AF you see it k f you see it there and this is the same thing as AF k and then k bh this is the same thing as bh k and you could go entry by entry actually let's just do that i'll do that really fast so let's do so i see e is the same thing as c e eye IDG is the same thing as d GI k CF is the same thing as c FK KD h is the same thing as d HK go to the second columns je j jb g jb g is the same thing as BG j l AF is the same thing as AFL and lb h is the same thing as b HL and then finally JC e is the same thing as c ej j DG is the same thing as DD j l EF l EF that is that or is that LC so let's see LD h is this right over here and so this one must be an LC f is the same thing as cfl is this is this one right over here in LC f let me make sure because that would throw a major monkey wrench into the whole operation so this entry right over here is going to be we get that from multiplying the second row times the second column and we're going to get C see we get JC e plus j DG and then we have LC f you have that's LC f + LD h and so you e see that these two quantities are the same it doesn't matter if I multiply the first two first and then multiply by the third or multiply the second and third and then multiply by the first now once again this is the associative property I'm keeping them essentially in the same order order matters but as we see depending we can associate these we can do the first two first or we could do the second to first