ass1sol - CS510 Homework 1 Solutions October 5 2010 Note...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS510 Homework 1 - Solutions October 5, 2010 Note: Problems graded are I,II,III,VI,VII I. f (x) = x1/2 , f (x) = 1 x−1/2 2 , f = − 1 x−3/2 4 , 3 f (x) = 8 x−5/2 (i) P (x) = f (4) + f (4)(x − 4) + f (4)(x − 4)2 /2 P (x) = 2 + 1 (x − 4) − 4 (ii) f (5) ≈ P (5) = 2 + 1 − 4 |E | = |(x − 4)3 · f (ξ )/3!| ξ ∈ (4, 5) 1 ≤ 3! max |(x − 4)3 | · max |f (ξ )| ξ ∈ (4, 5) 1 = 3! · 3 (4−5/2 ) 8 1 = 512 1 2 32 (x − 4) /2 1 143 64 = 64 = 2.234375 II. f (x) = x3 − x − 11 = 0 (i) f (x) = 3x − 1 > 0 x ∈ [2, 3] i.e f is monotonocally increasing in the interval 2,3 f (2) = −5 < 0 , f (3) = 13 > 0 i.e there must be a unique root x ∈ [2, 3] ¯ (ii) For bisection we have |ek | ≤ (b − a)/2k < 10−6 2k > 106 ≈ 220 we have k ≥ 20 ∴ at least 20 iterations are needed k xk = a − f (a)/m a b (iii) III. a 0 1 2 2.2778 2.3507 2.3683 2 2.2778 2.3507 3 3 3 (i) To be locally convergent the following condition must be satised |g (x)| < 1 , and we know f (x) has a root x ∈ [2, 3] ¯ ¯ (a) | g1 (x) |=| 3x2 |> 1 x ∈ [2, 3] (b) | g2 (x) |=| 1 (x + 11)−2/3 |< 1 x ∈ [2, 3] i.e locally convergent 3 (c) | g3 (x) |=| (4x3 − 2x)/11 |> 1 x ∈ [2, 3] 1 (d) We know newton is locally convergent since g4 (¯) = 0 x (ii) We need to check the contraction mapping theorem conditions (a) For (a) we know that | g2 (x) |< 1 f or x ∈ [2, 3] i.e the second condition of the contraction mapping theorem is satised. (b) We see the g2 (x) > 0 f or x ∈ [2, 3] (i.e montonocally increassing), therefore it suce to check the boundaries for the rst condition, we nd that g2 (2) = 131/3 ∈ [2, 3] and g2 (3) = 141/3 ∈ [2, 3] which =⇒ g (x) ∈ [2, 3] f or x ∈ [2, 3] i.e rst condition is also satised. (iii) We choose gauss newton starting from 2.5 k xk 0 1 2 3 4 5 2.5 2.380281690 2.373669437 2.373649822 2.373649822 2.373649822 IV. Using newton method the iteration is xk+1 = xk − x2 − a f (xk ) = xk − k f ( xk ) 2xk (i) Relative error in the initial iterate √ x0 − a x0 √ r0 =| | =| √ − 1 | a a But 2 e 2 a ∈ [(1.00..0)2 × 2e , (1.11..1)2 × 2e ] x0 −1≤ √ −1≤ e a (1.11..1)2 × 2 +1 2 e 2 +1 (1.00..0)2 × 2e −1 if e is even x0 −1≤ e −1≤ √ a 2 (1.11..1)2 × 2 2 (1.11..1)2 2 2 +1 e 2 2 +1 (1.00..0)2 × 2 2 e e −1 x0 2 −1≤ √ −1≤ −1 a (1.00..0)2 √ x0 2−1≤ √ −1≤1 a 2 Similarly if e is odd x0 22 −1≤ e −1≤ √ e −1 a 2 (1.11..1)2 × 2 (1.00..0)2 × 2 2 √ √ 2 x0 2 −1≤ √ −1≤ −1 a (1.11..1)2 (1.00..0)2 √ x0 0≤ √ −1≤ 2−1 a 2 e+1 2 e+1 Therefore r0 ≤ 1 V. (i) First we show the hint xk+1 = xk − = xk − = xk − f (xk ) m x2 − a k x2 −x2 −1 k k xk −xk−1 x2 − a k xk + xk−1 Subtracting √ a from both sizes we get √ ek (xk + a) ek+1 = ek − x k + x k −1 √ ek (xk + xk−1 ) − ek (xk + a) = x k + x k −1 ek ek−1 = x k + x k −1 (ii) We know | ek+1 | = O(| ek || ek−1 |) = c | ek || ek−1 | | ek+1 | | ek || ek−1 | =c We want to nd p such that ek+1 = sk | ek |p = sk sp−1 | ek−1 |p k 2 Substituting back sk sp−1 | ek−1 |p 2 | ek+1 | p k = = sk sk−1 | ek−1 |p −p−1 −1 | ek || ek−1 | sk−1 | ek−1 |p | ek−1 | 2 3 Since we know that | ek+1 |= O(| ek || ek−1 |), this implies p2 − p − 1 = √ 0 =⇒ p = (1 + 5)/2 VI. (i) Using taylor expansion around a f (x) f (a + h) f (a − h) = f (a) + f (a)(x − a) + f (2) (a)(x − a)3 + f (3) (ξ )(x − a)3 /3! = f (a) + f (a)h + f (2) (a)h2 /2 + f (3) (ξ )h/3! ξ1 ∈ (a, a + h) = f (a) − f (a)h + f (2) (a)h2 /2 − f (3) (ξ )h3 /3! ξ2 ∈ (a − h, a) Subtracting the last two equations and dividing by 2h we get f (a) = f (a + h) − f (a − h) + ET (h) = h2 (3) (f (ξ1 ) + f (3) (ξ2 )) 3 h2 (3) (f (ξ1 ) + f (3) (ξ2 )) 12 Let M3 = maxx | f (3) (x) | x ∈ (a − h, a + h) ET (h) = h2 M3 6 (ii) There are two sources of errors 1. Error term in taylor polynomial ≤ ET (h) 2. Round of error ≤ ER (h) ER (h) = ≤ = = = | f (a ˆ h) − f (a + h) | + | f (a ˆ h) − f (a − h) | + − 2h | f (a + h)(1 + δ ) − f (a + h) | + | f (a − h)(1 + δ ) − f (a − h) | max 2h | f (a + h)δ | + | f (a − h)δ | max 2h M0 + M0 2h M0 h max Therefore E (h) ≈ ≈ ER (h) + ET (h) h2 M0 + M3 h 6 What h minimizes the error dE (h) M0 h = − 2 + M3 = 0 dh h 3 4 h3 M3 = 3 M0 h= 3 3 M0 M3 (iii) k 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 k 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 h D( h ) 1 . 0 0 0 0 0 0 e+00 1 . 0 0 0 0 0 0 e −01 1 . 0 0 0 0 0 0 e −02 1 . 0 0 0 0 0 0 e −03 1 . 0 0 0 0 0 0 e −04 1 . 0 0 0 0 0 0 e −05 1 . 0 0 0 0 0 0 e −06 1 . 0 0 0 0 0 0 e −07 1 . 0 0 0 0 0 0 e −08 1 . 0 0 0 0 0 0 e −09 1 . 0 0 0 0 0 0 e −10 1 . 0 0 0 0 0 0 e −11 1 . 0 0 0 0 0 0 e −12 1 . 0 0 0 0 0 0 e −13 1 . 0 0 0 0 0 0 e −14 1 . 0 0 0 0 0 0 e −15 1 . 0 0 0 0 0 0 e −16 1 . 0 0 0 0 0 0 e −17 1 . 0 0 0 0 0 0 e −18 h D( h ) 1 . 0 0 0 0 0 0 e+00 1 . 0 0 0 0 0 0 e −01 1 . 0 0 0 0 0 0 e −02 1 . 0 0 0 0 0 0 e −03 1 . 0 0 0 0 0 0 e −04 1 . 0 0 0 0 0 0 e −05 1 . 0 0 0 0 0 0 e −06 1 . 0 0 0 0 0 0 e −07 1 . 0 0 0 0 0 0 e −08 1 . 0 0 0 0 0 0 e −09 1 . 0 0 0 0 0 0 e −10 1 . 0 0 0 0 0 0 e −11 1 . 0 0 0 0 0 0 e −12 1 . 0 0 0 0 0 0 e −13 1 . 0 0 0 0 0 0 e −14 1 . 0 0 0 0 0 0 e −15 1 . 0 0 0 0 0 0 e −16 1 . 0 0 0 0 0 0 e −17 1 . 0 0 0 0 0 0 e −18 5 Error 3 . 0 0 0 0 0 0 e+00 3 . 0 0 0 0 0 0 e+00 3 . 0 0 0 0 0 0 e+00 3 . 0 0 0 0 0 0 e+00 3 . 0 0 0 0 0 0 e+00 3 . 0 0 0 0 0 0 e+00 3 . 0 0 0 0 0 0 e+00 3 . 0 0 0 0 0 0 e+00 3 . 0 0 0 0 0 0 e+00 3 . 0 0 0 0 0 0 e+00 3 . 0 0 0 0 0 0 e+00 3 . 0 0 0 0 0 0 e+00 3 . 0 0 0 2 6 7 e+00 2 . 9 9 7 6 0 2 e+00 2 . 9 9 7 6 0 2 e+00 3 . 3 3 0 6 6 9 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 Error 7 . 7 5 0 0 0 0 e+00 6 . 7 6 0 0 0 0 e+00 6 . 7 5 0 1 0 0 e+00 6 . 7 5 0 0 0 1 e+00 6 . 7 5 0 0 0 0 e+00 6 . 7 5 0 0 0 0 e+00 6 . 7 5 0 0 0 0 e+00 6 . 7 5 0 0 0 0 e+00 6 . 7 5 0 0 0 0 e+00 6 . 7 5 0 0 0 1 e+00 6 . 7 5 0 0 0 1 e+00 6 . 7 4 9 9 7 8 e+00 6 . 7 5 0 6 0 0 e+00 6 . 7 4 5 7 1 5 e+00 6 . 7 5 0 1 5 6 e+00 7 . 5 4 9 5 1 7 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 0 . 0 0 0 0 0 0 e+00 3 . 5 5 2 7 1 4 e −15 2 . 6 6 4 5 3 5 e −15 − 3.304024 e −13 − 3.304024 e −13 1 . 9 6 5 4 0 6 e −11 − 2.467999 e −10 1 . 7 5 1 6 0 2 e −09 − 1.823241 e −08 2 . 4 8 2 2 1 1 e −07 2 . 4 8 2 2 1 1 e −07 2 . 4 8 2 2 1 1 e −07 2 . 6 6 7 0 1 7 e −04 − 2.397834 e −03 − 2.397834 e −03 3 . 3 0 6 6 9 1 e −01 − 3.000000 e+00 − 3.000000 e+00 − 3.000000 e+00 1 . 0 0 0 0 0 0 e+00 1 . 0 0 0 0 0 0 e −02 1 . 0 0 0 0 0 0 e −04 9 . 9 9 9 9 9 2 e −07 1 . 0 0 0 0 7 0 e −08 1 . 4 4 1 4 1 6 e −10 − 6.108110 e −10 3 . 3 8 5 9 9 2 e −09 − 1.881847 e −08 5 . 5 8 4 9 7 5 e −07 5 . 5 8 4 9 7 5 e −07 − 2.164596 e −05 6 . 0 0 0 7 8 9 e −04 − 4.284902 e −03 1 . 5 5 9 8 9 7 e −04 7 . 9 9 5 1 6 6 e −01 − 6.750000 e+00 − 6.750000 e+00 − 6.750000 e+00 VII. _ (i) | xk+1 − x |≤ L | xk − x | ¯ ¯ | xk+1 − x |≤ L | xk + xk+1 − xk+1 − x | ¯ ¯ | xk+1 − x |≤ L | xk+1 − x | +L | xk+1 − xk | ¯ ¯ (1 − L) | xk+1 − x |≤ L | xk+1 − xk | ¯ | xk+1 − x |≤ ¯ L | xk+1 − xk | (1 − L) > 0 1−L | xk+1 − xk |≤ =⇒ | xk+1 − x |≤ ¯ L 1−L (ii) let L ≤ 1−L 1 2 L ≤ (1 − L) =⇒ L ≤ 1 Therefore if L ≤ 2 , then it is safe to take the approximation. 6 ...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online