Statistics 119
Random Number Generator
This HP 12C Platinum program calculates uniformly distributed pseudo-random numbers
u
i
in the range
0 < u
i
< 1
The following method is used:
• u
i+1
= fractional part of (997 u
i
)
• where i = 0, 1, 2, ...
• u
0
= 0.5284163
*
(seed)
The period of this generator has a length of 500,000 numbers and the generator passes the
frequency test (chi square) for uniformity, the serial test and the run test. The most
significant digits (the left hand digits) are the most random digits. The right most digits
are significantly less random.
12c platinum / 12C
RPN KEYSTROKES
DISPLAY
12c platinum
ALG KEYSTROKES
DISPLAY
fs
fs
fCLEARÎ
000,
fCLEARÎ
000,
.
001, 48
.
001, 48
5
002, 5
5
002, 5
2
003, 2
2
003, 2
8
004, 8
8
004, 8
4
005, 4
4
005, 4
1
006, 1
1
006, 1
6
007, 6
6
007, 6
3
008, 3
3
008, 3
?0
009, 44 0
§
009, 20
9
010, 9
9
010, 9
9
011, 9
9
011, 9
7
012, 7
7
012, 7
§
013, 20
³
013, 36
gT
014, 43 24
gT
014, 43 24
?0
015, 44 0
?0
015, 44 0
t
016, 31
t
016, 31
g(010
017,43,33,010
g(009
017,43,33,009
fs
fs
REGISTERS
n: Unused i: Unused PV: Unused PMT: Unused
FV: Unused R
0
: U
i
R
1
-R
.7
: Unused
*
Other seeds may be selected but the quotient of (seed x 10
7
) divided by two or five must not be an
integer. Also, it would be wise to statistically test other seeds before using them.