





































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






































1 TAYLOR Polynomials 2
2 Errors 7
3 Numeric Differentiation 8
4 Roots. Midpoint Method 10
5 Roots. NEWTON’s Method 10
6 Roots. HALLEY’s Method 12
7 Roots. Secant Method 14
8 Roots. Miscellaneous 14
9 Fixed Point Iteration 14
10 NEWTON’s Method for Systems 15
11 Secant Method for Systems 17
12 Interpolation polynomials 17
13 Interpolation polynomials and NEWTON divided differences 19
14 Interpolation and ˇCEBY ˇSEV polynomials 21
15 Interpolation Splines 22
16 Least Squares Fitting 24
17 Compound Newton-Cotes Quadrature Methods 29
18 RICHARDSON Extrapolation and ROMBERG Qudrature 32
19 GAUSS-LEGENDRE Quadrature 34
20 Miscellaneous Quadrature Problems 34
21 Iterative methods for fixed points for non- linear systems. Simultaneous and succes- sive displacements 36
22 Vectors. Inner Products and Norms 38
23 Matrices 39
24 GAUSS-JORDAN Row Reduction 41
25 LU Facrorization 42
26 Positive Definite Matrices 43
27 GAUSS-JACOBI and GAUSS-SEIDEL iter- ative methods for linear systems 43
This list of problems will be augmented during the quarter. Some of the problems are from old lists of sample problems, old tests or old assignments. Thus there may be some duplication, or at least, near duplication, of other material on my web pages. Other problems may seem familiar because I used them as examples in my lectures.
Some of the problems here may be used with minor editing on future tests. Other problems, espe- cially those which are pretty theoretical, are for instruction and amusement.
If you have difficulties with any of the problems then ask me for hints or clarification, but don’t wait until the end of the term!
e =
k=
k!
Deduce 2. 5 ≤ e ≤ 2. 75. Hint Show k! ≥ 2(3k−^2 ) if k ≥ 3.
∑^ n
k=
k!
2 k
to approximate
e = e^1 /^2. How large should we take n to guarantee the error is no larger than 10 −^12? Hint You may find it useful to note e^1 /^2 ≤ 2.
mial
p(x) = 1 + 2x + 2x^2 +
x^3.
Use the TAYLOR remainder to give a good upper bound for the truncation error that we make at x = − 12 and at x = 12.
TAYLOR polynomial
p(x) = x −
x^2 +
x^3.
Use this inequality (and only this inequality) to obtain an estimate of
∫ (^1)
0
sin(x) x dx
with an error no bigger than 0. 0008. Be sure to explain what you are doing and to back up your claim that the error is no bigger than 0. 0008. ( Hint: Find an interval containing the value of the integral and use the midpoint as your estimate.)
1 + x +
x^2 −
x^4 −
x^5 −
x^6.
Given that
∣ f (7)(x)
∣ ≤ 120 for | x | ≤ 12 estimate the error in approximating f (x) by the TAYLOR
polynomial on the interval
Part B: Compute the value of the TAYLOR polynomial at x = 12.
Part C: Use your calculator to compute f
2
and compare this value with the estimate obtained in part B. How does the actual error compare with your estimate of the error obtained in part A?
x. Evaluate the TAYLOR polynomial at x = 1. 2 and compare your result with
1 − t
= 1 + t + t^2 + t^3 +
t^4 1 − t
and integrate with respect to s to obtain
arctan x = x −
x^3 3
x^5 5
x^7 7
∫ (^) x
0
s^8 1 + s^2 ds.
Now use tan
( (^) π 8
2 − 1 to estimate π. Note that the absolute error in your estimate of π is bounded by ∣ ∣ ∣ ∣ ∣
0
s^8 1 + s^2
ds
0
s^8 ds
How does this estimate compare with the actual error?
1 − t
= 1 + t + t^2 + t^3 + t^4 + t^5 + t^6 + t^7 1 − t
Again compare the estimated error and the actual error.
e =
n=
n!
to deduce e ≤ 3.
ex^ =
∑^ n
k=
k!
xk^ +
(n + 1)!
eξ^ xn+
for some ξ between 0 and x. If we use the polynomial part here (the Taylor polynomial of degree n) to estimate ex^ how large must we take n in order to ensure the absolute truncation error is bounded by 10 −^9 on the interval [− 1 , 1]. How large must we take n in order to ensure the same error bound, but just on the interval [− 12 , 12 ].
lor polynomial. This method is sometimes more convenient the estimating the TAYLOR remainder directly (and avoids the mysterius ξ.) For example, if we integrate (^1) −^1 x =
k=0 x
k (^) we obtain
− log(1 − x) =
k=
k
xk^ , | x | < 1.
Thus
− log(1 − x) =
∑^ n
k=
k xk^ + Rn(x) where Rn(x) =
k=n+
k xk^.
An easy estimate yields
| Rn(x) | ≤
n + 1
k=n+
| x |k^ ≤
n + 1
| x |n+ 1 − | x |
Taking x = 12 we obtain
log 2 ∼=
∑^ n
k=
k 2 k^
with an absolute error bounded by
(n + 1)2n^
How large should we take n to guarantee an estimate of log 2 with an absolute error no larger than 10 −^12?
log(1 + x) =
k=
(−1)k+ k
xk^ , | x | < 1.
Thus
log
1 + x 1 − x
= − log(1 − x) + log(1 + x) = 2
k=
x^2 k+ 2 k + 1 , | x | < 1.
A real number xa is said to have m significant decimal digits as an approximation to the real number xt 6 = 0 provided that (^) ∣ ∣ ∣ ∣
xt − xa xt
−m− (^1).
The best value of m is called the number of significant decimal digits in xa as an approximation to xt or simply the number of significant digits when xt and “decimal” are understood. It is clearly given by
m =
− log 10
xt − xa xt
Here
indicates the greatest integer function otherwise known as floor. Note this definition of significant decimal digits may not agree with the count obtained by other methods, but it is more convenient, and equally useful.
formula above to find the the number of significant decimal digits in each. Does your understanding of significant digits agree with your calculated result?
ing from − 63 to 64 and with a mantissa of length 12 bits. Assume only normalized representations are used and there is no packing.
A.) What is the largest exactly representable positive number?
B.) What is the smallest exactly representable positive number?
C.) What is the unit round?
Answers:
denormals when the exponent is − 63. Suppose also we reserve the largest exponent, 64 , to designate ±∞, projective infinity, NaN’s and other special data. How does this affect the answers to the previous problem?
ing from − 63 to 64 and with a mantissa of length 12 bits. Assume only normalized representations are used and the format is packed (that is, the most significant bit in the mantissa is not explicitly stored).
A.) What is the largest exactly representable positive number?
B.) What is the smallest exactly representable positive number?
C.) What is the unit round?
denormals when the exponent is − 63. Suppose also we reserve the largest exponent, 64 , to designate ±∞, projective infinity, NaN’s and other special data. How does this affect the answers to the previous problem? Note that numbers with exponent − 63 are not packed (to allow for denormals).
ing from − 63 to 64 and with a mantissa of length 12 bits. Assume only normalized representations are used and there is no packing. Find the error that we make when storing 113.2 (decimal)? Ans: 1 /80 = 0. 0125.
be the error in storing 113. 2?
f ′(a) =
− 5 f (a) + 9f (a + 2h) − 4 f (a + 3h) 6 h
h^2
Show that the error term can be written as
cf (3)(a)h^2 + O
h^3
and compute the constant c. Hint: Use Taylor expansions.
f ′′(a) =
f (a) − 3 f (a + 2h) + 2f (a + 3h) 3 h^2
Show that the error term can be written as
cf (3)(a)h + O
h^2
and compute the constatnt c. Hint: Use TAYLOR expansions.
Here are a few standard numeric differentiation formulæ:
p(x) = x^3 − 6 x^2 + 9x − 5
has a root in the interval [4, 5]. Suppose we bisect the interval. (A) Which half of the interval can we guarantee contains a root? (B) If we use the midpoint of the subinterval containing the root to estimate the root give an upper bound for the error.
p(x) = x^3 − 3 x + 1
has a root in the interval [0, 1]. Use the bisection method (also called binary search method ) to locate the root with an error no larger than 161. (Your work must show clearly that you used the bisection method .)
[− 1 , 0]. (A) Suppose we bisect the interval. Which half of the interval can we guarantee contains a root. Why? (B) Bisect the subinterval known to contain a root. Which sub-sub-interval can we now guarantee contains the root? (C) If we use the midpoint of this last interval as an estimate of the root find an bound for the error that we make.
p(x) = 2x^4 − 4 x + 1
has a root in the interval [0, 1]. Suppose we bisect the interval. (A) Which half of the interval can we guarantee contains a root? (B) If we use the midpoint of the subinterval containing the root to estimate the root, give an upper bound for the error.
p(x) = x^5 + x + 1
has a root in the interval [− 1. 0 , − 0 .5]. Suppose we bisect the interval. (A) Which half of the interval can we guarantee contains a root? (B) If we use the midpoint of the subinterval containing the root to estimate the root, give an upper bound for the error.
in the interval [−π/ 2 , 0]. Part (B). Use the bisection method to obtain an estimate of the root with an error no larger than π/ 8. In part (B) you must give the estimate provided by application of the bisection method and explain it. I have no interest in the more accurate solution provided by your calculator.
This section deals with the NEWTON root estimate iteration
xn+1 = xn − f (xn) f ′(xn)
p(x) = x^5 + x + 1
has a root in the interval [− 1 , 0]. Use the midpoint of this interval as an initial guess and apply NEWTON’s method once. What is your new approximation to the root?
p(x) = x^3 − 3 x + 1
has a root in the interval [0, 1]. Use the midpoint of this interval as an initial guess and use one iteration of NEWTON’s method to obtain a new approximation to the root. (You must obtain exactly the value given by one iteration of NEWTON’s method.)
NEWTON’s method (twice) to compute successive approximations x 1 , x 2 to a root. (B) Estimate the error in the root estimate x 1. (C) Given that p(x) has only one real root,. 866369759... , find the actual errors in x 1 and x 2. How do they compare with your estimate of the error in x 1?
contain a root of f (x) = exp(x) − 6 x. Be sure to justify your answer (without finding the roots). Use an initial guess x 0 = 0 and apply NEWTON’s iteration once to obtain a new estimate x 1 for one of the roots.
root a^1 /^3 by applying NEWTON’s method to estimate the positive root of f (x). For n ≥ 0 find an expression for the (n + 1)st^ iterate xn+1 in terms of xn. Simplify.
5)/2 = 1. 6180339.... Use NEWTON’s method with initial “guess” x 0 = 2 for the root and compute the iterates x 1 , x 2 and x 3 and also the error in each iterate. Is the rate of convergence about what you would expect?
Use NEWTON’s method to compute successive approximations x 1 , x 2 , x 3 , x 4 and x 5. Given that − 1. 627772774213681160... is the only real root of p(x) find the actual errors in the root estimates. Do they behave as you would expect?
f (x) = x^7 + x^6 − 4 x^5 − 6 x^4 + 2x^3 + 8x^2 + 5x + 1
and let
g(x) =
f (x) f ′(x)
so g has the same roots as f , but the roots of g are all simple. Use an initial guess x 0 = 1. 1 and apply NEWTON’s method to f and to g. Comment on the rate of convergence (for example, compare the
errors) to the root
√ 5+ 2 = 1.^6180339887498948482045868343...^ (a double root for^ f^ ).
Accordingly, the next root estimate is
xn+1 = xn + δn = xn −
f (xn) f ′(xn)
HALLEY’s method results from taking a higher order TAYLOR expansion
0 = f (xn + δ) = f (xn) + f ′(xn)δ +
f ′′(ηn)δ^2
form some ηn between xn and xn + δ. This equation is quadratic in δ. We could use the quadratic formula, but we would probably get a headache. Instead note the δ which satisfies f (xn + δ) = 0 is given by
δ = −
f (xn) f ′(ξn)
where of course we do not know ξn. If we substitute this expression for one of the factors of δ in the δ^2 term we obtain
0 = f (xn) + f ′(xn)δ − f (xn)f ′′(ηn) 2 f ′(ξn)
It follows that
δ = −
2 f (xn)f ′(ξn) 2 f ′(xn)f ′(ξn) − f (xn)f ′′(ηn)
Thus, when all works well, we expect δ ≈ ∆n where
∆n = −
2 f (xn)f ′(xn) 2 f ′(xn)^2 − f (xn)f ′′(xn)
Setting xn+1 = xn + ∆n as the next root estimate we obtain HALLEY’s iteration
xn+1 = xn −
f (xn) f ′(xn)
f (xn)f ′′(xn) 2 f ′(xn)^2
If we start sufficiently close to a simple root α then some heavy algebra and analysis shows HAL- LEY’s method yields K(α − xn+1) ≈ (K(α − xn))^3
for a certain constant K, that is, HALLEY’s method is of order 3. In more prosaic terms, if we start sufficiently close to a simple root, then after things settle down we will see roughly a tripling of the number of significant digits with each iteration!
f (x) = x − cos(x)
has a simple root given approximately by
α = 0. 739085133215160641655312087673873404013411758900757465
Starting with an initial guess of x 0 = 0. 1 compute a few NEWTON and HALLEY iterations and the error in each. Comment on your results. Are your results consistent with your expectations? Note: The error in x 4 for NEWTON’s method is about − 1. 03 × 10 −^11 and for HALLEY’s method it is about
p(x) = x^3 − 3 x + 1
has a root in the interval [0, 1]. Use the points x 0 = 0. 0 and x 1 = 0. 5 as initial guesses and use one iteration of the secant method to obtain a new approximation to the root. (You must obtain exactly the value given by one iteration of the secant method.)
to a root. Use the secant method to compute successive approximations x 2 , x 3 , x 4 and x 5. Given that − 1. 627772774213681160... is the only real root of p(x) find the actual errors in the root estimates. Do they behave as you would expect?
Thus for small > 0 the polynomial p(x) + x^4 has a root at x = α() which is continuously differentiable in and satisfies α(0) = 5. Compute the derivative α′(0).
Thus for small > 0 the polynomial p(x) + x^4 has a root at x = α() which is continuously differentiable in and satisfies α(0) = 5. Compute the derivative α′(0).
the root must be in the interval (− 1 , 0). Hint: Sign change.
small > 0 the polynomial p(x) + x^2 has a root at x = α() which is continuously differentiable in and satisfies α(0) = 1. Compute the derivative α′(0). Use your result to estimate a root of p(x) = x^3 + 1. 1 x^2 − x − 1.
g(x) = 1 +
x
Show that g has a unique positive fixed point α. Let x 0 = 2. Does the iteration xn+1 = g(xn) appear to converge to α.
x then G maps the interval I = [9, 49] into itself and | G′(x) | ≤ 5 6 for each^ x^ ∈^ I.^ Part (A).^ How do you know that^ G^ has a unique fixed point in^ [9,^ 49]?^ Part (B). If x 0 = 49 and we define xn+1 = G(xn)
Use the initial point (− 0. 8 , 0 .4) and iterate three times. Given that the actual solution is
(− 0. 865034729 , 0 .450902472)
compute the error in each of your iterates. Comment.
rithm. Do several more iterations. Comments?
equations
x^2 + y^2 + z^3 = 3 x + 2y − 2 z = 0 x^3 + y^3 − 3 z^2 = 2.
Use the initial point (1. 0 , − 1. 0 , 0) and iterate three times. Given that the actual solution is
(1. 44825 , − 0. 95663 , − 0 .23250)
compute the error in each of your iterates. Comment.
rithm. Do several more iterations. Comments?
x^2 + y^2 = 1 x^2 + y = − 1
is obviously (0, −1). Use the initial point (0. 25 , − 2 .0) and iterate 5 times. At each step compute the error in your iterate. What behavior of the errors do you observe?
rithm. Do several more iterations. Comments?
x^4 + 2y^4 + 3x^2 y^2 + 2xy^3 + 3x − 2 y^2 + 4
by setting the partial derivatives equal to 0 and using NEWTON’s method with 3 iterations and an initial guess of (− 1. 0 , 1 .0).
rithm. Do several more iterations. Comments?
2 x^2 + y^2 = 4 x^2 − 4 xy − y^2 = 0
has four solutions. Use NEWTON’s method with the initial point (1. 0 , 1 .0) and with four iterations to estimate one solution. What happens if you use the initial points (− 1. 0 , 1 .0), (1. 0 , − 1 .0) or (− 1. 0 , − 1 .0)?
rithm. Do several more iterations. Comments?
The secant iteration for approximating roots can be extended to systems of equations. This method has the advantage of not requiring derivatives, but it does require us to supply 3 initial points (in the case of 2 variables).
To estimate a solution to the system
f (x, y) = 0 g(x, y) = 0
we first choose 3 points (x 1 , y 1 ), (x 2 , y 2 ) and (x 3 , y 3 ) which are close to a solution. By evaluating f at these 3 points we obtain 3 points in 3-space, (xn, yn, f (xn, yn)), n = 1, 2 , 3. If these points are not collinear there is a unique plane P 1 through them. Likewise from g we obtain 3 points (xn, yn, g(xn, yn)), n = 1, 2 , 3. If these points are not collinear there is a unique plane P 2 through them. If the planes P 1 and P 2 are not parallel they intersect in a line and if this line is not parallel to the (x, y)-plane it meets that plane in a point (x 4 , y 4 ). Now use the points (x 2 , y 2 ), (x 3 , y 3 ) and (x 4 , y 4 ) and repeat the construction to obtain the next iterate (x 5 , y 5 ).
equations
x^3 − 3 y + 2 = 0 y^3 − 2 x^2 + 3x + 4 = 0.
Use the initial points (− 0. 8 , 0 .4), (− 0. 8 , 0 .5) and (− 0. 9 , 0 .5) and iterate three times. Given that the actual solution is (− 0. 865034729 , 0 .450902472) compute the error in each of your iterates. Com- ment. Remark: As a check on your work note the first iterate is (− 0. 8646900900 , 0 .4492075016).
interpolation polynomial of degree at most 2 which interpolates f (x) between these points. (B) Use the result of part (A) to estimate f ( 32 ). (C) What estimate do you get for f ( 32 ) if you use linear interpolation between successive points?
and (3, 1). Ans: − 53 x^3 + 152 x^2 − 476 x + 2
x 0 1 2 3 4 5 y 2 2 3 5 6 7
compute the interpolation polynomial of degree ≤ 5 with the given nodes. As a check on your work, compare your result with my graph below.
Interpolation Polynomial
x
f [x 0 , x 1 ] =
f (x 1 ) − f (x 0 ) x 1 − x 0
f [x 0 , x 1 , · · · , xk ] =
f [x 1 , · · · , xk ] − f [x 0 , · · · , xk− 1 ] xk − x 0 Pn(x) = f (x 0 ) + f [x 0 , x 1 ](x − x 0 ) + · · · + f [x 0 , x 1 , · · · , xn](x − x 0 ) · · · (x − xn− 1 ) = Pn− 1 (x) + f [x 0 , x 1 , · · · , xn](x − x 0 ) · · · (x − xn− 1 )
where Pk (x) is the interpolation polynomial (of degree ≤ k) for the function f with nodes at x 0 , x 1 , · · · , xk.
A remarkable identity which holds for any function f is:
f (x) = Pn(x) + f [x 0 , x 1 , · · · , xn, x](x − x 0 )(x − x 1 ) · · · (x − xn).
A consequence of this identity is if we view Pn(x) as an approximation to f (x) then the error is given by 1 (n + 1)!
f (n+1)(ξ) (x − x 0 )(x − x 1 ) · · · (x − xn)
for some ξ between min(x 0 , x 1 , · · · , xn, x) and max(x 0 , x 1 , · · · , xn, x).
0 and f (x 2 ) = − 1. Compute the NEWTON divided differences f [x 0 , x 1 ] and f [x 0 , x 1 , x 2 ]. Find the linear interpolation polynomial P 1 (x) through the first two points and the quadratic inter- polation polynomial P 2 (x) through all three points. What estimates do these polynomials give for f (1)?
NEWTON divided difference f [x 0 , x 1 , x 2 ].
2 , f [− 1 , 1] = 1, f [− 1 , 1 , 2] = − 2 , f [− 1 , 1 , 2 , 4] = 2. (A) Find the interpolation polynomial P 3 (x) for f (x) of degree at most 3 with nodes at − 1 , 1 , 2 , 4. (B) Use the interpolation polynomial to estimate f (0). (C) Find a good upper bound for the absolute error in the estimate of f (0) given that |f [− 1 , 1 , 2 , 4 , x]| ≤ 1. 4 for all x in the interval [− 1 , 4].
let x 0 , x 1 , · · · , xn be any n + 1 distinct points. Use properties of the NEWTON divided differences to compute f [x 0 , x 1 , · · · , xn].
differences. k 0 1 2 3 xk − 1 0 1 3 yk 1 0 − 1 2 f [xk− 1 , xk ] × − 1 − 1 f [xk− 2 , xk− 1 , xk ] × × f [xk− 3 , xk− 2 , xk− 1 , xk ] × × ×
Use the NEWTON divided differences to compute the interpolation polynomial of degree at most 3 for the 4 data points (xk , yk ) k = 0, · · · , 3.
differences. k 0 1 2 3 xk − 1 1 2 4 yk 0 1 3 − 1 f [xk− 1 , xk ] × 1 / 2 2 f [xk− 2 , xk− 1 , xk ] × × − 4 / 3 f [xk− 3 , xk− 2 , xk− 1 , xk ] × × ×