can be multiplied if the number of in the first matrix is the same as the number of in the second matrix. The resulting product will have the number of rows of the first matrix and the number of columns of the second matrix.
- The product of an m×n and an n×p matrix is an m×p matrix.
⎣⎢⎢⎡a11⋮am1⋯⋱⋯a1n⋮amn⎦⎥⎥⎤⋅⎣⎢⎢⎡b11⋮bn1⋯⋱⋯b1p⋮bnp⎦⎥⎥⎤=⎣⎢⎢⎡c11⋮cm1⋯⋱⋯c1p⋮cmp⎦⎥⎥⎤
- The in the ith row and jth column of the product matrix is calculated using all the elements in the ith row of the first matrix and jth column of the second matrix using the following formula.
cij=ai1b1j+ai2b2j+⋯+ainbnj
Click on the elements of the product matrix below to see the illustration of how to find the product of a
4×2 and a
2×3 matrix.
A trick to help remember matrix multiplication is to rearrange the position of the matrices.
It is important to keep in mind that two matrices
A and
B can be multiplied the number of
columns of
A is the same as the number of
rows of
B. As an example, consider two matrices
A and
B, whose numbers of columns and rows are different.
To multiply A by B, each element of the first row of A should be multiplied by the corresponding element of the first column of B. However, the element c of A does not have a corresponding element in B, because B has only 2 rows, whereas A has 3 columns. Therefore, the multiplication cannot be performed.