Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Question Possible Marks Actual Marks 1 6 2 6 3 6 Total 18

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

UNIVERSITY OF VICTORIA

MIDTERM EXAM 1 MARCH 11 2019


COMPUTER SCIENCE 349A

NAME: STUDENT NO.


INSTRUCTOR: Rich Little
. DURATION: 40 minutes
TO BE ANSWERED ON THE PAPER
STUDENTS MUST COUNT THE NUMBER OF PAGES IN THIS EXAMINATION PAPER BEFORE
BEGINNING TO WRITE, AND REPORT ANY DISCREPANCY IMMEDIATELY TO ME.
PLEASE PUT YOUR NAME ON THE VERY BACK SHEET AS WELL.
THIS QUESTION PAPER HAS 4, SINGLE-SIDED PAGES. YOU MAY USE THE BACK
PAGES.
NOTES: (0) CLOSED BOOK EXAM; ONLY BASIC CALCULATORS ARE ALLOWED, (1)
ANSWER ALL QUESTIONS, (2) THERE ARE A TOTAL OF 18 MARKS, (3) THE BACK
PAGE OF EACH QUESTION MAY BE USED FOR YOUR ANSWERS. (4) STUDENTS ARE
ALLOWED ONE 8.5-by-11 INCH SHEET CONTAINING ANY INFORMATION — BOTH
SIDES CAN BE USED.

Question Possible marks Actual marks


1 6
2 6
3 6
Total 18
MAR 11, 2019 CSC 349A, 2

1. (a) [2 points] How many iterations of the bisection method must run to gaurantee that
the absolute error of your approximation to the root is less than 10−4 if the initial
interval is [0, 4]?
(b) [4 points] Consider the following system of linear equations Ax = b.

−x1 + x2 + 4x3 = −2
x2 + 5x3 = 4
x1 + 6x3 = 6

Specify the augmented matrix for this system of equations and use Naive Gaussian
Elimination to put it in upper triangular form (i.e. do the Forward Elimination step).
MAR 11, 2019 CSC 349A, 3

2. (a) [3 points] Consider the following polynomial: f (x) = x3 − 4x2 − 3x + 18. Use Horner’s
algorithm to compute f (−1) and f 0 (−1).
(b) [1 points] If x0 = −1 is the initial approximation to a root of this polynomial, use
Newton’s method to determine the next approximation x1 to the root.
(c) [2 points] If we use Newton’s method on f (x) in (a) until it converges to an actual
root xt = −2, what is the order of convergence? Justify your answer.
MAR 11, 2019 CSC 349A, 4

3. Consider the following function,


x1/3 − 1
g(x) = .
x−1
Using precision k=4, b=10, chopping, floating-point arithmetic fl (g(1.011)) = 0.2727
whereas the true value is g(1.011) = 0.3321185.

(a) [2 points] The quadratic Taylor polynomial approximation for f (x) = x1/3 , expanded
about a = 1, is
x − 1 (x − 1)2
f (x) ≈ 1 + − .
3 9
Use this to get an accurate linear approximation to g(x) near x = 1. (NOTE: no
calculations needed here, just a new function.)
(b) [3 points] Use the approximation in (a) to show that the computation fl (g(1.011)) is
unstable. Use the notation and definition of stability given in class.
(c) [1 point] Is g(x) well-conditioned near x = 1? Do NOT use the condition number.

You might also like