Using a = 4 and c = 1 (bottom row) gives a cycle length of 9 with any seed in. The second row is the same generator with a seed of 3, which produces a cycle of length 2. The top row shows a generator with m = 9, a = 2, c = 0, and a seed of 1, which produces a cycle of length 6. Each row shows the state evolving until it repeats. Two modulo-9 LCGs show how different parameters lead to different cycle lengths.
0 Comments
Leave a Reply. |