Question: 6. (Bonus): This exercise will enable you to test your favorite pseudorandom generator. The test is based on a well known property of random integers:

 6. (Bonus): This exercise will enable you to test your favorite

6. (Bonus): This exercise will enable you to test your favorite pseudorandom generator. The test is based on a well known property of random integers: Given two randomly chosen integers m and n, the probability they are relatively prime (their greatest common divisor is 1) is . Use this property in a program to determine statistically the value of 7. The program should call the random number generator from the system library to generate the random integers. It should loop through a large number of random numbers to estimate the probability that two numbers are relatively prime. From this find an approximate value of a. Report the typeame of the random number generator(s), the number of pairs of numbers in your sample, and the approximate value of 7. You may compare two pseudorandom generators in different programming languages, say, Python and C++ to see the difference. 6. (Bonus): This exercise will enable you to test your favorite pseudorandom generator. The test is based on a well known property of random integers: Given two randomly chosen integers m and n, the probability they are relatively prime (their greatest common divisor is 1) is . Use this property in a program to determine statistically the value of 7. The program should call the random number generator from the system library to generate the random integers. It should loop through a large number of random numbers to estimate the probability that two numbers are relatively prime. From this find an approximate value of a. Report the typeame of the random number generator(s), the number of pairs of numbers in your sample, and the approximate value of 7. You may compare two pseudorandom generators in different programming languages, say, Python and C++ to see the difference

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!