Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: is rand random enough to simulate dice rolls? (math definition)

by LanX (Sage)
on Jan 03, 2021 at 15:08 UTC ( #11126205=note: print w/replies, xml ) Need Help??

in reply to is rand random enough to simulate dice rolls?

The rand function is supposed to be a "Pseudorandom number generator".

And the requirements for PRNG's are mathematically defined.

One of them says, that for every range epsilon ε around the expected average P(E) you can find a minimum set size N such that the actual average will always be within that range.

That's math-speak for "the bigger the closer".

And that's very similar to your test, with the exception that there is no guaranty about this set size 10000. Could be less, could be more.

From my tests it's very likely to hold for 10000 tho, but you can only be "sure" after checking the implementation.

HTH! :)

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

) DISCLAIMER: security is relative if it comes to software and it's implementation

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11126205]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2021-10-28 10:58 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (96 votes). Check out past polls.