From p.dalgaard@biostat.ku.dk  Sun Dec  2 00:55:16 2001
From: p.dalgaard@biostat.ku.dk (Peter Dalgaard BSA)
Date: 02 Dec 2001 01:55:16 +0100
Subject: [Rd] bug in rbinom? (PR#1190)
In-Reply-To: <200112020027.BAA29162@pubhealth.ku.dk>
References: <200112020027.BAA29162@pubhealth.ku.dk>
Message-ID: <x2vgfqwidn.fsf@blueberry.kubism.ku.dk>

viele@ms.uky.edu writes:

> I was simulating the central limit theorem in class,
> but found that repeated use of
> 
> mean(rbinom(100000,500,0.4))
> 
> resulted in values less than 200 (the expected mean), for example
> 
> > mean(rbinom(100000,500,0.4))
> [1] 199.0294
> > mean(rbinom(100000,500,0.4))
> [1] 199.1077
> > mean(rbinom(100000,500,0.4))
> [1] 199.0668
> and so on.
> 
> I did this 1000 times and found the results to be distributed
> approximately N(199.0787,s=0.036). The standard deviation
> is pretty accurate, but the mean is significantly off from 200.

I see the same thing on Linux. Looks like it needs checking against
the original CACM algorithm.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel 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-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] bug in rbinom? (PR#1190)
Peter Dalgaard BSA