#Monte Carlo estimation examples x=seq(0,1,by=.01) f=function(x) return(sin(x)*log(x+1)/x) plot(x,f(x),type="l") plot(x,f(x),type="l",ylim=c(0,1)) x=runif(100000) y=runif(100000) z=f(x) mean(y