So far, we've learned how to add and subtract matrices (the sizes had to be the same) and how to multiply a matrix by a scalar.  These were really easy.

Multiplying two matrices is a bit tricky, but, once you get the hang of it, it's a snap -- you just need to be careful!

First of all, the size of the two matrices you are multiplying is super important!

Here's how it works:

Say the size of matrix A is 3 x 4
and the size of matrix B is 4 x 1
and we want  A times B...

Looking at the sizes...

A times B ... A is a 3 x 4 matrix ... B is a 4 x 1 matrix ... the 4's must match ... and the answer will be a 3 x 1 matrix

You'll see this when we do one.

In general:

If the size of matrix A is m x n
and the size of matrix B is n x p,

then

m x n dot n x p ... the n's must match ... the answer is size m x p

This is for  A times B...

Can we multiply B times ANo!

B times A ... B is n x p ... A is m x n ... the p and the m don't match
 

For this to all make sense, we really just need to do one.