The cost probability curve may be a nice smooth one, or a collection
of rectangles or other shapes.
It can always be converted to a histogram.
Add the count from every histogram channel, and mark the start point
and end-point for each channel on the accumulating count.
Use the pseudo-random number generator (available with most programming
languages) to pick a value from the accumulating count.
Chech through the various start-point/end-point which channel was
selected, and use its value.
Illustration:
The cost histogram looks like:
cost histogram The accumulating count:
8+22+11+4 = 45 Channel 1: start =1 end = 8 The PRNG picking a number from 1 to 45, will pick, say 28.
This falls into channel 2, and the corresponding value is
$20,000 to $35,000
Comment? eMail: teach_me@classexpress.com |
(c) Class Express LLC Contact Us