The random numbers generated by the calculator are called pseudo random numbers because although they look random they in fact are the result of some strange computations. Furthermore, they are completely reproducible. Once we accept this we can just drop the pseudo from the term pseudo random.
![]() |
The random number generator in the calculator uses a seed
value to both start and to continue the process of generating random numbers.
In general there is no need for a user to
alter that seed value. However, if you do change it then
you will alter the sequence of random values produced on you calculator.
For this web page we want your calculator to be able to produce exactly the sequence that the calculator used here produced. To do this we will set the seed value. In Figure 1 we have entered the value 25717 and then used the
|
![]() |
Press ![]() |
![]() |
Use the ![]() ![]() |
![]() |
The command is complete. This command will place the value 25717 into the random number seed.
Press ![]() |
![]() |
The only visible response from the calculator is to echo the value 25717. |
![]() |
Use the ![]() ![]() ![]() |
![]() |
Figure 7 has the rand item on the main screen. When used in an
expression, the rand item acts as a function and it returns a random
value between 0 and 1. We will press ![]() |
![]() |
The calculator response is .5863844503, which certainly seems like a random value between 0 and 1. |
![]() |
We want to perform the rand function again. We could return to the MATH menu, go to the PRB sub menu, and select it again, or we could
press ![]() ![]() Press
|
![]() |
Figure 10 shows that the second time we performed the rand command
the result was .194143297, another seemingly random value between 0 and 1.
Figure 10 goes on to show yet a third use of the rand command, this time producing the value .5827919869. We could continue to perform the rand command and we would find that it continues to produce what seem to be random values between 0 and 1. Before we do anything like that let us demonstrate the effect of changing the seed value. |
![]() |
The top line of Figure 11 is the same as the bottom line of Figure10. We have just executed more commands and the screen has rolled up as we have done this. The new commands were first to reset the seed value to 25717 and then to perform the rand function two times. What we see is that the rand function produces the same set of values that it did in Figures 8 and 10. In fact, at this point, we know the exact value that rand will produce the next time we use it, namely the value .5827919869, shown at the bottom of Figure 10 and the top of Figure 11. |
![]() |
For us to understand the next command you need to recall that the TI–83/84
calculators "understand" implied multiplication. Typing 3π on these calculators
is as good as typing 3*π. Thus, in Figure 12, when we recall the previous command via
![]() ![]() ![]() ![]() ![]() |
![]() |
In Figure 13 we do see the expected result. We also see a new command, rand*20, and the result of performing that command, 3.30643276, a value that we could not have predicted from earlier screens because it involves using the next random number generated by the function rand. |
![]() |
We have seen that rand will produce a random value between 0 and 1. We have seen that
we can form the expression rand*20
and that expression will produce a random value between 0 and 20.
What can we do to produce a random integer between 0 and 19 inclusive?
The immediate answer is that we can take the integer value of the random
number between 0 and 20. To do that we return to the MATH menu, via the
![]() ![]() ![]() ![]() |
![]() |
The int( function is in place. Now we will complete the expression. |
![]() |
Return to the MATH menu, via the ![]() ![]() ![]() |
![]() |
We finish our expression via ![]() ![]() ![]() ![]() ![]() |
![]() |
Figure 18 picks up where we left things in Figure 17,
but now we have created and had the calculator perform the command
rand(5).
The result is that we have produced a list of 5 values, the first one being .9923155961
and the second value is shown as starting with .9.
The three dots after that indicate that there is more to see. We can
use the ![]() |
![]() |
In Figure 19, on the last line of the display, we see the end of the first random value from Figure 18, namely, ...61 and that is followed by most of the second value in the list, namely, .9813998199..., where the three dots mean that there is more to the display. |
![]() |
For Figure 20 we have combined the things we have learned to form the command int(rand(5)*20). To perform this command the calculator will produce 5 random values, each between 0 and 1. It will multiply each of those random values by 20. Then, for each of the five values, it will find the largest integer less than or equal to that value. The result is a list of 5 integer values, in the first case this was {3 7 6 4 10}. Then we recalled the command and executed it to get a new list. Then we recalled the command again and performed it to get the third set of five values. |
The task of producing random integers within a given range happens so often
that the TI–83/84 family of calculators has a special
command that does just that. The command is randInt(.
The TI documentation for randint( is:
That documentation gives the syntax of the command as
randInt(lower,upper[,numtrials]) meaning
that we have a required lower and
upper specification but an optional numtrials value.
We will explore this command.
![]() |
For Figure 21 we have returned to the MATH menu and moved to the PRB submenu.
Then we moved the highlight down to the
fifth item, randInt(. We press ![]() |
![]() |
In Figure 22 we completed the randInt( command by using 25 as the
lower value and 35 as the higher value. Adding a closing right parenthesis, the
command was complete and we press ![]() |
![]() |
For Figure 30 we have built the same command, but this time we have
specified the numtrials as 5. As usual, press ![]() |
![]() |
Our first execution of the command randInt(25,35,5)
produced the list {35 35 30 26 33}.
We note that all the values are within the desired
range and that we actually have a repeated value, namely 35.
There is nothing to say that this cannot happen.
We then recalled the command and performed it again, this time generating the values {25 33 34 30 28}. We were lucky enough this time to not have any repeated values. |
![]() |
If the range of values is large enough, that is
if higher-lower is a large enough value,
then picking even a moderate number of random values in the
range will likely not result in having any
duplicate values.
For example, if there are 12,500 credit students at the
college this term and we want to
select a random grup of 30 students then we could just
number the students 1 to 12,500 and ask the calculator to
choose 30 random values in the range from 1 to 12,500. The
command to do this, randInt(1,12500,30) is on Figure 25,
along with the start of the resulting list of values. We could just scroll over that list to see all the values, but we might as well take advantage of some of the features of the calculator to ease this task. |
![]() |
To generate Figure 26 we press ![]() ![]() ![]() ![]() ![]() |
![]() |
For example, we can sort that list. Press ![]() ![]() |
![]() |
We have the start of the command specified. The command is to sort a list into ascending values. We just need to tell the calculator which list to sort. |
![]() |
We complete the command via ![]() ![]() ![]() ![]() |
![]() |
The key sequence ![]() ![]() ![]() ![]() |
![]() |
For Figure 31 we have indeed scrolled over some of the list do display more items. |
![]() |
Another way to display the items in the list is to use teh List Editor
on the calculator. We get to that list editor via the STAT menu. We return to the STAT
menu via the ![]() ![]() |
![]() |
Figure 32 shows us the start of the List Editor screen.
Here we see, in the first column,
the first seven values in L1.
The highlight, in Figure 33 is on the first
item. As such, the bottom of the screen tells us that
item #1 in the list has the value 25.
If we use ![]() |
![]() |
For Figure 34 we have scrolled down to display item 13 which has the value 4519. |
![]() |
For Figure 35 we have scrolled down to display item 19 which has the value 8089. |
![]() |
For Figure 36 we have scrolled down to display item 25 which has the value 9256. |
![]() |
For Figure 37 we have scrolled down to display item 31 which has the no value at this time. Remember that we generated just 30 values via the command in Figure 25. In Figures 33 through 37 we have seen the list of the 30 students that we have randomly selected from the 12,500 credit students this term. |
©Roger M. Palay
Saline, MI 48176
August, 2013