When you can multiply, and what shape you get
Matrix multiplication is not entrywise — it pairs each row of the left matrix with each column of the right matrix. The deal: to multiply A · B, the number of columns of A must equal the number of rows of B. These are the “inner” numbers; the “outer” numbers give the size of the answer.
A is (2 x 3), B is (3 x 2)
inner: 3 = 3 -> OK to multiply
outer: 2 2 -> product is (2 x 2)
( m x n ) * ( n x p ) = ( m x p )
The inner n's must match and then vanish.The row-times-column recipe
The entry in row i, column j of the product is the dot product of row i of A with column j of B: multiply matching numbers and add them up. Walk through every (row, column) pairing and you fill in the whole product.
- Pick a row of A and a column of B.
- Multiply their first entries, their second entries, and so on.
- Add those products into one number — that is one entry of the answer.
- Repeat for every row-column pairing to fill the whole product.
[ 1 2 ] [ 5 6 ]
[ 3 4 ] * [ 7 8 ]
row1 . col1 = 1*5 + 2*7 = 5 + 14 = 19
row1 . col2 = 1*6 + 2*8 = 6 + 16 = 22
row2 . col1 = 3*5 + 4*7 = 15 + 28 = 43
row2 . col2 = 3*6 + 4*8 = 18 + 32 = 50
Result = [ 19 22 ]
[ 43 50 ]Order matters; the identity does not change anything
Unlike numbers, matrix multiplication is not commutative: in general A · B ≠ B · A. Sometimes B · A is not even a legal product because the shapes do not line up. So the commutative property fails here — order is part of the meaning.
The identity matrix I is the multiplicative anchor: for any square matrix A of matching size, A · I = I · A = A. It plays exactly the role the number 1 plays for ordinary multiplication, which is why the next guide can talk about an inverse — the matrix that multiplies A back to I.