essential understanding issue in monte carlo simulation

53 Views Asked by At

lets look at my problem with this example:
$$ \int_0^1 f(x) dx=\mathbb{E}[f(U)]$$ where $U$ is uniformly distributed on $[0,1]$.

The Monte Carlo estimator would be $\displaystyle M:=\frac{1}{n} \sum_{i=1}^n f(U_i)$ for i.i.d. copies of $U.$

Then according to strong law of large numbers it would hold $\displaystyle \frac{1}{n} \sum_{i=1}^n f(U_i (\omega)) \rightarrow \mathbb{E}[f(U)]$ for "almost all omega".

But when simulating it on computer what one does is to sample n different $\omega$ as in $\displaystyle \frac{1}{n} \sum_{i=1}^n f(U (\omega_i))$.
I am not quite sure why this is the same.