Question: Please run 20 tests in Matlab as the problem is required. 6. Consider the following two ways of solving a 2-by-2 linear system of equations:

Please run 20 tests in Matlab as the problem is required.

Please run 20 tests in Matlab as the problem is required. 6.

6. Consider the following two ways of solving a 2-by-2 linear system of equations: Ar = = = b 21 a 22 Algorithm 1. Gaussian elimination with partial pivoting. (You can use the Matlab command \\) Algorithm 2. Cramer's rule (see textbook Page 67-68): det(A) = 011 * 022 - 012 * 021, T1 = (022 * b1 - 012 * b2)/ det(A), 12 = (-a21 * b1 + all * b2) / det(A). Show by means of numerical examples that Cramer's rule is not backward stable. Please include your code and results in the answer. Hint: Choose a matrix which is nearly singular: A(:,2) ~ A(:, 1) and b ~ A(:, 2). You can construct A(:, 2) by adding a random perturbation (Matlab command rand) of small norm to A(:, 1) and construct b from A(:, 2) similarly. Run 20 tests and demonstrate your results. You can estimate the relative backward error using the formula 116 All = where a is the computed solution and r = A - br is the residue

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