Matrices & linear systems

matrix multiplication

To multiply matrices A and B, you take each row of A and pair it with each column of B: multiply matching entries and add them up. That single number, the row dotted with the column, fills one slot of the answer.

Why this odd-looking rule? Because a matrix is really a function, and multiplying two matrices means doing one transformation after another. A*B is the single matrix that has the same effect as: first apply B, then apply A. The row-times-column rule is exactly what makes that work out.

Two warnings. The shapes must match: the number of columns in A must equal the number of rows in B. And order matters: A*B is usually not the same as B*A, because rotating then stretching differs from stretching then rotating.

[[1,2],[3,4]] * [[5,6],[7,8]] = [[19,22],[43,50]]

Top-left 19 = 1*5 + 2*7: row one dotted with column one.

Matrix multiplication is associative ((AB)C = A(BC)) but not commutative (AB is usually not BA).

Also called
matrix productmatrix multiply矩阵乘法矩陣乘法矩阵乘积