matrix multiplication
Matrix multiplication is the surprising one. Unlike addition, you do not just multiply matching entries. Instead you slide each row of the first matrix across each column of the second, multiplying paired numbers and summing them — a “row meets column” handshake that produces one entry of the answer.
Concretely, the entry in row i, column j of the product AB is found by taking row i of A and column j of B, multiplying their first numbers together, their second numbers together, and so on, then adding all those products. This is called a dot product of that row with that column.
For the product to exist, the column count of A must equal the row count of B; an m-by-n times an n-by-p gives an m-by-p result. The biggest surprise: matrix multiplication is not commutative — in general AB is not equal to BA, and one may even exist while the other does not. It does, however, stay associative and distributive.
[1, 2; 3, 4] · [5, 6; 7, 8] = [19, 22; 43, 50]: top-left is 1·5 + 2·7 = 19.
Row 1 of the left dotted with column 1 of the right.
Because AB and BA usually differ, “order matters” is the rule, not the exception. Always say which side you are multiplying on; “multiply by C” is ambiguous unless you specify CA versus AC.