Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Suppose U is a mm+1 augmented, upper triangular matrix that represents a linear system with m equations and m unknowns. Assuming the entries along the
Suppose U is a mm+1 augmented, upper triangular matrix that represents a linear system with m equations and m unknowns. Assuming the entries along the main diagonal of U are nonzero, we can perform back substitution on U to obtain the unique solution to the linear system.
%Back substitution on a m by m+1 upper triangular matrix U. [m, n] = size (U); x = U(:,m+1); % Initialize column vector of unknowns (to be updated). x(m) = U(m,m+1)/U(m,m); % Solve last equation of augmented matrix. for i = m-1:-1:1 % i counts down from m-1 to 1 in intervals of 1. SUM = 0; for j = i+1:m SUM = SUM + U(i, j) *x(j); end x(i) = (U(i,n) - SUM)/U(i,i); % Updates the ith entry of x. end x % x is the solution of the linear system. a. How many flops occur per passage through the inner for-loop? b. How many times does one pass through the inner for-loop for a given index i? Using your answer from the previous question, how many total flops occur within the inner for-loop for a given index i? Note: your answer should depend on the index i. c. How many flops occur to update the ith entry of the vector x for a given index i? Using your answer from the previous question, how many flops occur per passage through the outer for-loop? Note: your answer should still depend on the index i. d. Show that the total number of flops that occur within the outer for-loop is m + m - 2. N N(N +1) Hint: recall the useful ide i= 12 e. Because solving the last equation of the augmented matrix introduces one additional flop?, the total flop count of back substitution is m2 + m - 1. For very large matrices, what is the asymptotic flop count of back substitution
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started