All lessons

Matrix times vector

Day
4 of 40
Length
2:28
Textbook
Lay §1.4
Syllabus
Groundwork before Lesson 10

Ax is a linear combination of the columns of A, using the entries of x as the weights.

On Day 2, asking whether b\teal{\mathbf 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=bA\mathbf x = \teal{\mathbf b}. The vectors stand side by side as the columns of a matrix AA, and the weights stack into a vector x\mathbf x. This notation also sets up Day 5, where AxA\mathbf x 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]\yellow{\mathbf a_1} = \begin{bmatrix} 3 \\ 2 \end{bmatrix} and a2=[−12]\blue{\mathbf a_2} = \begin{bmatrix} -1 \\ 2 \end{bmatrix}. Compute the linear combination 2a1+1a22\yellow{\mathbf a_1} + 1\blue{\mathbf a_2}.

Walk through the solution

Scale each vector by its weight, then add entry by entry, exactly as on Day 1:

2[32]+1[−12]=[64]+[−12]=[56].2\begin{bmatrix} 3 \\ 2 \end{bmatrix} + 1\begin{bmatrix} -1 \\ 2 \end{bmatrix} = \begin{bmatrix} 6 \\ 4 \end{bmatrix} + \begin{bmatrix} -1 \\ 2 \end{bmatrix} = \begin{bmatrix} 5 \\ 6 \end{bmatrix}.

The whole calculation depends on two lists: the vectors a1,a2\yellow{\mathbf a_1}, \blue{\mathbf a_2} and the weights 2,12, 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:

[3−122][21]=[56].\begin{bmatrix} \yellow{3} & \blue{-1} \\ \yellow{2} & \blue{2} \end{bmatrix}\begin{bmatrix} \yellow{2} \\ \blue{1} \end{bmatrix} = \teal{\begin{bmatrix} 5 \\ 6 \end{bmatrix}}.

The left side is a new name for the same combination.

Matrix times vector

If AA is an m×nm\times n matrix with columns a1,…,an\mathbf a_1, \dots, \mathbf a_n and x\mathbf x is in Rn\mathbb{R}^n, then the product AxA\mathbf x is the linear combination of the columns of AA that uses the entries of x\mathbf x as weights:

Ax=[a1a2⋯an][x1⋮xn]=x1a1+x2a2+⋯+xnan.A\mathbf x = \begin{bmatrix} \mathbf a_1 & \mathbf a_2 & \cdots & \mathbf a_n \end{bmatrix}\begin{bmatrix} x_1 \\ \vdots \\ x_n \end{bmatrix} = x_1\mathbf a_1 + x_2\mathbf a_2 + \cdots + x_n\mathbf a_n.

The product is defined only when AA has as many columns as x\mathbf x has entries, because each column needs exactly one weight. The answer has mm entries, one for each row of AA.

The yellow column a1 = (3, 2) stretched to 2a1 = (6, 4), the blue column a2 = (−1, 2) placed at its tip, and the teal arrow Ax ending at (5, 6), marked with an orange dot.

The first entry of x\mathbf x stretches the first column to (6,4)(6, 4). The second entry scales the second column by 11, and that arrow starts at the tip of the first. Together they land on Ax=(5,6)A\mathbf x = (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]2\begin{bmatrix} 1 \\ 4 \end{bmatrix} - 3\begin{bmatrix} 2 \\ -1 \end{bmatrix} + \begin{bmatrix} 0 \\ 5 \end{bmatrix} as AxA\mathbf x. What are AA and x\mathbf x? Enter x\mathbf x.

Walk through the solution

The vectors become the columns of AA, in order, and the weights become the entries of x\mathbf x. The last vector has no number in front, so its weight is 11, and the minus sign in front of the 33 makes the second weight −3-3:

[1204−15][2−31].\begin{bmatrix} 1 & 2 & 0 \\ 4 & -1 & 5 \end{bmatrix}\begin{bmatrix} 2 \\ -3 \\ 1 \end{bmatrix}.

AA is 2×32 \times 3 because there are three vectors with two entries each. The product equals (2−6+0, 8+3+5)=(−4,16)(2 - 6 + 0,\ 8 + 3 + 5) = (-4, 16).

Drag the weights until AxA\mathbf x lands on the target. Look for a pair of weights that you can read straight off the columns.

Set the weights in x\mathbf x so that AxA\mathbf x lands on the ringed point [−12]\begin{bmatrix} -1 \\ 2 \end{bmatrix}.
[3−122][11]=[24]\begin{bmatrix} \textcolor{#FFD447}{3} & \textcolor{#5BC0EB}{-1} \\ \textcolor{#FFD447}{2} & \textcolor{#5BC0EB}{2} \end{bmatrix}\begin{bmatrix} \textcolor{#FFD447}{1} \\ \textcolor{#5BC0EB}{1} \end{bmatrix} = \textcolor{#3DD6B5}{\begin{bmatrix} 2 \\ 4 \end{bmatrix}}
=1[32]+1[−12]= 1\textcolor{#FFD447}{\begin{bmatrix} 3 \\ 2 \end{bmatrix}} + 1\textcolor{#5BC0EB}{\begin{bmatrix} -1 \\ 2 \end{bmatrix}}

Which product is defined?

The row rule

Scaling whole columns explains what AxA\mathbf x means, but it is slow to write out by hand. This section finds a faster way to compute one entry at a time.

Compute [3−122][21]\begin{bmatrix} 3 & -1 \\ 2 & 2 \end{bmatrix}\begin{bmatrix} 2 \\ 1 \end{bmatrix} by columns, but do not simplify the entries. Which numbers from AA does the top entry use?

Walk through the solution

By columns, the product is

2[32]+1[−12]=[2⋅3+1⋅(−1)2⋅2+1⋅2]=[56].2\begin{bmatrix} 3 \\ 2 \end{bmatrix} + 1\begin{bmatrix} -1 \\ 2 \end{bmatrix} = \begin{bmatrix} 2 \cdot 3 + 1 \cdot (-1) \\ 2 \cdot 2 + 1 \cdot 2 \end{bmatrix} = \begin{bmatrix} 5 \\ 6 \end{bmatrix}.

The top entry is 3⋅2+(−1)⋅13 \cdot 2 + (-1) \cdot 1. The numbers 33 and −1-1 are exactly the top row of AA, and they are paired with the entries 22 and 11 of x\mathbf x in order. The bottom entry, 2⋅2+2⋅12 \cdot 2 + 2 \cdot 1, uses only the bottom row. Each entry of the answer comes from one row of AA.

Top line: 2 times (3, 2) plus 1 times (−1, 2) written as one column with entries 2·3 + 1·(−1) and 2·2 + 1·2, equal to (5, 6). Bottom line: the same product computed by rows, with row 1 of A, the vector x and the entry 3·2 + (−1)·1 boxed in orange.

The row rule

Entry ii of AxA\mathbf x is the sum of the products of matching entries from row ii of AA and from x\mathbf x. For a 2×22 \times 2 matrix,

[a11a12a21a22][x1x2]=[a11x1+a12x2a21x1+a22x2].\begin{bmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \end{bmatrix}\begin{bmatrix} x_1 \\ x_2 \end{bmatrix} = \begin{bmatrix} a_{11}x_1 + a_{12}x_2 \\ a_{21}x_1 + a_{22}x_2 \end{bmatrix}.

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 matrix II has 11s down its diagonal and 00s elsewhere. By the row rule, [1001][4−7]=[4+00−7]=[4−7]\begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}\begin{bmatrix} 4 \\ -7 \end{bmatrix} = \begin{bmatrix} 4 + 0 \\ 0 - 7 \end{bmatrix} = \begin{bmatrix} 4 \\ -7 \end{bmatrix}, and in general Ix=xI\mathbf x = \mathbf x.

The row rule gives a second picture of Ax=bA\mathbf x = \mathbf b. Each row says one entry of AxA\mathbf x must match one entry of b\mathbf b, and the inputs x\mathbf x that make it match form a line, just like the equations on Day 3.

Drag x\mathbf x so that both rows of AxA\mathbf x match b=[72]\mathbf b = \begin{bmatrix} 7 \\ 2 \end{bmatrix}. Each colored line shows where one row matches.
x
3(0)+(−1)(0)=0✓2(0)+(2)(0)=0✓\begin{aligned} \textcolor{#7BC96F}{3}(0) + (\textcolor{#7BC96F}{-1})(0) &= 0 & \phantom{\checkmark} \\ \textcolor{#F2665E}{2}(0) + (\textcolor{#F2665E}{2})(0) &= 0 & \phantom{\checkmark} \end{aligned}
Ax=[00]A\mathbf x = \begin{bmatrix} \textcolor{#7BC96F}{0} \\ \textcolor{#F2665E}{0} \end{bmatrix}

One problem in three forms

Reading AxA\mathbf x backwards turns a question into an equation. The widget above solved Ax=(7,2)A\mathbf x = (7, 2), and the next problem writes that same question three ways.

Write the system 3x1−x2=73x_1 - x_2 = 7,  2x1+2x2=2\ 2x_1 + 2x_2 = 2 as a vector equation and as a matrix equation. Then solve it.

Walk through the solution

Collect the coefficients of x1x_1 into one vector and the coefficients of x2x_2 into another, as on Day 2:

x1[32]+x2[−12]=[72].x_1\begin{bmatrix} 3 \\ 2 \end{bmatrix} + x_2\begin{bmatrix} -1 \\ 2 \end{bmatrix} = \begin{bmatrix} 7 \\ 2 \end{bmatrix}.

By the definition of AxA\mathbf x, the left side is the matrix with those columns times x\mathbf x:

[3−122][x1x2]=[72].\begin{bmatrix} 3 & -1 \\ 2 & 2 \end{bmatrix}\begin{bmatrix} x_1 \\ x_2 \end{bmatrix} = \begin{bmatrix} 7 \\ 2 \end{bmatrix}.

All three forms have the same augmented matrix, so one row reduction solves them all. Halve row 2 to get x1+x2=1x_1 + x_2 = 1, then add it to row 1 to cancel x2x_2: 4x1=84x_1 = 8, so x1=2x_1 = 2 and x2=−1x_2 = -1.

The system 3x1 − x2 = 7, 2x1 + 2x2 = 2, the vector equation x1(3, 2) + x2(−1, 2) = (7, 2) and the matrix equation, stacked with the same colors. Beside them the augmented matrix row reduces to the identity with last column (2, −1), giving x = (2, −1).

Theorem 3

If AA is an m×nm\times n matrix with columns a1,…,an\mathbf a_1, \dots, \mathbf a_n and b\mathbf b is in Rm\mathbb{R}^m, then the matrix equation Ax=bA\mathbf x = \mathbf b has the same solution set as the vector equation x1a1+⋯+xnan=bx_1\mathbf a_1 + \cdots + x_n\mathbf a_n = \mathbf b. Both have the same solution set as the linear system whose augmented matrix is [a1⋯anb]\begin{bmatrix} \mathbf a_1 & \cdots & \mathbf a_n & \mathbf b \end{bmatrix}.

In particular, Ax=bA\mathbf x = \mathbf b has a solution exactly when b\mathbf b is a linear combination of the columns of AA.

Solve [3−122]x=[16]\begin{bmatrix} 3 & -1 \\ 2 & 2 \end{bmatrix}\mathbf x = \begin{bmatrix} 1 \\ 6 \end{bmatrix} by row reducing the augmented matrix.

Walk through the solution
  1. 1

    Write [Ab]\begin{bmatrix} A & \mathbf b \end{bmatrix}. Row 2 has all even entries, so halve it, and then swap the rows so the pivot 11 sits on top. This avoids fractions.

    [3−11226]∼[1133−11]\begin{bmatrix} 3 & -1 & 1 \\ 2 & 2 & 6 \end{bmatrix} \sim \begin{bmatrix} 1 & 1 & 3 \\ 3 & -1 & 1 \end{bmatrix}
  2. 2
  3. 3

Check the answer on the column picture.

Set the weights in x\mathbf x so that AxA\mathbf x lands on the ringed point [16]\begin{bmatrix} 1 \\ 6 \end{bmatrix}.
[3−122][11]=[24]\begin{bmatrix} \textcolor{#FFD447}{3} & \textcolor{#5BC0EB}{-1} \\ \textcolor{#FFD447}{2} & \textcolor{#5BC0EB}{2} \end{bmatrix}\begin{bmatrix} \textcolor{#FFD447}{1} \\ \textcolor{#5BC0EB}{1} \end{bmatrix} = \textcolor{#3DD6B5}{\begin{bmatrix} 2 \\ 4 \end{bmatrix}}
=1[32]+1[−12]= 1\textcolor{#FFD447}{\begin{bmatrix} 3 \\ 2 \end{bmatrix}} + 1\textcolor{#5BC0EB}{\begin{bmatrix} -1 \\ 2 \end{bmatrix}}

Spanning every target

Sometimes no weights work. The next problem finds out exactly which targets a matrix can reach.

Let A=[12−3−6]A = \begin{bmatrix} 1 & 2 \\ -3 & -6 \end{bmatrix}. For which b=(b1,b2)\mathbf b = (b_1, b_2) does Ax=bA\mathbf x = \mathbf b have a solution?

Walk through the solution

We cannot row reduce numbers we do not know, but we can carry b1b_1 and b2b_2 along as symbols. Clear the −3-3 with R2←R2+3R1R_2 \leftarrow R_2 + 3R_1. Row 2 becomes (−3+3, −6+6, b2+3b1)(-3 + 3,\ -6 + 6,\ b_2 + 3b_1):

[12b1−3−6b2]∼[12b1003b1+b2]\begin{bmatrix} 1 & 2 & b_1 \\ -3 & -6 & b_2 \end{bmatrix} \sim \begin{bmatrix} 1 & 2 & b_1 \\ 0 & 0 & 3b_1 + b_2 \end{bmatrix}

Row 2 now says 0=3b1+b20 = 3b_1 + b_2. If 3b1+b2≠03b_1 + b_2 \neq 0, that is false and there is no solution. If 3b1+b2=03b_1 + b_2 = 0, it is true, and row 1 can be solved. So Ax=bA\mathbf x = \mathbf b has a solution exactly when b2=−3b1b_2 = -3b_1.

The points with b2=−3b1b_2 = -3b_1 form a line through the origin. That makes sense, because the second column (2,−6)(2, -6) is twice the first column (1,−3)(1, -3), so every combination is a multiple of (1,−3)(1, -3).

Drag b\mathbf b and watch the last entry of the reduced matrix. It is zero exactly when b\mathbf b is on the line.

Drag b\mathbf b to a point other than the origin where Ax=bA\mathbf x = \mathbf b has a solution.
b
[Ab]∼[122007]\begin{bmatrix} A & \mathbf b \end{bmatrix} \sim \begin{bmatrix} 1 & 2 & 2 \\ 0 & 0 & \textcolor{#E8ECF1}{7} \end{bmatrix}
last entry=3b1+b2\text{last entry} = 3b_1 + b_2
The yellow column a1 = (3, 2) and the blue column a2 = (6, 4) lie on one teal line through the origin. The point b = (7, 2), ringed in orange, sits below the line.

The same thing happens for any pair of parallel columns. Here (3,2)\yellow{(3, 2)} and (6,4)\blue{(6, 4)} span one line, and b=(7,2)\mathbf b = (7, 2) sits off it, so Ax=bA\mathbf x = \mathbf b has no solution.

Let A=[10221301−1]A = \begin{bmatrix} 1 & 0 & 2 \\ 2 & 1 & 3 \\ 0 & 1 & -1 \end{bmatrix}. Find the condition on b1,b2,b3b_1, b_2, b_3 for Ax=bA\mathbf x = \mathbf b to have a solution. Do three columns in R3\mathbb{R}^3 reach everything?

Walk through the solution

Carry the bb's along again. R2←R2−2R1R_2 \leftarrow R_2 - 2R_1 clears column 1, and then R3←R3−R2R_3 \leftarrow R_3 - R_2 clears below the second pivot. Row 3 becomes (0, 1−1, −1−(−1), b3−(b2−2b1))(0,\ 1 - 1,\ -1 - (-1),\ b_3 - (b_2 - 2b_1)):

[102b1213b201−1b3]∼[102b101−1b2−2b101−1b3]∼[102b101−1b2−2b10002b1−b2+b3]\begin{bmatrix} 1 & 0 & 2 & b_1 \\ 2 & 1 & 3 & b_2 \\ 0 & 1 & -1 & b_3 \end{bmatrix} \sim \begin{bmatrix} 1 & 0 & 2 & b_1 \\ 0 & 1 & -1 & b_2 - 2b_1 \\ 0 & 1 & -1 & b_3 \end{bmatrix} \sim \begin{bmatrix} 1 & 0 & 2 & b_1 \\ 0 & 1 & -1 & b_2 - 2b_1 \\ 0 & 0 & 0 & 2b_1 - b_2 + b_3 \end{bmatrix}

The system has a solution exactly when 2b1−b2+b3=02b_1 - b_2 + b_3 = 0. That equation describes a plane through the origin, so the three columns reach only a plane. For example, b=(1,0,0)\mathbf b = (1, 0, 0) gives 2≠02 \neq 0 and has no solution.

The trouble is the row of zeros in the echelon form of AA. Only two of its three rows have a pivot.

Theorem 4

Let AA be an m×nm\times n matrix. These statements are either all true or all false:

(a) For each b\mathbf b in Rm\mathbb{R}^m, the equation Ax=bA\mathbf x = \mathbf b has a solution.

(b) Each b\mathbf b in Rm\mathbb{R}^m is a linear combination of the columns of AA.

(c) The columns of AA span Rm\mathbb{R}^m.

(d) AA 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 AA has a pivot, the augmented column can never hold a pivot, so every system is consistent. If some row of AA has no pivot, Problem 7 shows how a target can be missed.

Slide kk until some row of the echelon form has no pivot. The orange entries are the pivots.
A=[121250133]A = \begin{bmatrix} 1 & 2 & 1 \\ 2 & 5 & \textcolor{#5BC0EB}{0} \\ 1 & 3 & 3 \end{bmatrix}
∼[12101−2004]\sim \begin{bmatrix} \textcolor{#FF8A3D}{1} & 2 & 1 \\ 0 & \textcolor{#FF8A3D}{1} & -2 \\ 0 & 0 & \textcolor{#FF8A3D}{4} \end{bmatrix}
rows with a pivot: 3 of 3\text{rows with a pivot: } 3 \text{ of } 3

Linearity

Because the entries of x\mathbf x are weights on the columns, the product treats sums and multiples of x\mathbf x in a simple way.

Let A=[2531]A = \begin{bmatrix} 2 & 5 \\ 3 & 1 \end{bmatrix}, u=[4−1]\mathbf u = \begin{bmatrix} 4 \\ -1 \end{bmatrix} and v=[−35]\mathbf v = \begin{bmatrix} -3 \\ 5 \end{bmatrix}. Compute AuA\mathbf u, AvA\mathbf v and A(u+v)A(\mathbf u + \mathbf v). Enter A(u+v)A(\mathbf u + \mathbf v).

Walk through the solution

Use the row rule for each product.

Au=[2⋅4+5⋅(−1)3⋅4+1⋅(−1)]=[311],Av=[2⋅(−3)+5⋅53⋅(−3)+1⋅5]=[19−4].\begin{aligned} A\mathbf u &= \begin{bmatrix} 2 \cdot 4 + 5 \cdot (-1) \\ 3 \cdot 4 + 1 \cdot (-1) \end{bmatrix} = \begin{bmatrix} 3 \\ 11 \end{bmatrix}, \\ A\mathbf v &= \begin{bmatrix} 2 \cdot (-3) + 5 \cdot 5 \\ 3 \cdot (-3) + 1 \cdot 5 \end{bmatrix} = \begin{bmatrix} 19 \\ -4 \end{bmatrix}. \end{aligned}

For the third, first add: u+v=(1,4)\mathbf u + \mathbf v = (1, 4). Then A(u+v)=(2+20, 3+4)=(22,7)A(\mathbf u + \mathbf v) = (2 + 20,\ 3 + 4) = (22, 7).

Now compare. Au+Av=(3+19, 11−4)=(22,7)A\mathbf u + A\mathbf v = (3 + 19,\ 11 - 4) = (22, 7), the same vector. Multiplying the sum gives the same answer as adding the products.

Matrix times vector is linear

For any AA, any u,v\mathbf u, \mathbf v and any scalar cc,

A(u+v)=Au+Av,A(c u)=c (Au).A(\mathbf u + \mathbf v) = A\mathbf u + A\mathbf v, \qquad A(c\,\mathbf u) = c\,(A\mathbf u).

The reason is that the entries of x\mathbf x are the weights on the columns. For two columns,

A(u+v)=(u1+v1)a1+(u2+v2)a2=(u1a1+u2a2)+(v1a1+v2a2)=Au+Av,A(c u)=(c u1)a1+(c u2)a2=c (u1a1+u2a2)=c (Au).\begin{aligned} A(\mathbf u + \mathbf v) &= (u_1 + v_1)\mathbf a_1 + (u_2 + v_2)\mathbf a_2 \\ &= (u_1\mathbf a_1 + u_2\mathbf a_2) + (v_1\mathbf a_1 + v_2\mathbf a_2) = A\mathbf u + A\mathbf v, \\ A(c\,\mathbf u) &= (c\,u_1)\mathbf a_1 + (c\,u_2)\mathbf a_2 = c\,(u_1\mathbf a_1 + u_2\mathbf a_2) = c\,(A\mathbf u). \end{aligned}

The same regrouping works for any number of columns.

Tomorrow these two rules become the definition of a linear transformation, and AxA\mathbf x becomes a way to move the whole plane at once.

Practice

Warm-up

Is [2103−14][152]\begin{bmatrix} 2 & 1 \\ 0 & 3 \\ -1 & 4 \end{bmatrix}\begin{bmatrix} 1 \\ 5 \\ 2 \end{bmatrix} defined? (Modeled on Lay §1.4 #1.)

Compute [1−230][41]\begin{bmatrix} 1 & -2 \\ 3 & 0 \end{bmatrix}\begin{bmatrix} 4 \\ 1 \end{bmatrix}.

Show the solution

By rows, the first entry is 1⋅4+(−2)⋅1=21 \cdot 4 + (-2) \cdot 1 = 2 and the second is 3⋅4+0⋅1=123 \cdot 4 + 0 \cdot 1 = 12. By columns, 4(1,3)+1(−2,0)=(4−2, 12+0)=(2,12)4(1, 3) + 1(-2, 0) = (4 - 2,\ 12 + 0) = (2, 12), which agrees.

Let a1=(2,1)\mathbf a_1 = (2, 1), a2=(0,3)\mathbf a_2 = (0, 3) and a3=(−1,1)\mathbf a_3 = (-1, 1). Write 4a1−a2+2a34\mathbf a_1 - \mathbf a_2 + 2\mathbf a_3 as AxA\mathbf x with A=[a1a2a3]A = \begin{bmatrix} \mathbf a_1 & \mathbf a_2 & \mathbf a_3 \end{bmatrix}, and enter x\mathbf x. (Modeled on Lay §1.4, Example 2.)

Show the solution

The weights become the entries of x\mathbf x, in the order of the columns, so x=(4,−1,2)\mathbf x = (4, -1, 2):

[20−1131][4−12]=[8−0−24−3+2]=[63].\begin{bmatrix} 2 & 0 & -1 \\ 1 & 3 & 1 \end{bmatrix}\begin{bmatrix} 4 \\ -1 \\ 2 \end{bmatrix} = \begin{bmatrix} 8 - 0 - 2 \\ 4 - 3 + 2 \end{bmatrix} = \begin{bmatrix} 6 \\ 3 \end{bmatrix}.

Core

Compute [3−1204−5][21−1]\begin{bmatrix} 3 & -1 & 2 \\ 0 & 4 & -5 \end{bmatrix}\begin{bmatrix} 2 \\ 1 \\ -1 \end{bmatrix} as a combination of the columns, then check it with the row rule. (Modeled on Lay §1.4 #3.)

Show a hint

There are three columns, so there are three scaled vectors to add. Watch the sign of the third weight.

Show the solution
2[30]+1[−14]−1[2−5]=[60]+[−14]+[−25]=[39]2\begin{bmatrix} 3 \\ 0 \end{bmatrix} + 1\begin{bmatrix} -1 \\ 4 \end{bmatrix} - 1\begin{bmatrix} 2 \\ -5 \end{bmatrix} = \begin{bmatrix} 6 \\ 0 \end{bmatrix} + \begin{bmatrix} -1 \\ 4 \end{bmatrix} + \begin{bmatrix} -2 \\ 5 \end{bmatrix} = \begin{bmatrix} 3 \\ 9 \end{bmatrix}

By rows, the first entry is 3⋅2+(−1)⋅1+2⋅(−1)=33\cdot 2 + (-1)\cdot 1 + 2\cdot(-1) = 3 and the second is 0⋅2+4⋅1+(−5)⋅(−1)=90\cdot 2 + 4\cdot 1 + (-5)\cdot(-1) = 9.

Solve [123−1]x=[45]\begin{bmatrix} 1 & 2 \\ 3 & -1 \end{bmatrix}\mathbf x = \begin{bmatrix} 4 \\ 5 \end{bmatrix} by row reducing the augmented matrix. (Modeled on Lay §1.4 #11.)

Show a hint

The top left entry is already 11. Clear below it first.

Show the solution
[1243−15]∼[1240−7−7]R2−3R1∼[102011]R2÷(−7), R1−2R2\begin{aligned} \begin{bmatrix} 1 & 2 & 4 \\ 3 & -1 & 5 \end{bmatrix} &\sim \begin{bmatrix} 1 & 2 & 4 \\ 0 & -7 & -7 \end{bmatrix} && R_2 - 3R_1 \\ &\sim \begin{bmatrix} 1 & 0 & 2 \\ 0 & 1 & 1 \end{bmatrix} && R_2 \div (-7),\ R_1 - 2R_2 \end{aligned}

So x=(2,1)\mathbf x = (2, 1). Check: 2 (1,3)+1 (2,−1)=(4,5)2\,(1, 3) + 1\,(2, -1) = (4, 5).

You are told that [2101−13][12−1]=[4−4]\begin{bmatrix} 2 & 1 & 0 \\ 1 & -1 & 3 \end{bmatrix}\begin{bmatrix} 1 \\ 2 \\ -1 \end{bmatrix} = \begin{bmatrix} 4 \\ -4 \end{bmatrix}. Without any row operations, find weights c1,c2,c3c_1, c_2, c_3 with [4−4]=c1[21]+c2[1−1]+c3[03]\begin{bmatrix} 4 \\ -4 \end{bmatrix} = c_1\begin{bmatrix} 2 \\ 1 \end{bmatrix} + c_2\begin{bmatrix} 1 \\ -1 \end{bmatrix} + c_3\begin{bmatrix} 0 \\ 3 \end{bmatrix}. (Modeled on Lay §1.4 #25.)

Show a hint

Read the given product with the definition of AxA\mathbf x. What are the weights on the columns?

Show the solution

The product AxA\mathbf x is the combination of the columns of AA with the entries of x\mathbf x as weights, so c1=1c_1 = 1, c2=2c_2 = 2 and c3=−1c_3 = -1. Check: (2,1)+(2,−2)+(0,−3)=(4,−4)(2, 1) + (2, -2) + (0, -3) = (4, -4).

Let A=[2−1−42]A = \begin{bmatrix} 2 & -1 \\ -4 & 2 \end{bmatrix}. For which hh does Ax=[3h]A\mathbf x = \begin{bmatrix} 3 \\ h \end{bmatrix} have a solution? (Modeled on Lay §1.4 #15.)

h=h =
Show a hint

Row reduce [Ab]\begin{bmatrix} A & \mathbf b \end{bmatrix} with hh carried along, and look at the last entry of row 2.

Show the solution

R2←R2+2R1R_2 \leftarrow R_2 + 2R_1 gives row 2 as (−4+4, 2−2, h+6)=(0,0,h+6)(-4 + 4,\ 2 - 2,\ h + 6) = (0, 0, h + 6). That row says 0=h+60 = h + 6, which holds only when h=−6h = -6. The columns are parallel, so they reach only the line b2=−2b1b_2 = -2b_1, and (3,−6)(3, -6) is on it.

A 4×44 \times 4 matrix AA has an echelon form with pivots in only three rows. Do the columns of AA span R4\mathbb{R}^4? (Modeled on Lay §1.4 #17.)

Challenge

True or false: if [Ab]\begin{bmatrix} A & \mathbf b \end{bmatrix} has a pivot position in every row, then Ax=bA\mathbf x = \mathbf b has a solution. (Modeled on Lay §1.4 #23.)

Let A=[10221301−1]A = \begin{bmatrix} 1 & 0 & 2 \\ 2 & 1 & 3 \\ 0 & 1 & -1 \end{bmatrix} from Problem 7. Check that b=(3,7,1)\mathbf b = (3, 7, 1) satisfies the condition, and then find the solution of Ax=bA\mathbf x = \mathbf b with x3=0x_3 = 0.

Show a hint

Put b1=3b_1 = 3, b2=7b_2 = 7, b3=1b_3 = 1 into the reduced matrix from Problem 7. Column 3 has no pivot, so x3x_3 is free.

Show the solution

The condition is 2b1−b2+b3=6−7+1=02b_1 - b_2 + b_3 = 6 - 7 + 1 = 0, so a solution exists. The reduced rows become x1+2x3=3x_1 + 2x_3 = 3 and x2−x3=7−6=1x_2 - x_3 = 7 - 6 = 1. With x3=0x_3 = 0 they give x1=3x_1 = 3 and x2=1x_2 = 1.

Check: 3(1,2,0)+1(0,1,1)+0(2,3,−1)=(3,7,1)3(1, 2, 0) + 1(0, 1, 1) + 0(2, 3, -1) = (3, 7, 1). Every other value of x3x_3 gives another solution, x1=3−2x3x_1 = 3 - 2x_3 and x2=1+x3x_2 = 1 + x_3.

Suppose Au=[12]A\mathbf u = \begin{bmatrix} 1 \\ 2 \end{bmatrix} and Av=[3−1]A\mathbf v = \begin{bmatrix} 3 \\ -1 \end{bmatrix}. You do not know AA, u\mathbf u or v\mathbf v. Find A(2u−v)A(2\mathbf u - \mathbf v).

Show a hint

Split A(2u−v)A(2\mathbf u - \mathbf v) with the two linearity rules.

Show the solution

By linearity, A(2u−v)=A(2u)+A(−v)=2Au−AvA(2\mathbf u - \mathbf v) = A(2\mathbf u) + A(-\mathbf v) = 2A\mathbf u - A\mathbf v. So

2[12]−[3−1]=[2−34+1]=[−15].2\begin{bmatrix} 1 \\ 2 \end{bmatrix} - \begin{bmatrix} 3 \\ -1 \end{bmatrix} = \begin{bmatrix} 2 - 3 \\ 4 + 1 \end{bmatrix} = \begin{bmatrix} -1 \\ 5 \end{bmatrix}.

Knowing what AA does to u\mathbf u and v\mathbf v is enough to know what it does to every combination of them. Tomorrow's lesson builds on exactly this fact.