Evaluate quality of the random number generator in python

Assignment Help Python Programming
Reference no: EM13969025

This program is going to evaluate the quality of the random number generator in Python by simulating dice rolls and looking at the distributions of the values. A random number generator must be initialized with a seed value. Then random values can be computed using a fancy calculation. We will use the random module. The seed() function without any arguments will use the system clock to seed the calculations. The random(a,b) function call will return an integer in the range from a to b. We will use a=1 and b=6 to return values for a six sided die. Adding two of these together simulates a dice roll. If these rolls were truly random, the odds of getting a particular value are: 2 and 12 - 1/36, 3 and 11 - 2/36, 4 and 10 - 3/36, 5 and 9 - 4/36, 6 and 8 - 5/36, and 7 - 6/36.

You are going to determine how close to these probabilities we can get for different sample sizes of dice rolls. For each sample size you should roll the dice a particular number of times and keep track of how often each value occurs in a list. You should create a list of lists that holds the counts for a sequence of sample sizes that includes 100, 1000, 10000, 100000, 1000000 and 10000000. For each list corresponding to a particular sample size, you should compute the percentage of the rolls corresponding to each dice value. You should then compute the difference between each of these values and the ideal percentages given above.

You then should print a table of these percentage difference values, where the rows correspond to the dice values and the columns correspond to the sample sizes. If the random number generator is working well, these differences should get smaller as the sample sizes grow. Print out a final assessment of the generator's quality as good or bad. A good rating is given if the difference values for each dice value do decrease as sample size grows, otherwise a bad rating is given if for any dice value the differences between two sample sizes do not get smaller.

Make sure that you properly comment your program. Submit the source file along with sample output of your program showing the table of data.

 

Reference no: EM13969025

Questions Cloud

Describe why this law or regulation causes these challenges : Laws and regulations are put in place to serve a purpose and to protect the entities and organizations that can be affected by them. Which law or regulation appears to cause significant challenges for international management? Describe why this law o..
Describe how the organization was managed in the past : Describe how the organization (Kaiser Permanente) was managed in the past. Compare the difference between management approaches in the past to those the organization currently uses. Ensure you identify relevant management theory both for past practic..
Culture of organization has impact on staffing decisions : The culture of an organization has a major impact on staffing decisions. Many organizations consider the company's talent philosophy-how the company views its employees-as an influence on staffing strategies. What are the decisions that influence a c..
Force of attraction between mars and the satellite : 1) What is the force of attraction between Mars and the satellite? 2) What speed should the satellite have to be in a perfectly circular orbit? 3) How much time does it take the satellite to complete one revolution?
Evaluate quality of the random number generator in python : This program is going to evaluate the quality of the random number generator in Python by simulating dice rolls and looking at the distributions of the values.
Develop work for different types of crises : When there is a crisis within your organization employees are going to need to be trained on how to communicate with the media. What media and multimedia tools might best help you develop training content and material for employees and managers of an..
Problem regarding the beat frequency : The speed of sound is 343 m/s and the merry go round revolves once every 20s. What is the beat frequency that is detected by the listener when the speakers are both pointing at him from equal distances?
Explain the concept of future value : Explain the concept of Future Value (FV) in your own words. Why is FV an important topic in money management? Why would you want to take $1000 today instead of waiting for a year
What would their total recruiting cost be : The Digby's workforce complement will grow by 10% (rounded to the nearest person) next year. Ignoring downsizing from automating, what would their total recruiting cost be? Assume Digby spends the same amount extra above the $1,000 recruiting base as..

Reviews

Write a Review

Python Programming Questions & Answers

  Compare programming with python and programming with scratch

Compare programming with python and programming with scratch. Describe the same program you might create in both programming languages.

  Calculate the accuracy of your linear classifier

Plot X,Y and the decision boundary. Make sure that you use a good plotting technique so that it is easy to distinguish which datapoint is X and which is Y. Calculate the accuracy of your linear classifier.

  Write a python program

Write a Python program

  Improve the structural design - haunted house game

List the things you changed and the purpose of changing it. Good reasons include making code easier to read and easier to navigate when modifying it.

  Implement your algorithm in python

Write a Python program that, for every transaction, takes input on the customer ID and the total sale amount in the transaction.

  You will define an operation on positive integers called

you will define an operation on positive integers called twiddle which consists of summing the squares of the digits of

  Aussie best car abcdeclares that based on its yearly sales

aussie best car abcdeclares that based on its yearly sales it will award a bonus as follows. the bonus will be equally

  Assignment on python code

A robot is asked to navigate a maze. It is placed at a certain position (the starting position) in the maze and is asked to try to reach another position (the goal position)

  Look up terms in a tech dictionary

Create a program that allows a user to look up terms in a tech dictionary - programming or scripting that is of interest to you, and complete one or more web-based tutorials on the topic.

  Convert inches into yards feet and inches

Convert inches into yards, feet, and inches

  Q1if we knew all the ecological social and competitive

q1if we knew all the ecological social and competitive forces that regulate populations and in reality we couldnt what

  Turn the turtle image into a .gif picture

How can you turn the turtle image into a .gif picture when using the built-in turtle for Python? If that's impossible how do you remove the line when you move the turtle around?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd