Friday, May 01, 2020

[xlyjjjlp] Fun with d20 dice

Uniformly sample one integer from each of the following inclusive ranges:

0 .. 4
0 .. 6
0 .. 8
0 .. 10
0 .. 12
0 .. 15
0 .. 16
0 .. 18

Using the Chinese remainder theorem, find the smallest number which has the sampled numbers as remainders when divided by 5 7 9 11 13 16 17 19.  This uniformly samples a large integer in the range 0 to 232792560-1 ( 24*(19 primorial) - 1 ).

The ranges were chosen to be within the limits of a d20 die, the largest common die.

Not sure what this is useful for.  If you want a random large decimal number, just sample digits with a d10 or d20.

No comments :