# Sequence graphing on the TI-86

## by Sam Jordan

### edited by Ray Kremer

About the only thing the TI-83 series has over the TI-86 is built in sequence graphing. Not surprisingly though, there is a way to do it that is still mostly automatic.

Back to the FAQ

While the TI-86 does not have a built-in sequence graphing mode, like the TI-83 or TI-89, it is capable of computing and plotting the same types of sequences as handled by those calculators.

A sequence is nothing more than a "list" of numbers. On the TI-86, you use the "list" facility and a TI BASIC "For" loop to generate a sequence. You then use the "Stat Plot" capability of the TI-86 to graph those lists in the same style as on the TI-83 or 89.

#### 1. Generating a Sequence in a list.

A list is a simple sequence. Each element of the sequence is numbered and is reference by that number. In these examples, the sequence is usually a list named "U" and the elements are numbered from 1 to some larger positive number. For example, you can create a simple sequence with the following assignment command:

{2,4,8,10,12}U

In this case, there are 5 elements of the list U. Each of them can be referenced by number as in "U(4)" which is 10.

However, rather than assigning the list directly, we would rather use an equation to define the values of the list. In this case, a simple "For" loop in basic can be used to define the list. We will "name" the list "U", and use the variable "N" to index the individual values of the list. The values of the list are defined by the equation of "U(N)=2*N". As you know, in the TI-86, we would actually assign the result of "2*N" to the list in the assignment of:
2*NU(N)
where "" is the [STO>] button on the keyboard.
Some other list functions that need to be taken care of are to "clean out" any old list values, and then fill in the desired new values. We will create a simple program to do this as:

Program:Sseq
:DelVar(U)
:For(N,1,10)
:2*NU(N)
:End

After entering this program named "Sseq" (short for "simple sequence") on the TI-86 using the programming interface as described in the TI-86 Guidebook in "Chapter 16:Programming", you can run it and then display the resulting sequence "U" on the home screen simply by pressing [ALPHA] [U] [ENTER] which displays:

U
{2 4 6 8 10 12 14 16 18 20}

The above program and equation are examples of "non-recursive" sequences. A non-recursive sequence is one in which none of the elements in the sequence depend on the values of any of the other elements in the sequence. Each element depends only on the current value of N for computing the element.

For such non-recursive sequences you can also use the "seq()" function from the home screen instead of a For loop in a program. Using the same example, type in
seq(2N,N,1,10)U
The 2N is the equation, the second N tells the calculator which variable in the equation is changing. Once again, if you call up the variable U you will get
{2 4 6 8 10 12 14 16 18 20}

A recursive sequence is one in which an element of the sequence is calculated using the values of one or more of the earlier elements in the sequence. In this case, you always need to specify one or more of the elements that begin the sequence along with the equation for computing the remainder of the sequence. In a non-recursive sequence, you need only specify the equation, and do not need to specify any initial elements of the sequence. For example, you could specify the above "even number" sequence recursively as:
U(N)=U(N-1)+2
where U(1)=2

This could be computed using the program:

Program:rseq
:DelVar(U)
:{2}U
:For(N,(dim U)+1,20,1)
:U(N-1)+2U(N)
:End

Again, after running the program, you simply type "U" at the home screen to view the resulting sequence values and see:
{2 4 6 8 10 12 14 16 18 20}
which is the same sequence as before.

Note that the thing that makes a sequence recursive vs non-recursive is not the value of the sequence, but rather, the way it is computed.

#### 2. Graphing the sequence.

A sequence can be graphed using the built-in Stat Plot capability of the TI-86. These are described in detail in "Chapter 14: Statistics" of the TI-86 manual.

But, for fun, we'll go over how to recreate the converging recursive sequence from the TI-83 and 89 manuals given by U(N)=-.8*U(n-1)+3.6 with an initial value of U(1)=-4.

First, modify the "rseq" program to read:

Program:rseq
:DelVar(U)
:{-4}U
:For(N,(dim U)+1,20,1)
:-.8*U(N-1)+3.6U(N)
:End

This will result in a sequence that looks like:

U
{-4 6.8 -1.84 5.072 ...

In order to graph this, we'll use Stat Plot #1 with the U list stored in "yStat" and we'll create a list of the index values (1-20) in the "xStat" list using the "seq()" function as in:

seq(x,x,1,20)xStat
UyStat

Now select the [STAT] menu and choose [F3] for the PLOT option. This will bring up the "STAT PLOTS" menu. From here, select [F1] for the "Plot 1" definition screen. Use the cursor to select "ON", and then scroll down to "type" and select [F1] for "SCAT" as in "scatter plot". Set the Xlist Name=xStat and the Ylist Name to yStat. Choose an appropriate mark (I like the box over [F1]) and exit the STAT menus back to the Home screen.

Now set up the Window using the [GRAPH] menu. For this example, just select Zoom and then Zstd to put the screen in the normal x-y graph settings, and then go to the "Window" settings and set xMin=0 and xMax=20.

Now turn off any other equations, and hit "GRAPH" to do the plot. This should give you a traceable plot of the converging sequence that looks very much like the example in the TI-83 and 89 manuals.

#### 3. Web Plotting

When the above sequence:

U(N)=-.8*U(N-1)+3.6

was plotted, it showed two curves approaching each other as N increased. This shows that the sequence converges towards a single value. Another method of showing this convergence is in a "Web" plot. This form of plot can only be demonstrated on the TI-83 or 89 if the sequence:

1. is recursive to one level only (defined with U(N-1)).
2. does not reference "N" directly.
3. does not reference any sequence other than itself.

The sequence we are currently working with meets these restrictions. In fact, the contents of the "U" list as generated above may be used directly as input to this next bit of code which sets up two equations and a pair of lists in "xStat" and "yStat".

Program:UWEB
:{U(1),U(3)}xStat
:{U(2),U(4)}yStat
:LinR xStat,yStat,y1
:y2=x
:For(N,2,dimL U)
: 2(N-1)i
: U(N-1)xStat(i)
: U(N)yStat(i)
: U(N)xStat(i+1)
: U(N)yStat(i+1)
:End

After running the above bit of code, set up your "stat plot" the same as above, but this time, use the line format instead of the dot format. Again, select the [GRAPH] menu and plot the graph.

This time, you should see the web plot appear and a pair of lines will be graphed which cross at the center of the web. The intersection of these lines is the value towards which the sequence converges. The first four lines of the above program compute the equations of these two lines and place them in the y1 and y2 equation variables. You could also determine the convergence value by finding the simultaneous solution to these two equations.

#### 4. Predator-Prey Web

This example, from page 6-13 of the TI-83 Plus Guidebook, is plotted in two different ways. The first plots time on the x-axis, and then plots two separate populations of rabbits and wolves on the y-axis.

This short program (UVWEB) will generate three lists. xStat will contain the time count from 1 to 400. U will contain the rabbit population corresponding to the time count. V will contain the wolf population corresponding to the time count.

Program:UVWEB
:seq(x,x,1,400)xStat
:{200}U
:{50}V
:For(N,2,400)
:U(N-1)*(1+.05-.001*V(N-1))U(N)
:V(N-1)*(1-.03+.0002*U(N-1))V(N)
:End

To graph this, you need to set up two separate stat plots. We will set STAT PLOT 1 with xList=xStat, yList=U and mode=line. We will set STAT PLOT 2 with xList=xStat, yList=V and mode=line.
Your window should have xMin=0,xMax=400 and yMin=0, yMax=300. Both xScl and yScl should be 100.
Turn off all other plots and equations and graph this. It should match the graph shown in the TI-83 and TI-89 Guidebooks.

To plot the "UV" axis example, simply turn off stat plot #2, and modify stat plot #1 to use xList=U, yList=V and regraph it with window settings xMin=84,xMax=237, xScl=50 and yMin=25,yMax=75,yScl=10.

This graph should match the UV axes format graph.

Back to the FAQ

visitors since 8/1/2001