Question: Implement a utility class named Distribution, which contains the following two static methods. a) The exponential method returns an exponential distribution value calculated with this
Implement a utility class named Distribution, which contains the following two static methods.
a) The exponential method returns an exponential distribution value calculated with this formula, where mean is a double parameter which holds the distribution’s mean:
-Math.log(Math.random()) * mean
b) The normal method returns a normal distribution value calculated with this formula, where mean and deviation are double parameters that hold the distribution’s mean and standard deviation, respectively:
![]()
mean + deviation Math.sqrt(-2 Math.log(Math.random())) Math.cos(2 Math.PI * Math.random());
Step by Step Solution
3.36 Rating (159 Votes )
There are 3 Steps involved in it
The provided instructions and formula seem to be a request for the implementation of a utility class in Java that can produce values following the exp... View full answer
Get step-by-step solutions from verified subject matter experts
