Working with the Uniform Distribution
a) Let’s use base graphics in R to create a histogram of the result of generating a sample of 100000 Unif(0, 1) (independent) random observations. Denote the random variable with this distribution by X. Experiment with the breaks option in the hist() function to get
a better look at the distribution. Why is the distribution not perfectly uniform, like we know the PDF to be?
b) Use simulation methods to estimate E(X), and E(X²), and use these results to calculate Var(X).