Britannica
Sources used in this answer
When can two matrices be multiplied?
Created from Britannica articles
using AI.
AI can make mistakes, so verify using Britannica articles.
linear algebra
One method of adding and subtracting vectors is to place their tails together and then supply two more sides to form a parallelogram. The vector from their tails to the opposite corner of the parallelogram is equal to the sum of the original vectors. The vector between their heads (starting from the vector being subtracted) is equal to their difference.
In linear algebra, the multiplication of two matrices, A and B, is defined only when the number of columns in the first matrix (A) is equal to the number of rows in the second matrix (B).1
If matrix A is an matrix and matrix B is an matrix, the resulting product matrix will have dimensions . The element in the th row and th column of the product is calculated by taking the sum of the products of corresponding elements from the th row of A and the th column of B.1
It is important to note that matrix multiplication is not commutative; in general, . However, it remains associative and distributive over addition when the operations are possible.1