good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re^2: is rand random enough to simulate dice rolls?by LanX (Saint) |
on Jan 03, 2021 at 16:33 UTC ( [id://11126214]=note: print w/replies, xml ) | Need Help?? |
> At least old perls for Windows had a very limited PRNG, with an interval of only 2^14 (?). Having an interval of 2**14 ~= 16_000 means the sequence repeats. > I've no idea how evenly distributed its output is/was. By definition it must hit the average 3.5 exactly after 2**14 runs.° IMHO 10000 runs for a margin of ± 0.2 is a safe bet. ² If this test fails, something must be done.
Cheers Rolf °) modulo rounding errors with Perl floats ²) that's more than 3% of the interval!
In Section
Seekers of Perl Wisdom
|
|