Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0...

54
Matlab Primer

Transcript of Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0...

Page 1: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Matlab Primer

Page 2: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Math128A algorithms vs. General Purpose algorithms

For any vector x ∈ Rn, compute its norm

‖x‖2 =(x21 + x22 + · · ·+ x2n

) 12 =

(n∑

k=1

x2k

) 12

.

I INPUT: n, x1, · · · , xn.I OUTPUT: Norm.

I Step 1: Set SUM = 0.

I Step 2: For k = 1, · · · , n set SUM = SUM + xk ∗ xk .I Step 3: Set Norm =

√SUM.

I Step 4: Output Norm.STOP.

Page 3: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Math128A algorithms vs. General Purpose algorithms

Page 4: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Math128A algorithms vs. General Purpose algorithms

Page 5: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Bisection Method

I Given continuous function f (x) on the interval [a, b] withf (a) · f (b) < 0, there must be a root in (a, b).

I To find a root: set [a1, b1] = [a, b].

I set p1 = a1+b12 and compute f (p1).

I if f (p1) = 0, then quit with root p1 (must be very lucky.)I if f (a1) · f (p1) < 0, then set [a2, b2] = [a1, p1],I otherwise (f (p1) · f (b1) < 0) set [a2, b2] = [p1, b1],

I repeat with p2 = a2+b22 .

Page 6: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Bisection Method

Page 7: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Naive Bisection Method

Page 8: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically
Page 9: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically
Page 10: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Proof of Thm 2.1Assume that f (pn) 6= 0 for all n.

I By construction

a1 ≤ a2 ≤ · · · ≤ an ≤ · · · ≤ · · · ≤ bn ≤ · · · ≤ b2 ≤ b1.

Thus sequences {an} and {bn} monotonically converge tolimits a∞ ≤ b∞, respectively.

I Since f (an) · f (bn) < 0 for all n, it follows thatf (a∞) · f (b∞) ≤ 0, and thus a root p ∈ [a∞, b∞] ⊂ [an, bn]exists.

I Since pn = an+bn2 , it follows that |pn − p| ≤ bn−an

2 .I By construction

bn−an =bn−1 − an−1

2=

bn−2 − an−222

= · · · =b1 − a1

2n−1=

b − a

2n−1.

I Put together,

|pn − p| ≤ b − a

2n.

I In fact, a∞ = b∞ = p.

Page 11: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Example Function with Root

2.5 2.6 2.7 2.8 2.9 3 3.1 3.2 3.3 3.4 3.5−3

−2

−1

0

1

2

3

4

5

6

7function = $ex − (2+2x2)$

Page 12: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

2.5 2.6 2.7 2.8 2.9 3 3.1 3.2 3.3 3.4 3.5−3

−2

−1

0

1

2

3

4

5

6

7Bisection Method with 52 Points

Page 13: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Fixed Point Iteration

The number p is a fixed point for a given function g if g(p) = p.

Page 14: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Fixed Point Example

Page 15: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Fixed Point Theorem (I)

Page 16: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Proof of Thm 2.3

I If g(a) = a or g(b) = b,then g has a fixed point at anendpoint.

I Otherwise, g(a) > a and g(b) < b. The functionh(x) = g(x)− x is continuous on [a, b], with

h(a) = g(a)− a > 0 and h(b) = g(b)− b < 0.

I This implies that there exists p ∈ (a, b), h(p) = 0.

I g(p)− p = 0, or p = g(p).

If |g ′(x)| ≤ k < 1 for all x in (a, b), and p and q are two distinctfixed points in [a, b]. Then a number ξ exists

g(p)− g(q)

p − q= g ′(ξ) < 1.

So

1 =p − q

p − q=

g(p)− g(q)

p − q= g ′(ξ) < 1.

This contradiction implies uniqueness of fixed point.

Page 17: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Fixed Point Iteration

Given initial approximation p0, define Fixed Point Iteration

pn = g(pn−1), n = 1, 2, · · · ,

If iteration converges to p, then

p = limn→∞

pn = limn→∞

g(pn−1) = g(p).

Page 18: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Fixed Point Theorem (II)

Page 19: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Fixed Point Example x − x2 = 0: no convergence

g(x) = x2 ∈ [1,∞] for x ∈ [1,∞],

|g ′(x)| unbounded in[1,∞].

Page 20: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Fixed Point Example x − sin(x) = 0: slow convergence

g(x) = sin(x) ∈ [−1, 1] for x ∈ [−1, 1],

|g ′(x)| ≤ 1 ∈ [−1, 1].

Page 21: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Fixed Point Example x − sin(x) = 0: slow convergence

g(x) = sin(x) ∈ [−1, 1] for x ∈ [−1, 1],

|g ′(x)| ≤ 1 ∈ [−1, 1].

Page 22: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Fixed Point Example x − log(2 + 2x2) = 0: normalconvergence

g(x) = log(2 + 2x2) ∈ [2, 3] for x ∈ [2, 3],

|g ′(x)| ≤ 4

5∈ [2, 3].

2.5 2.55 2.6 2.65 2.7 2.75 2.8 2.85 2.9 2.95 3−2.5

−2

−1.5

−1

−0.5

0FixedPoint Method with 66 Points

Page 23: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Fixed Point Example x − (1− cos(x)) = 0: fastconvergence

g(x) = 1− cos(x) ∈ [−1, 1] for x ∈ [−1, 1],

|g ′(x)| ≈ with.

Page 24: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Fixed Point Example x − (1− cos(x)) = 0: fastconvergence

g(x) = 1− cos(x) ∈ [−1, 1] for x ∈ [−1, 1],

|g ′(x)| ≤ 1 ∈ [−1, 1].

Page 25: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Fixed Point Theorem (II)

Page 26: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Proof of Thm 2.4

I A unique fixed point p ∈ [a, b] exists.

I

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

I

|pn − p| ≤ k|pn−1 − p| ≤ k2|pn−2 − p| ≤ · · · ≤ kn|p0 − p|.

I Sincelimn→∞

kn = 0,

{pn}∞n=0 converges to p.

Page 27: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Newton’s Method for solving f (p) = 0

I Suppose that f ∈ C 2[a, b].

I Let p0 ∈ [a, b] be an approximation to p with

f ′(p0) 6= 0, and |p − p0| ”small”.

I Taylor expand f (x) at x = p:

0 = f (p) = f (p0) + (p − p0)f ′(p0) +(p − p0)2

2f ′′(ξ(p)).

”Solve” for p:

p = p0 −f (p0)

f ′(p0)− (p − p0)2

2f ′(p0)f ′′(ξ(p))

≈ p0 −f (p0)

f ′(p0)def= p1.

Newton’s Method: pk+1 = pk − f (pk )f ′(pk )

, k = 0, 1, · · ·

Page 28: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Newton’s Method for solving f (p) = 0

p = p0 −f (p0)

f ′(p0)− (p − p0)2

2f ′(p0)

≈ p0 −f (p0)

f ′(p0)f ′′(ξ(p))

def= p1.

I If p0 ”close to” p, we can expect fast convergence.

I Best hope in practice: p0 ”not too far from” p. Newton’smethod may or may not converge.

I If Newton’s method converges, it converges quickly.

Page 29: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Geometry of Newton’s Method

I Taylor expand f (x) at x = p:

0 = f (p) = f (p0) + (p − p0)f ′(p0) +(p − p0)2

2f ′′(ξ(p)).

I Replace f (x) by a straight line:

f (p0) + (p − p0)f ′(p0) ≈ 0.

I

p ≈ p0 −f (p0)

f ′(p0)

is the horizontal intercept of straight line

y = f (p0) + (x − p0)f ′(p0)

Page 30: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Newton Method

Page 31: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically
Page 32: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically
Page 33: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Newton Method for f (x) = ex − (2 + 2x2)

2.6 2.8 3 3.2 3.4 3.6 3.8−4

−2

0

2

4

6

8Newton Method with 8 Points

Page 34: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Computing square root with Newton’s Method

I Given a > 0, pdef=√a is positive root of equation

f (x)def= x2 − a = 0.

I Newton’s Method

pk+1 = pk −p2k − a

2pk=

1

2

(pk +

a

pk

), k = 0, 1, 2, · · · ,

I Newton’s Method is well defined for any p0 > 0.

Page 35: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Newton Method for square root

Page 36: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically
Page 37: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Proof of Theorem 2.6I Newton’s method is fixed point iteration

pn = g(pn−1), g(x) = x − f (x)f ′(x) .

I Since f ′(p) 6= 0, there exists an interval[p − δ1, p + δ1] ⊂ [a, b] on which f ′(x) 6= 0. Thus, g(x) isdefined on [p − δ1, p + δ1].

I

g ′(x) = 1− f ′(x) f ′(x)− f (x) f ′′(x)

(f ′(x))2=

f (x) f ′′(x)

(f ′(x))2∈ C [p−δ1, p+δ1].

I Since g ′(p) = 0, there exists 0 < δ < δ1 so that

|g ′(x)| ≤ κ (=1

2), for all x ∈ [p − δ, p + δ].

I If x ∈ [p − δ, p + δ], then

|g(x)−p| = |g(x)−g(p)| = |g ′(ξ)(x−p)| ≤ κ|x−p| ≤ |x−p|.

Therefore g(x) ∈ [p − δ, p + δ].I {pn} converges to p by Fixed Point Theorem.

Page 38: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Newton Method Divergence Example: f (x) = x1/3

Page 39: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Secant Method: Poor man’s Newton Method

Motivation

I Newton method style of fast convergence

I Avoid need for derivative calculations.

Approach

I Newton method: pn+1 = pn − f (pn)f ′(pn)

.

I Replace f ′(pn) by its cheap approximation

f ′(pn) = limx→

f (pn)− f (x)

pn − x≈ f (pn)− f (pn−1)

pn − pn−1.

I Secant method

pn+1 = pn −f (pn)(pn − pn−1)

f (pn)− f (pn−1), n = 1, 2, · · · .

Page 40: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Secant Method: Geometry

I ”Approximate” f (x) by a straight line

f (x) ≈ (x − p0)f (p1)− (x − p1)f (p0)

p1 − p0.

Both f (x) and straight line go through points(p0, f (p0)), (p1, f (p1)).

I Let approximate root p2 be the x-intercept of the straight line

p2 =p0f (p1)− p1f (p0)

f (p1)− f (p0)= p1 −

f (p1)(p1 − p0)

f (p1)− f (p0).

Page 41: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Secant Method: Illustration

Page 42: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Fixed point for g(x) = log(2 + 2x2)

2.5 3 3.5 4−5

0

5

10

15

20

25SecantMethod with 11 Points

Page 43: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Performance: number of iterations vs. error in the solution

I Function to be considered

g(x) = log(2 + 2x2), f (x) = x − g(x) = x − log(2 + 2x2).

I Root p of f (i.e., f (p) = 0)

p = 2.98930778246493e + 00.

I Bisection Method

I Fixed Point Iteration

I Newton’s Method

I Secant Method

Page 44: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Bisection Method Order of Convergence

0 10 20 30 40 50 6010

−16

10−14

10−12

10−10

10−8

10−6

10−4

10−2

100

Convergence Rate, Bisection Method

Page 45: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Fixed Point Iteration Order of Convergence

0 10 20 30 40 50 60 7010

−15

10−10

10−5

100

Convergence Rate, Fixed Point Method

Page 46: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Secant Method Order of Convergence

1 2 3 4 5 6 7 8 9 1010

−12

10−10

10−8

10−6

10−4

10−2

100

102

Convergence Rate, Secant Method

Page 47: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Newton Method Order of Convergence

1 2 3 4 5 6 710

−14

10−12

10−10

10−8

10−6

10−4

10−2

100

Convergence Rate, Newton Method

Page 48: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Order of convergence

Page 49: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Linear and Quadratic Order of convergence

Page 50: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Recall rate of convergence: the Big O

the Big O() = rate of convergence

Page 51: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Recall rate of convergence: the Big O

Page 52: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Linear and Quadratic Order of convergenceI Suppose that {pn}∞n=1 is linearly convergent to 0,

limn→∞

|pn+1||pn|

= 0.5, or roughly|pn+1||pn|

≈ 0.5,

hence pn ≈ (0.5)n|p0|.I Suppose that {p̃n}∞n=1 is quadratically convergent to 0,

limn→∞

|p̃n+1||p̃n|2

= 0.5, or roughly|p̃n+1||p̃n|2

≈ 0.5.

But now

Page 53: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Linear and Quadratic Order of convergence

Page 54: Matlab Primer › ~mgu › MA128ASpring2017 › MA128A...Proof of Thm 2.1 Assume that f(p n) 6= 0 for all n. I By construction a 1 a 2 a n b n b 2 b 1: Thus sequences fa ngand fb ngmonotonically

Linear and Quadratic Order of convergence