s-news
[Top] [All Lists]

runif function and extreme values:

To: s-news <s-news@wubios.wustl.edu>
Subject: runif function and extreme values:
From: Aldi Kraja <aldi@wubios.wustl.edu>
Date: Thu, 24 Oct 2002 15:18:09 -0500
Organization: Washington University
Reply-to: aldi@wubios.wustl.edu
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0
Hi,
I am testing a random die. By using runif the two extreme values 1 and 6 are showing with less values compared with the numbers 2,3,4, and 5. Is there any good reason for it to happen?
(Tested for 100, 1000, 10000, and 100000).
rollingADie(100000,6)

Here is the function I am using:
rollingADie<-function(n, max1)
{
   # n nr. of obs. and max represent max number selected of a rolling die
   y <- round(runif(n, min = 1, max = max1))
   hist(y, main = "The rolling die", probability = T)
   return(NULL)
}
TIA,
Aldi

--




<Prev in Thread] Current Thread [Next in Thread>