Question: 1 Random Numbers In this part you will program an instantiable Random class for generating random numbers. You are required to use a sequential random

 1 Random Numbers In this part you will program an instantiableRandom class for generating random numbers. You are required to use asequential random number generator (RNG). This is a function of form new((Pold)P2) mod M In this function, P, P2, and M are large

1 Random Numbers In this part you will program an instantiable Random class for generating random numbers. You are required to use a sequential random number generator (RNG). This is a function of form new ((Pold)P2) mod M In this function, P, P2, and M are large constant prime numbers (for example, 7919, 65537, and 102611). Random numbers generated by this function will be strictly less than M, and greater than or equal to zero. Choosing P, P2, and M can be more of an art than a science - some results seem random, and others are predictable. Therefore, our class will allow the programmer to specify these values in the constructor for each Random they create We will also need to specify an initial value S, since there will be no rold the first time we invoke the function. This value is called the seed. Note: Some students wil notice that this is not inherently "random". What we are really doing is generating numbers with such a complicated function that it's impossible to predict the next one. However, if we set the seed to the same value, the exact same numbers will appear! This property will be useful for debugging

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!