Matrix Multiplication and Ax as a Combination of Columns
Quick answer
The product Ax is the linear combination of the columns of A whose coefficients are the entries of x, which is why a linear system and a matrix equation say the same thing. Multiplying two matrices applies this column by column: AB has the same columns as B, each replaced by A times it. The sizes must match, an m × n matrix times an n × p matrix giving m × p, and the product means doing B first and then A. Matrix multiplication is associative but not commutative.
What you'll learn
Compute Ax as a linear combination of columns
Multiply matrices of compatible sizes
Explain the product as a composition of transformations
Use the identity matrix and the rules that do and do not hold
For this to make sense, x must have one entry per column of A.
With
A=102213x=[23]
the product is 2(1,0,2)+3(2,1,3)=(8,3,13). Computing entry by
entry, each component is a dot product of a row of A with x:
1(2)+2(3)=8, then 0(2)+1(3)=3, then 2(2)+3(3)=13. The two
recipes always agree.
This is why the two halves of the course fit together:
Ax=b⟺x1a1+⋯+xnan=b
So Ax=b has a solution exactly when b lies in
Span{a1,…,an}. A system of equations, a
combination of columns, and a matrix equation are three ways of writing one
problem.
Since A acts on vectors, it acts on each column of a second matrix. That is
the definition of the product:
AB=A[b1⋯bp]=[Ab1⋯Abp]
The sizes have to line up: A must have as many columns as B has rows. An
m×n matrix times an n×p matrix is m×p. Entry by
entry, the number in row i, column j of AB is the dot product of row i
of A with column j of B.
Applying B to a vector and then A to the result is doing two
transformations in a row. Because A(Bx) is a linear combination of
the columns of A with the entries of Bx as coefficients, unwinding
the definitions gives A(Bx)=(AB)x for every x.
The product AB is the single matrix that does B first and then A, and
the order of the letters matches the order of application, right to left.
Two rules follow. Composition of functions is associative, so
(AB)C=A(BC). And composition is not commutative: turning then stretching
differs from stretching then turning, so AB=BA in general.
The columns of a matrix have a meaning in this language. Since
ej picks out the jth column, Aej=aj: the
columns are the images of the standard basis vectors. That is enough to pin
down the whole transformation.
What size is the product of a 4×3 matrix and a 3×7 matrix?
Answer
4×7
Full solution
The inner sizes, both 3, must match and disappear; the outer sizes remain.
Can a 2×3 matrix be multiplied by a 2×3 matrix?
Answer
No
Full solution
The first has 3 columns and the second has 2 rows, so the sizes do not line up in either order.
Compute XY for X=[1324] and Y=[5768].
Answer
[19432250]
Full solution
Row 1 against the columns of Y: 5+14=19 and 6+16=22. Row 2: 15+28=43 and 18+32=50.
Compute YX for the same matrices, and compare.
Answer
[23313446], different from XY
Full solution
5+18=23, 10+24=34, 7+24=31, 14+32=46. Matrix multiplication does not commute.
Write Ax=b for the system 2x1+x2=5, x1−x2=1.
Answer
[211−1][x1x2]=[51]
Full solution
The coefficients form the matrix, the unknowns the vector, and the right-hand sides the target.
If A is 3×2, what are the images Ae1 and Ae2?
Answer
The first and second columns of A
Full solution
ej has a 1 in position j, so the combination of columns keeps only column j.
The matrix M=[2011] acts on the unit square. Where does the corner (1,1) go?
Answer
(3,1)
Full solution
M(1,1) is the sum of the two columns, (2,0)+(1,1), which matches the parallelogram in the figure.
A student computes [1324][5768] as [5211232]. What went wrong?
Hint
How many numbers go into one entry of the product?
Answer
The student multiplied matching entries. Each entry of the product is a dot product of a row with a column, giving [19432250].
Full solution
Entry by entry multiplication is a different operation, and it does not match composition: the point of the row-by-column rule is that (AB)x=A(Bx), which entrywise products fail.
Frequently asked questions
What is Ax?
The linear combination of the columns of A with the entries of x as coefficients. For a 3 × 2 matrix and x = (2, 3), it is 2 times the first column plus 3 times the second.
When can two matrices be multiplied?
When the first has as many columns as the second has rows. An m × n matrix times an n × p matrix gives an m × p matrix.
How is each entry of a product computed?
The entry in row i and column j of AB is the dot product of row i of A with column j of B.
Is matrix multiplication commutative?
No. AB and BA can have different sizes, and even when both exist they are usually different matrices.
What does the identity matrix do?
I has ones on the diagonal and zeros elsewhere, and AI = IA = A. It is the matrix of the transformation that changes nothing.