Question: For n = 2 , 3 , . . . . , generate a Hilbert matrix H and a n - vector b = Hx

For n =2,3,...., generate a Hilbert matrix H and a n-vector b=Hx using x, a n-vector with all
entries equal to 1. You can generate these via a function generatorHb. Using the
GaussElimination, forwardSubstitution, and backwardSubstitution functions developed in
Assignment 2, solve the system the system 2= to obtain the approximate solution 2. Find
the \infty norm of the residual =2 and of the error =2, where x is the true
solution, i.e., the n-vector with all entries equal to 1. How large can you take n before the error is
100%? Also monitor the cond(H) and see how this varies as a function of n.
Note:
1. Your PDf submission should include the complete algorithm package including the
following functions: GaussElimination, forwardSubstitution, backwardSubstitution,
generatorHb that work for a general \times matrix and n-vector.
2. You cannot use a built-in Gauss elimination or LU decomposition functions of the
program.
3. For each n, your program should print the following vectors: 2,, r
4. As part of your solution, you should present the following table in your PDF file
n & Cond(H)
2
3
:
5. Finally, you should also identify the n at which the error goes to 100%
To pass this challenge project, you must:
1. The data in point 3 and the table in point 4 in the Note above should be included in your
before your code in the pdf file.
2. Include the complete code for all the functions. Do not print images of the code or paste
code with a black background.
3. Obtain the correct answers for 2,, r for the different values of n.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!