[R] How do you force runif to return non-duplicate results eg runif(0, 1, n=10)? thanks

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue May 18 06:55:30 CEST 2004


On Tue, 18 May 2004, Briggs, Meredith M wrote:

<nothing>

runif by definition samples independently from U(0,1).  So by defnition 
the results are not duplicated.  It is possible due to finite computer 
representations that you would get duplicates to computer accuracy but the 
chance of that in sample size of 10 is about the chance of winning the UK 
lottery twice in a row, and much less plausible than a computer fault.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list