Sum of 15 random +/- integers always greater than or equal to zero
If they were independent identically distributed discrete uniform random
integers, then the probability of a negative sum would be nearly 0.5. How do
you want to constrain the "randomness" to ensure that the sum is not
negative? Some possibilities if the 15th value produces a negative sum would
include,
- replace the 15th value with -SUM(fourteenValues)
- throw it away and draw again until the sum is non-negative
....
Note that the 1st option can result in a value larger than 99,999, in which
case the 2nd option would never terminate.
Jerry
"MikeM" wrote:
Howdy:
What I'd like to do is the following:
Generate a column of 15 random integers from -99,999 to +99,999
The sum of these 15 random integers must be greater than or equal to zero.
Thanks.
Mike
|