Docsity

Study Guide for Exam - Numerical Linear Algebra | MATH 170A, Study notes of Mathematics

Toggle sidebar
bg1
Instructor: Emre Mengi
Math 170A (Winter 2009)
Study Guide for Weeks 6-7
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.
•Definitions of absolute and relative condition numbers of a numerical problem (see question
2below)
•Definition of the condition number of a matrix (section 2.2)
•Absolute and relative condition numbers for the following numerical problems and their
relations with the condition number of a matrix
–The matrix-vector product Ax as a function of x
–The solution xof the linear system Ax =bas a function of b(section 2.3)
–The solution xof Ax =bas a function of A(section 2.3)
•Large multipliers in LU factorization may cause large (backward) error and must be avoided.
(see question 1below)
•The computed LU factorization ˆ
Lˆ
Uwhen partial pivoting is used has a backward error
E:= P A −ˆ
Lˆ
Uwith small norm. (section 2.7; specifically see theorem 2.7.13; note that the
factor of 2 in the upper bound can be removed.)
•The backward errors by forward substitution and back substitution have small norms. (sec-
tion 2.7; see theorem 2.7.2 and corollary 2.7.9; again the factor of 2 in the upper bounds can
be removed.)
•The total backward error of GEPP (section 2.7; see theorem 2.7.14; once again the scalar 6
in the upper bound can be replaced by 3.)
•The forward error of GEPP deduced by means of the backward error; Let ˆxbe the computed
solution of Ax =bsatisfying (A+δA)ˆx=bwhere kδAk ≤ machckAk. Then
kˆx−xk
kxk
| {z }
forward error
≤mach c
| {z }
backward error
kAkkA−1k
| {z }
condition number
.
•Definition of the least squares problem (section 3.1, page 184)
•How to express a line or polynomial fitting problem as a least squares problem (section 3.1,
pages 181-183)
pf3
pf4

Partial preview of the text

Download Study Guide for Exam - Numerical Linear Algebra | MATH 170A and more Study notes Mathematics in PDF only on Docsity!

Instructor: Emre Mengi

Math 170A (Winter 2009)

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.

  • Definitions of absolute and relative condition numbers of a numerical problem (see question 2 below)
  • Definition of the condition number of a matrix (section 2.2)
  • Absolute and relative condition numbers for the following numerical problems and their relations with the condition number of a matrix - The matrix-vector product Ax as a function of x - The solution x of the linear system Ax = b as a function of b (section 2.3) - The solution x of Ax = b as a function of A (section 2.3)
  • Large multipliers in LU factorization may cause large (backward) error and must be avoided. (see question 1 below)
  • The computed LU factorization Lˆ Uˆ when partial pivoting is used has a backward error E := P A − Lˆ Uˆ with small norm. (section 2.7; specifically see theorem 2.7.13; note that the factor of 2 in the upper bound can be removed.)
  • The backward errors by forward substitution and back substitution have small norms. (sec- tion 2.7; see theorem 2.7.2 and corollary 2.7.9; again the factor of 2 in the upper bounds can be removed.)
  • The total backward error of GEPP (section 2.7; see theorem 2.7.14; once again the scalar 6 in the upper bound can be replaced by 3.)
  • The forward error of GEPP deduced by means of the backward error; Let ˆx be the computed solution of Ax = b satisfying (A + δA)ˆx = b where ‖δA‖ ≤ machc‖A‖. Then

‖xˆ − x‖ ‖x‖ ︸ ︷︷ ︸ forward error

≤  ︸ ︷︷ ︸mach c backward error

‖A‖‖A−^1 ‖

condition number

  • Definition of the least squares problem (section 3.1, page 184)
  • How to express a line or polynomial fitting problem as a least squares problem (section 3.1, pages 181-183)

Homework 6 (due on March 2nd, Monday by 3pm)

In Matlab question (question 4 ) attach your Matlab plots and outputs. Questions with (*) may be more challenging.

  1. Consider the matrix

A =

[

10 −^8

]

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.

  • plot growth factor.m (plots ρmax with respect to the size of the matrix n for a given class of matrices)
  • plot condition factor.m (plots the condition number κ(A) = ‖A‖ 1 ‖A−^1 ‖ 1 with respect to the size of the matrix n for a given class of matrices)
  • growth factor (computes the growth factor of a matrix; this is an auxiliary m-file called by plot growth factor.m)

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.)