Let us consider a simple example with
a = 5, c = 1, m = 16, and .
The sequence of pseudorandom integers generated by this algorithm is:
In Figure 3, we illustrate the random number cycle
for this generator. We immediately observe four features:
Figure 3: Random Number Cycle for Example 1- LC(5,1,16,1).
The period (the number of integers before the sequence repeats) P is 16 -
exactly equal to the modulus, m. When the next result depends upon only the
previous integer, the longest period possible is P = m. In the current
example with a modulus of 16, the mod operation generates integer results
to 15, inclusive. Thus, for m=16, this sequence is of long period (the
longest possible), and uniform (it completely fills the space of integers from
0-15). Note that the period is exactly equal to , i.e. , where M
is the base 2 log of the modulus.