# Exercise 2 : Exponential distribution and related distributions ```{r} n <- 10000 u <- runif(n) x <- -1/2 * log(1-u) hist(x, breaks = 50, freq = FALSE) curve(dexp(x, rate = 2), add = TRUE, col = "red") qqplot(x, rexp(n, rate = 2)) ```