Question: By using a random number generator in Python in the range -1 -> +1 Answer the following: Does the number 0.0 ever occur? What is

By using the random number generator in Python (random) in the range

By using a random number generator in Python in the range -1 -> +1 Answer the following: Does the number 0.0 ever occur? What is the smallest difference between two random numbers? Does the random number generator ever produce a number a second time?

By using the random number generator in Python (random) in the range -1 1. Please answer as best you can (and you may need to generate a lot of random number to do so ) the following questions: a) Does the number 0.0 ever occur? b) What is the smallest difference between two random numbers and using that information can you work out how many "bits" are being used to represent it (Hint: log2(r) give the approximate number of bits in a number and the minimum difference tells you something about the resolution of the generator) c) Does the random number generator ever produce a number a second time?

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 Programming Questions!