library(knitr)
Function rexp() is used to generate random exponential distribution. We will use default rate=1.
Function replicate() will repeat the rexp() 100 times, producing hundred simulations
# generate 100 simulations of 30 samples
siml100 <- replicate(100,rexp(n=30))
means_dist <- colMeans(siml100)
hist(means_dist, main="Distribution of Means")
min_dist <- apply(siml100,2,min)
hist(min_dist, main="Distribution of Minimums")
The distribution of the means appears to be symmetric. Since we set the exponention function rate to 1, the distribution centers around 1.
The distribution of the minimums is skewed to the right and most of those values fall between 0 and 0.5.