Question: Write a Java function with prototype: double custom(double [] outcomes, double [] probabilities), that returns a random value that is distributed according to an arbitrary

Write a Java function with prototype: double custom(double [] outcomes, double [] probabilities), that returns a random value that is distributed according to an arbitrary distribution described in a table of discrete values/outcomes (for the random variable) and the probability of those values.

The main(...) function should accept 10 parameters from the calling environment. These 10 parameters represent 5 pairs of outcome values and associated probabilities. For instance, the custom distribution given in Table 1 is given in input in the following way:

Write a Java function with prototype: double custom(double [] outcomes, double []

Outcome Probability 10 20 40 70 0.16 0.13 0.22 0.20 0.29 ble 1: A custom probability distribution

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!