Three basic operations are defined on matrices:
1. Scalar multiplication. For A=[aij]m×n and a scalar k, kA=[kaij]m×n — every entry is scaled by k. Taking k=−1 gives −A=[−aij], the negative of A (never call it "a negative matrix").
2. Addition and subtraction. These are defined only when A and B have the same order. Then A+B=[aij+bij] and A−B=A+(−1)B=[aij−bij], entrywise. If the orders differ, A+B and A−B are simply not defined. Addition/subtraction extends to any finite number of matrices of the same order.
3. Multiplication. A is conformable for the product AB only when the number of columns of A equals the number of rows of B: if A is m×n and B is n×p, then AB exists and has order m×p — schematically (m×n)(n×p)=(m×p), with the inner dimensions matching and cancelling. Each entry of AB is a row-by-column dot product: …