Pascal random number generator

Assignment Help Programming Languages
Reference no: EM13807724

Your program should use the Free Pascal compiler described in CSC 540. When you hand in your assignment to the digital dropbox, it should be a .PAS file, not zipped.

Your assignment is to explore the behavior of your Pascal 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. Here is one web resource: https://deming.eng.clemson.edu/pub/tutorials/qctools/histm.htm

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, using the Free Pascal function randomize, 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.

Be careful to use qword instead of int variables for the appropriate declarations since some of these numbers will be way over 32,767 (the limit of a Pascal int). 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.)

Also, while you are debugging your program, it is wise to print out to the screen now and then so you can see what's going on (and perhaps what's going wrong!). But once you start running programs that do LOTS of calculations, then do input and output sparingly; input and output require FAR more time than other calculations, and you want simulations doing millions of trials to go quickly, not slowly.

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?

Reference no: EM13807724

Questions Cloud

Influences on child success : Influences on Child Success
Competitive advantage in the workplace : 1. What competitive advantage in the workplace do you possess that provides value for current and future employers? How can you fortify this advantage in support of your career growth and movement?
Is distinction between real-virtual simply old-fashioned : Is the distinction between real-virtual simply an old-fashioned prejudice? Is there something to be said for authenticity, or originary experience?
Also important to know how revenue and profit are tied to s : In addition to understanding how costs are tied to staffing, it is also important to know how revenue and profit are tied to staffing.In a managerial role, you will often come up the financial issue of growing business while maintaining costs.Pretend..
Pascal random number generator : Your assignment is to explore the behavior of your Pascal random number generator by throwing random numbers between 20001 and 380000 (inclusive)
Initiative and process for corporations : Continuous improvement has been a very popular initiative and process for corporations especially since the 1980s. You might be familiar with the term Continuous Improvement Management (CIM).
Shape of distribution, center and the amount of dispersion : Could this z-score be used in calculating probabilities using Table 3 in Appendix B? Why or why not?
Describe the official and unofficial actors of the policy : Provide the historical perspective of the policy. Describe the official and unofficial actors of the policy. Present both of the positions of the policy
Discuss the regional characteristics of the state of texas : Discuss the regional characteristics of the state of Texas

Reviews

Write a Review

Programming Languages Questions & Answers

  Program to retrieve records based on last name-first name

Customer service representatives wish to be able to retrieve records based on Last Name + First Name, Product Number, or State fields. Write down steps involved in your analysis of this problem?

  Write a program that bounces blue ball inside jpanel

Write a program that bounces a blue ball inside JPanel. The ball should begin moving with a mousePressed event. When the ball hits the edge of the JPanel.

  Program to store highest value using two-dimensional array

Write down a program which uses the two-dimensional array to store highest and lowest temperatures for each month of the year.

  Prepare clear button which will clear result text box

Make the compute button the Accept button. Prepare Clear button which will clear result text box and reset all text boxes, 4. controls, and internal variables used.

  Website design html

It's all about Website design. It is going to be web site. 3 web pages, 2 font styles, 2 font sizes, 2 colors minimum.

  Develop console application to generate random number

Develop C++ console application which generates the random number which should be guessed by user. Program will indicate to user if their guess is correct, too high or too low.

  Describe the necessary formulas and sample calculations

Demonstrates your thought process and steps used to analyze the problem. Be sure to include the required input and output and how you will obtain the required output from the given input

  Create class to store the product name

Choose a fruit or vegetable product that you might commonly find at the farmers market (for example, tomatoes, potatoes, lettuce, apples, cantaloupes, etc). Create a class that stores the product name.

  Calculate the average of a variable quantity of integers

Create a simple command line program to calculate the average of a variable quantity of integers that are passed as an argument when the program is called.

  Java api represented associative array

Character strings in C and C++ are implemented as arrays of char and Java API represented associative array?

  Write looping structure pseudocode accepting employee data

Write looping structure pseudocode which prompts user for employee data; application continues to accept data for new employees until user enters 0 for ID number to indicate desire to quit.

  Write program which asks user for the url of a pdf file

Write a program which asks the user for the URL of a PDF file, checks that the URL starts with "http://" and ends with "pdf" or "PDF", downloads it with wget, and displays it with display.

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