1 Let Me Repeat Myself, Myself, Myself …. David W. Stephens The Bryn Mawr School...

Post on 29-Dec-2015

216 views 1 download

Transcript of 1 Let Me Repeat Myself, Myself, Myself …. David W. Stephens The Bryn Mawr School...

1

Let Me Repeat Myself, Myself, Myself ….

David W. StephensThe Bryn Mawr School

stephensd@brynmawrschool.org

T^3 Regional ConferenceIndiana University of Pennsylvania

18 March 2006

2

Iterated Functions … or recursion:Today’s Agenda

The process of iterating functions (recursion) leads to some fascinating results and important applications. This session will include both mathematics and technology to model the convergence or divergence of iterated functions.

With algebraic investigations and applications, we will look at the mathematics, graphical behavior, and technology to support students as they learn some sophisticated ideas.

3

Examples to be investigated

Examples will be chosen from linear and quadratic functions, compound interest, medications for chronic conditions, predator-prey, deer populations, Newton’s method for locating roots, and Euler’s method for solving differential equations. Spreadsheets and graphing calculators will use sequences, time series, and web graphs to visualize iterated results.

4

Staying Away from the “Usual” Algebra

I will resist the teacher temptation (“T^2”) to write these processes with closed form functions.

Instead, we will look at the recursive methods to simulate phenomena, adding technology as it is appropriate.

5

Technology

TI-83/84 calculators Use of ANS, programs, SEQ mode, and LISTS

Spreadsheets TI Connect MathType PowerPoint TI-2006/2007 (student brains!)

All of my students bring this calculator to class every day. Some claim that their batteries are dead!

6

Example 1:

One classic recursive problem in the early study of chaos is the story of a student who leaves home to go to the mall. After she goes 2/3 of the way, she changes her mind and

heads back toward home. After 2/3 of the way back home, she changes her mind.

She reverses direction and heads back to the mall. After 2/3 of the way back, she changes her mind again,

and so forth. Where does she end eventually?

7

Example 1 (continued):

Use a unit line segment.Home = 0 and Mall = 1W0 = 0

W1 = 2/3

W2 = 2/9

W3 = 20/27

W4 = 20/81

W5 = 181/243

The distance from home to the mall could be used instead. For the teaching moment, the unit segment is better. Why?

8

Example 1 (continued):

It seems that the iteration eventually leads to the walker bouncing back and forth between the ¼ and ¾ marks on the route between home and the mall. These become two fixed points.Question 1? What would happen if the switch

was made at a fraction different from 2/3?Question 2? Do all iterations lead to a fixed

point? Two fixed points? None? More?

9

Example 2:

Iterating functions … the terminology Evaluate a function f(x) The output becomes the new input. Repeat, repeat, repeat ...

f(x) = 2x + 1f(1) = 3 (x = 1 is called the seed)f(f(1)) = f(3) = 7 and f(f(f(1))) =f 3(1)= f(7) = 15 1 3 7 15 … is called the orbit

What eventually happens for f n(1)?

The orbit for recursive functions is the same idea as a sequence.

10

Example 2 (continued):

We will use algebra as the only technology here for a few minutes.

Iterate f(x) = ½ x + 1 with x = 1Iterate g(x) = 3/8 x – 4 with x = 2Iterate h(x) = -3/7 x + 2 with x = 7

Question : What matters most if f n(a) is going to converge toward a fixed point? Is it the slope? The y-intercept? The initial seed? The fact that the function is linear?

11

Example 2 (continued):

Suppose that we have an example which does converge. To what fixed point does it converge? If it converges, that means that f(n)= f(n-1) at

some point in the orbit (and forever afterward).Set f(x) = x, and solve for x.

12

Example 2 (continued):

The calculator can be used to build the orbit (a sequence).Type in the seed (which is 1) on the HOME

screen.ENTER.Type ANS *(1/2) + 1 (for f(x) = ½ x + 1)ENTERHit ENTER repeatedly.

13

Example 2 (continued):

We can look at the results graphically.Look at the seed (an x-value)Calculate f(seed) (a y-value). Move up/down to

that y-value.Since that y-value become the next x-value,

graph y = x together with f(x). Follow the first y-value to the y = x line, transferring the y-value to an identical x-value.

Move up/down to the f(x) function. Continue.

14

SEQ mode for iterated functions

On the MODE key, select SEQ (instead of the usual FUNC).

Select 2nd FORMAT and Web at the top.

Type y = , and use the screen to the right to iterate y = 1/2x + 1 (Recall that “x” is the

previous y, so u(n) = current value u(n-1) = previous value

seed

beginning subscript

iterated (recursive) function

15

A Web Plot

y = 1/2x + 1

y = x

Type GRAPH.

Type TRACE and use the right arrow to simulate the iteration.

16

Example 2 (continued):

This is called a web diagram. Continue the process.The result will either

Spiral in (converge/ attract to a fixed point)Spiral out (diverge /repel)Staircase in (converge / attract to a fixed point)Staircase out (diverge / repel)

The importance lies in the intersection of f(x) with y =x

17

A Time Plot

Select 2nd FORMAT and choose Time at the top.

GRAPH. (You may need to extend the x-values, since they serve as the counters, as they would in a sequence.)

TRACE. Then right arrow will step you through the successive values of the iteration. You can look to see if there

is convergence toward a fixed point or not. The convergence here has a very different look than the one in the web plot.

18

Example 3:

A fascinating iteration concerns the quadratic function family f(x) = ax(1-x) Use the ITER1 program

(Always seed with a value between 0 and 1) Hit ENTER to toggle between the web plot and the numerical

values. Hit QUIT to exit the program. Use a = 0.5 Use a = 1.5 Use a = 3.2 Use a =3.5 Use a = 4

19

Example 3 (continued):

The behavior of the iteration is sensitive to the choice of the parameter, “a”. For some choices of “a”, small changes in “a” lead to vastly different orbits. This is part of the study of chaos.

20

Example 4:

When money is invested in a bank account, interest is added. As the money stays in the account, interest is added to the principal and to the preceding interest.M0

M1 = M0(1 + r)

M2 = M1(1+r) M0 (1 + r)2

Mn = Mn-1(1+r)

21

Example 4 (continued):

Mn = Mn-1(1+ r/n)where n = # of compoundings per yearThis is an example where divergence is desired!

22

Example 5:

A man is taking medication for high blood pressure. He takes 100 mg each day, and his body metabolizes 83% of the medication still in the body each day.Why does he need to take 100 mg every day?Why doesn’t he eventually overdose?

Example 4

23

Example 5 (continued):

This is actually a geometric series question, but we will look at it as an iterated function. f(0) = 100 f(1) = 100 + f(0)*(1-0.83)

= 100 + 0.17 * f(0) f(2) = 100 + 0.17*f(1) f(n) = 100 + 0.17*f(n-1)

Simulate this on the HOME screen of a TI-83/84.

24

Example 5 (continued):

This iterated function does converge toward one fixed point, and this is good to converge. (It would be bad to diverge this time!)Question 1: What would happen if the initial

dosage were 200 mg and the rest of the daily dosages were 100 mg?

Question 2: What would happen if all of the daily dosages were 200 mg instead of 100 mg?

25

Example 6:

An old method to approximate square roots came from the Babylonians.To find the square root of 3, they reasoned that it

had a value between some seed number x and 3/x.

Average those two numbers to improve your initial guess (the seed).

So f(x) = .5(x + 3/x) Iterate this function.

26

Example 7:

A newer method for finding square roots (or the zeroes on any function) comes from the calculus.Newton’s Method for locating roots:

xn+1 = xn – f(xn)/f’(xn)This method will often converge toward one root of a

function. How do we know which root the orbit will approach?

But Newton’s Method will sometimes diverge. Why?

27

Example 7 (continued):

Here is a graphical explanation of the iteration for Newton’s Method.

28

Example 8:

Advanced calculus students in high school encounter Euler’s method for solving differential equations. It is based on the local linearity of most

functions. f(x) = f(a) + f’(a) (x – a)

This becomes yn+1 = yn + dy/dx n * delta x The orbit of y’s, when paired with x’s, form data which can

approximate the solution function to the differential equation.

29

Example 9:

In the growth (or decline) of populations of a species of animals, a strictly algebraic solution based on explicitly defined functions fails. But the use of iterated functions is a beautiful alternative.Suppose that we observe a herd of deer. There

are newborns, yearlings, adult males, and adult females.

The problem is complicated because the populations interact with each other.

30

Example 9 (continued):

The population in each age group is affected by the other age groups in some way.The number of newborns depends on the number

of adult females.The number of adult females and males are both

affected by how many adult females and males were present a year earlier, since yearlings become adults and other adults have died out.

31

Example 9 (continued):

Suppose thatNB(n) = 0.1*AF(n-1)YR(n) = .85 * NB(n-1)AF(n) = 0.45* YR(n) + 0.95*AF(n)AM(n) = 0.45* YR(n) + 0.95*AM(n)

Explain the multiplier factorsExperiment with different multiplier factorsExperiment with different initial populations.

32

Example 10:

A predator-prey relationship offers some fascinating interaction between populations, and the results are surprising as well as sensitive to the parameters in complicated ways.Suppose that we have fox and rabbits.F(n) = a*F(n-1) + b*R(n-1)R(n) = c*R(n-1) - d*F(n-1)

33

Example 10 (continued):

Biologists have also found that another factor that affects the two populations is the number of interactions between the two species. The more interactions, the more the predator is positively affected, and the more negatively the prey is affected.The interaction is proportional to the product of

the two populations. Isn’t that a clever way to measure the interactions?

34

Example 10 (continued):

SoR(n) = a*R(n-1) - b*F(n-1)*R(n-1)F(n) = c*F(n-1) + d*F(n-1)*R(n-1)

We can look at a spreadsheet to watch these populations.

We can look at another plot (called “uv”) in the SEQ mode on the calculator.

35

Example 10 (continued):

Rabbits

u(n)

Foxes

v(n)

36

Example 10 (continued):

To get a plot of the (rabbit,fox) populations against reach other, use 2nd FORMAT and select UV

rabbits

foxe

stime = 0 (begin)

37

Conclusion

Iteration provides models for some important processes that are not easily accessible by explicit functions.

There are some results which are very different from traditional algebra solutions.

Algebra and graphical formats are valuable here, and technology is an essential tool to understand and access the long term results.