Implement a utility class named Distribution, which contains the following two static methods. a) The exponential method

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 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());

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: