next up previous

4 N-tuple Generation With LCGs     continued...

In Figure 6a--f we present a few examples to illustrate this behavior. These examples depict the result of generating all pairs of consecutive numbers in the period of full-period LCGs. For each modulus, the plotted points show the effect of our choice of the multiplier, a. In Figure 6a we show the set of points produced by scaling by 1/509 the output of the generator . Note that the points form more than one set of rows. That is, there are several angles from which the points appear to line up. From some perspectives, the rows are close together, while from at least one perspective, the rows are rather far apart. The best situation is to have the maximum spacing of the rows, when viewed over all angles, as small as possible. When the maximum spacing is large, as it certainly is in Figure 6b, , then clearly the unit square is not well covered by this set of points, and the results of our simulation may be adversely affected by this ``striping.'' Figure 6c shows the effect of a good choice of a, , for which the maximum spacing between rows is clearly smaller than it is in the first two cases, and where the points cover the unit square with nearly optimal uniformity, given that with this generator we can generate only a small number of points.

Figures 6a-c are examples that all use the prime modulus m = 509. When m is a power of two, the other major case to consider, the situation is similar, as depicted in Figures 6d and e. Recall that when m is a power of two and c = 0, the full period is , but only if mod 8 or mod 8. Thus we choose so that with period 512, we plot almost the same number of points (508) as we see in Figures 6a-c. Figure 6d illustrates the result of using a good choice of a ( mod 8). As in the prime modulus case, the plotted points form a uniform looking lattice. But when we plot the points in Figure 6e generated by taking mod 8, we see that the pattern looks like two lattice structures slightly offset from one another. This double lattice distinguishes the mod 8 case from the mod 8 case and is the reason that mod 8 is preferred, even though both sets of a values produce the same period. As an aside, the two lattice structures in the mod 8 case come about from plotting separately the pairs beginning with odd indices and those beginning with even indices.