--------------------------------------------
-----------------------------------------
rnorm(10)
#low of large numbers
n <- 1000000
c<-0
for(i in rnorm(n))
{
if(i>=-1 & i<=1)
{
c<-c+1
}
}
result=c/n
#############
#c <-0
for (i in rnorm(n))
{
if (i>=-1 & i<=1)
{
c=c=c+1
}
}
result<- c/n
-----------------------------------------
rnorm(10)
#low of large numbers
n <- 1000000
c<-0
for(i in rnorm(n))
{
if(i>=-1 & i<=1)
{
c<-c+1
}
}
result=c/n
#############
#c <-0
for (i in rnorm(n))
{
if (i>=-1 & i<=1)
{
c=c=c+1
}
}
result<- c/n
No comments:
Post a Comment