smalltalk: newton's method, chaos, and fractalssmalltalk: newton’s method, chaos, and...

83
Smalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1 / 82

Upload: others

Post on 25-Jul-2020

17 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Smalltalk: Newton’s Method, Chaos, andFractals

Brian Heinold

Mount St. Mary’s University

February 2, 2017

1 / 82

Page 2: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

A Question

Solve x2 + 7x + 1 = 0.

Answer? Use the quadratic formula:

−b±√b2 − 4ac

2a=−7±

√72 − 4

2

Simplifies to 12(−7 +

√45) and 1

2(−7−√

45)

2 / 82

Page 3: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

A Question

Solve x2 + 7x + 1 = 0.

Answer? Use the quadratic formula:

−b±√b2 − 4ac

2a=

−7±√

72 − 4

2

Simplifies to 12(−7 +

√45) and 1

2(−7−√

45)

3 / 82

Page 4: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

A Question

Solve x2 + 7x + 1 = 0.

Answer? Use the quadratic formula:

−b±√b2 − 4ac

2a=−7±

√72 − 4

2

Simplifies to 12(−7 +

√45) and 1

2(−7−√

45)

4 / 82

Page 5: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

A Question

Solve x2 + 7x + 1 = 0.

Answer? Use the quadratic formula:

−b±√b2 − 4ac

2a=−7±

√72 − 4

2

Simplifies to 12(−7 +

√45) and 1

2(−7−√

45)

5 / 82

Page 6: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Let’s Check Our Work. . .

6 / 82

Page 7: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

A Harder Question

Solve x5 + 7x + 1 = 0.

Answer? Hmmm...

7 / 82

Page 8: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

A Harder Question

Solve x5 + 7x + 1 = 0.

Answer? Hmmm...

8 / 82

Page 9: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Let’s Try Wolfram. . .

9 / 82

Page 10: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Look Carefully

Why = in the first and ≈ in the second?

10 / 82

Page 11: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Look Carefully

Why = in the first and ≈ in the second?

11 / 82

Page 12: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Solving Equations

Quadratic equations — solved via quadratic formula oralgebra

Fifth-order equations — there’s no formula and no algebrathat works

Another equation that can’t be solved analytically:cosx = x

High school math’s dirty little secret: Many (if not most)equations from real applications can’t be solved by thetechniques you learn

And this includes integrals and differential equations

12 / 82

Page 13: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Solving Equations

Quadratic equations — solved via quadratic formula oralgebra

Fifth-order equations — there’s no formula and no algebrathat works

Another equation that can’t be solved analytically:cosx = x

High school math’s dirty little secret: Many (if not most)equations from real applications can’t be solved by thetechniques you learn

And this includes integrals and differential equations

13 / 82

Page 14: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Solving Equations

Quadratic equations — solved via quadratic formula oralgebra

Fifth-order equations — there’s no formula and no algebrathat works

Another equation that can’t be solved analytically:cosx = x

High school math’s dirty little secret: Many (if not most)equations from real applications can’t be solved by thetechniques you learn

And this includes integrals and differential equations

14 / 82

Page 15: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Solving Equations

Quadratic equations — solved via quadratic formula oralgebra

Fifth-order equations — there’s no formula and no algebrathat works

Another equation that can’t be solved analytically:cosx = x

High school math’s dirty little secret: Many (if not most)equations from real applications can’t be solved by thetechniques you learn

And this includes integrals and differential equations

15 / 82

Page 16: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Solving Equations

Quadratic equations — solved via quadratic formula oralgebra

Fifth-order equations — there’s no formula and no algebrathat works

Another equation that can’t be solved analytically:cosx = x

High school math’s dirty little secret: Many (if not most)equations from real applications can’t be solved by thetechniques you learn

And this includes integrals and differential equations

16 / 82

Page 17: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Solving Equations Numerically

So what do we do?

Use a numerical method to get an approximate solution.

What?

It’s a series of steps to follow. Each step hopefully gets us alittle closer to the exact answer.

Newton’s Method is one such numerical method.

17 / 82

Page 18: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Solving Equations Numerically

So what do we do?

Use a numerical method to get an approximate solution.

What?

It’s a series of steps to follow. Each step hopefully gets us alittle closer to the exact answer.

Newton’s Method is one such numerical method.

18 / 82

Page 19: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Solving Equations Numerically

So what do we do?

Use a numerical method to get an approximate solution.

What?

It’s a series of steps to follow. Each step hopefully gets us alittle closer to the exact answer.

Newton’s Method is one such numerical method.

19 / 82

Page 20: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Solving Equations Numerically

So what do we do?

Use a numerical method to get an approximate solution.

What?

It’s a series of steps to follow. Each step hopefully gets us alittle closer to the exact answer.

Newton’s Method is one such numerical method.

20 / 82

Page 21: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Solving Equations Numerically

So what do we do?

Use a numerical method to get an approximate solution.

What?

It’s a series of steps to follow. Each step hopefully gets us alittle closer to the exact answer.

Newton’s Method is one such numerical method.

21 / 82

Page 22: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Solving Equations

Solving an equation like x5 + 7x+ 1 = 0 is looking for where thegraph crosses the x-axis.

22 / 82

Page 23: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Newton’s Method

We start by making a guess at what the solution is.

The closer our guess is to a solution, the better.

Then follow the following sequence of steps.

23 / 82

Page 24: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Newton’s Method

We start by making a guess at what the solution is.

The closer our guess is to a solution, the better.

Then follow the following sequence of steps.

24 / 82

Page 25: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Newton’s Method

We start by making a guess at what the solution is.

The closer our guess is to a solution, the better.

Then follow the following sequence of steps.

25 / 82

Page 26: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Step 1

26 / 82

Page 27: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Step 2

27 / 82

Page 28: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Step 3

28 / 82

Page 29: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Step 4

29 / 82

Page 30: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Step 5

30 / 82

Page 31: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Steps 6, 7. . .

Repeat these steps a few more times.

31 / 82

Page 32: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

The Overall Process

1 Make an initial guess

2 Keep repeating the following until we get tired:1 Go to the function2 Follow the tangent line to the axis

32 / 82

Page 33: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

The Overall Process

1 Make an initial guess

2 Keep repeating the following until we get tired:1 Go to the function2 Follow the tangent line to the axis

33 / 82

Page 34: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Algebraic Version

Instead of graphically, we do things symbolically.

Following the tangent line means using the derivative. A littlealgebra tells us where the tangent line meets the axis:

improved guess = old guess− f(old guess)

f ′(old guess)

Or, in more common notation:

xn+1 = xn −f(xn)

f ′(xn)x0 = initial guess

34 / 82

Page 35: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Algebraic Version

Instead of graphically, we do things symbolically.

Following the tangent line means using the derivative. A littlealgebra tells us where the tangent line meets the axis:

improved guess = old guess− f(old guess)

f ′(old guess)

Or, in more common notation:

xn+1 = xn −f(xn)

f ′(xn)x0 = initial guess

35 / 82

Page 36: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Algebraic Version

Instead of graphically, we do things symbolically.

Following the tangent line means using the derivative. A littlealgebra tells us where the tangent line meets the axis:

improved guess = old guess− f(old guess)

f ′(old guess)

Or, in more common notation:

xn+1 = xn −f(xn)

f ′(xn)x0 = initial guess

36 / 82

Page 37: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Algebraic Version

Instead of graphically, we do things symbolically.

Following the tangent line means using the derivative. A littlealgebra tells us where the tangent line meets the axis:

improved guess = old guess− f(old guess)

f ′(old guess)

Or, in more common notation:

xn+1 = xn −f(xn)

f ′(xn)x0 = initial guess

37 / 82

Page 38: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Example

f(x) = x5 + 7x + 1

Let’s use x = 1 as our initial guess.

Iterating = x− x5 + 7x + 1

5x4 + 7:

x0 = 1

x1 = 1−15 + 7 · 1 + 1

5 · 14 + 7= .25

x2 = .25−.255 + 7 · .25 + 1

5 · .254 + 7= −0.1419 . . .

x3 = −.1419 · · · −(−0.1419 . . . )5 + 7 · (−0.1419 . . . ) + 1

5 · (−0.1419 . . . )4 + 7= −0.1428 . . .

38 / 82

Page 39: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Example

f(x) = x5 + 7x + 1

Let’s use x = 1 as our initial guess.

Iterating = x− x5 + 7x + 1

5x4 + 7:

x0 = 1

x1 = 1−15 + 7 · 1 + 1

5 · 14 + 7= .25

x2 = .25−.255 + 7 · .25 + 1

5 · .254 + 7= −0.1419 . . .

x3 = −.1419 · · · −(−0.1419 . . . )5 + 7 · (−0.1419 . . . ) + 1

5 · (−0.1419 . . . )4 + 7= −0.1428 . . .

39 / 82

Page 40: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Example

f(x) = x5 + 7x + 1

Let’s use x = 1 as our initial guess.

Iterating = x− x5 + 7x + 1

5x4 + 7:

x0 = 1

x1 = 1−15 + 7 · 1 + 1

5 · 14 + 7= .25

x2 = .25−.255 + 7 · .25 + 1

5 · .254 + 7= −0.1419 . . .

x3 = −.1419 · · · −(−0.1419 . . . )5 + 7 · (−0.1419 . . . ) + 1

5 · (−0.1419 . . . )4 + 7= −0.1428 . . .

40 / 82

Page 41: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Example

f(x) = x5 + 7x + 1

Let’s use x = 1 as our initial guess.

Iterating = x− x5 + 7x + 1

5x4 + 7:

x0 = 1

x1 = 1−15 + 7 · 1 + 1

5 · 14 + 7= .25

x2 = .25−.255 + 7 · .25 + 1

5 · .254 + 7= −0.1419 . . .

x3 = −.1419 · · · −(−0.1419 . . . )5 + 7 · (−0.1419 . . . ) + 1

5 · (−0.1419 . . . )4 + 7= −0.1428 . . .

41 / 82

Page 42: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Example

f(x) = x5 + 7x + 1

Let’s use x = 1 as our initial guess.

Iterating = x− x5 + 7x + 1

5x4 + 7:

x0 = 1

x1 = 1−15 + 7 · 1 + 1

5 · 14 + 7= .25

x2 = .25−.255 + 7 · .25 + 1

5 · .254 + 7= −0.1419 . . .

x3 = −.1419 · · · −(−0.1419 . . . )5 + 7 · (−0.1419 . . . ) + 1

5 · (−0.1419 . . . )4 + 7= −0.1428 . . .

42 / 82

Page 43: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Example

f(x) = x5 + 7x + 1

Let’s use x = 1 as our initial guess.

Iterating = x− x5 + 7x + 1

5x4 + 7:

x0 = 1

x1 = 1−15 + 7 · 1 + 1

5 · 14 + 7= .25

x2 = .25−.255 + 7 · .25 + 1

5 · .254 + 7= −0.1419 . . .

x3 = −.1419 · · · −(−0.1419 . . . )5 + 7 · (−0.1419 . . . ) + 1

5 · (−0.1419 . . . )4 + 7= −0.1428 . . .

43 / 82

Page 44: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Example

f(x) = x5 + 7x + 1

Let’s use x = 1 as our initial guess.

Iterating = x− x5 + 7x + 1

5x4 + 7:

x0 = 1

x1 = 1−15 + 7 · 1 + 1

5 · 14 + 7= .25

x2 = .25−.255 + 7 · .25 + 1

5 · .254 + 7= −0.1419 . . .

x3 = −.1419 · · · −(−0.1419 . . . )5 + 7 · (−0.1419 . . . ) + 1

5 · (−0.1419 . . . )4 + 7= −0.1428 . . .

44 / 82

Page 45: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Look familiar?

45 / 82

Page 46: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Chaos Appears!

Try Newton’s method on 3

√3−4xx = 0.

The iterating formula simplifies to 4x(1− x).

The first 36 values, using a starting value of .4:.960, .154, .520, .998, .006, .025, .099, .358, .919, .298, .837, .547,

.991, .035, .135, .466, .995, .018, .071, .263, .774, .699, .842, .532,

.996, .016, .064, .241, .732, .785, .676, .876, .434, .983, .068, .252,

.754, .742, .765, .719, .808, .620, .942, .219, .683, .866, .464, .995

Looks pretty random. . .

46 / 82

Page 47: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Chaos Appears!

Try Newton’s method on 3

√3−4xx = 0.

The iterating formula simplifies to 4x(1− x).

The first 36 values, using a starting value of .4:.960, .154, .520, .998, .006, .025, .099, .358, .919, .298, .837, .547,

.991, .035, .135, .466, .995, .018, .071, .263, .774, .699, .842, .532,

.996, .016, .064, .241, .732, .785, .676, .876, .434, .983, .068, .252,

.754, .742, .765, .719, .808, .620, .942, .219, .683, .866, .464, .995

Looks pretty random. . .

47 / 82

Page 48: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Chaos Appears!

Try Newton’s method on 3

√3−4xx = 0.

The iterating formula simplifies to 4x(1− x).

The first 36 values, using a starting value of .4:.960, .154, .520, .998, .006, .025, .099, .358, .919, .298, .837, .547,

.991, .035, .135, .466, .995, .018, .071, .263, .774, .699, .842, .532,

.996, .016, .064, .241, .732, .785, .676, .876, .434, .983, .068, .252,

.754, .742, .765, .719, .808, .620, .942, .219, .683, .866, .464, .995

Looks pretty random. . .

48 / 82

Page 49: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Chaos Appears!

Try Newton’s method on 3

√3−4xx = 0.

The iterating formula simplifies to 4x(1− x).

The first 36 values, using a starting value of .4:.960, .154, .520, .998, .006, .025, .099, .358, .919, .298, .837, .547,

.991, .035, .135, .466, .995, .018, .071, .263, .774, .699, .842, .532,

.996, .016, .064, .241, .732, .785, .676, .876, .434, .983, .068, .252,

.754, .742, .765, .719, .808, .620, .942, .219, .683, .866, .464, .995

Looks pretty random. . .

49 / 82

Page 50: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Even Stranger. . .

Iterations for two very close starting values:

.400 .401

.960 .960

.154 .151

.520 .512

.998 .999

.006 .002

.025 .009

.099 .036

.358 .137

.919 .474

.400000 .400001

.960 .960

.154 .154

.520 .520

.998 .998

.006 .006

.025 .025

.099 .099

.358 .357

.919 .919

.298 .299

.837 .838

.547 .543

.991 .993

.035 .029

.135 .113

.466 .400

.995 .960

.018 .153

.071 .519

50 / 82

Page 51: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Even Stranger. . .

Iterations for two very close starting values:

.400 .401

.960 .960

.154 .151

.520 .512

.998 .999

.006 .002

.025 .009

.099 .036

.358 .137

.919 .474

.400000 .400001

.960 .960

.154 .154

.520 .520

.998 .998

.006 .006

.025 .025

.099 .099

.358 .357

.919 .919

.298 .299

.837 .838

.547 .543

.991 .993

.035 .029

.135 .113

.466 .400

.995 .960

.018 .153

.071 .519

51 / 82

Page 52: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Chaos

This is an example of chaos.

Irregular, but not totally random

Sensitive dependence on initial conditions

Even if our starting values were vanishingly close, say only10−20 apart, it would only take several dozen iterations forthem to start to diverge.

52 / 82

Page 53: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Chaos

This is an example of chaos.

Irregular, but not totally random

Sensitive dependence on initial conditions

Even if our starting values were vanishingly close, say only10−20 apart, it would only take several dozen iterations forthem to start to diverge.

53 / 82

Page 54: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Chaos

This is an example of chaos.

Irregular, but not totally random

Sensitive dependence on initial conditions

Even if our starting values were vanishingly close, say only10−20 apart, it would only take several dozen iterations forthem to start to diverge.

54 / 82

Page 55: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

The Double Pendulum: Another Chaotic System

A double pendulum is a pendulum attached to anotherpendulum.

55 / 82

Page 56: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

The Double Pendulum: Another Chaotic System

A double pendulum is a pendulum attached to anotherpendulum.

If we change the starting angle by something as small as justthe width of an atom (like a .0000000001 difference), after 30-60seconds the pendulum will be doing something completelydifferent.

56 / 82

Page 57: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Another Chaotic System: The Magnetic Pendulum

No matter how hard you try to start it in the same location,each time you release it, after a few seconds, it will be doingsomething different.

57 / 82

Page 58: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Another Chaotic System: Plinko

58 / 82

Page 59: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Another Chaotic System: The Weather

The Butterfly Effect — A butterfly flapping its wings inJapan can mean the difference between a tornado and asunny day six months later in Texas

Weather is a chaotic system; this is why we can’t predictthe weather more than a few days out.

59 / 82

Page 60: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Another Chaotic System: The Weather

The Butterfly Effect — A butterfly flapping its wings inJapan can mean the difference between a tornado and asunny day six months later in Texas

Weather is a chaotic system; this is why we can’t predictthe weather more than a few days out.

60 / 82

Page 61: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Another Chaotic System: Life

Before leaving for school, I stop to look at myself in themirror for a few seconds. When I get to the intersection atthe road, there is now a car coming that I wouldn’t havemet. While waiting, I see a quarter next to my bike andpick it up. If I hadn’t picked it up, a few days later someonewalking by would have thrown out their back while trying topick it up. Later that day at the doctor’s office that personmet someone else. She was moving to Houston the next day,but she and the guy that threw out his back have a goodconversation and decide to stay in touch. Later they startdating, get married. That marriage would not havehappened if I hadn’t stopped to look in the mirror.

61 / 82

Page 62: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Some Good Books on Chaos

Chaos: Making a New Science, James Gleick, 1987.

Does God Play Dice? Ian Stewart, 1989.

62 / 82

Page 63: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Imaginary Numbers

Solutions of x3 − 1 = 0?

x = 1 is one, but there are two others: x = −12 ±

32 i

63 / 82

Page 64: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Imaginary Numbers

Solutions of x3 − 1 = 0?

x = 1 is one, but there are two others: x = −12 ±

32 i

64 / 82

Page 65: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Imaginary Numbers

Solutions of x3 − 1 = 0?

x = 1 is one, but there are two others: x = −12 ±

32 i

65 / 82

Page 66: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Newton’s Method Works with Imaginary Numbers

66 / 82

Page 67: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Trying different starting values

Let’s see how different starting values behave.

Some will go to one root, some to other.

The closer they are to a root, the more quickly they willget there.

Try each starting value in the range from say -2 to 2 in thereal and imaginary directions.

Color each one based on how long it takes until it is within.00001 of a root.

67 / 82

Page 68: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Trying different starting values

Let’s see how different starting values behave.

Some will go to one root, some to other.

The closer they are to a root, the more quickly they willget there.

Try each starting value in the range from say -2 to 2 in thereal and imaginary directions.

Color each one based on how long it takes until it is within.00001 of a root.

68 / 82

Page 69: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Trying different starting values

Let’s see how different starting values behave.

Some will go to one root, some to other.

The closer they are to a root, the more quickly they willget there.

Try each starting value in the range from say -2 to 2 in thereal and imaginary directions.

Color each one based on how long it takes until it is within.00001 of a root.

69 / 82

Page 70: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Trying different starting values

Let’s see how different starting values behave.

Some will go to one root, some to other.

The closer they are to a root, the more quickly they willget there.

Try each starting value in the range from say -2 to 2 in thereal and imaginary directions.

Color each one based on how long it takes until it is within.00001 of a root.

70 / 82

Page 71: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Trying different starting values

Let’s see how different starting values behave.

Some will go to one root, some to other.

The closer they are to a root, the more quickly they willget there.

Try each starting value in the range from say -2 to 2 in thereal and imaginary directions.

Color each one based on how long it takes until it is within.00001 of a root.

71 / 82

Page 72: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

This Is What We Get

72 / 82

Page 73: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

A Zoomed-In Version

73 / 82

Page 74: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Example Orbits of Iterations

74 / 82

Page 75: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Example Orbits of Iterations

75 / 82

Page 76: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Example Orbits of Iterations

76 / 82

Page 77: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Example Orbits of Iterations

77 / 82

Page 78: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Newton’s Method on z9 − 1 = 0 (Roughly)

78 / 82

Page 79: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Newton’s Method on zc − 1 = 0 (c is imaginary)

79 / 82

Page 80: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Newton’s Method on zc − 1 = 0 (c is imaginary)

80 / 82

Page 81: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Netwon’s Method on z−4.7+.3i + z − 1

81 / 82

Page 82: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Good Book on Fractals

Chaos and Fractals: New Frontiers of Science, 2nd ed.,Heinz-Otto Peitgen, Hartmut Jurgens, & Dietmar Saupe, 2004

82 / 82

Page 83: Smalltalk: Newton's Method, Chaos, and FractalsSmalltalk: Newton’s Method, Chaos, and Fractals Brian Heinold Mount St. Mary’s University February 2, 2017 1/82 A Question Solve

Thanks for your attention!

83 / 82