In this section, we consider the alternative form of the rootfinding problem known as the fixed-point problem.
Given f for rootfinding, we could define g(x)=x−f(x), and then f(r)=0 implies g(r)=r and vice versa. There are infinitely many ways to make this transformation, such as g(x)=x+cf(x) for any constant c. The process can be reversed, too. Given g(x), we could define f(x)=x−g(x), and then g(p)=p implies f(p)=0.
There is an extraordinarily simple way to try to find a fixed point of any given g(x).
This is our first example of an iterative algorithm that never quite gets to the answer, even if we use exact numbers. The idea is to generate a sequence of values that one hopes will converge to the correct result, and stop when we are satisfied that we are close enough to the limit.
In Demo 4.2.1, the two computed iterations differ only in the choice of x1. In the first case we evidently generated a sequence that converged to one of the fixed points. In the second case, however, the generated sequence diverged.[1] The easiest way to uncover the essential difference between the two cases is to use a Taylor series expansion.
Suppose a fixed point p is the desired limit of an iteration x1,x2,…. It’s often easier to express quantities in terms of the error sequence ϵ1,ϵ2,…, where ϵk=xk−p. Starting from (4.2.1), we have
If the iteration is to converge to p, the errors must approach zero. In this case we can neglect the second-order term and conclude that ϵk+1≈g′(p)ϵk. This is consistent with convergence if ∣g′(p)∣<1. However, if ∣g′(p)∣>1, we are led to the conclusion that the errors must grow, not vanish, even if they start quite small.
In computation we usually want to know not just whether an iteration converges but also the rate at which convergence occurs, i.e., how quickly the errors approach zero. Other things being equal, faster convergence is preferred to slower convergence, as it usually implies that the computation will take less time to achieve a desired accuracy.
The prediction of the series analysis above is that if the fixed point iteration converges, the errors approximately satisfy ∣ϵk+1∣=σ∣ϵk∣, for σ=∣g′(p)∣<1. This is a well-known type of convergence.
If we suppose that the ratios in (4.2.4) all equal σ (i.e., perfect linear convergence), then ∣ϵk∣=Cσk. Taking logs, we get
The convergence condition σ=∣g′(p)∣<1 derived by series expansion is a special case of a more general condition.
It can be shown that a function satisfying (4.2.6) is continuous in S. If L<1, we call g a contraction mapping because distances between points all decrease after an application of g. This situation leads to a major result about fixed points.
From the Fundamental Theorem of Calculus, which asserts that g(s)−g(t)=∫stg′(x)dx, it’s easy to conclude that an upper bound of ∣g′(x)∣≤L for all x results in (4.2.6). Hence:
There are stronger and more general statements of Theorem 4.2.1. For instance, it’s possible to show that all initial x1 that are sufficiently close to the fixed point will lead to convergence of the iteration. Algorithmically the main virtue of the fixed point iteration is that it is incredibly easy to apply. However, as we are about to discover, it’s far from the fastest option.
✍ In each case, show that the given g(x) has a fixed point at the given p and use (4.2.3) to show that fixed point iteration can converge to it.
(a)g(x)=1+x−91x2, p=3
(b)g(x)=π+41sin(x), p=π
(c)g(x)=x+1−tan(x/4), p=π
⌨ For each case in the preceding problem, apply 25 fixed point iterations and use a log-linear graph of the error to verify linear convergence. Then use numerical values of the error to determine an approximate value for σ in (4.2.4).
✍ In each case, show that the given g(x) has a fixed point at the given p. Then determine analytically whether the fixed point iteration could converge to that point given a close enough starting value.
(a)g(x)=3+x−x2, p=3
(b)g(x)=1+x, p=(1+5)/2
(c)g(x)=−1+x, p=(1−5)/2
(d)g(x)=x+1−tan(πx), p=1/4
In Demo 4.2.1 we defined g(x)=x−f(x) to find a fixed point of the polynomial f(x)=x2−4x+3.5.
(a) ✍ Why does the iteration spiral in to the fixed point, instead of approaching it monotonically? (Refer to the series analysis.)
(b) ✍ Show that if g^(x)=(x2+3.5)/4, then any fixed point of g^ is a root of f.
(c) ⌨ Use fixed point iteration on g^ to try to find both roots of f, and note which case(s), if either, converge.
(d) ✍ Use (4.2.3) to explain the success/failure in part (c) for each fixed point.
✍ The mth root of a positive real number a is a fixed point of the function
We can only ever generate a finite sample from an infinite sequence, which in principle does not guarantee anything whatsoever about the limit or divergence of that sequence. However, in practical computing one usually assumes that well-established trends in the sequence will continue, and we complement observed experience with rigorous theory where possible.