14.3: Matrix Product
- Page ID
- 14860
Given an n × m matrix A and a m × p matrix B, the matrix product AB is defined by
\[(AB)_{ij}=\sum_{k=1}^{m}A_{ik}B_{kj}\]
where the index ij indicates the i-th row and j-th column entry of the resulting n × p matrix. Each entry therefore consists of the scalar product of the i-th row of A with the j-th column of B.
Note that for this to work, the right hand matrix (here B) has to have as many columns as the left hand matrix (here A) has rows. Therefore, the operation is not commutative, i.e., AB ≠ BA.
For example, multiplying a 3x3 matrix with a 3x1 matrix (a vector), works as follows: Let
\[\boldsymbol{A} =\begin{pmatrix}
a & b & c\\
p & q & r\\
u & v & w
\end{pmatrix}\ \boldsymbol{B}=\begin{pmatrix}
x\\
y\\
z
\end{pmatrix}\]
Then their matrix product is:
\[\boldsymbol{AB} =\begin{pmatrix}
a & b & c\\
p & q & r\\
u & v & w
\end{pmatrix}\begin{pmatrix}
x\\
y\\
z
\end{pmatrix}=\begin{pmatrix}
ax+by+cz\\
px+qy+rz\\
ux+vy+wz
\end{pmatrix}\]