What do you expect to happen and what actually does happen


PROGRAMMING ASSIGNMENT

Your assignment is to explore the behavior of your Python random number generator by throwing random numbers between 20001 and 380000 (inclusive). At first you will bin the results into 10 equal histogram bins. After each simulation run (more about that below), output the histogram results into a text file. Then import the text file into Excel (or some other graphing program) and use a bar graph to display your histogram results. If you don't know what a histogram is, check the web.

You should run at least three different simulations to generate numbers to put into your histogram bins. Feel free to do more simulations than this (you might find that interesting), but you MUST do these. It might be useful to do each of these more than once and see if different runs give different results.

1. Throw 1,000 numbers, and output the histogram numbers.
2. Throw 10,000 numbers, and output the histograms.
3. Throw 100,000 numbers, and output the histograms.

Now you will do a similar simulation, but with more numbers and a more interesting kind of graph. This time instead of doing 6 bins in your histogram, do 36 bins. And instead of displaying a one dimensional histogram, make a TWO dimensional histogram in 6 rows of 6. (This is something like a reduced size chess board.) This is easy to do with MS Excel. Here are the next "runs" you should do:

4. Throw 100,000 numbers, and output the histogram numbers.

5. Throw 1,000,000 numbers, and output the histogram numbers.

6. Throw 10,000,000 numbers, and output the histogram numbers.

NOTE WELL: when you are doing histograms, you do NOT need to store the numbers that are generated. You only need to keep track of the counts in the bins. If you try to keep all the numbers you generate, you are going to have BIG problems. Also, make sure that your bins are assigned in such a way that a random choice from the range is equally likely to land in any of the bins. (Notice that 10 and 36 both divide evenly into 360000, the number of different numbers that you can throw.).

As you gather results, think about the law of large numbers and how that affects your results. What do you expect to happen, and what actually does happen? How do you explain the difference?

Format your assignment according to the following formatting requirements:

1. The answer should be typed, double spaced, using Times New Roman font (size 12), with one-inch margins on all sides.

2. The response also includes a cover page containing the title of the assignment, the student's name, the course title, and the date. The cover page is not included in the required page length.

3. Also include a reference page. The Citations and references should follow APA format. The reference page is not included in the required page length.

Request for Solution File

Ask an Expert for Answer!!
Python Programming: What do you expect to happen and what actually does happen
Reference No:- TGS02986162

Expected delivery within 24 Hours