1. the datasets are large, i.e. large n 2. 7 3. unifmem <- function(r,s,t,u) { # t,u in (r,s) lhs <- (s - (t+u)) / (s-t) rhs <- (s-u) / (s-r) return(list(lhs=lhs,rhs=rhs)) # left-hand and right-hand sides } print(unifmem(1,4,1.2,0.2)) # 0.2 was an error, as it's not in (1,4) 4. Setting the integral across the entire support equal to 1, we find that 1 = c (1/3)(4^3 - 1^3), so c = 1/21. Then F_x(s) is equal to the integral of (1/21) t^2 from 1 to s, i.e. (1/21)(s^3 - 1). cdf <- function(t) { (1/21) * (t^3 - 1) } print(cdf(1.5)) # 0.113092