Hi all members,
I am trying to solve a problem based on Monte Carlo simulation and I am a little bit confused.
The problem concerns the computation of the surface area of F(x) = (x^4)*exp(-x) when x belongs to (1,5) through the geometric approach of Monte Carlo simulation. My code for handling this problem is:
>res1=0
>curve((x^4)*exp(-x),xlim=c(1,5),ylim=c(1,5))
>x=runif(1000,1,5)
>y=runif(1000,1,5)
>points(x,y,col=ifelse(yfor (i in 1:100000) {
> x=runif(100000,1,5)
> y=runif(100000,1,5)
> res1