if( rand() % 100 < X)
because rand() gives a gaussian distibution. (I am under the impression that this means rand()%100 will give 50 most commonly and 1 and 99 least commonly). So is their either - A random function with a flat distribution curve OR
- A formula that could give me W and Z such that W < rand()%100 < Z is true X percent of the time rand()%100 is performed.