1. We will use simulation to demonstrate the minimum of iid exponential random variables is another exponential random variable.
(a) Set B=1000, n=10. Sample a vector of n*B=10000 from the exponential distribution with λ = 1, using rexp(n*B, rate=1) . Store the vector in a B-by-n matrix called x.exp (use the function matrix). No need to print out the values.
Note: Pay attention to how the parameter rate is defined in the function rexp. For an exponential distribution with parameter λ and pdf f(x) = εe^{-λx}, x > 0, the mean is 1/λ, and rate is 1/mean. Thus rate is equal to λ. See help(rexp).
(b) Find the minimum of every row in x.exp using apply(x.exp, min, ...) (fill out the rest of the command). Store the results in a vector called x.min. No need to print out the values.
(c) x.min should follow an exponential distribution with parameter λ₀. State the value of λ₀ with a brief explanation, by quoting the minimum exponential example in Lecture 19.
(d) Plot the histogram of x.exp using
hist(x.min, prob=TRUE, ...)
and overlay the histogram with the pdf of exponential λ₀ using
curve(dexp(x,rate=...), add=T).
Clearly label the title, x and y axes. Comment on how well the theoretical curve fits the observed values in the histogram.