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 []](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3c65347e11_05066f3c652d87e6.jpg)
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
Get step-by-step solutions from verified subject matter experts
