Setting a seed

The following ensures you will get the same results as me.

set.seed(10)

Uniform distribution (slide 15)

punif(4.3, min = 0, max = 10) - punif(2.5, 0, 10) + punif(8, 0, 10, lower.tail = F)
## [1] 0.38

Normal distribution (slide 27)

1 - pnorm(2, mean = 1, sd = 1.5)
## [1] 0.2524925
pnorm(2, mean = 1, sd = 1.5, lower.tail = F)
## [1] 0.2524925