= Solution
For <independent> standard <Cauchy distribution> draws $X_1,\ldots,X_n$, the code averages the indicators $I_i=\mathbf1_{\{X_i>2\}}$. Each is a <Bernoulli random variable> with parameter
$$
\theta=\int_2^\infty\frac{dx}{\pi(1+x^2)}=\frac12-\frac{\arctan2}{\pi}=\frac{\arctan(1/2)}\pi.
$$
Hence it is an <unbiased estimator> of that tail probability, and <independence> gives
$$
\boxed{\widehat\theta=\frac1n\sum_{i=1}^n I_i,\qquad\theta\approx0.1475836,\qquad\operatorname{Var}(\widehat\theta)=\frac{\theta(1-\theta)}n.}
$$
The <variance> is finite even though the underlying Cauchy draws have no finite mean: the variables being averaged are bounded indicators, not the Cauchy values themselves.
Back to article page