Write a utility class called RandomDistribution, which contains the following four class methods. You should be able to implement all of these methods with calls to Math class methods and/or calls to one of the uniform methods within the RandomDistribution class.
a) Write a method called uniform that generates a double random number from a continuous distribution that is uniform between double values min and max.
b) Write another (overloaded) method called uniform that generates an int random number from a discrete distribution that is uniform between int values min and max, including both of these end points.
c) Write a method called triangular that generates an int random number from a symmetrical discrete triangular distribution that goes between the int values min and max, including both of these end points. (Hint: Make two calls to the int version of the above uniform method.)
d) Write a method called exponential that generates a double random number from an exponential distribution having an expected time between random arrival events equal to averageTimeInterval. Here is the algorithm:
return ← averageTimeInterval * loge(1.0 — Math.random)
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.