


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!



Instructor: Emre Mengi
Study Guide for Weeks 6- This homework concerns the condition numbers (sections 2.2, 2.3), backward error analysis of Gaus- sian elimination (section 2.7), the (discrete) least squares problem (section 3.1). Before attempting homework 6 please make sure that you have understood the topics listed below. The short-hand GEPP is used for Gaussian elimination with partial pivoting.
‖xˆ − x‖ ‖x‖ ︸ ︷︷ ︸ forward error
≤ ︸ ︷︷ ︸mach c backward error
condition number
In Matlab question (question 4 ) attach your Matlab plots and outputs. Questions with (*) may be more challenging.
A =
Suppose Lˆ Uˆ is the computed LU factorization for A in single precision by Gaussian elimination without pivoting in part (a) and with partial pivoting in part (b). Define the growth factor
ρmax :=
maxi,j |ˆuij | maxi,j |aij |
(Note : mach ≈ 6 × 10 −^8 in single percision)
(a) For Gaussian elimination without pivoting write down the computed factors Lˆ and Uˆ as well as the matrix E = A − Lˆ Uˆ. Provide also ‖E‖ 1 and ρmax.
(b) Repeat part (a) for GEPP. Note that the error matrix is now defined as E := P A − Lˆ Uˆ where P is the permutation matrix corresponding to the row swap performed.
2.(*) The aim of this question is to perform a backward error analysis to determine the forward error involved in the computation of (A + B)x where A, B ∈ Rn×n^ and x ∈ Rn. Here assume that A + B is invertible. In IEEE arithmetic (actually in any finite precision floating point arithmetic) the computation y = Ax can be performed such that the computed value ˜y satisfies
y˜ = (A + δA˜)x for some δA˜ such that ‖ δA˜‖ 1 ≤ nmach‖A‖ 1 + o(mach).
Here o(mach) represents terms such as ^2 mach converging to zero faster than mach as mach → 0. On the other hand the addition C = A + B can be performed such that the computed sum Cˆ satisfies
Cˆ = (A + B + δ ) for some δ such that ‖δ ‖ 1 ≤ mach‖A + B‖ 1.
(a) Define f : Rn×n^ → Rn^ as f (A) = (A + B)x for a fixed x ∈ Rn^ and B ∈ Rn×n. Show that the absolute condition number of f given by
κδ(A) = sup‖δA‖ 1 ≤δ
‖f (A + δA) − f (A)‖ 1 ‖δA‖ 1
satisfies the inequality κδ(A) ≤ ‖x‖ 1.
(b) Let f be as defined in part (a). Show that the relative condition number of f given by
˜κδ(A) = κδ(A)/
‖f (A)‖ 1 ‖A‖ 1
satisfies κ˜δ(A) ≤ ‖(A + B)−^1 ‖ 1 ‖A‖ 1.
You will only need to call the first two m-files above (unless you would like to entertain yourself with further numerical experiments), but you need to save all three on your computer. Both of the first two routines take three parameters. The first two are integers lb, ub which determine the interval [lb, ub] in which the size of the matrix n varies. The third is a string (such as ‘lotkin’, ‘kahan’, ‘leslie’, ‘randn’) identifying the family of matrices. The question is “what are the allowable families?” There is a built-in Matlab routine called gallery. It generates matrices from various families. You can type help gallery for the names of the specific families. Most of the families that can be generated by gallery are allowable families for plot growth factor.m and plot condition factor.m. But you will specifically experiment with ‘lotkin’, ‘ris’, ‘riemann’ and ‘chebvand’. (Though yet again feel free to entertain yourself with others.) For instance the commands
plot_growth_factor(5,50,’riemann’); plot_condition_number(5,50,’riemann’);
plot ρmax and κ(A) for the Riemann matrices with sizes varying in between 5 and 50.
(a) Plot the growth factors for ‘lotkin’, ‘ris’, ‘riemann’ and ‘chebvand’ with sizes varying in [5, 50]. Do you observe ρmax exceeding
n significantly?
(b) Plot the condition numbers for ‘lotkin’, ‘ris’, ‘riemann’ and ‘chebvand’ with sizes varying in [5, 10]. Order these families according to their condition numbers.
(c) Consider the 10×10 linear systems Ax = b with A equal to one of ‘lotkin’, ‘ris’, ‘riemann’ and ‘chebvand’. For each of the matrices ‘lotkin’, ‘ris’, ‘riemann’ and ‘chebvand’ of sizes 10 × 10 repeat the following. Set x equal to the vector of ones, then define b = Ax. Finally attempt to solve the system Aˆx = b.
(i) Based on equation (3) and your observations in part (b) in theory how many of the decimal places of x (the exact solution) and ˆx (the computed solution) would you expect to match? (ii) Now perform the suggested computations in Matlab. You can generate the specific matrices by typing
A = gallery(matname,10); where matname is one of ’lotkin’, ’ris’, ’riemann’ and ’chebvand’. Do you ob- serve the accuracy that you expect in (i)? (Note : To see the computed results in double precision you should type >> format long e; in Matlab.)