Views
7 months ago

numerical3j

{36} • Numerical

{36} • Numerical Methods Exercise 11 We apply Newton’s method to f (x) = cos x − x. We know, by the intermediate value theorem, that there is a solution in [0,1], so we can start at x 1 = 1. We obtain (to 9 decimal places) x 1 = 0.750363868, x 2 = 0.739112891, x 3 = 0.739085133, x 4 = 0.739085133. After only 3 iterations we have the solution to 9 decaimal places. This is much better than the bisection method, which took 7 iterations to obtain 6 decimal places. Exercise 12 We have f (x) = x(x − 1)(x − 2) = 2x − 3x 2 + x 3 and f ′ (x) = 2 − 6x + 3x 2 = 3 [ (x − 1) 2 − 1 3] . Substituting x = 1 ± 1 5 , we obtain f (x) = x(x − 1)(x − 2) = (1 ± 1 )(± 1 )(−1 ± 1 ) = ±1 5 5 5 5 5 [( f ′ (x) = 3 ± 1 ) 2 − 1 ] [ 1 = 3 5 3 5 − 1 = 3] −2 5 x − f (x) f ′ (x) = 1 ± 1 ∓4 5 5 − = 1 ± 1 ∓ 2 = 1 ∓ 1 5 −2 5 5 5 5 Thus if x 1 = 1 + 1 5 then x 2 = 1 − 1 5 and x 3 = 1 + 1 5 . ( ( ) ) 2 1 2 − 5 = ∓4 5 5 Exercise 13 The original interval has length b − a. Afer n iterations the interval has length b−a 2 n . The best guess is the midpoint of this interval; its distance from the solution can be no more than half the length of this interval. So this best guess is within b−a 2 n+1 of a solution. Exercise 14 The first interval [a 0 ,b 0 ] = [−5,5] has length 10, so after n iterations, the interval [a n ,b n ] has length 10 2 n . To obtain an accuracy of 0.05 we require 10 2 n < 0.05, so 2 n > 10 0.05 = 200, hence n > log 2 (200) ∼ 7.64, so 8 steps are required. Exercise 15 The first interval has length b − a, so after n iterations, the interval [a n ,b n ] has length b−a 2 . To obtain an accuracy of ɛ, we require b−a n ( ) 2 < ɛ. Rearranging this gives 2 n > b−a n ( ) ɛ , or n > log b−a 2 ɛ . So the bisection method will require at least log b−a 2 ɛ steps. Exercise 16 Given an interval [a,b] = [a 0 ,b 0 ], you could divide it into ten subintervals at the 9 points 1 10 , 2 10 ,..., 9 1 2 9 10 from a to b, i.e. at the points a + 10 (b −a), a + 10 (b −a), ..., a + 10 (b −a). The

A guide for teachers – Years 11 and 12 • {37} j ’th point is a+ j 10−j 10 (b−a) = 10 a+ j 10b. You could then evaluate f at these 9 points. If f = 0 at any of these points, we have an exact solution. Otherwise, as f changes sign between a and b, it must change sign on at least one of the sub-intervals; one such sub-interval is chosen as [a 1 ,b 1 ]. Repeating this method produces a sequence of nested intervals [a 0 ,b 0 ] ⊃ [a 1 ,b 1 ] ⊃ [a 2 ,b 2 ] ⊃ ···, each of which contains a solution, and each of which is one tenth the size of the previous interval. If [a 0 ,b 0 ] = [0,1], then each successive [a n ,b n ] determines a successive decimal digit of the solution.