Question: code in python 1. Choose an m {150, 151, ... ,5000} and an a E {2,3,..., m 1} so that the linear congruential generator (LCG)

code in python 1. Choose an m {150, 151, ... ,5000} andcode in python

1. Choose an m {150, 151, ... ,5000} and an a E {2,3,..., m 1} so that the linear congruential generator (LCG) Rn = (aRn-1) mod m has full period. [Remember that m should be prime.] Report your choice of a and m. For the seed Ro = 1, generate R1, ..., Rm-1 and define Nk to be the number of the R;s that are equal to k. More formally, Nk = #{j:R; = k; j 1, ..., m 1} = What should Nk be for each k = 1, ...,m 1? Produce a plot of Nk versus k for k 1, ...,m 1

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!