I'm a linear algebra student and I've just come across the formal definition for multiplying matrices as follows:

Let $A = \alpha_{ij}$ be an $l \times m$ matrix over $K$ and let $B = \beta_{ij}$ be an $m \times n$ matrix over $K$. The product $AB$ is an $l \times n$ matrix $C = \gamma_{ij}$ where for $1 \leq i \leq l$ and $1 \leq j \leq n$, $$\gamma_{ij} = \sum_{k=1}^m \alpha_{ik}\beta_{kj} $$

This might sound really silly, but I can't fully understand this definition.

I already know how to multiply any two matrices, but I just can't seem to wrap my head around this definition and how the summation works. When do I input the $i$ and $j$, and in what fashion? Why is the summation up to $m$?

I've tried to use a simplified example to help myself but I still haven't been able to make the connection between how I usually multiply matrices (multiply the first row of $A$ by the columns of $B$ for the first row of entries of matrix $C$, do the same with the next rows of $A$ to obtain the rest of the rows of the matrix) and how it connects to this definition.

Can someone help simplify this definition of matrix multiplication, and really break it down? Thank you.

  • 2
    $\begingroup$ For example, let's suppose that $A$ is $2 \times 3$ and $B$ is $3 \times 2$, and $C = AB$. How do we compute $c_{11}$, the $(1,1)$ entry of $C$? As you know, we take the dot product of the first row of $A$ and the first column of $B$, like this: $c_{11} = a_{11} b_{11} + a_{12} b_{21} + a_{13} b_{31}$. We can write this using summation notation as $c_{11} = \sum_{k=1}^3 a_{1k} b_{k1}$. $\endgroup$ – littleO Apr 26 '17 at 0:01

The definition says that the $(i,j)$ entry of the matrix product $AB$ is given by

$$ \alpha_{i1} \beta_{1j} + \alpha_{i2} \beta_{2j} + \dots + \alpha_{im} \beta_{mj}. $$

The entries of the $i$-th row of $A$ are

$$ \alpha_{i1}, \alpha_{i2}, \dots, \alpha_{im} $$

(the row index is fixed while the column index runs from $1$ to $m$).

The entries of the $j$-th column of $B$ are

$$ \beta_{1j}, \beta_{2j}, \dots, \beta_{mj} $$

(the column index is fixed while the row index runs from $1$ to $m$).

Hence, the definition above says that to calculate the $(i,j)$ entry of the product you multiply the first element of the $i$-th row of $A$ by the first element of the $j$-th column of $B$, then you multiply the second element of the $i$-th row of $A$ by the second element of the $j$-th row of $B$ and so on and add everything together. If $A$ is a $1 \times m$ matrix (a row vector) and $B$ is a $m \times 1$ matrix (a column vector) then this looks like

$$ \begin{pmatrix} a_{11} & \dots & a_{1m} \end{pmatrix} \begin{pmatrix} b_{11} \\ \vdots \\ b_{m1} \end{pmatrix} = (a_{11} b_{11} + \dots + a_{1m}b_{m1}). $$


That formula describes exactly what you say you do when you

multiply the first row of $A$ by the columns of $B$ for the first row of entries of matrix $C$

The first row of $A$ corresponds to $i=1$ in that sum. For each particular value of $j$ you use the $j$th column of $B$ to calculate the entry $C_{1j}$. Then you do the same for the other rows of $A$ - the other values of $i$.

It may help to write out the summation with $\ldots$ rather than the $\Sigma$. For example, $$ c_{13} = a_{11}b_{13} + a_{12}b_{23} + \cdots + a_{1m}b_{m3}. $$

You can't really "simplify" that definition since it is just what you have to do. The good news is that you're already doing it.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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