A famous example of Monte Carlo integration is the Monte Carlo estimate of $\pi$.
The unit disk $\{ (x, y) : x^2 +y^2 \le 1 \}$ is inscribed in the square $[ 1, 1] \times [ 1, 1]$, which has area $4$. If we generate a large number of points that are Uniform on the square, the proportion of points falling inside the disk is approximately equal to the ratio of the disk’s area to the square’s area, which is $\frac{\pi}4$. Thus, to estimate $\pi$ we can take the proportion of points inside the circle and multiply by $4$.
How close is estimate to the actual value of $\pi$?
All help are appreciated. Thanks in advance.
We cannot have certainty, so let's deal with a $99\%$ confidence interval (which in this context is highly unsatisfactory).
Every time we increase the number of iterations by a factor of $100$, the width of the $99\%$ confidence interval shrinks by a factor of $10$. The width of the confidence interval for $\pi/4$ when $n=100$ is of order of magnitude $0.1$. So $1$ million iterations give us about $4$ decimal places. One million million iterations (which take a while!) give us about $7$, at the unsatisfactory $99\%$ level. It is decidedly not a good way to proceed.