Skip to content
Prev 318019 / 398502 Next

Why R simulation gives same random results?

On 20/02/2013 23:13, Greg Snow wrote:
That is exceedingly unlikely.  We are not told the platform, but AFAIK 
on all common R platforms and current versions of R:

- the time is measured to at least msec accuracy.
- times which might cancel out pid differences are many hours apart.

A while ago it was possible on some platforms to get the same seed by 
starting two R processes on the same clock tick (within 1/60 or 1/100 s 
of each other).  But now you are talking about generating a pretty 
random unsigned integer with 32 bits to set the seed, so the probability 
of coincidence is very small.
Much more likely.
This falls within the class of parallel simulations.  You would do 
better to set carefully selected seeds: see the vignette for package 
'parallel'.