# Use of the TI-82 Calculator to Supplement Chaos, Fractals, and Dynamics

#### Hoyt Taylor and Tim Pettus

In this paper, we rely heavily on Robert L. Devaney's Chaos, Fractals, and Dynamics for the theoretical background, while we offer suggestions of how to use the TI-82 calculator for exploring the world of dynamics in a high school precalculus class. The science of mathematics has entered a new age with the development of faster and faster and smaller and smaller computers. In much the same way that amateur astronomers with their own telescopes can experience the fascination and delight of astronomy, non-professional mathematicians (teachers, students, and the like) now have the opportunity to do the same with modern mathematics.

To this end it is urged that you, the teacher, construct your course so that many of the questions, data, hypotheses, and conclusions emanate from your students, who, it is imagined, will be working in some form of cooperative learning. This experience of primary scientific research has the potential to be highly memorable and incredibly rich.

It is expected that your students will become familiar with the ideas of Chapter One of Devaney's text through hands on exploration. A simple program to iterate a function of your choosing is given below:

PROGRAM: ITERATE1

: Prompt S

: Input Y1

: Fill(0,L1)

: 0->I

: For (N,1,99)

: Y1(S)->S

: S->L1(N)

: Disp S

: I+1->I

: If I=7 :Then

: Pause

: 0->I

: End

: End

This program asks for a seed value, S, and the function you wish to iterate, Y1. Y1 must be entered with a leading " (quotation mark) before the function is given in terms of X. The display is set to give the seven values that the screen can hold at a time, as well as saving all the values in list L1. Before operating the program, store values for A and B, say .5->A, and 3->B. Run ITERATE. Arbitrarily assign the value 1 to the seed prompt, and type in "AX+B at the next ? prompt. Hit ENTER and observe the first seven iterates. Another press of ENTER gives the next seven iterates, and so on. When you have seen enough, press ON to escape the program.

Perhaps you would like to try this same function Y = AX + B over and over again. To eliminate the need to type it in every trial, go into the program and delete the line Input Y1, exit from the program, and then press Y=. Enter AX+B for Y1. To change A or B, make the change before next running the program, storing new values to A and/or B, then execute ITERATE again.

Allow your students plenty of time to gather data for this simplest of non-trivial dynamical systems. What patterns can they find as they vary parameters A and B?

## Four Methods to Look at the Iterates of f(x)=x2+C

This section specifically will show how the TI-82 can be used to:

1) generate a list of iterates of x2+C,
2) show the iterates of x2+C on a web diagram,
3) show a plot of the iterates of x2+C over time, and
4) generate a histogram to look at different distributions for the iterates of x2+C.

These four uses of the TI-82 are introduced and are used to examine the orbits of f(x)=x2-.8 with a seed value of x=0. When f(x) is evaluated successively starting with the seed value of x=0, the following sequence of numbers is produced:

0

f(0) =-.8

f(-.8) =-.16

f(-.16) =-.7744

f(-.7744) =-.2003

f(-.2003) =-.7599

f(-.7599) =-.2226

: :

: :

f(-.2764) =-.7236

f(-.7236) =-.2764

: :

The last 2 terms of the sequence demonstrate that new values of f(x) will eventually cycle back and forth between -.7236 and -.2764.

We will now look at this sequence using lists, webs, a time plot, and finally a histogram.

1) Lists:

Start by putting the 4 settings below on the TI-82. If a word is written in bold letters, then it needs to be highlighted.

Set MODE Set WINDOW Set TblSet

Normal Sci Eng WINDOW FORMAT TABLE SETUP

Float 0123456789 UnStart=0 TblMin=0

Func Par Pol Seq nStart=0 Indpnt: Auto Ask

Connected Dot nmin= Depend: Auto Ask

Sequential Simul nmax=

FullScreen Split Xmin= Note: Line 1 and 3 of the WINDOW

Xmax= display must be as shown but the

Set Y= Xscl= rest of the entries can be anything.

Un=Un-12-.8 Ymin=

Vn= Ymax=

Yscl=

 Press TABLE and the table to right is displayed. Un starts with a value of 0, U1=-.8, U2 =-.16, etc. up to U6=-.2226. You can find higher values of Un by scrolling down the table. To get to a high value of h quicker, change TblMin in TblSet to a higher integer. For instance, set TblMin=100, and press TABLE. Then after a pause, while the TI-82 calculates, the table will reappear with h starting at 100. This table will clearly show that the iterates have converged to a 2-cycle of -.2764 and -.7236 n Un ___________ 0 0 1 -.8 2 -.16 3 -.7744 4 -.2003 5 -.7599 6 -.2226

#2) Webs:

Start by putting the 4 settings below on the TI-82.

Set MODE Set WINDOW

Normal Sci Eng WINDOW FORMAT WINDOW FORMAT

Float 0123456789 UnStart=0 Time Web

Func Par Pol Seq nStart=0 CoordOn CoordOff

Connected Dot nmin=0 GridOff GridOn

Sequential Simul nmax=0 AxesOn AxesOff

FullScreen Split Xmin=-3 LabelOff LabelOn

Xmax=3

Set Y= Xscl=1

Un=Un-12-.8 Ymin=-2

Vn= Ymax=2

Yscl=1

Press TRACE and the graph below will be displayed. The first time you trace by pressing the `scroll to the right' button, the cursor moves vertically from the point (0,0) to (0,-.8), a point on the curve Y= X2+C, and a segment connects the points. The second time the scroll button is pressed, the cursor will move horizontally to the point (-.8,-.8), a point on the line Y=X, and again a segment connects the points. Each successive `scroll' causes the cursor to connect a horizontal segment from the curve Y=X2+C to the line Y=X or a vertical segment from the line Y=X to the curve Y=X2+C.

To get a `web' that immediately settles into its orbit (without the wide line caused by early iterates), set UnStart= -.7236 in the WINDOW menu and start the web again.

#3) Time Chart:

Start by putting the 4 settings below on the TI-82.

Set MODE Set WINDOW

Normal Sci Eng WINDOW FORMAT WINDOW FORMAT

Float 0123456789 UnStart=0 Time Web

Func Par Pol Seq nStart=0 CoordOn CoordOff

Connected Dot nmin=0 GridOff GridOn

Sequential Simul nmax=200 AxesOn AxesOff

FullScreen Split Xmin=0 LabelOff LabelOn

Xmax=200

Set Y= Xscl=0

Un=Un-12-.8 Ymin=-2

Vn= Ymax=2

Yscl=1

Press TRACE and a time plot is displayed. Next press the `scroll to the right' button. The meaning of the graph will be obvious since a point flashes on the graph along with its value Un and the value of h. It will be clear that the sequence of numbers is converging to a two-cycle. To have the time plot show only the sequence after it has settled into its cycle, set nmin=50 in the WINDOW menu and press TRACE or GRAPH again.

#4) Histogram:

The program HISTOGRM asks to have a value for C inputted. It then asks the user to input the number N of iterates to be plotted(64 or 128 are good initial values for N). The program starts with an initial seed of X=0 and iterates f(x)=x2+C fifty times before plotting any points. The next N iterates will be displayed in a histogram. The user is next allowed to plot more points or to stop by inputting 0 in response to the prompt "How many more?".

PROGRAM:HISTOGRM

: PlotsOff

: ClrDraw : Lbl 1

: FnOff : For(I,1,N)

: 0->Xmin : S2+C->S

: 94->Xmax :iPart ((S+2)/D->J
: 0->Ymin : [A](J,1)+1->[A](J,1)
: 62->Ymax : [A](J,1)->K
: 4/94->D : Pt-On(J,K)

: {95,1}->dim[A] : End
: Fill(0,[A]) : Disp "HOW MANY MORE?"
: Disp "C OF X2+C." : Input N
: Prompt C : If I>0
: C->S : Goto 1
: For(N,1,50) : Disp "WANT TO ZOOM IN?"
: S2+C->S : Disp "RUN HISTGRAM2."
: End : Disp " "
: Disp "NO. OF PTS." : Disp "TO SEE HISTOGRM,"

: Prompt N : Disp "PRESS GRAPH."

Program is continued above in a 2nd column.

If HISTOGRM is run with C=-.8 and N=96, the histogram on the next page is shown. Since Xmin=-2, Xmax=2, Ymin=0, and Ymax=62, the histogram is interpreted as a 2-cycle with all 96 points accumulating at two positions. These two positions are -.2764 and -.7236 with 48 points at each position.

Sometimes you may wish to `ZOOM IN' and look more closely at a part of the histogram. If so, program HISTGRM2 is useful. It should be run immediately after HISTOGRM. There are a number of `Pause's in HISTGRM2 to allow viewing. After viewing to your satisfaction, press the ENTER key to continue the run.

: PROGRAM:HISTGRM2
: Lbl 2
: Menu("LOOK CLOSER","SEEN ENOUGH",A,"ZOOM IN",B,"MORE OF SAME",C)
: Lbl B
: Disp "U IS XMIN"
: Disp "V IS XMAX": Pause
: DispGraph: Pause
: Prompt U,V
: ClrDraw
: Fill(0,[A])
:(V-U)/94->D
: Lbl C
: Disp "NO. OF PTS. "
: Prompt N

: For(I,1,N)

: Lbl 3

: S2+C->S
: If S<U or S>V
: Goto 3
: iPart((S-U)/D)+1->J
: [A](J,1)+1->[A](J,1)
: [A](J,1)->K
: Pt-On(J,K)
: End

:Disp "FINISHED": Pause

:DispGraph: Pause

: Goto 2

: Lbl A

## Exercises

Use these 4 tools to investigate if iteration of f(x)=x2+C, starting with a seed of x=0, cycles for the values of C below. If f(x) cycles, record the period of the orbit.

1) C=.1 2) C=-.5 3) C=-.8 4) C=-1.3 5) C=-1.37

6) C=-1.6 7) C=-1.76 8) C=-1.77 9) C=-1.95 10) C=-1.4

The web diagram for exercise 10 is on the next page. It apparently cycles but the period of this orbit is difficult to determine from the picture. A list of iterates would eventually show the period. Also a time plot and a histogram can be used effectively to determine the period. If you reason that f(x)=x2-1.4 gives a 16-cycle, you should look further. In a time plot, `zooming' to a smaller Y scale is useful. For instance, you could set Ymin=.38 and Ymax=.65 (they were originally -2 and 2) and look at this new time plot. This zooming in clearly distinguishes some values in the orbit.

The Orbit Diagram

The exercises help demonstrate that in general, as C decreases, the number of points in the orbit of X2+C increases until the behavior is chaotic. The program BIFURCAT produces the picture below. The horizontal axis shows values of C from C=-2 to C=.25. The points on the vertical axis are the iterates of X2+C (starting with seed X=0). The first 50 iterates are not shown so that the points shown represent points to which the orbit of the iterates converges.

PROGRAM:BIFURCAT

: ClrDraw : PlotsOff : FnOff
: For( C, -2, .25, DX)
: 0->X
: For( I, 0, 200, 1)
: X2+C->X
: If I>50
: Pt-On(C, X)
: End : End

-2 -.75 .25

## Higher Iterates

The cyclic nature of some of the orbits of 0 bears further investigation. Keeping in mind that a cycle of period n means that the same value reappears after n iterations, plotting f(n)(x), the nth composition of f with itself, should yield just those attracting fixed points that turn up when we look at every nth point.

The TI-82 is able to plot

Y1 = X2 + C

Y2 = Y12 + C

Y3 = Y22 + C

:

:

This allows us to get a visual representation of the fixed points of higher periods. For example, in Y=, set the Yn's as above down to Y4 = Y32 + C, and set Y5 = X. Highlight the equal sign for Y1, Y4, and Y5. Exit back to the home screen, choose for example -1.3 and store that to C. See that your window is set for x and y ranging from -2 to 2, and press GRAPH. The intersection of the diagonal line y = x, with each of the curves gives the fixed point for each of those functions. In the case of Y4 = Y32 + C you are seeing the period 4 points (or period 2 or 1) of the original function Y1 = X2 + C. To determine if those points are attracting or repelling, one can zoom in on the points of intersection with the diagonal (Y=X) and using TRACE and the nDeriv function, find the slope at the point in question. A slope between -1 and 1 means the point is attracting for that cycle.

Try this procedure for the value of c = -1.4 which we looked at earlier.

## Complex Iteration

Forging further out into the void (to return to our parallel with astronomy), the domain of our function f(z) = z2 + c might be expanded to include all complex numbers, z. This is the realm of the amazing visual representations that so abound these days in bookstores, museums, etc. Our first program iterates a function and puts the orbit in lists, L1 and L2; L1 is the real part, L2 the imaginary.

PROGRAM:CMPLXITR

:AxesOn

:PlotsOff

:FnOff

:ClrDraw

:ClrList L1, L2

:Disp "R,I,CONST"

:Prompt R,I

:Disp "SEED"

:Prompt A, B

:For(N,1,99)

:A2-B2+R->D

:2AB+I->B

:D->A

:A->L1(N)

:B->L2(N)

:End

## Julia Sets

The program FILLEDJS asks for the real and imaginary parts of a complex number C to be inputted. It then plots the Julia Set for f(x)=x2+C (if it exists). It is often convenient to input -2, 2, -2, and 2 for Xmin, Xmax, Ymin, and Ymax, respectively.

PROGRAM:FILLEDJS

: ClrDraw : A2-B2+R->D
: AxesOff : 2AB+I->B
: PlotsOff : D->A
: FnOff : If A2+B2<4
: Disp "CNST:RL,IM" : Goto 3
: Prompt R, I : Lbl 4
: Prompt Xmin,Xmax,Ymin,Ymax : V+DY->B

: Xmin->A : If B<Ymax

: Lbl 1 : Goto 2
: Ymin->B : U+DX->A
: A->U : If A<Xmax

: Lbl 2 : Goto 1
: 0->N : Stop
: U->A : Lbl 5
: B->V : Pt-On(U,V)
: Lbl 3 : Goto 4
: N+1->N
: If N>9 ****

: Goto 5

(program is continued in next column)

The following are Julia Sets drawn with this program. These two graphs have the same value of C (in both R=.255 and I=0). However, their graphs are different since the line of the program followed by the **** is changed to `If N> 50' from `If N> 9' for the graph to the left.

N > 50 C=.255+0i N > 9 C=.255+0i

The graph to the left and below is obtained by running FILLEDJS with C=-.4 -.5i (R=-.4 and I=-.5). The values of Xmin, Xmax, Ymin, and Ymax are -1.5, 1.5, -1, and 1. The graph to the right and below is obtained by running BCKWRDJS ( a program which is listed after these graphs). Program BCKWRDJS draws the skeleton of a Julia Set using backward iteration. It uses an algorithm that is much quicker than FILLEDJS. Two versions are given. On the left, only rectangular coordinates are used. The right hand program goes back and forth to polar coordinates. Both do the same thing.

N > 9 C=-.4 -.5i C=-.4 -.5i

PROGRAM:BCKWRDJS PROGRAM:BKWRDJS2

: AxesOff : AxesOff

: FnOff : FnOff

: PlotsOff : PlotsOff

: ClrDraw : ClrDraw

: Disp "REAL, IMAG" : Disp "REAL, IMAG"

: Prompt R,I : Prompt R,I

: 1->A : 1->A

: 1->B : 1->B

: Lbl 1 : Lbl 1

: PT-On(A,B) : PT-On(A,B)

: PT-On(-A,-B) : PT-On(-A,-B)

: 2iPart (2Rand)-1->C : B-I->Q : A-R->P

: B-I->Q : A-R->P : (P2+Q2)^.25->Z

: C abs ((P+ (PP+QQ))/2)->A : If P=0

: If A=0 : p/2->q

: .01->A : If P>0

: Q/2/A->B : tan-1(Q/P)->q

: Goto 1 : If P<0

: tan-1(Q/P)+p->q

: q/2+(iPart 2rand)p->q

: Zcosq->A

: Zsinq->B

: Goto 1

To zoom in on any portion of a Julia Set, one need only change the window settings to those desired. It is urged that this feature be employed in order to demonstrate the self-replicating nature of Julia Sets. By thinking of a Julia Set as a mapping of boundary points to other points elsewhere on the boundary, and due to the continuity among points that this mapping involves, it is hoped that an intuitive feel for the why behind the fractal nature of Julia Sets will be enjoyed.

Mandelbrot Set

The Mandelbrot Set shown above is obtained by running the program MANDELBR. For the above picture -2, 2, -2, and 2 were used for Xmin, Xmax, Ymin, and Ymax, respectively.

PROGRAM:MANDELBR

: AxesOff
: ClrDraw

: For(I, 1, 58, 1)

: For(J, 17, 31, 1)

: -2+4I/94->D

: 2-4J/62->E

: D->X

: E->Y

: For(K, 1, 30, 1)

: X2-Y2+D->M

: 2XY+E->N

: M2+N2->R

: If R>4

: Goto 1

: M->X

: N->Y

: End

: Pt-On(D,E)

: Pt-On(D,-E)

: Lbl 1

: End

: End

Woodrow Wilson Leadership Program in Mathematics lpt@www.woodrow.org
The Woodrow Wilson National Fellowship Foundation webmaster@woodrow.org
CN 5281, Princeton NJ 08543-5281 Tel:(609)452-7007 Fax:(609)452-0066