Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

3. Suppose A Rnxn is nonsingular. (a) (4 points) Given B Rm*p, show how to use the LU factorization with partial pivoting to solve AX-

image text in transcribedimage text in transcribed

3. Suppose A Rnxn is nonsingular. (a) (4 points) Given B Rm*p, show how to use the LU factorization with partial pivoting to solve AX- B. What is the cost of your method? Hint: AXBis equivalent to AX(:,j)-B(:, j) for j 1:p (b) (5 points) Use lupp.m given in the lecture notes to solve AX - B, where 10 x 10 Hilbert matrix A - (a ai 1/(i +j - 1); 10 5 B A * randn(10,5) Here randn is a MATLAB built-in function to generate a random matrix. Denote this randn(10, 5) by Xt and your computed solution by Xc . Compute |Xe XllF/XllF and elIAllFlA- F, where e is the machine epsilon. Check MTALAB built-in functions or constants norm, cond and eps, to see how to compute or get related quantities . Compute the relative residual |B - AXcomp F/(AlF) i. Run your code 10 times (you may use a loop). Notice each time you have different B, since Xtrue is random. Answer the following questions: i1. Do you see any rough relation between Xc- XtF/ XF and eAF iii. Do you see any rough relation between |[B-AXcIF/dlAllFlKJIF) and e? IA IF? Print out your MATLAB code and the results 3. Suppose A Rnxn is nonsingular. (a) (4 points) Given B Rm*p, show how to use the LU factorization with partial pivoting to solve AX- B. What is the cost of your method? Hint: AXBis equivalent to AX(:,j)-B(:, j) for j 1:p (b) (5 points) Use lupp.m given in the lecture notes to solve AX - B, where 10 x 10 Hilbert matrix A - (a ai 1/(i +j - 1); 10 5 B A * randn(10,5) Here randn is a MATLAB built-in function to generate a random matrix. Denote this randn(10, 5) by Xt and your computed solution by Xc . Compute |Xe XllF/XllF and elIAllFlA- F, where e is the machine epsilon. Check MTALAB built-in functions or constants norm, cond and eps, to see how to compute or get related quantities . Compute the relative residual |B - AXcomp F/(AlF) i. Run your code 10 times (you may use a loop). Notice each time you have different B, since Xtrue is random. Answer the following questions: i1. Do you see any rough relation between Xc- XtF/ XF and eAF iii. Do you see any rough relation between |[B-AXcIF/dlAllFlKJIF) and e? IA IF? Print out your MATLAB code and the results

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Accounting And Auditing Research And Databases Practitioner's Desk Reference

Authors: Thomas R. Weirich, Natalie Tatiana Churyk, Thomas C. Pearson

1st Edition

1118334426, 978-1118334423

More Books

Students also viewed these Databases questions

Question

5. What decision-making model would you advocate to this person?

Answered: 1 week ago

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago