Question: write python code. Write a program that generates random numbers using the Wichmann-Hill pseudorandom number generator. The Wichmann-Hill number generator uses three LCG (Linear Congruential

write python code.

Write a program that generates random numbers using the Wichmann-Hill pseudorandom number generator. The Wichmann-Hill number generator uses three LCG (Linear Congruential Generators) with different prime moduli (values of m) to generate random numbers. If U_1i,U_2i and U_3i are the ith numbers generated from the three LCGs respectively, then we add the 3 values together and take only the fractional part to generate U_i, the ith value of our Wichmann-Hill generator. That is: U_i = (U_1i+U_2i+U_3i) mod 1 Set the values of the parameters for the three LCGs as you wish, as long as the values of m in each of the three LCGs are prime. Your program should output 100 values generated using the Wichmann-Hill generator

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!