next up previous
Next: About this document ...

Using the provided routine random.f90 that generates an uniform random deviate in the [0,1) interval evaluate the integral

\begin{displaymath}I = \int_{-1}^{+1} \frac{x^2}{\sqrt{1-x^2}} d x \end{displaymath}

averaging over N random numbers uniformely distributed in the integration domain. Estimate the statistical error associated with this scheme.

Compute the same integral using a random variable that satisfies the probability distribution

\begin{displaymath}p(x) = {1\over \pi \sqrt{1-x^2}}, \quad -1 \le x \le +1 \end{displaymath}

and compare the obtained value for the statistical error with the previous case.

HINT: a simple way to generate a random variable with probability distribution $p(x)$ is to define $x = cos(\pi y) $ with $ y $ uniformely distributed in the [0,1) interval.





Stefano de Gironcoli 2003-11-05