INTRODUCTION TO LINEAR ALGEBRA Third Edition MANUAL FOR INSTRUCTORS Gilbert Strang [email protected] Massachusetts Institute of Technology http://web.mit.edu/18.06/www http://math.mit.edu/˜gs http://www.wellesleycambridge.com Wellesley-Cambridge Press Box 812060 Wellesley, Massachusetts 02482 Solutions to Exercises Problem Set 1.1, page 6 1 Line through (1,1,1); plane; same plane! 3 v =(2,2) and w =(1,−1). 4 3v +w =(7,5) and v −3w =(−1,−5) and cv +dw =(2c+d,c+2d). 5 u+v =(−2,3,1)andu+v+w =(0,0,0)and2u+2v+w =(addfirstanswers)=(−2,3,1). 6 The components of every cv +dw add to zero. Choose c=4 and d=10 to get (4,2,−6). 8 The other diagonal is v −w (or else w −v). Adding diagonals gives 2v (or 2w). 9 The fourth corner can be (4,4) or (4,0) or (−2,2). 10 i +j is the diagonal of the base. 11 Fivemorecorners(0,0,1),(1,1,0),(1,0,1),(0,1,1),(1,1,1). Thecenterpointis(1,1,1). The 2 2 2 centers of the six faces are (1,1,0),(1,1,1) and (0,1,1),(1,1,1) and (1,0,1),(1,1,1). 2 2 2 2 2 2 2 2 2 2 2 2 12 A four-dimensional cube has 24 = 16 corners and 2·4 = 8 three-dimensional sides and 24 two-dimensional faces and 32 one-dimensional edges. See Worked Example 2.4 A. √ 13 sum=zerovector;sum=−4:00vector;1:00is60◦ fromhorizontal=(cosπ,sinπ)=(1, 3). 3 3 2 2 14 Sum =12j since j =(0,1) is added to every vector. 15 The point 3v + 1w is three-fourths of the way to v starting from w. The vector 1v + 1w is 4 4 4 4 halfway to u = 1v + 1w, and the vector v +w is 2u (the far corner of the parallelogram). 2 2 16 Allcombinationswithc+d=1areonthelinethroughv andw. ThepointV =−v+2w is on that line beyond w. 17 The vectors cv +cw fill out the line passing through (0,0) and u = 1v + 1w. It continues 2 2 beyond v +w and (0,0). With c≥0, half this line is removed and the “ray” starts at (0,0). 18 The combinations with 0≤c≤1 and 0≤d≤1 fill the parallelogram with sides v and w. 19 With c≥0 and d≥0 we get the “cone” or “wedge” between v and w. 20 (a) 1u + 1v + 1w is the center of the triangle between u,v and w; 1u + 1w is the center 3 3 3 2 2 of the edge between u and w (b) To fill in the triangle keep c ≥ 0, d ≥ 0, e ≥ 0, and c+d+e=1. 3 4 21 The sum is (v −u)+(w −v)+(u−w)= zero vector. 22 The vector 1(u+v +w) is outside the pyramid because c+d+e= 1 + 1 + 1 >1. 2 2 2 2 23 All vectors are combinations of u, v, and w. 24 Vectors cv are in both planes. 25 (a) Choose u =v =w = any nonzero vector (b) Choose u and v in different directions, and w to be a combination like u+v. 26 The solution is c=2 and d=4. Then 2(1,2)+4(3,1)=(14,8). 27 The combinations of (1,0,0) and (0,1,0) fill the xy plane in xyz space. 28 An example is (a,b) = (3,6) and (c,d) = (1,2). The ratios a/c and b/d are equal. Then ad=bc. Then (divide by bd) the ratios a/b and c/d are equal! Problem Set 1.2, page 17 1 u·v =1.4, u·w =0, v ·w =24=w ·v. 2 kuk=1 and kvk=5=kwk. Then 1.4<(1)(5) and 24<(5)(5). 3 Unit vectors v/kvk = (3,4) = (.6,.8) and w/kwk = (4,3) = (.8,.6). The cosine of θ is 5 5 5 5 v · w = 24. The vectors w,u,−w make 0◦,90◦,180◦ angles with w. kvk kwk 25 4 u1 =v/kvk= √110(3,1) and u2 =w/kwk= 13(2,1,2). U1 = √110(1,−3) or √110(−1,3). U2 could be √1 (1,−2,0). 5 5 (a) v·(−v)=−1 (b) (v+w)·(v−w)=v·v+w·v−v·w−w·w =1+( )−( )−1=0 so θ=90◦ (c) (v −2w)·(v +2w)=v ·v −4w ·w =−3 6 (a) cosθ= 1 so θ=60◦ or π radians (b) cosθ=0 so θ=90◦ or π radians (2)(1) 3 2 √ (c) cosθ= −1+3 = 1 so θ=60◦ or π (d) cosθ=−1/ 2 so θ=135◦ or 3π. (2)(2) 2 3 4 7 All vectors w = (c,2c); all vectors (x,y,z) with x+y +z = 0 lie on a plane; all vectors perpendicular to (1,1,1) and (1,2,3) lie on a line. 8 (a) False (b) True: u·(cv +dw)=cu·v +du·w =0 (c) True 9 If v w /v w =−1 then v w =−v w or v w +v w =0. 2 2 1 1 2 2 1 1 1 1 2 2 10 Slopes 2 and −1 multiply to give −1: perpendicular. 1 2 11 v ·w <0 means angle >90◦; this is half of the plane. 12 (1,1)perpendicularto(1,5)−c(1,1)if6−2c=0orc=3;v·(w−cv)=0ifc=v·w/v·v. 13 v =(1,0,−1),w =(0,1,0). 14 u =(1,−1,0,0),v =(0,0,1,−1),w =(1,1,−1,−1). √ √ √ 15 1(x+y)=5; cosθ=2 16/ 10 10=.8. 2 16 kvk2 =9 so kvk=3; u = 1v; w =(1,−1,0,...,0). 3 √ √ 17 cosα=1/ 2, cosβ =0, cosγ =−1/ 2, cos2α+cos2β+cos2γ =(v2+v2+v2)/kvk2 =1. 1 2 3 5 18 kvk2 =42+22 =20,kwk2 =(−1)2+22 =5,k(3,4)k2 =25=20+5. 19 v −w = (5,0) also has (length)2 = 25. Choose v = (1,1) and w = (0,1) which are not perpendicular; (length of v)2+(length of w)2 =12+12+12 but (length of v −w)2 =1. 20 (v+w)·(v+w)=(v+w)·v+(v+w)·w =v·(v+w)+w·(v+w)=v·v+v·w+w·v+w·w = v ·v +2v ·w +w ·w. Notice v ·w =w ·v! 21 2v ·w ≤2kvkkwk leads to kv +wk2 =v ·v +2v ·w +w ·w ≤kvk2+2kvkkwk+kwk2 = (kvk+kwk)2. 22 Compare v ·v +w ·w with (v −w)·(v −w) to find that −2v ·w =0. Divide by −2. 23 cosβ =w /kwkandsinβ =w /kwk. Thencos(β−a)=cosβcosα+sinβsinα=v w /kvkkwk+ 1 2 1 1 v w /kvkkwk=v ·w/kvkkwk. 2 2 24 Weknowthat(v−w)·(v−w)=v·v−2v·w+w·w. TheLawofCosineswriteskvkkwkcosθ for v ·w. When θ<90◦ this is positive and v ·v +w ·w is larger than kv −wk2. 25 (a) v2w2+2v w v w +v2w2 ≤v2w2+v2w2+v2w2+v2w2 is true because the difference is 1 1 1 1 2 2 2 2 1 1 1 2 2 1 2 2 v2w2+v2w2−2v w v w which is (v w −v w )2 ≥0. 1 2 2 1 1 1 2 2 1 2 2 1 26 Example 6 gives |u ||U | ≤ 1(u2+U2) and |u ||U | ≤ 1(u2+U2). The whole line becomes 1 1 2 1 1 2 2 2 2 2 .96≤(.6)(.8)+(.8)(.6)≤ 1(.62+.82)+ 1(.82+.62)=1. 2 2 27 The cosine of θ is x/px2+y2, near side over hypotenuse. Then |cosθ|2 =x2/(x2+y2)≤1. 28 Tryv =(1,2,−3)andw =(−3,1,2)withcosθ= −7 andθ=120◦. Writev·w =xz+yz+xy 14 as 1(x+y+z)2−1(x2+y2+z2). Ifx+y+z=0thisis−1(x2+y2+z2),sov·w/kvkkwk=−1. 2 2 2 2 29 The length kv −wk is between 2 and 8. The dot product v ·w is between −15 and 15. 30 The vectors w =(x,y) with v ·w =x+2y =5 lie on a line in the xy plane. The shortest w is (1,2) in the direction of v. 31 Three vectors in the plane could make angles >90◦ with each other: (1,0),(−1,4),(−1,−4). Four vectors could not do this (360◦ total angle). How many can do this in R3 or Rn? Problem Set 1.3 1 (x,y,z)=(2,0,0) and (0,6,0); n =(3,1,−1); dot product (3,1,−1)·(2,−6,0)=0. 2 4x−y−2z=1isparalleltoeveryplane4x−y−2z=dandperpendicularton =(4,−1,−2). 3 (a) True (assuming n 6=0) (b) False (c) True. 4 (a) x+5y+2z=14 (b) x+5y+2z=30 (c) y=0. 5 The plane changes to the symmetric plane on the other side of the origin. 6 x−y−z=0. 7 x+4y=0; x+4y=14. 8 u =(2,0,0), v =(0,2,0), w =(0,0,2). Need c+d+e=1. 6 9 x+4y+z+2t=8. 10 x−4y+2z=0. 11 We choose v = (6,0,0) and then in-plane vectors (3,1,0) and (1,0,1). The points on the 0 plane are v +y(3,1,0)+z(1,0,1). 0 12 v =(0,0,0); all vectors in the plane are combinations y(−2,1,0)+z(1,0,1). 0 2 13 v =(0,0,0); all solutions are combinations y(−1,1,0)+z(−1,0,1). 0 14 Particular point (9,0); solution (3,1); points are (9,0)+y(3,1)=(3y+9,y). 15 v = (24,0,0,0); solutions (−2,1,0,0) and (−3,0,1,0) and (−4,0,0,1). Combine to get 0 (24−2y−3z−4t,y,z,t). 16 Choose v =(0,6,0) with two zero components. Then set components to 1 to choose (1,0,0) 0 and (0,−3/2,1). Combinations are (x,6− 3z,z). 2 √ √ √ 17 Now |d|/knk=12/ 56=12/2 14=6/ 14. Same answer because same plane. 18 (a) |d|/knk=18/3=6 and v =(4,4,2) (b) |d|/knk=0 and v =0 √ (c) |d|/knk=6/ 2 and v =3n =(3,0,−3). 19 (a) Shortest distance is along perpendicular to line (b) Need t+4t=25 or t=5 √ (c) The distance to (5,−10) is 125. 20 (a) n = (a,b) (b) t = c/(a2 + b2) (c) This distance to tn = (ca,cb)/(a2 + b2) is √ |c|/ a2+b2. 21 Substitutex=1+t,y=2t,z=5−2ttofind(1+t)+2(2t)−2(5−2t)=27or−9+9t=27 or t=4. Then ktnk=12. 22 Shortest distance in the direction of n; w +tn lies on the plane when n ·w +tn ·n = d or t=(d−n·w)/n·n. The distance is |d−n·w|/knk (which is |d|/knk when w =0). 23 The vectors (1,2,3) and (1,−1,−1) are perpendicular to the line. Set x=0 to find y =−16 and z = 14. Set y = 0 to find x = 9/2 and z = 5/2. These particular points are (0,−16,14) and (9/2,0,5/2). 24 (a) n =(1,1,1,−1) (b) |d|/knk= 1 (c) dn/n·n =(1,1,1,−1) 2 4 4 4 4 (d) v =(1,0,0,0) (e) (−1,1,0,0), (−1,0,1,0), (1,0,0,1) 0 (f) all points (1−y−z+t,y,z,t). 25 n =(1,1,1) or any nonzero (c,c,c). √ √ 26 cosθ=(0,1,1)·(1,0,1)/ 2 2= 1 so θ=60◦. 2 Problem Set 2.1, page 29 1 The planes x=2 and y=3 and z=4 are perpendicular to the x,y,z axes. 2 Thevectorsarei =(1,0,0)andj =(0,1,0)andk =(0,0,1)andb =(2,3,4)=2i+3j +4k. 7 3 The planes are the same: 2y = 6 is y = 3, and 3z = 12 is z = 4. The solution is the same intersection point. The columns are changed; but same combination x =x. b 4 The solution is not changed; the second plane and row 2 of the matrix and all columns of the matrix are changed. 5 If z =2 then x+y =0 and x−y =z give the point (1,−1,2). If z =0 then x+y =6 and x−y=4 give the point (5,1,0). Halfway between is (3,0,1). 6 If x,y,z satisfy the first two equations they also satisfy the third equation. The line L of solutions contains v = (1,1,0) and w = (1,1,1) and u = 1v + 1w and all combinations 2 2 2 2 cv +dw with c+d=1. 7 Equation 1+ equation 2− equation 3 is now 0=−4. Solution impossible. 8 Column 3= Column 1; solutions (x,y,z)=(1,1,0) or (0,1,1) and you can add any multiple of (−1,0,1); b =(4,6,c) needs c=10 for solvability. 9 Fourplanesin4-dimensionalspacenormallymeetatapoint. ThesolutiontoAx =(3,3,3,2) is x =(0,0,1,2) if A has columns (1,0,0,0),(1,1,0,0),(1,1,1,0),(1,1,1,1). 10 Ax =(18,5,0), Ax =(3,4,5,5). 11 Nine multiplications for Ax =(18,5,0). 12 (14,22) and (0,0) and (9,7). 13 (z,y,x) and (0,0,0) and (3,3,6). 14 (a) x has n components, Ax has m components (b) Planes in n-dimensional space, but the columns are in m-dimensional space. 15 2x+3y+z+5t=8 is Ax =b with the 1 by 4 matrix A=[2 3 1 5]. The solutions x fill a 3D “plane” in 4 dimensions. 1 0 0 1 16 I = , P = . 0 1 1 0 0 1 −1 0 17 R= , 180◦ rotation from R2 = =−I. −1 0 0 −1 0 1 0 0 0 1 18 P =0 0 1 produces (y,z,x) and Q=1 0 0 recovers (x,y,z). 1 0 0 0 1 0 1 0 0 1 0 19 E = , E =−1 1 0. −1 1 0 0 1 1 0 0 1 0 0 20 E =0 1 0, E−1 = 0 1 0, Ev =(3,4,8), E−1Ev =(3,4,5). 1 0 1 −1 0 1 1 0 0 0 5 0 21 P1 = , P2 = , P1v = , P2P1v = . 0 0 0 1 0 0 8 √ √ 2 − 2 22 R= 1√ √ . 2 2 2 x 23 The dot product [1 4 5]y = (1 by 3)(3 by 1) is zero for points (x,y,z) on a plane in z three dimensions. The columns of A are one-dimensional vectors. 24 A=[1 2 ; 3 4] and x =[5 −2]0 and b =[1 7]0. r =b−A∗x prints as zero. 25 A∗v =[3 4 5]0 and v0∗v =50; v ∗A gives an error message. 26 ones(4,4)∗ones(4,1)=[4 4 4 4]0; B∗w =[10 10 10 10]0. 27 The row picture has two lines meeting at (4,2). The column picture has 4(1,1)+2(−2,1)= 4(column 1)+2(column 2)= right side (0,6). 28 Therowpictureshows2planesin3-dimensionalspace. Thecolumnpictureisin2-dimensional space. The solutions normally lie on a line. 29 Therowpictureshowsfourlines. Thecolumnpictureisinfour-dimensionalspace. Nosolution unless the right side is a combination of the two columns. .7 .65 30 u2 = , u3 = . The components always add to 1. They are always positive. .3 .35 31 u ,v ,w are all close to (.6,.4). Their components still add to 1. 7 7 7 .8 .3 .6 .6 .8 .3 32 = = steady state s. No change when multiplied by . .2 .7 .4 .4 .2 .7 8 3 4 5+u 5−u+v 5−v 34 M =1 5 9=5−u−v 5 5+u+v; M3(1,1,1)=(15,15,15); 6 7 2 5+v 5+u−v 5−u M (1,1,1,1)=(34,34,34,34) because the numbers 1 to 16 add to 136 which is 4(34). 4 Problem Set 2.2, page 40 1 Multiply by l= 10 =5 and subtract to find 2x+3y=14 and −6y=6. 2 2 y = −1 and then x = 2. Multiplying the right side by 4 will multiply (x,y) by 4 to give the solution (x,y)=(8,−4). 3 Subtract−1 timesequation1(oradd 1 timesequation1). Thenewsecondequationis3y=3. 2 2 Then y=1 and x=5. If the right side changes sign, so does the solution: (x,y)=(−5,−1). 4 Subtractl= c timesequation1. Thenewsecondpivotmultiplyingyisd−(cb/a)or(ad−bc)/a. a Then y=(ag−cf)/(ad−bc). 5 6x+4y is 2 times 3x+2y. There is no solution unless the right side is 2·10=20. Then all points on the line 3x+2y=10 are solutions, including (0,5) and (4,−1). 9 6 Singular system if b=4, because 4x+8y is 2 times 2x+4y. Then g=2·16=32 makes the system solvable. The lines become the same: infinitely many solutions like (8,0) and (0,4). 7 If a=2 elimination must fail. The equations have no solution. If a=0 elimination stops for a row exchange. Then 3y=−3 gives y=−1 and 4x+6y=6 gives x=3. 8 If k =3 elimination must fail: no solution. If k =−3, elimination gives 0=0 in equation 2: infinitely many solutions. If k=0 a row exchange is needed: one solution. 9 6x−4y is 2 times (3x−2y). Therefore we need b =2b . Then there will be infinitely many 2 1 solutions. 10 The equation y=1 comes from elimination. Then x=4 and 5x−4y=c=16. 11 2x + 3y + z = 8 x = 2 y + 3z = 4 gives y = 1 If a zero is at the start of row 2 or 3, 8z = 8 z = 1 that avoids a row operation. 12 2x − 3y =3 2x − 3y =3 x=3 Subtract 2×row 1 from row 2 y + z =1 gives y + z =1 and y=1 Subtract 1×row 1 from row 3 2y − 3z =2 − 5z =0 z=0 Subtract 2×row 2 from row 3 13 Subtract 2 times row 1 from row 2 to reach (d−10)y−z =2. Equation (3) is y−z =3. If d=10 exchange rows 2 and 3. If d=11 the system is singular; third pivot is missing. 14 The second pivot position will contain −2−b. If b=−2 we exchange with row 3. If b=−1 (singular case) the second equation is −y−z=0. A solution is (1,1,−1). 15 0x+0y+2z=4 0x+3y+4z=4 (a) x+2y+2z=5 (b) x+2y+2z=5 0x+3y+4z=6 0x+3y+4z=6 (exchange 1 and 2, then 2 and 3) (rows 1 and 3 are not consistent) 16 Ifrow1=row2,thenrow2iszeroafterthefirststep;exchangethezerorowwithrow3and there is no third pivot. If column 1= column 2 there is no second pivot. 17 x+2y+3z=0, 4x+8y+12z=0, 5x+10y+15z=0 has infinitely many solutions. 18 Row 2 becomes 3y−4z = 5, then row 3 becomes (q+4)z = t−5. If q = −4 the system is singular — no third pivot. Then if t = 5 the third equation is 0 = 0. Choosing z = 1 the equation 3y−4z=5 gives y=3 and equation 1 gives x=−9. 19 (a) Another solution is 1(x+X,y+Y,z+Z). (b) If 25 planes meet at two points, they 2 meet along the whole line through those two points. 20 Singular if row 3 is a combination of rows 1 and 2. From the end view, the three planes form a triangle. This happens if rows 1+2 = row 3 on the left side but not the right side: for example x+y+z=0, x−2y−z=1, 2x−y=1. No parallel planes but still no solution. 21 Pivots 2, 3, 4, 5 in the equations 2x+y=0, 3y+z=0, 4z+t=0, 5t=5. Solution t=4, 2 3 4 2 3 4 z=−3, y=2, x=−1. 22 The solution is (1,2,3,4) instead of (−1,2,−3,4). 10 23 The fifth pivot is 6. The nth pivot is (n+1). 5 n 1 1 1 1 1 1 24 A=a a+1 a+1 for any a,b,c leads to U =0 1 1. b b+c b+c+3 0 0 3 a 2 25 Elimination fails on if a=2 or a=0. a a 26 a=2 (equal columns), a=4 (equal rows), a=0 (zero column). 1 3 0 4 27 Solvable for s=10 (add equations); and . A=[1 1 0 0; 1 0 1 0; 1 7 2 6 0 0 1 1; 0 1 0 1] and U =[1 1 0 0; 0 −1 1 0; 0 0 1 1; 0 0 0 0]. 28 Elimination leaves the diagonal matrix diag(3,2,1). Then x=1,y=1,z=4. 29 A(2,:)=A(2,:)−3∗A(1,:) Subtracts 3 times row 1 from row 2. 30 The average pivots for rand(3) without row exchanges were 1,5,10 in one experiment—but 2 pivots2and3canbearbitrarilylarge. Theiraveragesareactuallyinfinite! Withrowexchanges inMATLAB’slucode, theaverages.75and.50and.365aremuchmorestable(andshouldbe predictable, also for randn with normal instead of uniform probability distribution). Problem Set 2.3, page 50 1 0 0 1 0 0 1 0 0 0 1 0 0 1 0 1 E21 =−5 1 0, E32 =0 1 0, P =0 0 11 0 0=0 0 1. 0 0 1 0 7 1 0 1 0 0 1 0 1 0 0 2 E E b =(1,−5,−35) but E E b =(1,−5,0). Then row 3 feels no effect from row 1. 32 21 21 32 1 0 0 1 0 0 1 0 0 1 0 0 3 −4 1 0,0 1 0,0 1 0 E , E , E −4 1 0. 21 31 32 0 0 1 2 0 1 0 −2 1 M =E E E 10 −2 1 32 31 21 1 1 1 1 4 Elimination on column 4: b = 0 → −4 → −4 → −4. Then back substitution in 0 0 2 10 Ux =(1,−4,10) gives z=−5, y= 1, x= 1. This solves Ax =(1,0,0). 2 2 5 Changing a from 7 to 11 will change the third pivot from 5 to 9. Changing a from 7 to 2 33 33 will change the pivot from 5 to no pivot. 6 If all columns are multiples of column 1, there is no second pivot. 1 0 0 7 To reverse E31, add 7 times row 1 to row 3. The matrix is R31 =0 1 0. 7 0 1 8 The same R from Problem 7 is changed to I. Thus E R =R E =I. 31 31 31 31 31