- Find out the discrete uniform DU(K), (continuous) uniform (0,1), U(0,1) related R commands.
- Prepare a 2×2 window for the following graphs of X, a discrete uniform (10) random variable.
- Plot pmf. cdf of X
- Plot a histogram of 10 sample from X. Compute the sample mean () and sample variance
- Plot a histogram of 100 sample. Compute the sample mean and sample variance.
- Plot a histogram of 1000 sample. Compute the sample mean and sample variance.
- Keep the plotted window, open another window and redo the steps in 2. Compare the results. What do you observe? Does this make sense to you?
- Take K=400, 2000 and redo Exercise 2. What do you observe? Does this make sense to you?
- Take the random variable X to be U(0,1), redo exercise 2 (except for the first dot, you will be plotting a pdf instead of a pmf of X).
- R code from class/history: g5class.r
A prelude to ggplot2