Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2: Due July 18th, 2017 First, do these problems. These will be graded for completion. 1.3: 4, 7 (You may write in pseudocode or proper

2: Due July 18th, 2017 First, do these problems. These will be graded for completion. 1.3: 4, 7 (You may write in pseudocode or proper MATLAB code.), 15 (write proper MATLAB code), 25 1.4: 15, 21, 52, 62 (Hint: Recall that det(A B) = det(A) det(B).) 1.5: 4, 11, 12 1.7: 10 b,c, 34 Write a function in MATLAB that takes as input a tridiagonal matrix given as three vectors: an n 1 vector v representing the main diagonal, an (n 1) 1 vector w representing the upper diagonal, and and (n 1) 1 vector z representing the lower diagonal. Have this function output the LU factorization (without pivoting) with the U as two vectors and the L as one vector representing the nontrivial diagonals. Use only basic programming. 1.8: 4, 9, 10 (the only part you need to submit is the equation relating L with K.) 2.1: 4, 10, 17 Then do these problems. These will be graded for correctness. 1. Write a function in MATLAB that takes as input a symmetric tridiagonal matrix represented as two vectors: an n 1 vector v representing the main diagonal and an (n 1) 1 vector w representing the upper (and lower) diagonal. Have this function output the Cholesky factor of the matrix as a vector for the main diagonal and a vector for the upper diagonal. Only submit the code, but to make sure your code works, if you input v = [4, 4, 4, 4, 4, 4] and w = [1, 1, 1, 1, 1], your program should output the vectors [2, 1.94, 1.93, 1.93, 1.93, 1.93] and [.5, .516, .518, .518, .518]. For big matrices, this algorithm is more efficient than the standard Cholesky method. For a 100 100 matrix, what percentage of the memory do we need to store our matrix, compared to the naive method? About what percentage of flops do we compute, compared to the naive method? (Use the approximations for flops we gave in class.) 2. Briefly explain why it is useful to calculate the Cholesky decomposition when solving Ax = b for a number of different b's, as compared to just using standard row reduction. 3. For sparse matrices (matrices with mostly zero entries, such as banded matrices), explain why trying to calculate A1 in order to solve Ax = b is even more inefficient (and thus foolish) than usual. (As compared to, say, using the Cholesky decomposition.) (Hint: Look at the paragraph above Exercise 1.5.12.) 4. Write a function in MATLAB that takes as input an n1 vector p of rearranged integers from 1 to n representing a permutation matrix P whose i-th row is the p(i)-th row of the identity matrix; an nn matrix B whose upper triangular portion stores U and strictly lower triangular portion stores L of the LU factorization of the matrix P A; and an n1 vector b. Have this function output the solution to Ax = b. Use only basic programming. Only submit the code, but to make sure your code works, if you input p = [3, 1, 2], B = [2, 1, 3; 0.4, 3, 3; 0.5, 0.2, 4] and b = [2; 1; 1], you should output x = [0.53; 0.83; 0.30]. 5. Explain why pivoting is necessary for Gaussian elimination to work on a computer. (There are two reasons.) 6. Watkins 2.1.14 For additional practice, here are some optional problems. These should not be turned in. 1 1.3: 11, 17, 23, 28 1.4: 22 (You'll probably need this one for practice!), 54, 56 1.5: 9, 12, 14 1.6: 5 1.7: 18, 35, 36, 37 2.1: 11, 13 2

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

Step: 3

blur-text-image

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

Linear Algebra A Modern Introduction

Authors: David Poole

4th edition

1285463242, 978-1285982830, 1285982835, 978-1285463247

More Books

Students also viewed these Mathematics questions