Question: Problem 3 . Condition number Write a MATLAB code that does the following: 1 . Repeat 1 0 0 times Generates a random 1 0

Problem 3. Condition number Write a MATLAB code that does the following: 1. Repeat 100 times Generates a random 10\times 1 vector b. Generates a 10\times 10 random matrix R Solves Rxr = b. Computes yr = Rxr. Theoretically, we should have yr = b. However, numerically the two quantities will differ. Compute the relative error error er =\| yr b\|/\| b\|. Generates a 10\times 10 Hilbert matrix H Solves H xh = b. Computes yh = Hxh. Theoretically, we should have yh = b. However, numerically the two quantities will differ. Compute the relative error error eh =\| yh b\|/\| b\|.2. Plots the ers and ehs obtained during the 100 repetitions. You should obtain a plot similar to the following A=hilb(10) A=rand(10)10010-5 norm(y-b)/norm(b)10-1010-1510-2003. Why are er and eh not identically zero? 204060 repetition 801004. The average error eh is about 10 orders of magnitude larger than the average error er! Why such a large difference? Justify your answer.

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 Programming Questions!