hw2_solution_SEJ

hw2_solution_SEJ - EE103 Spring 2010 HW2 Sol. Prof. S.E....

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

View Full Document Right Arrow Icon
EE103 Spring 2010 HW2 Sol. Prof. S.E. Jacobsen 1 Applied Numerical Computing EE103 Spring 2010 Instructor: Prof. S. E. Jacobsen HW2 Solution Problem 1 Machine epsilon 1 2 n M  is defined as the upper bound of the relative round-off error for a (,) n finite precision machine, and its interpretation is that 1+ M is the smallest number larger than one that the machine can distinguish from 1. Therefore, for the IEEE single precision format ( 2, 24 n ), machine epsilon M is 24 2 , and for the IEEE double precision format ( 2, 53 n ) , machine epsilon M is 53 2 . (a) For the 8 (,) ( 8 , ) nn machine, machine epsilon is 8 1 82 n . To achieve the relative error accuracy that an IEEE single precision machine possesses, we should have 8 8 1 33 24 23 8 6 22 2 . 23 n n n   That is, 8 n should at least be 9. Similarly, to achieve the relative error accuracy that an IEEE double precision machine possesses, we should have 8 8 1 53 52 8 85 5 2 . n n n That is, 8 n should at least be 19. (b) For the 10 1 0 machine, machine epsilon is 10 1 10 2 n . To achieve the relative error accuracy that an IEEE single precision machine possesses, we should have 10 10 1 1 24 23 10 10 10 10 2 10 2 1 23log 2 7.92. 2 n n That is, 8 n should at least be 8. Similarly, to achieve the relative error accuracy that an IEEE double precision machine possesses, we should have 10 10 1 1 53 52 10 10 10 10 2 10 2 1 52log 2 16.65. 2 n n That is, 8 n should at least be 17.
Background image of page 1

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

View Full DocumentRight Arrow Icon
EE103 Spring 2010 HW2 Sol. Prof. S.E. Jacobsen 2 Problem 2 (a) In this problem, the roots of 2 1 x x are   152 x  and the derivative of 2 () 1 gx x  is '( ) 2 g xx . However, 2 5 1 1 x , which means the fixed point method will not converge to either of the roots. Now consider the other function 1/2 () ( 1 ) x  . Notice that x has to be greater than -1 for g x to be valid, so x can only be   . The derivative is  1/2 1 2 1 x , and 1/2 11 1 2 1 1 2 51 x x  . Therefore, the fixed point method will converge to the root   at a linear (geometric) rate (since 0 and 1 ). From the figure below, it is also clear that for any initial point > -1, the fixed point method will converge to the root   . -1 -0.5 0 0.5 1 1.5 2 -1 -0.5 0 0.5 1 1.5 2 x sqrt(1+x) x (b) In the fixed point method, if k x is in the interval where () g x is greater than x , the next point 1 k x must be greater than k x . This can be easily shown by 1 kk k x x  . On the other hand, if k x g x is less than x , the next point 1 k x must be less than k x . Hence, in this problem if the initial point is chosen to be any number greater than   (root1 in the figure), k x will diverge to infinity. This can be easily shown by the following
Background image of page 2
EE103 Spring 2010 HW2 Sol. Prof. S.E. Jacobsen 3 Matlab code: g = @(x)x^2-1; xk = 2; % initial point x0 xk = g(xk) xk = 3 xk = g(xk) xk = 8 xk = g(xk) xk = 63 xk = g(xk) xk = 3968 xk = g(xk) xk =15745023 diary off; From part (a), we know that even for the initial points less than   152 , k x will not converge to any roots. However,
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 06/01/2010 for the course EE EE 103 taught by Professor Jacobsen during the Spring '09 term at UCLA.

Page1 / 11

hw2_solution_SEJ - EE103 Spring 2010 HW2 Sol. Prof. S.E....

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