1. Generate a histogram of 20,000 randomly generated integer floating-point numbers according to a normal distribution...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. Generate a histogram of 20,000 randomly generated integer floating-point numbers according to a normal distribution with a user-specified mean and standard deviation. Your histogram will include the frequencies of at least numBins (>=9) data points equal-width data bins centering at the mean value following values: mean +/- x*stdDev, where x is in {0, 1, 2, 3, 4, 5, ...} and the width of each data bin is 1. For example, given that mean=1.0 and standard deviation=2.0, you will calculate the frequency of values that fall into the following at least the following values data bins that center at 1-4*2, 1-3*2, 1-2*2, 1-2, 1, 1+2, 1+2*2, 1+3*2, and 1+ 4*2, respectively. More specifically, given a randomly generated value, you will want to round it up and check which bin the rounded value falls in. For example, if the randomly generated value is 3.124, this number will fall into the bin centering at 3 since round(3.124)=3. 2. Generate a histogram of 20,000 randomly generated floating-point numbers according to a uniform distribution with a user-specified range [a, b], where a and b are parameters. The histogram will include the frequencies of numBins (>=21) values equal-width data bins that are equally evenly distributed between a and b. For instance, if a=2.0, b=10.0, you will calculate the frequencies total number of randomly generated values that fall into each of following data bins, where each bin has a width of (b-a)/21 and centers at 2.0, 2.0+(8.0/20)*1, 2.0+(8.0/20)*2, 2.0+(8.0/20)*3, ..., 2.0+ (8.0/20)*20=10, respectively. To keep it simple, your can set the precision of each center at 0.1 (i.e., only consider the first digit after the decimal point, e.g., 2.0, 2.4, 2.8, etc.). Put all the above together, if the randomly generated value is 2.44323, it falls into the bin centering at 2.4 since rounding 2.44323 with a precision of 0.1 is 2.4. Please follow the problem solving process and submit the following steps in one set of documents as a group: Algorithm design and description in pseudo code Implement your algorithms in one CPP file: one free-standing function per problem. Feel free to include separate files if your group chooses to do so. o when choosing data structures, consider std::array, std::pair, and std::vector. o what's your function prototype? Test your CPP implementation using some input examples ● 1. Generate a histogram of 20,000 randomly generated integer floating-point numbers according to a normal distribution with a user-specified mean and standard deviation. Your histogram will include the frequencies of at least numBins (>=9) data points equal-width data bins centering at the mean value following values: mean +/- x*stdDev, where x is in {0, 1, 2, 3, 4, 5, ...} and the width of each data bin is 1. For example, given that mean=1.0 and standard deviation=2.0, you will calculate the frequency of values that fall into the following at least the following values data bins that center at 1-4*2, 1-3*2, 1-2*2, 1-2, 1, 1+2, 1+2*2, 1+3*2, and 1+ 4*2, respectively. More specifically, given a randomly generated value, you will want to round it up and check which bin the rounded value falls in. For example, if the randomly generated value is 3.124, this number will fall into the bin centering at 3 since round(3.124)=3. 2. Generate a histogram of 20,000 randomly generated floating-point numbers according to a uniform distribution with a user-specified range [a, b], where a and b are parameters. The histogram will include the frequencies of numBins (>=21) values equal-width data bins that are equally evenly distributed between a and b. For instance, if a=2.0, b=10.0, you will calculate the frequencies total number of randomly generated values that fall into each of following data bins, where each bin has a width of (b-a)/21 and centers at 2.0, 2.0+(8.0/20)*1, 2.0+(8.0/20)*2, 2.0+(8.0/20)*3, ..., 2.0+ (8.0/20)*20=10, respectively. To keep it simple, your can set the precision of each center at 0.1 (i.e., only consider the first digit after the decimal point, e.g., 2.0, 2.4, 2.8, etc.). Put all the above together, if the randomly generated value is 2.44323, it falls into the bin centering at 2.4 since rounding 2.44323 with a precision of 0.1 is 2.4. Please follow the problem solving process and submit the following steps in one set of documents as a group: Algorithm design and description in pseudo code Implement your algorithms in one CPP file: one free-standing function per problem. Feel free to include separate files if your group chooses to do so. o when choosing data structures, consider std::array, std::pair, and std::vector. o what's your function prototype? Test your CPP implementation using some input examples ●
Expert Answer:
Answer rating: 100% (QA)
Given the provided task an example approach for the two histogram generation problems using C can be described as follows 1 Histogram of Normally Distributed Random Numbers Algorithm in pseudo code fu... View the full answer
Related Book For
Introduction To Statistics And Data Analysis
ISBN: 9780495118732
3rd Edition
Authors: Roxy Peck, Chris Olsen, Jay L. Devore
Posted Date:
Students also viewed these programming questions
-
What is a risk inherent in using the waterfall life-cycle model? Explain in details.
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
BACKGROUND You are an information analyst working for NEE. The company president has asked you to prepare a Quantitative analysis of financial, sales, and operations data to help determine which...
-
Delta Catfish Company has taken a position in its tax return to claim a tax credit of $10 million (direct reduction in taxes payable) and has determined that its sustainability is more likely than...
-
If delays are recorded as 8-bit numbers in a 50-router network, and delay vectors are exchanged twice a second, how much bandwidth per (full-duplex) line is chewed up by the distributed routing...
-
Construct a stage-matrix model for an animal species that has two life stages: juvenile (up to 1 year old) and adult. Suppose the female adults give birth each year to an average of 1.6 female...
-
A representative volume element (RVE) consisting of a cylindrical isotropic fiber embedded and perfectly bonded in a cylinder of isotropic matrix material is shown in Figure 5.23. If the ends of the...
-
On January 1, 2014, Boston Company completed the following transactions (use a 7 percent annual interest rate for all transactions): a. Borrowed $115,000 for seven years. Will pay $6,000 interest at...
-
Problem #3: A steady free jet of water exits a 0.5 inch diameter nozzle with uniform velocity V (point 1). The water jet impinges on a flat plate having a weight of 5 lbf and hinged at the left edge...
-
Carl Kay is the vice-president of KM Ltd., a Canadian-controlled private corporation located in Halifax, Nova Scotia. KM operates a real estate development business constructing and selling...
-
What is the comparison of the differences between a database, a data warehouse and a data mart? What are the elements and major building blocks of a data warehouse and what each of them does? What...
-
Auditors generally divide company information systems into business processes or transactions cycles. Using this approach, the auditor is able to gather evidence by examining the processing of...
-
Question 3 Single-period Inventory Control for Continuous Distribution Demand (4 marks) A newsagent sells ' The Daily Business Bulletin' for $5.50 per copy. The bulletins are purchased from a...
-
TIM produces and sells two products, the MK and the KL. The organisation expects to sell 2 MK for every 2 KLs and have monthly sales revenue of GHe150,000. The MK has a C/S ratio of 20% whereas the...
-
Write a professional business letter to another organization proposing a partnership. To effectively write this letter, you will need to: Identify a cause you would like to support Identify an...
-
Two substances A and B have equal mass, but substance B has a higher specific heat than substance A . When the same amount of heat is supplied to both substances in separate thermally insulated...
-
Which of the following would appear as the pioneer organisms on bare rocks? (a) Lichens (b) Liverworts (c) Mosses (d) Green algae
-
Using Apple, demonstrate how the differentiation strategy can be well implemented.
-
When charities solicit donations, they must know what approach will encourage people to donate. Would a picture of a needy child tug at the heartstrings and convince someone to contribute to the...
-
According to the article Workaholism in Organizations: Gender Differences (Sex Roles [1999]: 333346), the following data were reported on 1996 income for random samples of male and female MBA...
-
Write a meaningful paragraph that includes the following six terms: sample, population, confidence level, estimate, mean, margin of error. A meaningful paragraph is a coherent piece writing in an...
-
Describe the working of a Carnot cycle.
-
Define thermal efficiency of a heat engine.
-
What are the limitations of Carnot cycle?
Study smarter with the SolutionInn App