Download Midterm Exam with Solutions - Numerical Analysis | MATH 128A and more Exams Mathematical Methods for Numerical Analysis and Optimization in PDF only on Docsity! Midterm Solutions Problem 2: (a) Our function is f(x) = (3x + 1)1/3. At x = 1, f(x) − x = 41/3 − 1. This is positive, since 13 < 4. At x = 2, f(x)−2 = 71/3−2. This is negative, since 23 > 7. By the Intermediate Value Theorem, f(x)−x has a root in the interval [1, 2]. Equivalently, f(x) has a fixed point in this interval. (b) Fixed point iteration for f(x) converges in an interval [a, b] if there is a root in this interval and |f ′(x)| < λ < 1 for all x ∈ [a, b]. From part (a), we know there is a root. We compute f ′(x) = 1 3 3(3x+ 1)−2/3 = (3x+ 1)−2/3. Since 3x + 1 ≥ 4 for x in [1, 2], we conclude that (3x + 1)−2/3 ≤ 4−2/3 < 1 for all x in the interval. This satisfies the conditions of the theorem, so the fixed point iteration pk+1 = (3pk + 1) 1/3 convergers for any starting point p0 ∈ [1, 2]. Problem 3: We want to find a polynomial P (x) of degree at most 2 such that P (0) = P (1) = P (2) = 1. We compute the Lagrange polynomials L0 = (x−1)(x−2) (0−1)(0−2) , L1 = (x−0)(x−2) (1−0)(1−2) , L2 = (x−0)(x−1) (2−0)(2−1) . Our polynomial P should be 1L0+1L1+1L2 = (x2 − 3x+ 2)/2− (x2 − 2x) + (x2 − x)/2 = 0x2 + 0x+ 1. So P (x) = 1. We verify P (1) = P (2) = P (3) = 1, so this is the correct polynomial. Problem 4: Relative error is |p−p ∗| |p| , and this should be at most 10 −4. So |p − p∗| ≤ 10−4p, or −10−4p ≤ p − p∗ ≤ 10−4p. This is true for p∗ in the interval [p− 10−4p, p+ 10−4p]. Since p = √ 2, this is [ √ 2− 10−4 √ 2, √ 2 + 10−4 √ 2]. An estimate has n significant digits if the relative error is less than 5·10−n. As we have just computed, for p in the above interval the relative error is at most 10−4 < 5 · 10−4, so any p∗ in this interval has at least 4 significant digits. Problem 5: (a) pk = λ αk , with λ < 1 and α > 0. Since λ < 1, pk approaches zero as k →∞ if and only if αk →∞. This is true if and only if α > 1, which is our condition for pk to approach zero. (b) We compute the order of convergence as the largest R for which limk→∞ pk+1 pR k exists. This is λ αk+1 (λαk )R , which is equal to λ α(αk) λR(α k) = λ(α−R)α k . Since α > 1 from part (a), this limit exists if and only if R ≤ α, so the order of convergence is α. 1