TI-82 Users Guide

Random Numbers from the Home Screen

The rand command: Press the button and the left arrow to select the probability menu. The top entry is the random operator command. If you press while the "1: rand" is highlighted, the -82 will write "rand" on the home screen. If you press again, you will see a number between zero and one.

Press repeatedly and the calculator will produce a list of numbers that seem to be randomly selected from the interval (0-1). In truth, they are derived from a predictable function, but it is complex enough to make them almost unpredictable. Such numbers are called pseudo-random numbers.

While random numbers are frequently used in mathematical simulations, we often want numbers other than from zero to one. We will briefly show you how to create numbers in any range you wish.

CHANGING THE INTERVAL: If we wish to have real numbers in some other interval, all we have to do is multiply the rand by an appropriate value, and perhaps add or subtract something. Here are the commands that can be entered to produce numbers from each of the following intervals. Try each command on the calculator and press enter several times to see the output.

For numbers in the interval

Use the expression

0< number <10

10*rand

1

1+9*rand

6< number<20

6+14*rand

Notice that we add enough to get the first value, and then we multiply by a number equal to the interval width (top - bottom). These produce real decimal values. If we wish to produce only integers we need to add one more menu selection to our palette.

The int command: Press , , and <4> and the calculator prints the command "int". This is the greatest integer function you may have studied in school. For positive integers, it simply removes the decimal fraction leaving the largest integer less than the value. Try each of the following and test the results:

Int( 3.5) int (4.234) int( -3.2) surprised? For negative values, the greatest integer function drops down to the next integer lower than the value, but for -3.2, the next lower integer IS -4. Get used to this if you wish to work with negative integers.

Now try the commands below and see what happens as you repeatedly press after entering them:

For Integers in the interval

(including endpoints)

Use the expression

0-10

int(11*rand)

1-10

int (10*rand)+1

6-20

int (15*rand)+6

:

Notice that we have had to add one more to the interval to make the values on both ends print. If we only used int(14*rand)+6 we would get numbers from 6 up to 19.


FOR THE TI-83 A NEW COMMAND IS PROVIDED UNDER THE MATH/PRB MENU THAT ALLOWS THIS TO BE DONE MORE EASILY. THE "randInt(" COMMAND ALLOWS YOU TO INPUT JUST THE LOW AND HIGH VALUES OF THE INTERVAL. THE COMMAND TO PRODUCE RANDOM INTEGERS IN THE INTERVAL FROM ONE TO SIX WILL APPEAR LIKE THIS WHEN COMPLETE: "randInt(1,6)".

SOME PRACTICE PROBLEMS: Now you need to see if you can make the calculator pick some random numbers. Be careful, we have thrown in a few tricky ones… but don't worry, the answers are down the page, and if you get really stuck, ask your teacher or send Mr. Ballew an e-mail letter with a really clear question.

  1. Simulate rolling a single die; that is, make the calculator pick integers from 1 through 6.
  2. Simulate drawing numbers from bingo. The numbers used in bingo range from 1 to 75.
  3. Make the calculator pick an even number in the interval [0,20] (the brackets mean that zero and 20 are in the set, while (0,20) would usually mean the numbers between 0 and 20 but NOT 0 or 20 themselves.
  4. Have the calculator randomly pick from the numbers ( 5, 8, 11, 14)
  5. Have the calculator randomly pick from the real numbers from (-5,5)

There are some additional methods you will learn as we go along to pick values and strings of values, but if you have mastered all of these, your well on the way to being able to simulate probabilities on the calculator.

CAREFUL… WE STORED THE ANSWERS DOWN HERE… DON'T LOOK BEFORE YOU REALLLLLLY TRY TO ANSWER THE QUESTIONS

  1. you can simulate a die roll by using int(6*rand)+1 (notice that it often does not matter if the +1 is inside or outside the parentheses)
  2. Bingo is similar to a 75 sided die so use int(75*rand)+1
  3. Pick the numbers [0,10] then double them… use 2(int(11*rand+1))….. notice that in [0,20] there are eleven even numbers counting zero and 20
  4. These are the numbers 3x+2 for x=1,2,3,and 4 so one method would be to make the integers from one to four, then put them into the function 2x+3… like this 3(int(4*rand+1))+2.
  5. This is the interval (0,10) shifted to the left five….. use (10*rand)-5… remember, if we want all real values, we don't use the "int" command.

In the next unit I'll show you how to use the list menu's to print and store long strings of random numbers and some other sequences.