Message text In most programming languages, there is a function for generating a pseudorandom number greater than or equal to zero and less than one. The call for this function will specify the range of numbers (six in our case) which is then multiplied by the random number giving us anything from 0.000000000 to 5.999999999 (likely with even more decimal places.) This is truncated to give an integer from zero to five. Adding one gives a result of one to six. This is the equivalent of rolling a six sided die. Every number has the same chance, so graphing the results would approach a straight line with many trials. No curve, bell or otherwise.
The random number call can be set to produce the same results every time the program is run, so predictable results may be tested. But once the code is working properly, the computer's internal clock (time of day) is used to reseed the generator for unpredictable (to most of us ordinary folk) and random enough results.
A sequence of 1,1,1,1 is every bit as likely as a sequence of 4,6,3,2. Each roll is an event all to itself and 1 is no more or less likely than 6 or any other number. |
|
|