MLUG: Re: [MLUG] grab_random_lines
Re: [MLUG] grab_random_lines
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Mike Miller wrote:
> On Thu, 22 May 2008, Stephen Montgomery-Smith wrote:
> 
>> Mike Miller wrote:
>>
>>> Does int(rand(x+1)) produce a uniformly-distributed random integer 
>>> between 1 and x?
>> The perlfunc man page seems to suggest that this is so.  I guess that 
>> for bootstrapping that the quality of the random number generator is 
>> rather important.
> 
> 
> It could be important, but for what I am doing right now, it doesn't 
> matter.  That is a good point though -- for a program that might be used 
> in many different ways we would want to know what we are getting from that 
> RNG.  I don't know what Perl uses and I don't know what gawk uses.
> 
> Mike

My guess is that they simply use the random function that comes with 
unix (the one that replaces the very low quality rand function).

However I did have one experience when I had to use the arc4random 
function instead (maybe it was some kind of Monte-Carlo simulation) 
because random wasn't high enough quality.


_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members