A computer generates random numbers on the interval 01 accor
A computer generates random numbers on the interval (0,1) according to a uniform distribution on this interval. If 100 such random numbers are generated, what\'s the probability that the mean of these 100 numbers is greater than .53?
Solution
We use the R software to solving this problem.
First, we fix B as the required number of simualtion study. At each stage, 100 observations are simulated from Unifrom (0,1). For each simulated sample of size n = 100, we observe if the mean is greater than 0.53, then, the following program gives the required sample.
> n <- 100
> B <- 1000
> GT53 <- 0
> for(i in 1:B) {
+ if(mean(runif(n))> 0.53) GT53 <- GT53+1
+ }
> GT53/1000
[1] 0.139
Thanks.
