Unformatted text preview: t simply numbered the initial states as one would number the integers in a
normal binary representation. This method certainly would not violate the conditions under
which the canonical form produces distinct cycles, and indeed the cycles of random numbers generated from each initial state would be di erent. But the rst few random numbers
from these cycles may be less than randomlooking when compared both with corresponding 34
Addition mod 16 z z z z z z z z z z z z z z z z z z 0
l.s.b. 0
0 m.s.b. z z z z z z z z z 0 0 0 0 0 0 0 0 0 0 X(n10) X(n9) X(n8) X(n7) X(n6) X(n5) X(n4) X(n3) X(n2) X(n1) Figure 11: Canonical Form for LFG(10,7,4)
output from other generators and with successive values from the same generator. As an
example, consider the LFG(10 7 4) generator, where we canonically initialize one register
with all zeros in the zed region of Figure 11 (call this generator \A") and a second generator
with a single one in the lower right corner of the zed region (call this generator \B"). Table
5 lists the rst 100 pseudorandom numbers produced by both of these generators, both as
integers in the range 0,15] and as oating point numbers in the range 0.0,1.0). Note that
the A sequence consists of low numbers (less than 0.5) for 43 iterations and is actually either
zero or one for the rst 19 iterations. B is somewhat better, but still not very satisfying.
In addition, A and B appear, at least until about 50 iterations, to be correlated. This appearance of nonrandom behavior on the part of these two sample sequences does not mean
that Fibonacci sequences or this method of initializing them does not produce high quality
random numbers. \Flat spots" are to be expected in any good pseudorandom number sequence of su cient length, and indeed such a sequence without them would be suspect with
regard to its randomness. The problem with initializing A and B in the example is that the
at spots were \lined up" with each other and were placed at the very beginning. Neither of
these results would be a problem if our application required the use of thousands of numbers Remarks 35 Table 4: Canonical Form Speci cations for Selected Fibonacci Generators
word no.(s)
` k for lsb = 1
32
0
53
1,2
10 7
7
17 5
10
35 2
0
55 24
11
71 65
1
93 91
1,2
127 97
21
158 128
63
from both the A and the B sequences and if the numbers generated at the beginning were
no more important than those generated later. After a short time, the two sequences would
look completely uncorrelated from each other and would appear internally random as well.
However, if the number of required pseudorandom numbers is small, the outcome of the
numerical experiment might be unexpectedly skewed due to the initial conditions.
The problem just demonstrated is not di cult to x. We simply need a di erent way
of \numbering" the patterns in the area of the free bits in the canonical form, one that
randomizes these patterns to some extent. An LCG can be used to initialize the free bits,
if one is careful to use it in such a way that a unique bit pattern results for each distinct
cycle number number. Pryor et al. Pryor et al., 1994] describe the use of the LCG of Park
and Miller Park and Miller, 1988] as a good method for initializing their family of Fibonacci
generators. In that family, M is equal to 32, so that the free bit rectangle is 31 bits high
whereas the Park and Miller generator uses a modulus of the prime number 231 ; 1. Thus
the successive values in the 31 high bits of the nth initial state for word 0 through word
(` ; 2) are simply the (` ; 1) LCG successors of n. This gives a simple way to initialize
231 ; 1 distinct cycles that start out with a satisfactory \look and feel." As an aside, this
particular LCG passes the `bitwise" randomness tests described by Altman Altman, 1988],
for use in initializing Fibonacci generators.
The second caveat related to the use of this canonical form is also highlighted by the
previous example. The astute reader may have noticed that with this method of initializing
the Fibonacci register, for every advance, the least signi cant bit is the same for all generators. Unfortunately, this is the tradeo vs. e ciency that was made in order to guarantee
uniqueness of the cycles: the least signi cant bit is simply nonrandom relative to the other 36 n
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 Table 5: The First 100 Random Numbers from LFGs \A" and \B"
Xn
Rn
Xn
Rn
Seq. \A" Seq. \B" Seq. \A" Seq. \B" n Seq. \A" Seq. \B" Seq. \A" Seq. \B"
0
0
0.000
0.000
51
15
7
0.938
0.438
0
0
0.000
0.000
52
1
15
0.062
0.938
1
1
0.062
0.062
53
1
1
0.062
0.062
0
0
0.000
0.000
54
4
2
0.250
0.125
0
0
0.000
0.000
55
7
1
0.438
0.062
0
0
0.000
0.000
56
0
2
0.000
0.125
0
2
0.000
0.125
57
15
11
0.938
0.688
0
0
0.000
0.000
58
5
11
0.312
0.688
0
0
0.000
0.000
59
1
1
0.062
0.062
1
3
0.062
0.188
60
6
8
0.375
0.500
0
0
0.0...
View
Full Document
 Fall '14
 Randomness, random number, Pseudorandom number generator, congruential generators, LCGs

Click to edit the document details