Mathematics
Matrix Multiplication and the Rules That Govern It
Quick fact
In matrix multiplication, the number of columns in the first matrix must exactly equal the number of rows in the second. If they don't match, the multiplication is undefined—no alternatives.
Why this is interesting
You might think multiplying matrices is just like multiplying numbers, but that's a trap. What if I told you that swapping the order of multiplication can give you a completely different result, or even be impossible?
Read the full explanation
Understanding Matrix Multiplication and the Rules That Govern It
Imagine you have a list of groceries and a list of prices. To find total cost, you multiply each quantity by its price and add them up. Matrix multiplication is like doing many of these calculations at once. Specifically, to find the element in row i and column j of the product, you multiply each element in row i of the first matrix by the corresponding element in column j of the second, then sum them up. This is called the dot product. For this to work, the number of columns in the first matrix must equal the number of rows in the second. The result's dimensions are (rows of first) × (columns of second).
A deeper explanation
Why such a strange rule? Matrix multiplication was designed to represent composition of linear transformations. When you apply one linear transformation (like rotation) and then another, the combined effect is given by multiplying their matrices. The order matters because transformations don't commute. The dimension rule ensures that the output of the first transformation (its number of rows) matches the input dimension of the second (its number of columns). This structure also makes matrix multiplication associative and distributive, allowing powerful techniques like solving multiple systems at once or breaking calculations into steps. Understanding these rules lets you manipulate matrices safely in applications like 3D graphics, where order of rotations matters, or in solving large systems efficiently.