Main Index

Your Pocket Scientific Calculator
Random Numbers


If you are studying statistics, or doing lots of other things, you will find yourself needing to generate lists of random numbers.

The Random Number key is over the decimal point, so you will need to use the SHIFT or ALPHA key.

If you use the SHIFT key,

each time you press = you will get a random number in the range 0 to 0.999, except that, unless you have changed the default settings, it will be displayed first as a common fraction and you will need to use the SD key to display it as a decimal, and when displayed as a decimal trailing zeros are omitted and numbers in the range 0.001 to 0.009 are shown in standard form. You might prefer to change the way the SD key works so that it is displayed as a decimal straight away. To do this you use SETUP, then 1 for Maths IO, then 2 for LineO. To switch back when you have finished do SETUP then 1 then 1. This is more fully described in Accuracy and displaying your answer. Actually if you are using your calculator in subjects other than maths you might prefer to leave it this way.

You often need a sequence of random numbers: try SHIFT Ran# = = = = = =

You can use random numbers in a calculation or other operation, for example try 1000 × Ran# = = There are some examples of this in the ALPHA section, next.

If you use the ALPHA key,

you get an integer in the range you specify, for example if you are wanting to simulate the throw of a die you will want an integer in the range 1 to 6 so you will enter

ALPHA RanInt (1,6) = = = = = (somehow a # creeps into the display)

To simulate tossing a coin you will enter ALPHA RanInt (0,1), but before you do so make certain you have agreed which is Heads and which is Tails.

To obtain the total produced by rolling two dies you could enter RanInt (1,6) + RanInt (1,6) = = = =

A Note on Random Numbers, for Advanced Readers

There are several ways of producing random numbers without using a computer or calculator.

If you are running a tombola stall at your local Scout Group Summer Fete you will not be expected to test your tombola machine, but if you own a casino, or are carrying out random safety tests on aircraft parts, or running the National Lottery, your equipment must be tested regularly to make certain the numbers produced really are random.

All of these produce genuinely random numbers, but they are not very convenient for producing more than a few numbers, for example the two million different Premium Bond winning numbers every month.The machine that draws the Premium Bond winning numbers is called ERNIE, for Electronic Random Number Indicating Equipment. The original ERNIE (ERNIE 1, introduced in 1957) used the random noise produced by a gas neon diode, today ERNIE 4 uses the thermal noise in transistors, and can generate a million random numbers an hour. ERNIE has always used special hardware, designed and built to produce totally random and totally unpredictable random numbers.

PCs and laptops, and of course calculators, do not have special hardware built in, instead they use a computer program containing a special algorithm, which takes a number, the seed, and carries out certain operations on it to produce a sequence of pseudo-random numbers. There are several different algorithms that can be used.

There is just one problem. Computers are essentially machines which carry out instructions very exactly, and if you run a pseudo-random number algorithm and start with the same seed each time you will always end up with the same sequence of random numbers. On some PC programs you can choose how you seed the algorithm but on most calculators you cannot, you just use the seed the calculator itself is programmed to use - programmed of course to be different each time you start a new sequence. Also sometimes, for example if you are selecting one hundred addresses from a list of ten thousand, you may not use the same address twice, so you can program your PC to ignore repeated numbers, but on your calculator you cannot do this so you may get the same number more than once.

The mathematics involved in pseudo-random number algorithms and generating seeds is quite advanced, and beyond the scope of this Web Page, but you can find it on other web pages.

back

© Barry Gray August 2016