Ax is a combination of the columns of A.
Stack v and w side by side as the columns of a matrix A. Put the numbers c and d into a vector x. Then Ax is exactly cv + dw.
Think: a shopping basket
You buy eggs and rice. Each food gives you roughly this much protein and carbs:
Each column of A is one food. The vector x says how many of each you take. Ax is the total in your basket.
Two ways to add it up
- By columns (whole foods): 2 eggs + 1 bowl = 2·(6, 1) + 1·(4, 45) = (16, 47).
- By rows (one nutrient at a time): protein 6·2 + 4·1 = 16. Carbs 1·2 + 45·1 = 47.
Same totals. The row way is how you calculate by hand: each entry is a dot product of a row with x. The column way is how you think: Ax is a mix of the columns.
Strang's advice: compute by rows if you like, but think by columns. The column view tells you what Ax can be.
Watch out
x needs one number per column. Two foods, two quantities. A 2 by 2 matrix needs a vector with 2 entries.
In the lab, the code computes Ax both ways. The plane draws the column way: x₁ times column 1, then x₂ times column 2 from its tip.
Worked examples
Example 1 · Both ways
A = 3125, x = (1, 2).
Example 2 · A wide matrix
A = 102311 has 3 columns, so x needs 3 entries. Take x = (2, 1, 1).
Three columns in, a vector with 2 entries out: one per row of A.
Problems
Try each one before you open the solution.
Compute Ax by columns for A = 1420 and x = (3, −1).
Show solutionHide solution
3·(1, 2) − 1·(4, 0) = (3 − 4, 6 − 0) = (−1, 6).
Which x makes Ax equal to column 2 of A? Which x gives column 1 + column 2?
Show solutionHide solution
x = (0, 1) picks out column 2. x = (1, 1) gives column 1 + column 2.
A is 3 by 2. How many entries must x have, and how many does Ax have?
Show solutionHide solution
x needs 2 entries, one per column. Ax has 3 entries, one per row.