MATH 417 Lecture 2

From Notes
Jump to navigation Jump to search

« previous | Thursday, January 16, 2014 | next »


Floating Points

64 bits

0 1 0 0 0 0 0 0 0 0 1 1 1 0 1 1 1 0 0 1 0 0 0 1 0 ... 0
s (sign) c (exponent; 11 bits) f (fractional part; 52 bits)

x=(−1)s2c−1023(1+f)

Bisection Algorithm

Binary search for a zero point between a and b by checking sign of midpoints.

Section 2.2: Fixed Point Iteration

Banach 1923

Given equation f(x)=0, rewrite as a function x=g(x)

For example x2−x−2=0 is rewritten as x=x2−2.


  1. Take p0∈[a,b]
  2. Iterate: pn+1=g(pn) for n=0,1,2,…


if pn converges to p* as n→∞, then p* is a fixed point such that f(p*)=0.

This is only useful if you know an interval where a fixed point must exist.

e.g. choosing p0=5 causes the iteration to diverge to ∞.


Theorem 2.3

Given x=g(x), where x∈[a,b] and g is continuous on [a,b],

  1. If g(x)∈[a,b] for any x∈[a,b], then there exists a p such that g(p)=p.
  2. If there exists a k<1 such that |g′(x)|≤k for all x∈[a,b], then p is unique.

Proof.

  1. Rolle's Theorem with f(x)=x−g(x).
    1. If g(a)=a or g(b)=b, we're done.
    2. Otherwise, (g(a)−a)(g(b)−b)≠0, then by Rolle's theorem, f(x)=0 for some x∈[a,b].
  2. Assume that p≠q are both fixed points. Then |p−q|=|g(p)−g(q)|=|g′(ζ)(p−q)|=|g′(ζ)||p−q|<|p−q|. Contradiction.
quod erat demonstrandum

Example

f(x)=x3+4x2−10=0. Find zero x*∈[1,2]:

  • f(1)<0
  • f(2)>0
  • f′(x)=3x2+8x>0 for x∈[1,2]

Find a g(x)...

"Stupid change": x=x−x3−4x2+10 (p4≈108). This is because g(x)=x3−4x2+x+10 is not within [a,b].

Another try: x=10−x34. May work, but prof. doesn't like it.

Yet another try: x=10x+4. Observe this function is within [a,b]. More importantly, |g′(x)|=52(x+4)32<1 for x=1. In fact, k=152. Therefore, pn+1=10pn+4 will converge:

Theorem. If g∈C[a,b]; |g′(x)|≤k<1 for all x∈[a,b]; p0 is any number in [a,b]; and pn+1=g(pn), then

  1. |pn−p|≤kn⋅max⁡(p0−a,b−p0) for n=0,1,…
  2. |pn−p|≤kn1−k|p1−p0|

Proof.

|pn−p|=|g(pn−1)−g(p)|=|g′(ζ)||pn−1−p|≤k|pn−1−p|

After k interations, we have |pn−p|≤kn|p0−p|≤knmax⁡(p0−a,b−p0). This proves (1).


Now if we have m>n, then |pm−pn|=|pm−pm−1+pm−1−pm−2+pm−2−…−pn+1+pn+1−pn|≤|pm−pm−1|+|pm−1−pm−2|+…+|pn+1−pn|

For any consecutive pj+1 and pj, we get

|pj+1−pj|=|g(pj)−g(pj−1|=|g′(ζ)||pj−pj−1|≤k|pj−pj−1|≤…≤kj|p1−p0|

Thus the distance above can be better estimated as

|pm−pn|=km−1|p1−p0|+km−2|p1−p0|+…+kn|p1−p0|=kn|p1−p0|(1+k+k2+…+kn+…)=kn1−k|p1−p0|

This proves (2).

quod erat demonstrandum

In many cases (for good guesses), the second estimate will be better than the first

Goal

|pn−p|≤estimate