Quality of a PRNG.The following code implements a common type of PRNG known as a multiplicative linear congruential generator.3
The seed value is set before first calling the random routine. Also note that % is C’s modulo operator and that the hexadecimal value 0x8000000 is 231. A typical use of this code in a network simulator might be to select a destination node in a 64-node network under uniform traffic:
Implement this random number generator and its corresponding call to generate random destination nodes. Comment on the “randomness” of the destinations created.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here