# CPSC/Math 402: Assignment #3

## Estimating the Condition Number of a Matrix

### Due by 5 p.m. Friday, March 1, 2002

Do Computer Problem #2.4 on page 101 of the textbook. To do this add functions to the C++ program used in lab (this is not a requirment -- you are welcome to write your own program). Before trying to add to the program you need to be sure you understand how it works. Once you understand it, you will not need to do much extra work. Mainly you need to write routines to solve Utv = c and Lty = v. The program already has routines to find the LU decomposition and to solve a system (such as Az = y) after LU has already been computed. There are also routines to compute the matrix norms.

To do part (b) write a routine to randomly generate vectors y. Also, use at least 10 rather than 5 (5 is pretty small for an experiment involving randomness).

### Hand In

• Printed copies of your source code.
• Email to ingram@cs.roanoke.edu a tar file containing all of your files (name your tar file something that includes your name). RECALL: To tar the files in a directory (you should have all your work in one subdirectory and no other junk there), use the following command:
```        tar czf ingramAssn3.tgz  .
```
• Answers to the questions at the end of 2.4 plus the output you based your answers on. Test your program on the two matrices given in the text plus at least two different Hilbert matrices (n at least 6). Use Mathematica to determine the condition number for each of these to use as one comparison, then as the book states explicitly compute A-1 (again using Mathematica) and compute the condition number using the definition.