One output entry is one dot product
Think of a row as a rule and a column as an input. To apply that rule, multiply matching entries and add. A matrix product performs all the compatible row–column pairings at once.
For example,
The first row produces the first output. The second row produces the second. Both read the same two input coordinates.
The shapes tell a story
If has shape and has shape , then
The shared is the number of terms in each dot product. The output has one row for each rule in and one column for each input in .
In symbols,
The index travels along a row of and down a column of . The indices tell us where to put the answer.
Try a second input
What happens if we add the input column beside ?
Answer: We get a second output column, . The same matrix applies its rules to each input independently.
