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)s2c1023(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 x2x2=0 is rewritten as x=x22.


  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)=xg(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 pq are both fixed points. Then |pq|=|g(p)g(q)|=|g(ζ)(pq)|=|g(ζ)||pq|<|pq|. Contradiction.
quod erat demonstrandum

Example

f(x)=x3+4x210=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=xx34x2+10 (p4108). This is because g(x)=x34x2+x+10 is not within [a,b].

Another try: x=10x34. 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 gC[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. |pnp|knmax(p0a,bp0) for n=0,1,
  2. |pnp|kn1k|p1p0|

Proof.

|pnp|=|g(pn1)g(p)|=|g(ζ)||pn1p|k|pn1p|

After k interations, we have |pnp|kn|p0p|knmax(p0a,bp0). This proves (1).


Now if we have m>n, then |pmpn|=|pmpm1+pm1pm2+pm2pn+1+pn+1pn||pmpm1|+|pm1pm2|++|pn+1pn|

For any consecutive pj+1 and pj, we get

|pj+1pj|=|g(pj)g(pj1|=|g(ζ)||pjpj1|k|pjpj1|kj|p1p0|

Thus the distance above can be better estimated as

|pmpn|=km1|p1p0|+km2|p1p0|++kn|p1p0|=kn|p1p0|(1+k+k2++kn+)=kn1k|p1p0|

This proves (2).

quod erat demonstrandum

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

Goal

|pnp|estimate