AMSC/CMSC 460 HW5: Hessenberg matrix reduction & positive definite matrices - Prof. Gilber, Assignments of Computer Science

The solutions to homework 5 of the amsc/cmsc 460 course, which covers the reduction of a hessenberg matrix to triangular form using gaussian elimination with partial pivoting, and the properties of positive definite matrices. It includes the implementation of a matlab function hesssolve(b, p, mult, u) to solve the system hx=b, and the proof of various facts related to positive definite matrices.

Typology: Assignments

Pre 2010

Uploaded on 02/13/2009

koofers-user-dux
koofers-user-dux 🇺🇸

9 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
AMSC/CMSC 460 Homework 5 Due 5/1
1. Assume we have a Matlab function
[p, mult, U] = hessreduce(H),
that reduces the upper Hessenberg matrix to triangular form by Gaussian elimination
with partial pivoting. Specifically, p(i) is 1if there was pivoting at the i-th stage of
the reduction of Hand and p(i) is 0if there was not pivoting. The quantity mult(i) is
the i-th multiplier in the reduction; i.e., H(i+1,i)/H(i,i). The matrix Uis the upper
triangular matrix produced by the reduction. Write a Matlab function
x = hesssolve(b, p, mult, U)
to solve the system Hx=b. Here p,mult, and Uare the output from hessreduce.
Answer:
n = size(H,1);
for i = 1:n-1
if p(i)
temp = b(i); b(i) = b(i+1); b(i+1) = temp;
end
b(i+1) = b(i+1) - mult(i)*b(i);
end
for j=n:-1:1
x(j) = b(j)/L(j,j);
b(1:j-1) = b(1:j-1) - L(1:j-1,j)*x(j);
end
2. A symmetric matrix Apositive definite if xTAx > 0 whenever x6= 0. Establish
the following facts. [Hint: You may use the facts in Page 77 of the Afternotes. You
may also use the fact that a matrix Uhas linearly independent columns if and only if
x6= 0 implies Ux 6= 0.]
a. Ais nonsingular.
b. A1is positive definite.
c. If Bis the submatrix of Asubtended by rows and columns i1< i2<· · · < ik,
then Bis positive definite. What does this say about the diagonal elements of
A.
d. The element of largest magnitude in Aoccurs on the diagonal. [Hint: Prove
the result for the 2×2 case and then use part c.]
1
pf2

Partial preview of the text

Download AMSC/CMSC 460 HW5: Hessenberg matrix reduction & positive definite matrices - Prof. Gilber and more Assignments Computer Science in PDF only on Docsity!

AMSC/CMSC 460 Homework 5 Due 5/

1. Assume we have a Matlab function

[p, mult, U] = hessreduce(H),

that reduces the upper Hessenberg matrix to triangular form by Gaussian elimination

with partial pivoting. Specifically, p(i) is 1 if there was pivoting at the i-th stage of

the reduction of H and and p(i) is 0 if there was not pivoting. The quantity mult(i) is

the i-th multiplier in the reduction; i.e., H(i+1,i)/H(i,i). The matrix U is the upper

triangular matrix produced by the reduction. Write a Matlab function

x = hesssolve(b, p, mult, U)

to solve the system Hx=b. Here p, mult, and U are the output from hessreduce.

Answer:

n = size(H,1); for i = 1:n- if p(i) temp = b(i); b(i) = b(i+1); b(i+1) = temp; end b(i+1) = b(i+1) - mult(i)*b(i); end

for j=n:-1: x(j) = b(j)/L(j,j); b(1:j-1) = b(1:j-1) - L(1:j-1,j)*x(j); end

2. A symmetric matrix A positive definite if xTAx > 0 whenever x 6 = 0. Establish

the following facts. [Hint: You may use the facts in Page 77 of the Afternotes. You

may also use the fact that a matrix U has linearly independent columns if and only if

x 6 = 0 implies U x 6 = 0.]

a. A is nonsingular.

b. A−^1 is positive definite.

c. If B is the submatrix of A subtended by rows and columns i 1 < i 2 < · · · < ik,

then B is positive definite. What does this say about the diagonal elements of

A.

d. The element of largest magnitude in A occurs on the diagonal. [Hint: Prove

the result for the 2×2 case and then use part c.]

AMSC/CMSC 460 Homework 5 Due 5/

e. If the columns of B are linearly independent, then A = BTB is positive defi-

nite, and conversely.

Answer:

a. If A is singular then there is a nonzero vector x such that Ax = 0. But then 0 = xT(Ax) = xTAx > 0 , a contradiction.

b. Let x 6 = 0. Then y = A−^1 x 6 = 0. Since x = Ay, we have

xTA−^1 x = yTATA−^1 Ay = yTAA−^1 Ay = yTAy > 0.

c. Let x = (x 1 x 2 · · · xk) T 6 = 0. Construct a vector as follows

y = zeros(n); for j=1:k y(i(j)) = x(j); end

Then it is easily verified that yTAy = xTBx. But since y 6 = 0, we have yTAy > 0.

d. Assume, to the contrary that aij (i 6 = j) is an element of largest magnitude and consider the matrix

B =

aii aij aij ajj

which is positive definite. Now if aij ≥ 0 , then

aii aij aij ajj

= aii + ajj − 2 aij ≤ 0.

On the other hand if aij ≤ 0 , then

aii aij aij ajj

= aii + ajj + 2aij ≤ 0.

In either case we find that B is not positive definite — a contradiction.

e. First suppose that B has linearly independent columns. Then for any nonzero x, y = Bx 6 = 0. Hence xT(BTB)x = (Bx)T(Bx) = yTy = ‖y‖^22 > 0

so that A = BTB is positive definite.

On the other hand if A = BTB is positive definite, then for any nonzero x,

0 < xT(BTB)x = ‖Bx‖^22.

Thus if x 6 = 0, then Bx 6 = 0, and hence the columns of B are independent.