

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


CMSC/MAPL 460 Dr. Wolfe ASSIGNMENT #2 Due March 5, 2001
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.
(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.
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).
‖∆x‖ ‖x‖
cond(A) 1 − ρ
‖∆b‖ ‖b‖
Consider the linear system Ax = b where
(^) , 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?