For the following calculation, why $E[Z_1^2] = \pi/4$ ? In general, how to calculate $E[Z^2]$ ? Thanks much.
3 down vote
Let's also elaborate on Ross Millikan's answer, adapted to the case f(x)=1−x2−−−−−√, 0≤x≤1. Suppose that $(X1,Y1),(X2,Y2),\ldots$is a sequence of independent uniform vectors on $[0,1]\times [0,1]$, so that for each $i$, $X_i$ and $Y_i$ are independent uniform $[0,1]$ random variables. Define $Z_i$ as follows: $Z_i=1$ if $X_i^2+Y_i^2 \le 1$, $Z_i=0$ if $X_i^2+Y_i^2 > 1$, so the $Z_i$ are independent and identically distributed random variables, with mean $\mu$ given by $ \mu = E[Z_1] =P[X_1^2+Y_1^2 \le 1]=P[(X_1,Y_1) \in \{(x,y) \in [0,1]^2 : x^2+y^2 \le 1\}] = \pi/4$, where the last equality follows from $P[(X1,Y1)\in A]=\text{area}A (A \subset [0,1]^2)$.
By the strong law of large numbers, the average Zˉn=∑ni=1Zin converges, with probability 1, to the expectation μ as n→∞. That is, with probability 1, Zˉn→π/4 as n→∞.
To get a probabilistic error bound, note first that the $Z_i$ have variance $\sigma^2$ given by $\sigma^2=\text{Var}[Z_1]=E[Z_1^2]−E^2[Z_1]=\pi /4−(\pi /4)^2=\pi /4 (1−\pi /4)<10/59$.