Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I understand that when you want to multiply two matrices that the number of rows in the left matrix have to be equal to the number of columns in the right, otherwise the result of the multiplication is undefined.

So this is okay:

$\begin{bmatrix}1&2&3\\4&5&6\end{bmatrix}*\begin{bmatrix}7&8\\9&10\\11&12\end{bmatrix}=\begin{bmatrix}58&64\\139&154\end{bmatrix}$

This is undefined:

$\begin{bmatrix}1&2&3\\4&5&6\end{bmatrix}*\begin{bmatrix}7&8&9\\10&11&12\end{bmatrix}=undefined$

But what exactly happens here?

$\begin{bmatrix}1&2&3\\4&5&6\end{bmatrix}*\begin{bmatrix}7&8\\9&10\\11&12\\13&14\\15&16\end{bmatrix}=\begin{bmatrix}?\end{bmatrix}$

The number of rows in the first matrix is equal to the number of columns in the second matrix, so by what I've been reading online this is doable. I'm just not sure how to accomplish this because all the examples I've seen only have shown the first example where there multiplication of elements is 1:1, I haven't seen any examples explaining what to do in the third case.

If I was to guess, I would say that we're supposed to multiply all the elements through but I want to know what the actual rule and process for this is before I commit something incorrect to memory by guessing.

Thanks to all in advance, I know this question is a bit simplistic.

share|improve this question
    
It's the number of columns in the first matrix that has to be equal to the number of rows in the second matrix. –  Qiaochu Yuan May 20 at 17:13

1 Answer 1

up vote 0 down vote accepted

The inner dimensions need to match (# of columns in first matrix = # of rows in second matrix). If $A$ is m by n (m rows, n columns), and $B$ is n by p, then $AB$ is m by p (and is undefined otherwise). The i-j'th component (ith row, jth column) of $AB$ is the $i$-th row of $A$ dotted with the $j$-th column of $B$.

Thus, the final matrix multiplication is undefined.

share|improve this answer
    
Okay thanks a ton. Between your answer and Qiaochu Yuan's comment it clicked in my head and I get it now. Thanks for your help! –  BCqrstoO May 21 at 5:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.