Test1Practice2

.pdf

School

University of New South Wales *

*We aren’t endorsed by this school

Course

2089

Subject

Mathematics

Date

Apr 3, 2024

Type

pdf

Pages

13

Uploaded by EarlFreedomWildcat32

(a) [ 4 marks ] (i) What is the value of after the following commands are executed in MATLAB or Python (with defined to be the relative machine precision for )? (ii) What are the elements of after the following commands are executed in MATLAB or Python (with the appropriate import commands)? MATLAB: Python: (b) [ 3 marks ] A technician claims that the amount of energy used in a chemical reaction (in appropriate units) is and that the measurement was made to decimal places. (i) Give the correctly rounded value for . (ii) Give an estimate of the absolute error in . MATLAB: Python: MATLAB: Python: MATLAB: Python: MATLAB: Python: MATLAB: Python: MATLAB: Python: MATLAB: Python: MATLAB: Python: MATLAB: Python: MATLAB: Python: MATLAB: Python:
(iii) Give an estimate of the relative error in . (c) [ 3 marks ] You are asked to calculate the expression when and is much smaller in magnitude than . (i) Is this expression good or not good for implementation on a computer? (ii) Find a mathematically equivalent, but numerical preferable, expression for . (Select the original expression if it is already the preferable one.) This expression risks a potential catastrophic cancellation. This expression is good for implementation on a computer.
(a) [ 4 marks ] The computational complexities of some common operations with by matrices are given in the table below. Operations Flops Matrix-matrix multiplication Matrix-vector multiplication LU factorization Cholesky factorization Back/forward substitution Tridiagonal solve You have a GHz workstation with cores where each core can do floating point operations per clock cycle. Estimate how long it will take to solve the by linear system where is symmetric and positive definite and . (b) [ 4 marks ] Estimate the size of the largest by matrix that can be stored in GB RAM using double precision floating point arithmetic. Assume that GB = bytes. (c) [ 2 marks ] Suppose is an invertible matrix with no special structure and . A programmer claims that the best strategy to solve two linear systems and is to first calculate the inverse and then compute and . Justify or refute this claim. 0.039 seconds 18 minutes 8.9 minutes 7.6E-6 seconds FALSE. Better to compute the factorization of the matrix once, then use forward and back substitutions to solve for . TRUE. Computing the inverse of the matrix is the most efficient way.
You are given the results of the following MATLAB commands and some related spy plots corresponding to a matrix with real number entries. NOTE: Related (not necessarily the same) Python commands are (a) [ 2 marks ] You are told that has the Cholesky factorization . Tick ALL statements that apply.
(b) [ 2 marks ] Is the matrix positive definite? Tick ALL answers that apply. (c) [ 2 marks ] What are the steps to solve using the Cholesky factorization ? (d) [ 4 marks ] The elements of the coefficient matrix are known exactly and the elements of the right-hand-side vector are known to significant figures. From the above MATLAB results it can be deduced that the -norm condition number of the matrix is . (i) Give an estimate on the relative error in the computed solution to . (ii) How many significant figures do you have in the computed solution? The matrix is lower triangular. The matrix is upper triangular. All the diagonal elements of are positive. All the diagonal elements of are equal to . All the diagonal elements of are nonzero. No, since is not symmetric because . Yes, since is symmetric and its Cholesky factorization exists. Yes, since all eigenvalues of are positive. Not enough information, since we cannot deduce that is symmetric from its spy plot. Yes, since is symmetric and all its eigenvalues are positive. Solve for by back substitution, and then solve for by forward substitution. Solve for by back substitution, and then solve for by forward substitution. Solve for by forward substitution, and then solve for by back substitution. Solve for by forward substitution, and then solve for by back substitution.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help