- Using only the runif function in R, generate 10,000 iid random variables from
- \(X \sim \text{Exponential}(5).\)
- \(Y \sim \text{Gamma}(3,1.5).\) Hint: Get in terms of exponential distribution.
- \(Z \sim \text{Chi Squared with 6 degrees of freedom}\) Hint: Get in terms of exponential distribution.
Find is \(P(X>Y)?\)
- Generate 10,000 draws of \(X_{(k)}\) when \(X_i\) is iid and \(X_i \sim \text{Uniform}(0,1)\). Plot the empirical density for \(X_{(k)}\) (histogram) and show that it is \(\text{Beta}(k,n+1-k)\) when
- \(k = 1\) and \(n = 100\)
- \(k = 50\) and \(n = 100\)
- \(k = 100\) and \(n = 100\)