This is the code in R for the Central Limit theorem question.
This is Exponential distribution with mean beta. How can I modify
this code to
Bernoulli(0.1), Uniform (0,4), and Normal distribution
(2,1)
plot.z <- function(n, m=1e5, beta = 1) {
mu <- beta
sigma <- beta
zs <- rep(0,m)
for(i in 1:m) {
Y.sample <- rexp(n, 1/beta)
Ybar <- mean(Y.sample)
zs[i] <- (Ybar - mu) / (sigma / sqrt(n))
}
p <- hist(zs, xlim=c(-4,4), freq = F,
main =...