Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: is rand random enough to simulate dice rolls?

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


in reply to Re^2: is rand random enough to simulate dice rolls?
in thread is rand random enough to simulate dice rolls?

> but it's possible that you won't meet the (3.4,3.6) range based on a string of high or low runs in the random number generator, and your test will fail.

But that's exactly what the definition of a PRNG guarantees.

There *exists* a large number, such that the range is met in the run.

Problematic is only the suggested number 10000, but my gut feeling says it's already big enough.

I'd say if the OP wants to be sure of that, then he should include it in his test-suite.

And if it's not critical enough to make the installation fail, he can still use it to emit a warning to the user.

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

  • Comment on Re^3: is rand random enough to simulate dice rolls?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2021-10-17 05:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (71 votes). Check out past polls.

    Notices?