These calculators use a seeded, pseudo-random number generator. It is an algorithm that provides a sequence of numbers that looks as if it were created randomly. Seeded means that you can restart it in the same location again.
Example (seed = 17)
17→rand ENTER
17
rand ENTER ENTER ENTER
.6745331315
.5503091595
.8311198328
Try it again,
17→rand ENTER
17
rand ENTER ENTER ENTER
.6745331315
.5503091595
.8311198328
Remark
Re-seeding restarts all of the calculator's random variables, rand, randInt, randNorm, and
randBin.
In order to create a truly random sequence, we need to introduce an "external" factor that will decide which number is used and which are skipped.
This can be done by the following program.
PROGRAM:RANDOM
:While 1
:rand→R
If getKey>0
Disp R
End
After you start the program,
RANDOM ENTER
press ANY KEY except ON to get a next number. When you press ON ENTER, the program is interrupted and stops running.
Comments
• The program is running all the time, generating around 30 numbers per second, using rand→R. Which of the numbers is displayed depends on the moment when you press a key.
• You may check that seeding did not provide a repeated performance.
• This method is used in all electronic slot machines in casinos. But their pseudo-random number generators create around 500 numbers per second.
• Operation getKey is in CATALOG, and also under PROGM I/O.