Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Distributed Relational Database Architecture Connectivity Guide

Authors: Teresa Hopper

4th Edition

0133983064, 978-0133983067

More Books

Students also viewed these Databases questions