---
tag: 076JGP6R3T
kind: definition
name: Matrix multiplication
msc: [15A99]
defines: 032Q9FB8MT
uses: [0N1MY1T0W9]
sources:
  - url: https://en.wikipedia.org/wiki/Matrix_multiplication
    locator: Definitions
---

## Definition

Let $R$ be a ring, let $A = (a_{ij})$ be an $m \times n$ [[matrix|0VD9ZSWWJG]] over $R$, and let $B = (b_{jk})$ be an $n \times p$ matrix over $R$.
The *product* $AB$ is the $m \times p$ matrix with entries
$$(AB)_{ik} = \sum_{j=1}^{n} a_{ij} b_{jk}$$
for $1 \le i \le m$ and $1 \le k \le p$.

## Remarks

The product $AB$ is defined only when the number of columns of $A$ equals the number of rows of $B$.
Column $k$ of $AB$ is the [[matrix–vector product|0PDVQEP0ZC]] of $A$ with column $k$ of $B$.
The product is [[associative|073E4XC016]] and [[distributive|0RXD6EZYBK]], but it is [[not commutative|0P506SPZP2]].
If $A$ and $B$ are the matrices of two linear maps, then $AB$ is the matrix of their composition.

## Explanations

### L1 human

To find the entry in row $i$ and column $k$ of $AB$, go along row $i$ of $A$ and down column $k$ of $B$.
Multiply the pairs of numbers and add the products.
For example, $\begin{pmatrix} 1 & 2 \\ 0 & 1 \end{pmatrix} \begin{pmatrix} 3 \\ 4 \end{pmatrix} = \begin{pmatrix} 11 \\ 4 \end{pmatrix}$.
