This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: COT4501 Fall2010 Midterm Solutions I: [25 points] Truncation Error and Rounding Error (a) (10 points) In the finite difference approximation of the first derivative f ( x ) f ( x + h ) f ( x ) h , why do the truncation error and rounding error go to zero and infinity respectively as h ? The truncation error for the finite difference approximation of the first derivative is bounded by Mh 2 since we have via the Taylor series approximation that f ( x ) = f ( x + h ) f ( x ) h h 2 f ( ) with [ x,x + h ] . When M is defined as M = sup [ x,x + h ] | f ( ) | we see that the truncation error defined as | f ( x ) f ( x + h ) f ( x ) h | Mh 2 which goes to zero as h . The rounding error for the the finite difference approximation of the first derivative is bounded by 2 h where each function call is assumed to have a maximum rounding error of . Since the bound can be reached when the function call rounding errors are exactly and when the errors conspire to add up, the rounding error can go to infinity as h . (b) (15 points) Derive the value of h at which the total error (truncation + rounding error) for the following approximation to the second derivative of the function f ( x ) is minimized: f ( x ) f ( x + h ) 2 f ( x ) + f ( x h ) h 2 . (1) You may assume a maximum absolute error of for each function call [ f ( x ) , f ( x + h ) and f ( x h ) in (1) above]. Explain the significance of your result. From the Taylor series approximations, we have f ( x + h ) = f ( x ) + hf ( x ) + h 2 2 f ( x ) + h 3 6 f ( x ) + h 4 24 f (4) ( 1 ) , 1 [ x,x + h ] (2) and f ( x h ) = f ( x ) hf ( x ) + h 2 2 f ( x ) h 3 6 f ( x ) + h 4 24 f (4) ( 2 ) , 2 [ x h,x ] . (3) From (2) and (3), we get f ( x + h ) + f ( x h ) 2 f ( x ) = h 2 f ( x ) + h 4 24 f (4) ( 1 ) + h 4 24 f (4) ( 2 ) which can be further simplified as f ( x ) = f ( x + h ) 2 f ( x ) + f ( x h ) h 2 h 2 24 f (4) ( 1 ) + h 2 24 f (4) ( 2 ) ....
View Full Document
- Fall '10