Answer
The product AB and BA are defined if A is an m×n matrix and B is an n×m matrix.
Work Step by Step
Let A be an m×n matrix and B be a p×q matrix.
The matrix product
AB is defined if n=p. Thus, A should be an
m×n matrix and B is an
n×q matrix.
The matrix product BA is defined if q=m. Thus, A should be an m×n matrix and
B is an n×m matrix.
Matrices with an identical number of rows and columns also have both products defined (same dimension), since in that case, the condition is satisfied as well.