Manual For Instructors: TO Linear Algebra Fifth Edition
Manual For Instructors: TO Linear Algebra Fifth Edition
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: [email protected]
Box 812060
Wellesley, Massachusetts 02482
Solutions to Exercises 169
1 Without exchange, pivots .001 and 1000; with exchange, 1 and −1. When the pivot is
1 1 1
|entry|
larger than the entries below it, all |ℓij | = ≤ 1. A = 0 1 −1 .
|pivot|
−1 1 1
9 −36 30
2 The exact inverse of hilb(3) is A−1 = −36 192 −180 .
30 −180 180
1 11/6 1.833 0 1.80
3 A 1 = 13/12 = 1.083 compares with A 6 = 1.10 . k∆bk < .04 but
1 47/60 0.783 −3.6 0.78 k∆xk > 6.
The difference (1, 1, 1) − (0, 6, −3.6) is in a direction ∆x that has A∆x near zero.
4 The largest kxk = kA−1 bk is kA−1 k = 1/λmin since AT = A; largest error 10−16 /λmin .
of x (already known from below) and divide by the pivot. Total for n rows < wn.
1 2
6 The triangular L−1 , U −1 , R−1 need 2
n multiplications. Q needs n2 to multiply the
right side by Q−1 = QT . So QRx = b takes 1.5 times longer than LU x = b.
10−9 , 10−12 , 10−15 are of order 10−16 , 10−11 , 10−7 , 10−4 , 10−3 .
√ √ 1 3 1 −1 10 14
11 (a) cos θ = 1/ 10, sin θ = −3/ 10, R = √110 = √1
10
.
−3 1 3 5 0 8
(b) A has eigenvalues
4 and 2. Put one eigenvectors in row 1 of Q: either
of the unit
1 1 −1 2 −4
Q= √ and QAQ−1 = or
2 1 1 0 4
1 1 −3 4 −4
Q= √ and QAQ−1 = .
10 3 1 0 2
12 When A is multiplied by a plane rotation Qij , this changes the 2n (not n2 ) entries in
rows i and j. Then multiplying on the right by (Qij )−1 = (Qij )T changes the 2n
entries in columns i and j.
13 Qij A uses 4n multiplications (2 for each entry in rows i and j). By factoring out cos θ,
the entries 1 and ± tan θ need only 2n multiplications, which leads to 23 n3 for QR.
1
14 The (2, 1) entry of Q21 A is 3 (− sin θ + 2 cos θ). This is zero if sin θ = 2 cos θ or
√ √ √
tan θ = 2. Then the 2, 1, 5 right triangle has sin θ = 2/ 5 and cos θ = 1/ 5.
15 This problem shows how elimination is more expensive (the nonzero multipliers in L
and LL are counted by nnz(L) and nnz(LL)) when we spoil the tridiagonal K by a
random permutation.
If on the other hand we start with a poorly ordered matrix K, an improved ordering
is found by the code symamd discussed in this section.
Solutions to Exercises 171
16 The “red-black ordering” puts rows and columns 1 to 10 in the odd-even order 1, 3, 5, 7,
9, 2, 4, 6, 8, 10. When K is the −1, 2, −1 tridiagonal matrix, odd points are connected
only to even points (and 2 stays on the diagonal, connecting every point to itself):
2 −1
−1 2 −1 2I D
K=
and P KP T =
with
· · · DT 2I
−1 2
−1 1 to 2
−1 −1 3 to 2, 4
D = 0 −1 −1 5 to 4, 6
−1 −1 7 to 6, 8
−1 −1 9 to 8, 10
17 Jeff Stuart’s Shake a Stick activity has long sticks representing the graphs of two linear
equations in the x-y plane. The matrix is nearly singular and Section 9.2 shows how to
compute its condition number c = kAkkA−1 k = σmax /σmin ≈ 80, 000:
kA−1 k ≈ 20000
1 1.0001 −1 −1 1.0001
A= kAk ≈ 2 A = 10000
1 1.0000 1 −1 c ≈ 40000.
3 For the first inequality replace x by Bx in kAxk ≤ kAkkxk; the second inequality is
5 If Λmax = Λmin = 1 then all Λi = 1 and A = SIS −1 = I. The only matrices with
6 All orthogonal matrices have norm 1, so kAk ≤ kQkkRk = kRk and in reverse kRk ≤
kQ−1 kkAk = kAk. Then kAk = kRk. Inequality is usual in kAk < kLkkU k when
AT A 6= AAT . Use norm on a random A.
7 The triangle inequality gives kAx + Bxk ≤ kAxk + kBxk. Divide by kxk and take
10 (a) The condition number of A−1 is kA−1 kk(A−1 )−1 k which is kA−1 kkAk = c(A).
(b) Since AT A and AAT have the same nonzero eigenvalues, AT has the same norm
as A.
11 Use the quadratic formula for λmax /λmin , which is c = σmax /σmin since this A = AT
is positive definite:
p √
c(A) = 1.00005 + (1.00005)2 − .0001 / 1.00005 − ≈ 40, 000.
12 det(2A) is not 2 det A; det(A + B) is not always less than det A + det B; taking
| det A| does not help. The only reasonable property is det AB = (det A)(det B). The
condition number should not change when A is multiplied by 10.
16 x21 +· · ·+x2n is not smaller than max(x2i ) and not larger than (|x1 |+· · ·+|xn |)2 = kxk21 .
√
x21 + · · · + x2n ≤ n max(x2i ) so kxk ≤ nkxk∞ . Choose yi = sign xi = ±1 to get
√ √
kxk1 = x · y ≤ kxkkyk = nkxk. The vector x = (1, . . . , 1) has kxk1 = n kxk.
17 For the ℓ∞ norm, the largest component of x plus the largest component of y is not
For the ℓ1 norm, each component has |xi + yi | ≤ |xi | + |yi |. Sum on i = 1 to n:
kx + yk1 ≤ kxk1 + kyk1 .
18 |x1 | + 2|x2 | is a norm but min(|x1 |, |x2 |) is not a norm. kxk + kxk∞ is a norm;
kAxk is a norm provided A is invertible (otherwise a nonzero vector has norm zero;
for rectangular A we require independent columns to avoid kAxk = 0).
that the errors do not approach zero. We can’t expect convergence when A is singular
and Ax = b is unsolvable!
0 1
6 Jacobi has S −1 T = 13 with |λ|max = 1 . Small problem, fast convergence.
3
1 0
1
0 3 1
7 Gauss-Seidel has S −1 T = with |λ|max = 9 which is (|λ|max for Jacobi)2 .
1
0 9
−1
a 0 −b 0 −b/a
8 Jacobi has S −1 T = = with |λ| = |bc/ad|1/2 .
d −c 0 −c/d 0
−1
a 0 0 −b 0 −b/a
Gauss-Seidel has S −1 T = = with |λ| = |bc/ad|.
c d 0 0 0 −bc/ad
So Gauss-Seidel is twice as fast to converge if |λ| < 1 (or to explode if |bc| > |ad|).
π
9 Gauss-Seidel will converge for the −1, 2, −1 matrix. |λ|max = cos2 n+1
is given
on page 527, together with the improvement from successive overrelaxation.
11 uk /λk1 = c1 x1 + c2 x2 (λ2 /λ1 )k + · · · + cn xn (λn /λ1 )k → c1 x1 if all ratios |λi /λ1 | <
0 1
1. The largest ratio controls the rate of convergence (when k is large). A =
1 0
has |λ2 | = |λ1 | and no convergence.
12 The eigenvectors of A and also A−1 are x1 = (.75, .25) and x2 = (1, −1). The inverse
(j−1)π
jπ
13 In the jth component of Ax1 , λ1 sin n+1 jπ
= 2 sin n+1 − sin n+1 − sin (j+1)π
n+1 .
jπ π π
The last two terms combine into −2 sin n+1 cos n+1 . Then λ1 = 2 − 2 cos n+1 .
Solutions to Exercises 175
2 −1 1 2 5 14
14 A = produces u0 = , u1 = , u2 = , u3 = .
−1 2 0 −1 −4 −13
1
This is converging to the eigenvector direction with largest eigenvalue λ = 3.
−1
Divide uk by kuk k to keep unit vectors.
1 2 1 2 5 14 1/2
15 A−1 = gives u1 = 1 , u2 = 1 , u3 = 1 → u∞ = .
3 1 2 3 1 9 4 27 13 1/2
1 cos θ sin θ cos θ(1 + sin2 θ) − sin3 θ
16 R = QT A = and A1 = RQ = .
0 − sin2 θ − sin3 θ − cos θ sin2 θ
17 If A is orthogonal then Q = A and R = I. Therefore A1 = RQ = A again, and the
“QR method” doesn’t move from A. But shift A slightly and the method goes quickly
to Λ.
20 Theoretically the q’s are orthonormal. In reality this important algorithm is not very
stable. We must stop every few steps to reorthogonalize—or find another more stable
way to orthogonalize the sequence q, Aq, A2 q, . . .
R(QR)R−1 = RAR−1 has R and R−1 upper triangular, so A1 cannot have nonzeros
on a lower diagonal than A. If A is tridiagonal and symmetric then (by using symmetry
for the upper part of A1 ) the matrix A1 = RAR−1 is also tridiagonal.
(q T
1 Aq 1 )q 1 . The dot product with q 1 is zero. This is Gram-Schmidt with Aq 1 as the
second input vector; we subtract from Aq 1 its projection onto the first vector q 1 .
176 Solutions to Exercises
Note The three lines after the short “pseudocodes” describe two key properties of con-
jugate gradients—the residuals r k = b − Axk are orthogonal and the search directions
are A-orthogonal (dT
i Adk = 0). Then each new approximation xk+1 is the closest
symmetric if A = AT , and since H has only one lower diagonal by construction, then
H has only one upper diagonal: H is tridiagonal and all the recursions in Arnoldi’s
method have only 3 terms.
Arnoldi). When Arnoldi is stopped sooner because the matrix size is large, the eigen-
values of Hk (called Ritz values) are close to eigenvalues of A. This is an important
way to compute approximations to λ for large matrices.
25 In principle the conjugate gradient method converges in 100 (or 99) steps to the exact
solution x. But it is slower than elimination and its all-important property is to give
good approximations to x much sooner. (Stopping elimination part way leaves you
nothing.) The problem asks how close x10 and x20 are to x100 , which equals x except
for roundoff errors.
1 1 1 q
26 A = has An = with q = 1 + 1.1 + · · · + (1.1)n−1 =
0 1.1 0 (1.1)n
0 10
(1.1n − 1)/(1.1 − 1) ≈ 10 (1.1)n . So the growing part of An is (1.1)n
0 1
√
with ||An || ≈ 101 times 1.1n for larger n.