Supercharge your learning!

Use adaptive quiz-based learning to study this topic faster and more effectively.

Multiplication of two matrices

The multiplication $$A\times B$$ of two matrices $$A$$ and $$B$$ is not straightforward. We assume that $$A$$ has size $$m_A\times n_A$$ and $$B$$ has size $$m_B\times n_B$$.

  • Size requirement. We must have $$$ n_A = m_B$$$
  • Size of the product The matrix $$A\times B$$ has size $$m_A\times n_B$$..
  • To compute one entry, we isolate one row in $$A$$ and one column in $$B$$. We multiply each pairing terms and we add them. We repeat the process for each row of $$A$$ and each column of $$B$$.
\begin{align*} & \times \begin{pmatrix} \qquad\quad\Tred{1}\qquad&\qquad\quad\Torange{1}\qquad\quad\\ \qquad\quad\Tred{2}\qquad&\qquad\quad\Torange{4}\qquad\quad \end{pmatrix}\\ \begin{pmatrix} \Tblue{1}&\Tblue{2}\\ \Tgreen{1}&\Tgreen{3}\\ \Tviolet{1}&\Tviolet{0} \end{pmatrix} &= \begin{pmatrix} \Tblue{1}\times\Tred{1} + \Tblue{2}\times \Tred{2}& \Tblue{1}\times\Torange{1} + \Tblue{2}\times\Torange{4}\\ \Tgreen{1}\times\Tred{1} + \Tgreen{3}\times \Tred{2}& \Tgreen{1}\times\Torange{1} + \Tgreen{3}\times\Torange{4}\\ \Tviolet{1}\times\Tred{1} + \Tviolet{0}\times \Tred{2}& \Tviolet{1}\times\Torange{1} + \Tviolet{0}\times\Torange{4} \end{pmatrix}\\ &= \begin{pmatrix} \qquad\quad5\qquad&\qquad\quad9\qquad\quad\\ \qquad\quad7\qquad&\qquad\quad13\qquad\quad\\ \qquad\quad1\qquad&\qquad\quad1\qquad\quad \end{pmatrix} \end{align*}

The following products are not defined because the matrices have incompatible sizes.

$$$ \begin{pmatrix} 1&0\\ 1&2\\ 0&1 \end{pmatrix} \times \begin{pmatrix} 0&1\\ 0&1\\ 1&0 \end{pmatrix},\; \begin{pmatrix} 1&0 \end{pmatrix} \times \begin{pmatrix} 0&1\\ 0&1\\ 1&0 \end{pmatrix},\; \begin{pmatrix} 1\\ 0 \end{pmatrix} \times \begin{pmatrix} 1\\ 0 \end{pmatrix}. $$$