This project show how the given simulation with exponential function fits into the normal distribution. After showing the simulation function, I would compare the mean and variance from the simulation with those theoretically given. Then lastly, I would show the histogram, how it fits into the normal distribution.
Lmd <- 0.2; n = 40;
Sim <- as.numeric();
for(i in 1:1000) {Sim[i] <- mean(rexp(n,Lmd))}
The theoretical mean given is 1/Lambda, 5. As you can see, the difference is decimal, which means quite close.
TMn <- 1/Lmd
dm <- mean(Sim)-TMn
dm
## [1] -0.02190769
Here is the tricky part. The value from the sample will be dramatically lower than the theoratical variance since the variance from sample is standard error of the mean. So I made the little adjustment by deviding theoratical SD with squared root n. As you see, the difference is small.
TSd <- 1/Lmd;
dV <- var(Sim) - (TSd/sqrt(1000))^2
dV
## [1] 0.5696144
Here is the histogram of simulated value. As you see, although it is right skewed little, it follows normal distribution.