[R] unexpected behaviour of rnorm()

Robin Hankin r.hankin at auckland.ac.nz
Tue Nov 26 21:25:59 CET 2002

Hello everyone.

If I do

f <- function(n){max(rnorm(n))}
plot(sapply(rep(5000,4000),f))   #[this takes my PC about 30 seconds]

then I get something quite unexpected: gaps in the distribution.  For
me, the most noticable one is at about 3.6.

Do others get this?  Is it an optical illusion?  It can't be right,
can it?  Or maybe I just don't understand the good ol' Gaussian very

anyone got an explanation?

[linux redhat 7.1; R-1.6.1]


Robin Hankin, Lecturer,
School of Geography and Environmental Science
Tamaki Campus
Private Bag 92019 Auckland
New Zealand

r.hankin at auckland.ac.nz
tel 0064-9-373-7599 x6820; FAX 0064-9-373-7042

as of: Wed Nov 27 09:15:00 NZDT 2002
This (linux) system up continuously for:  454 days, 14 hours, 57 minutes
r-help 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-help-request at stat.math.ethz.ch

More information about the R-help mailing list