[R] Wichmann-Hill Random Number Generator and the Birthday Problem

Peter Dalgaard p.dalgaard at biostat.ku.dk
Tue Aug 19 09:11:39 CEST 2008


Prof Brian Ripley wrote:
> Your coincidence calculations may be correct for _independent_ draws 
> from a discrete distribution on M values, but independence is not 
> satisfied.
> Yet again, you are trying to do things that any good text on 
> simulation would warn you against, and which (in a thread on R-devel) 
> you have already been told a good way to do.
>
A good example are the "good" old linear congruential random generators. 
These will start repeating at the first coincidence, for the pretty 
obvious reason that the next random number is a function only of the 
previous one. So the number of distinct values in N draws is min(N, 
cycle_length). In particular, the number of coincidences is 0 when N is 
less than cycle_length.

-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907



More information about the R-help mailing list