Math 4330, Homework 12 (Extra Credit)

advertisement
Math 4330, Homework 12 (Extra Credit)
1
This assignment expands on Homework 11, and assumes you’ve completed it already.
• Implement a linear congruential generator with modulus mL = 1120437 and your choice
of a, c and starting point; denote the resulting sequence by X0 , X1 , . . . .
• Implement the Fibonacci generator ( Eq. (5) in Section 3.2.2) with mF = 228 ; denote
the resulting sequence by Y0 , Y1 , . . . .
• Define a new sequence {Zn } by Zn = (Xn ⊕ Yn ) mod mL , where ⊕ denotes the bitwise
exclusive-or operation.
1. (5 points) Apply the Gap Test (3.3.2 C) to each sequence {Xn /mL }, {Yn /mF }, {Zn /mL }.
2. (10 points) Apply the Serial Correlation Test (3.3.2.K) to the first 105 elements of each
sequence {Xn /mL }, {Yn /mF }, {Zn /mL }. Tabulate the results for each sequence and
each test. Can you speculate about anything in general?
3. (5 points) In the definition of Zn , replace the bitwise exclusive-or operation with bitwise
or, and repeat the tests. Are the results for Zn better or worse? Replace it with bitwise
and, and repeat the tests. Again, are the results better or worse?
1
c
This document is copyright 2014
Chris Monico, and may not be reproduced in any form without
written permission from the author.
1
Download