 |
Ask A Scientist©
Mathematics Archive
|
 |
Dice Math
>> name Jonathan
>> status other
>> age 40s
>> Question - My goal is to simulate the rolling of large numbers of
>> dice without a recursive formula. I can generate "random" numbers between
>> 0 and 1 and i need an euqation that can allow me to, using one random
>> number, simulate the rolling of x numbers of y sided dice.
Don't do it. Use a separate "random" number to simulate each roll of each
die. Your method for generating random numbers is probably a linear
congruence generator, which is fine for most applications. However, if you
try to break it doen into separate "random" regions (low byte, high byte,
for example), it turns out that not all regions will pass the "randomness"
tests equally well.
In fact, when I use a linear congruence generator for my own Monte Carlo
codes, I combine several computer-generated variates into one number to
assure me that my numbers are as free from structure as possible.
I'm guessing that what you really want here is a formula to calculate the
probabilities of each possible sum of die rolls, say rolling two six-sided
dice in a craps game. Remember that all sides of a fair die have the same
probability; thus, the 36 possible permutations of rolling dice A and B
also all have equal probabilities of 1/36. To fin the probability of each
SUM (2-12), you need to find out how many different rolls lead to the same
sum.
Richard Barrans Jr., Ph.D.
Chemical Separations Group
Chemistry Division CHM/200
Argonne National Laboratory
9700 South Cass Avenue
Argonne, IL 60439
========================================
NEWTON is an electronic community for Science, Math, and Computer Science K-12 Educators.
Argonne National Laboratory, Division of Educational Programs, Harold Myron, Ph.D., Division Director.