Docsity

Numerical Computing Homework Solutions: Matrix Norms and Condition Number, Assignments of Mathematics

Toggle sidebar
bg1
Rensselaer Polytechnic Institute
MATH/CSCI 4800
Numerical Computing
Homework Set 1. SOLUTIONS
Due: Friday, September 9, 2011
(1) Do Review Question 2.52 in the text. You might want to illustrate with an example.
The 2-norm is much tougher to compute, For example, for the simple matrix
A=
1 0
3 2
,
we have to maximize the square root of
R=||Ax||2
||x||2=10x2
1+ 12x1x2+ 4x2
2
x2
1+x2
2
,
allowing all possible values of x. If one writes x1=cx2, then
R=10c2+ 12c+ 4
c2+ 1 ,
and putting dR/dc = 0 leads to a quadratic equation whose root is c= (1 + √5)/2. Putting in this
value and taking the square root of Rgives
||A||2= 3.7025.
(The MATLAB norm function confirms this value.) Compare that process with writing ||A||1= 4,
done by inspection.)
(2) Do Review Question 2.57 in the text.
For the matrix given,
A=
4 0 0
0−6 0
0 0 2
and A−1=
1/4 0 0
0−1/6 0
0 0 1/2
,
the condition number using the 1norm is
cond1(A) = 6 ×1
2= 3.
Using the infinity norm,
cond∞(A) = 6 ×1
2= 3.
Because the matrix is diagonal, the two norms are identical!
(3) Do Exercise 2.4 in the text.
(a) The determinant of this matrix is
det(A) = det
2 1
3 2
−det
1 0
3 2
+ det
1 0
2 1
= 1 −2 + 1 = 0,
so the matrix IS singular.
pf3

Partial preview of the text

Download Numerical Computing Homework Solutions: Matrix Norms and Condition Number and more Assignments Mathematics in PDF only on Docsity!

Rensselaer Polytechnic Institute

MATH/CSCI 4800

Numerical Computing

Homework Set 1. SOLUTIONS

Due: Friday, September 9, 2011

(1) Do Review Question 2.52 in the text. You might want to illustrate with an example.

The 2-norm is much tougher to compute, For example, for the simple matrix

A =

we have to maximize the square root of

R =

||Ax||

2

||x|| 2

10 x

2 1 + 12x^1 x^2 + 4x

2 2

x 2 1

  • x 2 2

allowing all possible values of x. If one writes x 1 = cx 2 , then

R =

10 c

2

  • 12c + 4

c 2

  • 1

and putting dR/dc = 0 leads to a quadratic equation whose root is c = (1 +

5)/ 2. Putting in this

value and taking the square root of R gives

||A|| 2 = 3. 7025.

(The MATLAB norm function confirms this value.) Compare that process with writing ||A|| 1 = 4,

done by inspection.)

(2) Do Review Question 2.57 in the text.

For the matrix given,

A =

and A

− 1

the condition number using the 1 norm is

cond 1 (A) = 6 ×

Using the infinity norm,

cond∞(A) = 6 ×

Because the matrix is diagonal, the two norms are identical!

(3) Do Exercise 2.4 in the text.

(a) The determinant of this matrix is

det(A) = det

 (^) − det

 (^) + det

so the matrix IS singular.

(b) The augmented matrix is

which transforms to

The final row operation gives 

The rank cannot be changed by row operations, and it is clear that the rank of the coefficient

matrix and the rank of the augmented matrix are both 2 , so there IS a solution, but n − r = 1, so

there is ONE arbitrary constant in the solution.

(4) What effect does multiplying a matrix by itself have on the condition number? Using the properties

of norms on page 55, show that

cond(A

2 ) ≤

cond(A)

From the norm inequalities given in the text, ||B

2 || ≤ ||B||||B||, and applying that result to both A and

its inverse,

cond(A

2 ) = ||A

2 || ||

A

− 1

|| ≤ ||A||

2 ||A

− 1 ||

2

cond(A)

(5) An n-dimensional “Hilbert matrix” is given by

A =

1 1 / 2 1 / 3... 1 /n

1 / 2 1 / 3 1 / 4... 1 /(n + 1)

1 / 3 1 / 4 1 / 5... 1 /(n + 2)

1 /n 1 /(n + 1) 1 /(n + 2)... 1 /(2n − 1)

Write a MATLAB m-file that

(a) Constructs an Hilbert matrix of arbitrary size, for a value of n obtained via an input statement

(DO NOT use the MATLAB command hilbert!!)

(b) Uses the MATLAB routine inv to compute A − 1 .

(c) Computes the condition number for that matrix using the ||A||∞ norm. (You will likely want to

use the MATLAB routine norm.)

What do submit–

  • A listing of your m-file.

Below is my m-file.

clear;

%Hilbert matrix computation

%Input

n=input(’N = ’);