Ax is a linear combination of the columns of A, using the entries of x as the weights.
On Day 2, asking whether b is in the span of some vectors turned into a linear system, and yesterday you learned to solve that system by row reduction. Writing the question out takes a line per equation, so today we write it as one short equation, Ax=b. The vectors stand side by side as the columns of a matrix A, and the weights stack into a vector x. This notation also sets up Day 5, where Ax becomes a rule that moves every point of the plane.
Each section below opens with a problem. Try it before you open the walkthrough, even if you only get partway.
Matrix times vector
Let a1=[32] and a2=[−12]. Compute the linear combination 2a1+1a2.
Walk through the solutionHide the walkthrough
Scale each vector by its weight, then add entry by entry, exactly as on Day 1:
2[32]+1[−12]=[64]+[−12]=[56].
The whole calculation depends on two lists: the vectors a1,a2 and the weights 2,1. Matrix notation writes those two lists next to each other. Put the vectors side by side as columns and stack the weights into a column:
[32−12][21]=[56].
The left side is a new name for the same combination.
Matrix times vector
If A is an m×n matrix with columns a1,…,an and x is in Rn, then the productAx is the linear combination of the columns of A that uses the entries of x as weights:
The product is defined only when A has as many columns as x has entries, because each column needs exactly one weight. The answer has m entries, one for each row of A.
The first entry of x stretches the first column to (6,4). The second entry scales the second column by 1, and that arrow starts at the tip of the first. Together they land on Ax=(5,6).
The translation also runs backward. Any linear combination can be written as a matrix times a vector.
Write 2[14]−3[2−1]+[05] as Ax. What are A and x? Enter x.
Walk through the solutionHide the walkthrough
The vectors become the columns of A, in order, and the weights become the entries of x. The last vector has no number in front, so its weight is 1, and the minus sign in front of the 3 makes the second weight −3:
[142−105]2−31.
A is 2×3 because there are three vectors with two entries each. The product equals (2−6+0,8+3+5)=(−4,16).
Drag the weights until Ax lands on the target. Look for a pair of weights that you can read straight off the columns.
Set the weights in x so that Ax lands on the ringed point [−12].
Right. With x=(0,1) the first column gets no weight, so Ax is exactly the second column a2.
[32−12][11]=[24]
=1[32]+1[−12]
Which product is defined?
The row rule
Scaling whole columns explains what Ax means, but it is slow to write out by hand. This section finds a faster way to compute one entry at a time.
Compute [32−12][21] by columns, but do not simplify the entries. Which numbers from A does the top entry use?
Walk through the solutionHide the walkthrough
By columns, the product is
2[32]+1[−12]=[2⋅3+1⋅(−1)2⋅2+1⋅2]=[56].
The top entry is 3⋅2+(−1)⋅1. The numbers 3 and −1 are exactly the top row of A, and they are paired with the entries 2 and 1 of x in order. The bottom entry, 2⋅2+2⋅1, uses only the bottom row. Each entry of the answer comes from one row of A.
The row rule
Entry i of Ax is the sum of the products of matching entries from row i of A and from x. For a 2×2 matrix,
The row rule is usually faster by hand, and the column picture explains what the answer means. They always agree, so each one checks the other.
The identity matrixI has 1s down its diagonal and 0s elsewhere. By the row rule, [1001][4−7]=[4+00−7]=[4−7], and in general Ix=x.
The row rule gives a second picture of Ax=b. Each row says one entry of Ax must match one entry of b, and the inputs x that make it match form a line, just like the equations on Day 3.
Drag x so that both rows of Ax match b=[72]. Each colored line shows where one row matches.
Both rows hold at x=[2−1]. The column picture found the same weights, because the row rule and the column rule compute the same product.
3(0)+(−1)(0)2(0)+(2)(0)=0=0✓✓
Ax=[00]
One problem in three forms
Reading Ax backwards turns a question into an equation. The widget above solved Ax=(7,2), and the next problem writes that same question three ways.
Write the system 3x1−x2=7, 2x1+2x2=2 as a vector equation and as a matrix equation. Then solve it.
Walk through the solutionHide the walkthrough
Collect the coefficients of x1 into one vector and the coefficients of x2 into another, as on Day 2:
x1[32]+x2[−12]=[72].
By the definition of Ax, the left side is the matrix with those columns times x:
[32−12][x1x2]=[72].
All three forms have the same augmented matrix, so one row reduction solves them all. Halve row 2 to get x1+x2=1, then add it to row 1 to cancel x2: 4x1=8, so x1=2 and x2=−1.
Theorem 3
If A is an m×n matrix with columns a1,…,an and b is in Rm, then the matrix equation Ax=b has the same solution set as the vector equation x1a1+⋯+xnan=b. Both have the same solution set as the linear system whose augmented matrix is [a1⋯anb].
In particular, Ax=b has a solution exactly when b is a linear combination of the columns of A.
Solve [32−12]x=[16] by row reducing the augmented matrix.
Walk through the solutionHide the walkthrough
1
Write [Ab]. Row 2 has all even entries, so halve it, and then swap the rows so the pivot 1 sits on top. This avoids fractions.
[32−1216]∼[131−131]
2
Clear below the pivot with R2←R2−3R1. Row 2 becomes (3−3,−1−3,1−9)=(0,−4,−8).
∼[101−43−8]
3
Scale row 2 by −41 to get (0,1,2), then clear above it with R1←R1−R2.
∼[100112]
So x=(1,2). Check by columns: 1(3,2)+2(−1,2)=(1,6).
Check the answer on the column picture.
Set the weights in x so that Ax lands on the ringed point [16].
You solved Ax=[16] with x=[11].
[32−12][11]=[24]
=1[32]+1[−12]
Spanning every target
Sometimes no weights work. The next problem finds out exactly which targets a matrix can reach.
Let A=[1−32−6]. For which b=(b1,b2) does Ax=b have a solution?
Walk through the solutionHide the walkthrough
We cannot row reduce numbers we do not know, but we can carry b1 and b2 along as symbols. Clear the −3 with R2←R2+3R1. Row 2 becomes (−3+3,−6+6,b2+3b1):
[1−32−6b1b2]∼[1020b13b1+b2]
Row 2 now says 0=3b1+b2. If 3b1+b2=0, that is false and there is no solution. If 3b1+b2=0, it is true, and row 1 can be solved. So Ax=b has a solution exactly when b2=−3b1.
The points with b2=−3b1 form a line through the origin. That makes sense, because the second column (2,−6) is twice the first column (1,−3), so every combination is a multiple of (1,−3).
Drag b and watch the last entry of the reduced matrix. It is zero exactly when b is on the line.
Drag b to a point other than the origin where Ax=b has a solution.
That works. Here 3b1+b2=0, so the last row reads 0=0 and b sits on the line the columns span.
[Ab]∼[102027]
last entry=3b1+b2
The same thing happens for any pair of parallel columns. Here (3,2) and (6,4) span one line, and b=(7,2) sits off it, so Ax=b has no solution.
Let A=12001123−1. Find the condition on b1,b2,b3 for Ax=b to have a solution. Do three columns in R3 reach everything?
Walk through the solutionHide the walkthrough
Carry the b's along again. R2←R2−2R1 clears column 1, and then R3←R3−R2 clears below the second pivot. Row 3 becomes (0,1−1,−1−(−1),b3−(b2−2b1)):
The system has a solution exactly when 2b1−b2+b3=0. That equation describes a plane through the origin, so the three columns reach only a plane. For example, b=(1,0,0) gives 2=0 and has no solution.
The trouble is the row of zeros in the echelon form of A. Only two of its three rows have a pivot.
Theorem 4
Let A be an m×n matrix. These statements are either all true or all false:
(a) For each b in Rm, the equation Ax=b has a solution.
(b) Each b in Rm is a linear combination of the columns of A.
(c) The columns of A span Rm.
(d) A has a pivot position in every row.
Statements (a), (b) and (c) say the same thing in three vocabularies. Statement (d) connects them to row reduction, and Day 12 returns to it as the standard test for whether columns span. If every row of A has a pivot, the augmented column can never hold a pivot, so every system is consistent. If some row of A has no pivot, Problem 7 shows how a target can be missed.
Slide k until some row of the echelon form has no pivot. The orange entries are the pivots.
At k=4 the last row of the echelon form is all zeros. The columns of A then span only a plane, so Ax=b has no solution for some b.
A=121253103
∼1002101−24
rows with a pivot: 3 of 3
Linearity
Because the entries of x are weights on the columns, the product treats sums and multiples of x in a simple way.
Let A=[2351], u=[4−1] and v=[−35]. Compute Au, Av and A(u+v). Enter A(u+v).
You are told that [211−103]12−1=[4−4]. Without any row operations, find weights c1,c2,c3 with [4−4]=c1[21]+c2[1−1]+c3[03]. (Modeled on Lay §1.4 #25.)
Show a hintHide the hint
Read the given product with the definition of Ax. What are the weights on the columns?
Show the solutionHide the solution
The product Ax is the combination of the columns of A with the entries of x as weights, so c1=1, c2=2 and c3=−1. Check: (2,1)+(2,−2)+(0,−3)=(4,−4).
Let A=[2−4−12]. For which h does Ax=[3h] have a solution? (Modeled on Lay §1.4 #15.)
Show a hintHide the hint
Row reduce [Ab] with h carried along, and look at the last entry of row 2.
Show the solutionHide the solution
R2←R2+2R1 gives row 2 as (−4+4,2−2,h+6)=(0,0,h+6). That row says 0=h+6, which holds only when h=−6. The columns are parallel, so they reach only the line b2=−2b1, and (3,−6) is on it.
A 4×4 matrix A has an echelon form with pivots in only three rows. Do the columns of A span R4? (Modeled on Lay §1.4 #17.)
Challenge
True or false: if [Ab] has a pivot position in every row, then Ax=b has a solution. (Modeled on Lay §1.4 #23.)
Let A=12001123−1 from Problem 7. Check that b=(3,7,1) satisfies the condition, and then find the solution of Ax=b with x3=0.
Show a hintHide the hint
Put b1=3, b2=7, b3=1 into the reduced matrix from Problem 7. Column 3 has no pivot, so x3 is free.
Show the solutionHide the solution
The condition is 2b1−b2+b3=6−7+1=0, so a solution exists. The reduced rows become x1+2x3=3 and x2−x3=7−6=1. With x3=0 they give x1=3 and x2=1.
Check: 3(1,2,0)+1(0,1,1)+0(2,3,−1)=(3,7,1). Every other value of x3 gives another solution, x1=3−2x3 and x2=1+x3.
Suppose Au=[12] and Av=[3−1]. You do not know A, u or v. Find A(2u−v).
Show a hintHide the hint
Split A(2u−v) with the two linearity rules.
Show the solutionHide the solution
By linearity, A(2u−v)=A(2u)+A(−v)=2Au−Av. So
2[12]−[3−1]=[2−34+1]=[−15].
Knowing what A does to u and v is enough to know what it does to every combination of them. Tomorrow's lesson builds on exactly this fact.