1. This project is a continuation of the previous project. Many applications require pseudorandom number sequences that are not uniformly distributed. For example, a program that simulates the birth...


1. This project is a continuation of the previous project. Many applications require pseudorandom number sequences that are
not
uniformly distributed. For example, a program that simulates the birth of babies can use random numbers for the birth weights of the newborns. But these birth weights should have a Gaussian distribution. In a Gaussian distribution, numbers form a bellshaped curve in which values are more likely to fall in intervals near the center of the overall distribution. The exact probabilities of falling in a particular interval can be computed by knowing two numbers: (1) a number called the
variance, which indicates how widely spread the distribution appears, and (2) the center of the overall distribution, called the
median
. For this kind of distribution, the median is equal to the arithmetic average (the
mean) and equal to the most frequent value (the
mode).


with an exact Gaussian distribution can be difficult, but there is a good way to approximate a Gaussian distribution using uniformly distributed random numbers in the range [0..1). The approach is to generate three pseudorandom numbers
r
1,
r

2,
r
3, and , each of which is in the range [0..1). These numbers are then combined to produce the next number in the Gaussian sequence. The formula to combine the numbers is:


Next number in the Gaussian sequence= median+ (2× (r
1+
r
2
+
r
3) – 3)
×
variance


Add a new method to the random number class, which can be used to produce a sequence of pseudorandom numbers with a Gaussian distribution. not allow the temperature to drop below absolute zero (–273.16°C). Also include these extra methods:


1. Two accessor methods that return the maximum temperature that the thermometer has ever recorded (with the return value in either Celsius or Fahrenheit degrees)


2. Two accessor methods that return the minimum temperature ever recorded


3. A modification method to reset the maximum and minimum counters


4. A boolean method that returns true if the temperature is at or below 0°C

Jan 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here