CSC_349A_EXAM_QUESTIONS

CSC_349A_EXAM_QUESTIONS - COMPUTER SCIENCE 349A SAMPLE EXAM...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
COMPUTER SCIENCE 349A SAMPLE EXAM QUESTIONS WITH SOLUTIONS PARTS 1, 2 PART 1. 1.1 (a) Define the term “ill-conditioned problem”. (b) Give an example of a polynomial that has ill-conditioned zeros. 1.2 Consider evaluation of ) tanh( 1 1 ) ( x x f = , where x x x x e e e e x + = ) tanh( . If ) ( x f is to be evaluated in floating-point arithmetic (e.g., k = 4 decimal digit, idealized, rounding floating-point), for each of the following ranges of values of x , specify whether the computed floating-point result will be accurate or inaccurate. (a) x is large and positive (for example, 4 > x if k = 4) (b) x is close to 0 (for example, 001 . 0 x if k = 4) (c) x is large and negative (for example, 4 < x if k = 4) 1.3 Consider 0 , ) 1 sin( ) 1 sin( ) ( + = h h h h g where the arguments for sin are in radians . When h is close to 0, evaluation of ) ( h g is inaccurate in floating-point arithmetic. In (a) and (d) below, use 4 decimal digit, idealized, rounding floating-point arithmetic. If x is a floating-point number, assume that ) (sin x f l is determined by rounding the exact value of x sin to 4 significant digits. (a) Evaluate ) ) ( ( h g f l for 00351 . 0 = h . Note that L 843088 . 0 ) 003 . 1 sin( = , L 843625 . 0 ) 004 . 1 sin( = and L 841470 . 0 ) 1 sin( = . (b) Taylor's Theorem can be expressed in two equivalent forms: given any fixed value 0 x ,
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
L + + + + = ) ( ! 3 ) ( ) ( ! 2 ) ( ) ( ) ( ) ( ) ( 0 3 0 0 2 0 0 0 0 x f x x x f x x x f x x x f x f or, using a change of variable (replacing x by h x + 0 , so that 0 x x h = is the independent variable), L + + + + = + ) ( ! 3 ) ( ! 2 ) ( ) ( ) ( 0 3 0 2 0 0 0 x f h x f h x f h x f h x f . Using the latter form of Taylor's Theorem (without the remainder term), determine the quadratic (in h ) Taylor polynomial approximation to ) 1 sin( h + . Note: leave your answer in terms of ) 1 cos( and sin(1); do not evaluate these numerically. (c) Use the Taylor polynomial approximation from (b) to obtain a polynomial approximation, say ) ( h p , to ) ( h g . (d) Show that ) ( h p is much better than ) ( h g for floating-point evaluation when h is close to 0 by evaluating ) ) 00351 . 0 ( ( p f l . Note that L 841470 . 0 ) 1 sin( = and L 540302 . 0 ) 1 cos( = . 1.4 If f e d c b a , , , , , have known values, then = f e y x d c b a is a system of 2 linear equations in the 2 unknowns x and y . If 0 bc ad , then the solution is bc ad bf de x = and bc ad ce af y = . Consider the linear system = 38 . 1 27 . 0 29 . 6 91 . 4 23 . 1 96 . 0 y x . Show that the problem of computing the solution y x is ill-conditioned.
Background image of page 2
1.5 (a) For what values of the real variable x , where 1 > x , is the following expression subject to subtractive cancellation that will produce a very inaccurate result (in terms of relative error) using floating-point arithmetic? 1 ) ( = x x x f , where 1 > x . (b) How should ) ( x f be evaluated in floating-point arithmetic in order to avoid the subtractive cancellation in (a)?
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/10/2011 for the course CSC 349 taught by Professor Oadje during the Spring '11 term at University of Victoria.

Page1 / 16

CSC_349A_EXAM_QUESTIONS - COMPUTER SCIENCE 349A SAMPLE EXAM...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online