With this definition of a random variable and its associated PDF, we attempt now a clarification of the Monte-Carlo strategy by using the evaluation of an integral as our example.
In discussion on numerical integration we went through standard methods for evaluating an integral like I=∫10f(x)dx≈N∑i=1ωif(xi), where ωi are the weights determined by the specific integration method (like Simpson's method) with xi the given mesh points. To give you a feeling of how we are to evaluate the above integral using Monte-Carlo, we employ here the crudest possible approach. Later on we will present slightly more refined approaches. This crude approach consists in setting all weights equal 1, ωi=1. That corresponds to the rectangle method I=∫baf(x)dx≈hN∑i=1f(xi−1/2), where f(xi−1/2) is the midpoint value of f for a given value xi−1/2.