Banks Q8.8

is.between <- function(x, a, b) {
a <= x & x <= b
}
myPDF<-seq(0,10,1)
myDist1 <- function (x){
  
  if(is.between(x,0,2)) {myPDF<-seq(0,2,.33) 
  }
     else if(is.between(x,2,10)) {myPDF<-seq(2,10,.041666)
     
     }
   else 0
}
myPlot1<-sapply(myPDF, myDist1)
mySample1<-sample(myPDF, 1000, replace = TRUE, prob= NULL)
hist(mySample1)