Monday, May 4, 2009

201 a sequence of numbers on TI-84

This afternoon we made a sequence of pseudorandom numbers with I-remember-not-what values for seed, multiplier, increment, and modulus. Later I figured out how to see this in the TI-84. I used values 5 for seed, 43 for multiplier, 200 for increment, and 17 for modulus. The graph immediately showed that my sequence of values was very non-random.


Do this with the calculator in Sequence mode — use Mode key, then on Function line, choose Seq.



nMin=1
u(n)=u(n-1)*43+200-iPart((u(n-1)*43+200)/17)*17
u(nMin)={5}


To get the u above, see the little u above the 7 key. For n, use the x key.


You can see the results in a table with TblStart=1, delta-Table=1, or in a graph:



nMin=1
nMax=100
PlotStart=1
PlotStep=100
Xmin=1
Xmax=100
Xscl=20
Ymin=-2
Ymax=18
Yscl=5


I read in the TI-83 manual that the screen is 63 pixels high and 95 pixels wide. Haven't tried these routines yet on the TI-89, but I'm sure that they're substantially the same there, excluding the screen dimensions.


What do you suppose makes this sequence so bad, anyway?

No comments: