situation when Monte Carlo method cannot be used

81 Views Asked by At

This is an example from notes enter image description here

I don't understand why we should think about the $E(x)$ and $var(x)$ first?

1

There are 1 best solutions below

0
On

Longer than a comment and may be late for this question, but essentially a comment :)

This comment may be of little use any longer, but consider splitting the integral as $$\int_{-\infty}^{-1}f(x)dx+\int_{-1}^0f(x)dx+\int_0^1f(x)dx+\int_1^{\infty}f(x)dx,$$ change variables $u=\frac{1}{x}$ in the first and last integrals to get $$\int_{-1}^{0}\frac{f(\frac{1}{x})}{x^2}dx+\int_{-1}^0f(x)dx+\int_0^1f(x)dx+\int_0^1\frac{f(\frac{1}{x})}{x^2}dx,$$ or simply $$ \int_{-1}^1f(x)+\frac{f(\frac{1}{x})}{x^2}dx. $$ Now, Monte Carlo integration is applicable as ever. Numerical simulations yield $$ { n=10^4\implies I=0.9863872988267333, \\ n=10^5\implies I=1.0010829777555326, \\ n=10^6\implies I=0.998729665417855, \\ n=10^7\implies I=1.0002986899268542, } $$ which are quite close to the theoretical integral value $1$.