# essential understanding issue in monte carlo simulation

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.

• You mean "according to the strong law of large numbers". – kimchi lover Sep 24 '18 at 18:02
• Yeah sure I mixed that up, gonna fix it. The question still standing tho – StefanWK Sep 24 '18 at 21:38