Q3

x <- rexp(10000, rate = 1/4)
mean(x)
## [1] 3.951416
y <- rexp(10000, rate = 1/10)
mean(y)
## [1] 10.11206
z <- x + y
mean(z)
## [1] 14.06348
sd(z)
## [1] 10.99774
hist(z, breaks = 50)

Q4

pnorm(1.5) - pnorm(-1.5)
## [1] 0.8663856
w <- rnorm(10000)
mean(w >= -1.5 & w <= 1.5)
## [1] 0.8673
pnorm(135, 120, 10) - pnorm(105, 120, 10)
## [1] 0.8663856
v <- rnorm(10000, 120, 10)
mean(v >= 105 & v <= 135)
## [1] 0.8705
curve(dnorm(x), -4, 4)
s <- seq(-1.5, 1.5, length.out = 200)
polygon(c(-1.5, s, 1.5), c(0, dnorm(s), 0), col = "lightblue")

Q5

points <- c(1, 0.75, 0.75, rep(0, 9))
scores <- replicate(1000, sum(sample(points, 36, replace = TRUE)))
table(scores)
## scores
##  1.75  2.25   2.5  2.75     3  3.25   3.5  3.75     4  4.25   4.5  4.75     5 
##     1     3     4     1     7     8    13     9    16    14    16    27    31 
##  5.25   5.5  5.75     6  6.25   6.5  6.75     7  7.25   7.5  7.75     8  8.25 
##    22    38    51    38    33    53    53    32    52    44    46    39    33 
##   8.5  8.75     9  9.25   9.5  9.75    10 10.25  10.5 10.75    11 11.25  11.5 
##    31    33    36    31    23    31    26    18     7    14    14     7    20 
## 11.75    12 12.25  12.5 12.75 13.25  13.5  14.5    15 
##     5     6     3     5     1     1     2     1     1
hist(scores)

mean(scores)
## [1] 7.37975