Exercises 05

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Exercises 247

5.28. In solving a nonlinear equation in one di- asymptotic convergence rate. For each method,
mension, how many bits of accuracy are gained specify a situation in which that method is partic-
per iteration of ularly appropriate.
(a) Bisection method? (a) Regular quadratic interpolation
(b) Newton’s method? (b) Inverse quadratic interpolation
5.29. In solving a nonlinear equation f (x) = 0, if (c) Linear fractional interpolation
you assume that the cost of evaluating the deriva-
tive f 0 (x) is about the same as the cost of evalu- 5.35. State at least one method for finding all the
ating f (x), how does the cost of Newton’s method zeros of a polynomial, and discuss its advantages
compare with the cost of the secant method per and disadvantages.
iteration?
5.36. Does the bisection method generalize
5.30. What is meant by inverse interpolation? to finding zeros of multidimensional functions?
Why is it useful for root finding problems in one Why?
dimension?
5.37. For solving an n-dimensional nonlinear
5.31. Suppose that you are using fixed-point it-
equation, how many scalar function evaluations
eration based on the fixed-point problem x = g(x)
are required per iteration of Newton’s method?
to find a solution x∗ to a nonlinear equation
f (x) = 0. Which would be more favorable for 5.38. Relative to Newton’s method, which of the
the convergence rate: a horizontal tangent of g at following factors motivate secant updating meth-
x∗ or a horizontal tangent of f at x∗ ? Why? ods for solving systems of nonlinear equations?
5.32. Suggest a procedure for safeguarding the (a) Lower cost per iteration
secant method for solving a one-dimensional non- (b) Faster convergence rate
linear equation so that it will still converge even
if started far from a root. (c) Greater robustness far from solution
5.33. For what type of function is linear frac- (d ) Avoidance of computing derivatives
tional interpolation a particularly good choice of 5.39. Give two reasons why secant updating
zero finder? methods for solving systems of nonlinear equa-
5.34. Each of the following methods for comput- tions are often more efficient than Newton’s
ing a root of a nonlinear equation has the same method despite converging more slowly.

Exercises
5.1. Consider the nonlinear equation 5.3. Newton’s method is sometimes used to im-
2 plement the built-in square root function on a
f (x) = x − 2 = 0. computer, with the initial guess supplied by a
lookup table.
(a) With x0 = 1 as a starting point, what is the
value of x1 if you use Newton’s method for solving (a) What is the Newton iteration for computing
this problem? the square root of a positive number y (i.e., for
solving the equation f (x) = x2 − y = 0, given y)?
(b) With x0 = 1 and x1 = 2 as starting points,
(b) If we assume that the starting guess has an
what is the value of x2 if you use the secant
accuracy of 4 bits, how many iterations would be
method for the same problem?
necessary to attain 24-bit accuracy? 53-bit accu-
5.2. Write out Newton’s iteration for solving racy?
each of the following nonlinear equations:
5.4. On a computer with no functional unit for
(a) x3 − 2x − 5 = 0. floating-point division, one might instead use mul-
(b) e−x = x. tiplication by the reciprocal of the divisor. Apply
(c) x sin(x) = 1. Newton’s method to produce an iterative scheme
248 Chapter 5: Nonlinear Equations

for approximating the reciprocal of a number y > (a)


0 (i.e., to solve the equation f (x) = (1/x) − y = 0,
given y). Considering the intended application, x21 + x22 = 1,
your formula should contain no divisions! x21 − x2 = 0.
5.5. (a) Show that the iterative method
(b)
xk−1 f (xk ) − xk f (xk−1 )
xk+1 = x21 + x1 x32 = 9,
f (xk ) − f (xk−1 )
3x21 x2 − x32 = 4.
is mathematically equivalent to the secant method
for solving a scalar nonlinear equation f (x) = 0. (c)
(b) When implemented in finite-precision floating-
x1 + x2 − 2x1 x2 = 0,
point arithmetic, what advantages or disadvan-
tages does the formula given in part a have com- x21 + x22 − 2x1 + 2x2 = −1.
pared with the formula for the secant method
given in Section 5.5.4)? (d )

5.6. Suppose we wish to develop an iterative x31 − x22 = 0,


method to compute the square root of a given pos- x1 + x21 x2 = 2.
itive number y, i.e., to solve the nonlinear equation
f (x) = x2 − y = 0 given the value of y. Each of (e)
the functions g1 and g2 listed next gives a fixed-
point problem that is equivalent to the equation 2 sin(x1 ) + cos(x2 ) − 5x1 = 0,
f (x) = 0. For each of these functions, deter- 4 cos(x1 ) + 2 sin(x2 ) − 5x2 = 0.
mine whether the corresponding fixed-point itera-
tion scheme xk+1 = gi (xk ) is locally convergent to 5.10. Carry out one iteration of Newton’s
√ method applied to the system of nonlinear equa-
y if y = 3. Explain your reasoning in each case.
(a) g1 (x) = y + x − x2 . tions
(b) g2 (x) = 1 + x − x2 /y. x21 − x22 = 0,
(c) What is the fixed-point iteration function 2x1 x2 = 1,
given by Newton’s method for this particular
problem? with starting value x0 = [ 0 1 ]T .
5.7. The gamma function has the following 5.11. Suppose you are using the secant method

known values: Γ(0.5) = π, Γ(1) = 1, Γ(1.5) =
√ to find a root x∗ of a nonlinear equation f (x) = 0.
π/2. From these three values, determine the ap- Show that if at any iteration it happens to be the
proximate value x for which Γ(x) = 1.5, using one case that either xk = x∗ or xk−1 = x∗ (but not
step of each of the following methods. both), then it will also be true that xk+1 = x∗ .
(a) Quadratic interpolation 5.12. Newton’s method for solving a scalar non-
(b) Inverse quadratic interpolation linear equation f (x) = 0 requires computation of
(c) Linear fractional interpolation the derivative of f at each iteration. Suppose that
we instead replace the true derivative with a con-
5.8. Using the various criteria given in Sec-
stant value d, that is, we use the iteration scheme
tion 5.2, investigate the existence and uniqueness
of solutions to the system of nonlinear equations xk+1 = xk − f (xk )/d.
in Example 5.2. How do your results change as
γ varies through the range of values given in the (a) Under what condition on the value of d will
example? this scheme be locally convergent?
5.9. Express the Newton iteration for solving (b) What will be the convergence rate, in general?
each of the following systems of nonlinear equa- (c) Is there any value for d that would still yield
tions. quadratic convergence?
Computer Problems 249

5.13. Consider the system of equations fixed point of the smooth function g: R → R, and
g 0 (x∗ ) = 0, then the convergence rate of the fixed-
x1 − 1 = 0, point iteration scheme xk+1 = g(xk ) is at least
x1 x2 − 1 = 0. quadratic if started close enough to x∗ .
For what starting point or points, if any, will New- 5.15. Verify the formula given in Section 5.5.6 for
ton’s method for solving this system fail? Why? the change h in c when using linear fractional in-
5.14. Supply the details of a proof that if x∗ is a terpolation to find a zero of a nonlinear function.

Computer Problems

5.1. (a) How many zeros does the function (a) x3 − 2x − 5 = 0.


(b) e−x = x.
f (x) = sin(10x) − x
(c) x sin(x) = 1.
have? (Hint: Sketching the graph of the function (d ) x3 − 3x2 + 3x − 1 = 0.
will be very helpful.) 5.4. Repeat the previous exercise, this time im-
(b) Use a library routine or one of your own de- plementing the inverse quadratic interpolation
sign to find all of the zeros of this function. (Hint: and linear fractional interpolation methods, and
You will need a different starting point or initial answer the same questions as before.
bracketing interval for each root.) 5.5. Consider the function
5.2. For the equation f (x) = (((x − 0.5) + x) − 0.5) + x,

f (x) = x2 − 3x + 2 = 0, evaluated as indicated (i.e., without any simplifi-


cation). On your computer, is there any floating-
each of the following functions yields an equivalent point value x such that f (x) is exactly zero? If
fixed-point problem: you use a zero-finding routine on this function,
what result is returned, and what is the value of
g1 (x) = (x2 + 2)/3, f for this argument? Experiment with the error

g2 (x) = 3x − 2, tolerance to determine its effect on the results ob-
g3 (x) = 3 − 2/x, tained.
5.6. Compute the first several iterations of New-
g4 (x) = (x2 − 2)/(2x − 3).
ton’s method for solving each of the following
equations, starting with the given initial guess.
(a) Analyze the convergence properties of each
of the corresponding fixed-point iteration schemes (a) x2 − 1 = 0, x0 = 106 .
for the root x = 2 by considering |gi0 (2)|. (b) (x − 1)4 = 0, x0 = 10.
(b) Confirm your analysis by implementing each For each equation, answer the following questions:
of the schemes and verifying its convergence (or What is the apparent convergence rate of the se-
lack thereof) and approximate convergence rate. quence initially? What should the asymptotic
convergence rate of Newton’s method be for this
5.3. Implement the bisection, Newton, and se- equation? How many iterations are required be-
cant methods for solving nonlinear equations in fore the asymptotic range is reached? Give an an-
one dimension, and test your implementations by alytical explanation of the behavior you observe
finding at least one root for each of the following empirically.
equations. What termination criterion should you
5.7. (a) How does Newton’s method behave
use? What convergence rate is achieved in each
when you apply it to find a solution to the non-
case? Compare your results (solutions and con-
linear equation
vergence rates) with those for a library routine for
solving nonlinear equations. x5 − x3 − 4x = 0,

You might also like