Sum of roll of N dice
|
06-24-2018, 01:08 AM
Post: #45
|
|||
|
|||
RE: Sum of roll of N dice
I have used a fairly fast method for rolling 5 or 6 dice. For 5 dices, I build a random number generator with modulus M=6 ^5*2^24. I used a Lehmer type. So after finding a good A (I don't have a numerical A here; the idea is that A/M as continued fraction should have small partial quotients), I just compute X=X*A+1 Mod M. Then dividing X by 2^24, I get a number uniformly distributed between 0 and 7775; convert to base 6 (or work the base 6 stuff into the computation). One gets a uniform distribution over five 6s. That's the roll.
This works if one has a good big-integer package. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)