Consider a multiplicative congruential generator for a 16-bit machine. What is t
ID: 3421170 • Letter: C
Question
Consider a multiplicative congruential generator for a 16-bit machine. What is the largest signed integer that can be stored in the machine? Let the modulus equal the largest prime less than the largest integer, and let the multiplier be a constant so that the generator has a full period. First, determine by hand the first three random numbers generated with this generator giving accuracy to four digits to the right of the decimal. Second, use Excel to verify your answers. Third, verily that the multiplier yields a generator with a period equal to one less than the modulus using Excel. (Note that the initial seed does not yield a random number.)Explanation / Answer
The first bit is the signed bit, 0 represents the positive number and 1 represents a negative number
Largest Possible Integer Value: 2^(15) - 1 = 32767
Largest Prime Number less than the largest possible integer value = 32749
32749 mod 661 = 360
661 mod 360 = 301
360 mod 301 = 59
Hence the first three random numbers will be equal to 360, 301 and 59
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.