Solution (source code)

= Solution
{c}

Draw independent uniforms $U_1,U_2$ on $(0,1)$, put $V=2U_1-1$, and accept $V$ if $U_2\leq\sqrt{1-V^2}$; otherwise repeat independently. This is <rejection sampling> from the uniform proposal $q(v)=1/2$. Its accepted unnormalized density is $q(v)\sqrt{1-v^2}$, and the acceptance probability is
$$
a=\frac12\int_{-1}^1\sqrt{1-v^2}\,dv=\frac\pi4.
$$
Dividing by $a$ gives the target <Wigner semicircle distribution>. The number of trials up to and including the first acceptance has a <geometric distribution> with success probability $\pi/4$, so
$$
\boxed{\mathbb E[N]=\frac4\pi.}
$$
The expected number of rejected trials alone is $4/\pi-1$.