I have a simulation that returns "yes" or "no" for each iteration, and I measure the average number of "hits" over many iterations to estimate the likelihood of "yes" occurring. I'd like to be able to say how accurate/trustworthy that estimate of the likelihood is, though.
Monte Carlo integration explains a similar basic Monte Carlo simulation:
Imagine that we want to measure the area of a pond with arbitrary shape. Suppose that this pond is in the middle of a field with known area $A$. If we throw $N$ stones randomly, such that they land within the boundaries of the field, and we count the number of stones that fall in the pond $N_{in}$, the area of the pond will be approximately proportional to the fraction of stones that make a splash, multiplied by $A$:
$$A_{pond}=\frac{N_{in}}{N}A.$$
That page then talks about a similar scenario, where you do integration of a function by checking whether random points are under it or not:
imagine a rectangle of height $H$ in the integration interval $[a,b]$, such that the function $f(x)$ is within its boundaries. … The fraction of points that fall within the area contained below $f(x)$ … is an estimate of the ratio of the integral of $f(x)$ and the area of the rectangle.
But then it switches to a different method of integration, where instead of checking yes/no for whether your test points falls under the curve, you instead evaluate the curve itself:
Another Monte Carlo procedure is based on the definition: $$\langle g \rangle=\frac{1}{(b-a)} \int_a^b{f(x)dx}.$$
In order to determine this average, we sample the value of $f(x)$:
$$\langle f \rangle \simeq \frac{1}{N}\sum_{i=1}^{N}f(x_i),$$
And then it tells how to calculate the variance for that type of method:
A possible measure of the error is the "variance" $\sigma^2$ defined by: $$\sigma ^2=\langle f^2 \rangle - \langle f \rangle ^2, $$
But I don't understand how to take this variance calculation and transfer it back to the original "number of hits" type of calculation. I'm not sure what function $f$ I'm evaluating or how to evaluate it.