Suppose that matrices A and B are conformable for multiplication; say that A has order m × n and B has order n × p. Let A = [aij] and B = [bij]. Then (matrix) multiplication is defined by taking the product AB to be the m × p matrix C, where C = [cij] and
The product AB is not defined if A and B are not conformable for multiplication. Matrix multiplication is not commutative; for example, if
then AB ≠ BA. Moreover, it is not true that AB = 0 implies that either A = 0 or B = 0, as the above example shows. However, matrix multiplication is associative: A(BC) = (AB)C, and the distributive laws hold: A(B + C) = AB + AC and (A + B)C = AC + BC.