
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Spring 2004 HW 3 Assigned: Thurs Feb 5, 2004; Due: Thurs Feb 12, 2004
Homework problems will be posted in the course directory: www.cs.odu.edu/˜pothen/Courses/CS417. If any corrections are found to be neces- sary, they will be posted in this directory as well. You must show your work to receive credit for your answers. In problems where you are asked to give reasons, an answer without a stated reason will receive no credit.
hij = 1/(i + j − 1), for i = 1, 2 ,... , n; j = 1, 2 ,... , n.
(a) In Matlab, type type hilb.m to see Matlab’s efficient ‘vectorized’ code for com- puting the Hilbert matrix. There are five lines of code in this Matlab program. Explain what each line of code does. Hint. Use Matlab’s help command as you need. In particular, you might find help punct to give you useful information. (b) Create a Hilbert matrix of order n and create a right hand side vector b such that the exact solution to Hx = b is the vector of all ones. Solve the system of equations Hx = b in Matlab. Compare the solution that you compute with the exact solution. Do this for three values of matrix sizes: n = 10, n = 20, and n = 30. (c) The difference between the computed solution and the exact solution (in absolute value) is known to be less than or equal to the product of two numbers: the condition number of the matrix and the machine precision. Use the Matlab command cond to calcu- late the condition numbers of the three Hilbert matrices; then compute the product of the condition number and machine precision in Matlab. Do the values of the product correctly predict the errors you see for the three values of n?