CSC 344 - Algorithms and Complexity

Dr R. M. Siegfried

Assignment #8 - Fun with Random Numbers

Due Monday, April 24, 2017

Recently, we learned how to generate pseudorandom numbers that can have a fairly long cycle. We saw in the lecture notes a set of methods ( rand and randinit()) in the program parkm.cc that can generate long-period sequences of pseudorandom numbers.

Use these methods to write a program to generate three sequences of pseudorandom numbers using the following pairs of values for m and a:
m a
231 - 1 91367
1073741789 91309
1073741789 100003

[Back to the Assignments Page]