Docsity

Linear Algebra Assignment Solutions for CMSC/MAPL 460 by Dr. Wolfe - Prof. Peter Wolfe, Assignments of Mathematics

Toggle sidebar
bg1
CMSC/MAPL 460 Dr. Wolfe ASSIGNMENT #2 Due March 5, 2001
1. Ex. 2.1, parts (a),(d), p.42, Shampine, Allen & Preuss.
2. Ex. 2.5, part (a), p.48, Shampine, Allen & Preuss.
3. Ex. 2.6, p.48, Shampine, Allen & Preuss.
4. Consider the linear system
6x1+ 2x2+ 2x3=−2
2x1+2
3x2+1
3x3= 1
x1+ 2x2−x3= 0
(a) Verify that its solution is
x1= 2.6x2=−3.8x3=−5.0
(b) Using four digit floating-point decimal arithmetic with rounding, solve the system
by Gaussian elimination without pivoting.
(c) Repeat part (b) using partial pivoting. In performing the arithmetic operations,
remember to round to four significant digits after each operation, just as would
be done on a computer. If you are careful you should see a significant difference.
5. The Hilbert matrix of order n,Hnis defined by
(Hn)i,j =1
i+j−1, i = 1, . . . , n, j = 1, . . . , n.
Hnis nonsingular. However, as nincreases, the condition number of Hnincreases
rapidly. Hnis a library function in MATLAB, hilb(n). Let n= 10, x=ones(10,1) and
b=Ax. Now use the backslash operator to solve the system Ax=b, obtaining x∗.
Since we know xexactly, we can compute e=x−x∗, the error, and r=b−H10x∗, the
residual. Compute these quantities and also cond(A) (a MATLAB function). Show
that the two basic principles of solving linear systems by G.E./P.P. in floating point
arithmetic hold. Repeat with n= 15.
6. Define the matrix Anof order nby
An=
1−1−1−1· · · −1
0 1 −1−1· · · −1
...
.
.
. 1 −1
0··· 0 1
(a) Find the inverse of Anexplicitly.
pf2

Partial preview of the text

Download Linear Algebra Assignment Solutions for CMSC/MAPL 460 by Dr. Wolfe - Prof. Peter Wolfe and more Assignments Mathematics in PDF only on Docsity!

CMSC/MAPL 460 Dr. Wolfe ASSIGNMENT #2 Due March 5, 2001

  1. Ex. 2.1, parts (a),(d), p.42, Shampine, Allen & Preuss.
  2. Ex. 2.5, part (a), p.48, Shampine, Allen & Preuss.
  3. Ex. 2.6, p.48, Shampine, Allen & Preuss.
  4. Consider the linear system

6 x 1 + 2x 2 + 2x 3 = − 2

2 x 1 +

x 2 +

x 3 = 1

x 1 + 2x 2 − x 3 = 0

(a) Verify that its solution is

x 1 = 2. 6 x 2 = − 3. 8 x 3 = − 5. 0

(b) Using four digit floating-point decimal arithmetic with rounding, solve the system by Gaussian elimination without pivoting. (c) Repeat part (b) using partial pivoting. In performing the arithmetic operations, remember to round to four significant digits after each operation, just as would be done on a computer. If you are careful you should see a significant difference.

  1. The Hilbert matrix of order n, Hn is defined by

(Hn)i,j =

i + j − 1

, i = 1,... , n, j = 1,... , n.

Hn is nonsingular. However, as n increases, the condition number of Hn increases rapidly. Hn is a library function in MATLAB, hilb(n). Let n = 10, x=ones(10,1) and b = Ax. Now use the backslash operator to solve the system Ax = b, obtaining x∗. Since we know x exactly, we can compute e = x−x∗, the error, and r = b−H 10 x∗, the residual. Compute these quantities and also cond(A) (a MATLAB function). Show that the two basic principles of solving linear systems by G.E./P.P. in floating point arithmetic hold. Repeat with n = 15.

  1. Define the matrix An of order n by

An =

(a) Find the inverse of An explicitly.

Hint: Find the inverse of A 6 by using MATLAB. Then use the result to “guess” the inverse of An in general. (b) Calculate cond(An) in the ∞-norm. (c) With b = [−n + 2, −n + 3,... , − 1 , 0 , 1]T^ , the solution of Anx = b is x = [1, 1 ,... , 1]T^. Perturb b to bˆ = b + [0,... , 0 , ≤]T^. Solve for ˆx in Anˆx = ˆb. Show that these values of b, ˆb, x, ˆx satisfy the fundamental inequality,

‖x − ˆx‖ ‖x‖

≤ cond(An)

‖b − bˆ‖ ‖b‖

(Use the ∞-norm.) Hint ˆx = x + A− n 1 (ˆb − b).

  1. Suppose x satisfies Ax = b and x + ∆x satisfies (A + ∆A)(x + ∆x) = b + ∆b. Then we have the condition number inequality: If ρ = ‖A−^1 ‖‖∆A‖ < 1

‖∆x‖ ‖x‖

cond(A) 1 − ρ

‖∆A‖

‖A‖

‖∆b‖ ‖b‖

Consider the linear system Ax = b where

A =

 (^) , b =

(a) Solve Ax = b using the backslash operator. (b) Use equation (1) to answer the following question: If each entry in A and b might have an error of ±.00005, how reliable is x? Use the ∞-norm. (c) Let

∆A =. 0001 ∗rand(3)−. 00005 ∗ones(3), ∆b =. 0001 ∗rand(3, 1)−. 00005 ∗ones(3, 1).

Solve (A + ∆A)(x + ∆x) = b + ∆b to get x + ∆x. Calculate ‖∆x‖/‖x‖. Is this consistent with (b)?

(a) Let A be an n × n matrix and x ∈ Rn. How many flops does it take to form the product Ax? (b) Let A and B be n × n matrices. How many flops does it take to form the product AB? (c) In light of the results of (a) and (b), from the standpoint of efficiency, how should one compute Akx for k a positive integer, k > 1?