Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

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: http://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?

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M91377696
  • Price:- $40

Guranteed 36 Hours Delivery, In Price:- $40

Have any Question?


Related Questions in Programming Language

Extend the adworks applicationi add dialogs to allow the

Extend the AdWorks application I. Add Dialogs to allow the user to Add, Edit, Read and Delete a Customer and refresh the view accordingly. 1. The user should be able to select a specific customer from the DataGrid and cl ...

Task silly name testeroverviewcontrol flow allows us to

Task: Silly Name Tester Overview Control flow allows us to alter the order in which our programs execute. Building on our knowledge of variables, we can now use control flow to create programs that perform more than just ...

Php amp session managment assignment -this assignment looks

PHP & SESSION MANAGMENT ASSIGNMENT - This assignment looks at using PHP for creating cookies and session management. Class Exercise - Web Project: Member Registration/Login This exercise will cover adding data connectivi ...

Question - create a microsoft word macro using vba visual

Question - Create a Microsoft Word macro using VBA (Visual Basic for Applications). Name the macro "highlight." The macro should highlight every third line of text in a document. (Imagine creating highlighting that will ...

Overviewthis tasks provides you an opportunity to get

Overview This tasks provides you an opportunity to get feedback on your Learning Summary Report. The Learning Summary Report outlines how the work you have completed demonstrates that you have met all of the unit's learn ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Structs and enumsoverviewin this task you will create a

Structs and Enums Overview In this task you will create a knight database to help Camelot keep track of all of their knights. Instructions Lets get started. 1. What the topic 5 videos, these will guide you through buildi ...

Assignment - proposal literature review research method1

Assignment - Proposal, Literature Review, Research Method 1. Abstract - Summary of the knowledge gap: problems of the existing research - Aim of the research, summary of what this project is to achieve - Summary of the a ...

Question 1 what is a computer program what is structured

Question: 1. What is a Computer program? What is structured programming? 2. What is modular programming? Why we use it? 3. Please evaluate Sin (x) by infinite series. Then write an algorithm to implement it with up to th ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As