Thanks for your reply, but I've got a question about that.
You are using "mod" to find the remainder of the SysRandom.

Just for example, the sysRandomMax is 11 (just for example, I know the
max is much LARGER!!)
That means that the random number can be gen is 0, 1, 2, ....., 10, 11
Assume the probability of each result is the same. That means each value
have 1/12 chance to return.

If I mod it with 5, then the result will be 0, 1, 2, 3, 4, 0, 1, 2, 3,
4, 0, 1 (each have same probability to gen), then the chance of the "0"
and "1" return is 3/12 and the other is 2/12. The probaility will not be
same for each value!

I am now try to give a random result of a dice, it is not fair that some
number have more probaility to return!


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to