Ila Sol5 ch04
Ila Sol5 ch04
TO
LINEAR
ALGEBRA
Fifth Edition
Gilbert Strang
Massachusetts Institute of Technology
math.mit.edu/linearalgebra
web.mit.edu/18.06
video lectures: ocw.mit.edu
math.mit.edu/∼gs
www.wellesleycambridge.com
email: linearalgebrabook@gmail.com
Box 812060
Wellesley, Massachusetts 02482
70 Solutions to Exercises
1 Both nullspace vectors will be orthogonal to the row space vector in R3 . The column
2 The nullspace of a 3 by 2 matrix with rank 2 is Z (only the zero vector because the 2
(e) (1, 1, 1) in the nullspace (columns add to the zero vector) and also (1, 1, 1) is in
the row space: no such matrix.
4 If AB = 0, the columns of B are in the nullspace of A and the rows of A are in the left
nullspace of B. If rank = 2, all those four subspaces have dimension at least 2 which
is impossible for 3 by 3.
8 Figure 4.3 has x = xr + xn , where xr is in the row space and xn is in the nullspace.
Then Axn = 0 and Ax = Axr + Axn = Axr . The example has x = (1, 0) and row
space = line through (1, 1) so the splitting is x = xr + xn = 21 , 12 + 21 , − 12 . All
Ax are in C(A).
10 (a) With AT = A, the column and row spaces are the same. The nullspace is always
perpendicular to the row space. (b) x is in the nullspace and z is in the column
space = row space: so these “eigenvectors” x and z have xT z = 0.
11 For A: The nullspace is spanned by (−2, 1), the row space is spanned by (1, 2). The
column space is the line through (1, 3) and N (AT ) is the perpendicular line through
(3, −1). For B: The nullspace of B is spanned by (0, 1), the row space is spanned by
(1, 0). The column space and left nullspace are the same as for A.
12 x = (2, 0) splits into xr + xn = (1, −1) + (1, 1). Notice N (AT ) is the y − z plane.
means: each basis vector for V is orthogonal to each basis vector for W . Then every
v in V (combinations of the basis vectors) is orthogonal to every w in W .
x
14 Ax = B x b means that [ A B ] = 0. Three homogeneous equations (zero right
−bx
hand sides) in four unknowns always have a nonzero solution. Here x = (3, 1) and
72 Solutions to Exercises
If S is spanned by (1, 1, 1), then S ⊥ is the plane spanned by (1, −1, 0) and (1, 0, −1).
If S is spanned by (1, 1, 1) and (1, 1, −1), then S ⊥ is the line spanned by (1, −1, 0).
18 S ⊥ contains ⊥
perpendicular to those two given vectors. So S is the nullspace
all vectors
1 5 1
of A = . Therefore S ⊥ is a subspace even if S is not.
2 2 2
20 If V is the whole space R4 , then V ⊥ contains only the zero vector. Then (V ⊥ )⊥ =
25 If the columns of A are unit vectors, all mutually perpendicular, then AT A = I. Simple
b2 = 2b1 . In that case (b1 , b2 ) is perpendicular to (−2, 1). The nullspace of the 2 by 2
matrix is the line 3x + y = 0. One particular vector in the nullspace is (−1, 3).
28 (a) (1, −1, 0) is in both planes. Normal vectors are perpendicular, but planes still in-
tersect! Two planes in R3 can’t be orthogonal. (b) Need three orthogonal vectors to
span the whole orthogonal complement in R5 . (c) Lines in R3 can meet at the zero
vector without being orthogonal.
1 2 3 1 1 −1 A has v = (1, 2, 3) in row and column spaces
29 A = 2 1 0 , B = 2 −1 0 ; B has v in its column space and nullspace.
3 0 1 3 0 −1 v can not be in the nullspace and row space,
or in the left nullspace and column space. These spaces are orthogonal and v T v 6= 0.
32 We need r T n = 0 and cT ℓ = 0. All possible examples have the form acr T with
a 6= 0.
33 Both r’s must be orthogonal to both n’s, both c’s must be orthogonal to both ℓ’s, each
pair (r’s, n’s, c’s, and ℓ’s) must be independent. Fact : All A’s with these subspaces
have the form [c1 c2 ]M [r1 r 2 ]T for a 2 by 2 invertible M .
The picture for part (a) has the vector b at an angle θ with the horizontal a. The picture
for part (b) has vectors a and b at a 90◦ angle.
1 1 1 5 1 3 1 1
1
1
1
3 P1 = 1 1 1 and P1 b = 5 . P2 = 3 9 3 and P2 b = 3 .
3 3 11
1 1 1 5 1 3 1 1
6 p1 = ( 19 , − 29 , − 29 ) and p2 = ( 94 , 94 , − 29 ) and p3 = ( 49 , − 92 , 49 ). So p1 + p2 + p3 = b.
1 −2 −2 4 4 −2 4 −2 4
1
1
1
7 P1 + P2 + P3 = −2 4 4 + 4 4 −2 + −2 1 −2 = I.
9 9 9
−2 4 4 −2 −2 1 4 −2 4
We can add projections onto orthogonal vectors to get the projection matrix onto the
larger space. This is important.
8 The projections of (1, 1) onto (1, 0) and (1, 2) are p1 = (1, 0) and p2 = 35 (1, 2). Then
9 Since A is invertible, P = A(AT A)−1 AT separates into AA−1 (AT )−1 AT = I. And
14 The projection of this b onto the column space of A is b itself because b is in that
b for 2A
15 2A has the same column space as A. Then P is the same for A and 2A, but x
b for A.
is half of x
1
16 2 (1, 2, −1) + 32 (1, 0, 1) = (2, 1, 1). So b is in the plane. Projection shows P b = b.
P projects onto the column space, I − P projects onto the left nullspace.
76 Solutions to Exercises
18 (a) I − P is the projection matrix onto (1, −1) in the perpendicular direction to (1, 1)
metric!)
25 The column space of P is the space that P projects onto. The column space of A
always contains all outputs Ax and here the outputs P x fill the subspace S. Then rank
of P = dimension of S = n.
(b) The row space is the line through v = (1, 2, 2) and PR = vv T /v T v. Always
PC A = A (columns of A project to themselves) and APR = A. Then PC APR = A.
32 Since P1 b is in C(A) and P2 projects onto that column space, P2 (P1 b) equals P1 b.
ba = p = (9, 9, 9, 9). Then eT a = (−9, −1, −1, 11)T(1, 1, 1, 1) = 0 and the shortest
x
√
distance from b to the line through a is kek = 204.
T
7 Now the 4 by 1 matrix in Ax = b is A = [ 0 1 3 4 ] . Then AT A = [ 26 ] and
match (C, D) = (1, 4) from Problems 1-4. Columns of A were not perpendicular so
we can’t project separately to find C and D.
1 0 0 0
Parabola
C
4 8 26 C 36
1 1 1 8
. AT Ab
9 Project b D
= x = 8 26 92 D = 112 .
1 3 9 8
4D to 3D E 26 92 338 E 400
1 4 16 20
Figure 4.9 (a) is fitting 4 points and 4.9 (b) is a projection in R4 : same problem !
1 0 0 0 C 0 C 0 Exact cubic so p = b, e = 0.
1 1 1 1 D 8 D 1 47 This Vandermonde matrix
.
10 = . Then = 3
1 3 9 27 E 8 E −28 gives exact interpolation
1 4 16 64 F 20 F 5 by a cubic at 0, 1, 3, 4
14 The matrix (b x − x)T is (AT A)−1 AT (b − Ax)(b − Ax)T A(AT A)−1 . When
x − x)(b
the average of (b − Ax)(b − Ax)T is σ 2 I, the average of (b x − x)T will be the
x − x)(b
output covariance matrix (AT A)−1 AT σ 2 A(AT A)−1 which simplifies to σ 2 (AT A)−1 .
b − x.
That gives the average of the squared output errors x
x − x)2 as
15 When A has 1 column of 4 ones, Problem 14 gives the expected error (b
21 e is in N(AT ); p is in C(A); x
b is in C(AT ); N(A) = {0} = zero vector only.
5 0 C 5
22 The least squares equation is = . Solution: C = 1, D = −1.
0 10 D −10
The best line is b = 1 − t. Symmetric t’s ⇒ diagonal AT A ⇒ easy solution.
27 The shortest link connecting two lines in space is perpendicular to those lines.
28 If A has dependent columns, then AT A is not invertable and the usual formula P =
A(AT A)−1 AT will fail. Replace A in that formula by the matrix B that keeps only the
pivot columns of A.
29 Only 1 plane contains 0, a1 , a2 unless a1 , a2 are dependent. Same test for a1 , . . . , an−1 .
If they are dependent, there is a vector v perpendicular to all the a’s. Then they all lie
on the plane v T x = 0 going through x = (0, 0, . . . , 0).
Solutions to Exercises 81
1 (a) Independent (b) Independent and orthogonal (c) Independent and orthonormal.
For orthonormal vectors, (a) becomes (1, 0), (0, 1) and (b) is (.6, .8), (.8, −.6).
5/9 2/9 −4/9
Divide by length 3 to get 1 0
2 QT Q = but QQT = 2/9 8/9
2/9 .
2 2 1 1 2 2
q 1 = ( 3 , 3 , − 3 ). q 2 = (− 3 , 3 , 3 ). 0 1
−4/9 2/9 5/9
3 (a) AT A will be 16I (b) AT A will be diagonal with entries 12 , 22 , 32 = 1, 4, 9.
1 0 1 0 0
4 (a) Q = 0 1 , QQT = 0 1 0 6= I. Any Q with n < m has QQT 6= I.
0 0 0 0 0
(b) (1, 0) and (0, 0) are orthogonal, not independent. Nonzero orthogonal vectors are
√ √
independent. (c) From q 1 = (1, 1, 1)/ 3 my favorite is q 2 = (1, −1, 0)/ 2 and
√
q 3 = (1, 1, −2)/ 6.
5 Orthogonal vectors are (1, −1, 0) and (1, 1, −1). Orthonormal after dividing by their
lengths : √1 , − √1 , 0 and √1 , √1 , − √1 .
2 2 3 3 3
x1 = aT T
1 b/a1 a1
17 p = (aT b/aT a)a = (3, 3, 3) and e = (−2, 0, 2). Then Gram-Schmidt will choose
√ √
q 1 = (1, 1, 1)/ 3 and q 2 = (−1, 0, 1)/ 2.
(this Cholesky
factorization
of AT A uses
the same R as Gram-Schmidt!). The example
−1 1 −1 2
1 3 3
has A = 2 1 = 2 −1 = QR and the same R appears in
3 0 3
2 4 2 2
9 9 3 0 3 3
AT A = = = RT R.
9 18 3 3 0 3
22 A = (1, 1, 2), B = (1, −1, 0), C = (−1, −1, 1). These are not yet unit vectors. As in
Problem 18, Gram-Schmidt will divide by ||A|| and ||B|| and ||C||.
1 0 0 1 0 0 1 2 4
23 You can see why q 1 = 0 , q 2 = 0 , q 3 = 1 . A = 0 0 1 0 3 6 =
0 1 0 0 1 0 0 0 5
QR. This Q is just a permutation matrix—certainly orthogonal.
(b) Since S contains solutions to (1, 1, 1, −1)T x = 0, a basis for S ⊥ is (1, 1, 1, −1)
27 When a and b are not orthogonal, the projections onto these lines do not add to the pro-
jection onto the plane of a and b. We must use the orthogonal A and B (or orthonormal
q 1 and q 2 ) to be allowed to add projections on those lines.
28 There are 12 m2 n multiplications to find the numbers rkj and the same for vij .
1
31 (a) c = 2
normalizes all the orthogonal columns to have unit length (b) The pro-
T T 1
jection (a b/a a)a of b = (1, 1, 1, 1) onto the first column is p1 = 2
(−1, 1, 1, 1).
(Check e = 0.) To project onto the plane, add p2 = 12 (1, −1, 1, 1) to get (0, 0, 1, 1).
1 0 0
1 0
32 Q1 = reflects across x axis, Q2 =
0 0
−1 across plane y + z = 0.
0 −1
0 −1 0
33 Orthogonal and lower triangular ⇒ ±1 on the main diagonal and zeros elsewhere.
35 Starting from A = (1, −1, 0, 0), the orthogonal (not orthonormal) vectors B =
(1, 1, −2, 0) and C = (1, 1, 1, −3) and D = (1, 1, 1, 1) are in the directions of q 2 , q 3 , q 4 .
The 4 by 4 and 5 by 5 matrices with integer orthogonal columns (not orthogonal rows,
since not orthonormal Q!) are
Solutions to Exercises 85
1 1 1 1 1
1 1 1 1
−1 1 1 1 1
−1 1 1 1
A D and 0 −2
B C =
1 1 1
0 −2 1 1
0 0 −3 1 1
0 0 −3 1
0 0 0 −4 1
36 [Q, R]
=qr(A) produces from A (m by n of rank n) a “full-size” square Q = [ Q1 Q2 ]
R
and . The columns of Q1 are the orthonormal basis from Gram-Schmidt of the
0
column space of A. The m − n columns of Q2 are an orthonormal basis for the left
nullspace of A. Together the columns of Q = [ Q1 Q2 ] are an orthonormal basis
for Rm .
37 This question describes the next q n+1 in Gram-Schmidt using the matrix Q with the
columns q 1 , . . . , q n (instead of using those q’s separately). Start from a, subtract its
projection p = QT a onto the earlier q’s, divide by the length of e = a − QT a to get
q n+1 = e/kek.