n <- 10000
sample<-rbinom(1,size,prob=0.2)
proportion <-sample/n
a.
The second line should be sample<-rbinom(1,size = n,prob=0.2)
rbinom creates a Binomial random variable of parameter n = 10000 and p = 0.2
b.
We know that for large sample size, n, the binomial distribution will approximate normal distribution with mean = np = 10000 * 0.2 = 2000
Also, the mean occurs with the high probability and thus sample = 2000 will have the highest probability.
proportion = sample / n = 2000 / 10000 = 0.2
Thus, 1/proportion with high probability is 1/0.2 = 5
Get Answers For Free
Most questions answered within 1 hours.