[R] random generators - curiosity

Remy X.O. Martin vsxo at hotmail.com
Fri Jul 5 18:53:33 CEST 2002

2002/07/05 18:43:04, Thomas Lumley <tlumley at u.washington.edu> wrote:

>One, as you observe, it isn't portable -- it has to be handled in
>different ways on different systems.

That's what I thought -- but the documentation to I forget what suggests that exactly 
which generators are present may also depend on the system :)

>Three, there's often not enough entropy to go around.  Many users of R
>generate far more random numbers than can reliably be produced by
>environmental noise, particularly in a system that isn't on-line and so
>doesn't have TCP/IP noise.

This is indeed a problem, and (under linux) the /dev/random device blocks when 
"entropy is empty". There is however a /dev/srandom that doesn't block, but returns 
lesser quality noise when the pool is empty. Unfortunately, I do not know how to 
distinguish between these noise-quality return types.

>that's why they are produced in different ways. Don't use R to write
>encryption software.

I wasn't quite considering to do that :)

>Actually, R provides hooks for user-supplied RNGs, so it would be possible
>for someone to write one based on environmental noise or based on securely

I didn't want to reinvent the wheel :) Now, it looks like I have a nice exercise for 
a rainy sunday!


r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list