Numerical Methods Qualification Exam Problems and Solutions (University of Maryland)/August 2006

From testwiki
Jump to navigation Jump to search

Problem 1

Consider the definite integral

I(f)=abf(x)dx

Let Qn(f) denote the approximation ofI(f) by the composite midpoint rule with n uniform subintervals. For every jβ„€ set

xj=a+jban,xj+12=xj+xj+12.

Let K(x) be defined by

K(x)=12(xxj)2,xj12<x<xj+12.

Assume that fC2([a,b]).

Problem 1a

Show that the quadrature error En(f) satisfies

EnQn(f)I(f)=abK(x)f(x)dx

Hint: Use integration by parts over each subinterval [xj1,xj].

Solution 1a

Integrating K(x)f(x)dx by parts over arbitrary points p and q gives

pqK(x)f(x)dx=[(xxj)f(x)12(xxj)2f(x)]x=px=qpqf(x)dx


Since K(x) is defined on [xj12,xj+12] we use

[p,q]=[xj,xj+12]

and

[p,q]=[xj12,xj]


Using the first interval we get

12[14(xj+1xj)2f(xj+12)+(xj+1xj)f(xj+12)](𝟏)


And for the second we get

12[14(xj1xj)2f(xj12)+(xjxj1)f(xj12)](𝟐)


Since these apply to arbitrary half-subintervals, we can rewrite equation (𝟐) with the its indecies shifted by one unit. The equation for the interval [xj+12,xj+1] is

12[14(xjxj+1)2f(xj+12)+(xj+1xj)f(xj+12)](𝟐)


Combining (𝟏) and (𝟐) and writing it in the same form as the integration by parts, we have

xjxj+1K(x)f(x)dx=(xj+1xj)f(xj+12)xjxj+1f(x)dx


Then our last step is to sum this over all of our n subintervals, noting that xj+1xj=(ba)/n

j=0n1xjxj+1K(x)f(x)dx=j=0n1(xj+1xj)f(xj+12)j=0n1xjxj+1f(x)dxabK(x)f(x)dx=banj=0n1f((xj+xx+1)/2)abf(x)dxabK(x)f(x)dx=Qn(f)I(f)

Problem 1b

Derive a sharp bound on the error of the form

|En(f)|Mnf for every fC2([a,b]).

Here denotes the maximum norm over [a,b]. Recall that the above bound is sharp when the inequality is an equality for some nonzero f.

Solution 1b

Applying the result of part (a), the triangle inequality, and pulling out the constant f(x), we have,


|En(f)|=|abK(x)f(x)dx|ab|K(x)||f(x)|dxf(x)ab|K(x)|dxMn


Mn is some constant less than infinity since [a,b] is compact and |K(x)| is continuous on each of the finite number of intervals for which it is defined.


The above inequality becomes an equality when


f(x)=c,


where c is any constant.

Problem 2

Consider the (unshifted) QR method for finding the eigenvalues of an invertible matrix Aℝn×n

Problem 2a

Give the algorithm.

Solution 2a

The QR algorithm produces a sequence of similar matrices {Ai} whose limit tends towards being upper triangular or nearly upper triangular. This is advantageous since the eigenvalues of an upper triangular matrix lie on its diagonal.


i = 0   
A_1 = A 
while ( error > tolerance  )   
   A_i=Q_i R_i  (QR decomposition/factorization)
   A_{i+1}=R_i Q_i (multiply R and Q, the reverse multiplication)
   i=i+1 (increment)

Problem 2b

Show that each of the matrices An generated by this algorithm are orthogonally similar to A.

Solution 2b

From the factor step (QR decomposition) of the algorithm, we have


Ai=QiRi


which implies


Qi1Ai=Ri


Substituting into the reverse multiply step, we have


Ai+1=RiQi=Qi1AiQi

Problem 2c

Show that if A is upper Hessenberg then so are each of the matrices An generated by this algorithm.


Solution 2c

A series of Given's Rotations matrices pre-multiplying A, a upper Heisenberg matrix, yield an upper triangular matrixR i.e.


G(n1,n)G(2,3)G(1,2)A=R


Since Givens Rotations matrices are each orthogonal, we can write


A=(G(n1,n)G(2,3)G(1,2))TQR


i.e.


A=QR


If we let A0:=A, we have A0=Q0R0, or more generally for k=1,2,3,


Ak=QkRk.


In each case, the sequence of Given's Rotations matrices that compose Q have the following structure


Q=G(1,2)TG2,3TG(n1,n)T=(**000**00000100000100001)(100000**000**00000100001)(100000100000001000000**0000**)=(********0***000**)


So Q is upper Hessenberg.


From the algorithm, we have


Ak+1=RkQk=(****0***00**0000*)(********0***000**)


We conclude Ak+1 is upper Hessenberg because for j=1,2,,n2 the jth column of Ak+1 is a linear combination of the first j+1 columns of Rk since Qk is also upper Hessenberg.

Problem 2d

Let


(3315)


For this A the sequence {An} has a limit. Find this limit. Give your reasoning.

Solution 2d

The eigenvalues of A can be computed. They are 6 and 2. Furthermore, the result of matrix multiplies in the algorithm shows that the diagonal difference, (a1,2a2,1), is constant for all i.


Since the limit of A is an upper triangular matrix with the eigenvalues of A on the diagonal, the limit is


(6202)

Problem 3

Let AℝN×N be symmetric and positive definite. Let bℝN. Consider solving Ax=b using the conjugate gradient method. The nth iterate x(n) then satisfies


x(n)xAyxA for every yx(0)+𝒦n(r(0),A),


where A denotes the vector A-norm, r(0) is the initial residual, and


𝒦n(r(0),A)=span{r(0),Ar(0),,An1r(0)}.

Problem 3a

Prove that the error x(n)x is bounded by


x(n)xApn(A)Ax(0)xA,


where pn(z) is any real polynomial of degree n or less that satisfies pn(0)=1. Here pn(A)A denotes the matrix norm of pn(A) that is induced by the vector A-norm.

Solution 3a

We know that x(n)xAyxA for every yx(0)+𝒦n(r(0),A), so if we can choose a yx(0)+𝒦n(r(0),A) such that


x(n)xAyxApn(A)Ax(0)xA,


then we can solve part a.

Rewrite r^(0)

First note from definition of r(0)


r(0)=Ax(0)b=Ax(0)Ax=A(x(0)x)

Rewrite Krylov space

Therefore, we can rewrite 𝒦n(r(0),A) as follows:


𝒦n(r(0),A)=𝒦n(A(x(0)x),A)=span{A(x(0)x),A2(x(0)x),,An(x(0)x)}

Write y explicitly

We can then write y explicitly as follows:


yx0+𝒦n(r(0),A)x0+𝒦n(A(x(0)x),A)=x0+α1A(x(0)x)+α2A2(x(0)x)++αnAn(x(0)x)for arbitrary real numbers αii=1,2,,n

Substitute and Apply Inequality

We substitute y into the hypothesis inequality and apply a norm inequality of matrix norms to get the desired result.


x(n)xAyxA=(x0x)+α1A(x(0)x)+α2A2(x(0)x)++αnAn(x(0)x)A=αnAn(x(0)x)+αn1An1(x(0)x)++α2A2(x(0)x)+α1A(x(0)x)+(x0x)A=P(A)(x(0)x)AP(A)Ax(0)xA

Problem 3b

Let Tn(z) denote the nth Chebyshev polynomial. Let λmin and λmax denote respectively the smallest and largest eigenvalues of A. Apply the result of part (a) to

pn(z)=Tn(λmax+λmin2zλmaxλmin)Tn(λmax+λminλmaxλmin)

to show that

x(n)xA1Tn(λmax+λminλmaxλmin)x(0)xA.

You can use without proof the fact that

pn(A)A=max{|pn(z)|:zSp{A}},

where Sp(A) denotes the set of eigenvalues of A, and the facts that for every nβ„• the polynomial Tn(z) has degree n, is positive for z>1, and satisfies

Tn(cos(θ))=cos(nθ)for allθℝ.

Solution 3b

Overview

We want to show that


pn(A)A=1Tn(λmax+λminλmaxλmin)

Maximize Numerator of p_n(z)

By hypothesis,


pn(A)A=max{|pn(z)|:zSp{A}}


Since only the numerator of pn(z) depends on z, we only need to maximize the numerator in order to maximize |pn(z)|. That is find


z:maxz[λmin,λmax]|Tn(λmax+λmin2zλmaxλmin)|


Rewrite T_n

Let cos(θ)=x. Then


θ=arccos(x)


Hence,


Tn(cosθ)=Tn(x)=cos(nθ)=cos(narccos(x))


so


Tn(x)=cos(narccos(x))


Max of T_n is 1

Denote the argument of Tn as x(z) since the argument depends on z. Hence,


x(z)=λmax+λmin2zλmaxλmin,


Then,


x(λmin)=λmaxλminλmaxλmin=1


x(λmax)=λminλmaxλmaxλmin=1


Thus x(z)[1,1].


Now, since arccos(x) is real for x[1,1],


1cos(narccos(x)ℝ)Tn(x)1


Hence,


maxx[1,1]Tn(x)=maxx[1,1]|cos(narccos(x))|=1

Show T_n(1)=1

Let z=λmin, then


|Tn(λmax+λmin2(λmin)λmaxλmin)|=|Tn(1)|


Using our formula we have,


|Tn(1)|=|cos(narccos(1))|=|cos(n2πk)|k𝐙=1


In other words, if z=λmin, Tn achieves its maximum value of 1.

Template:BookCat