Solution (source code)

= Solution

Write $p=1/M$ and $v_f=\int\phi^2f-\theta^2$. The Bernoulli <central limit theorem> gives
$$
\boxed{\frac{N-\mathbb EN}{\sqrt n}\ \Longrightarrow\ N(0,p(1-p)).}
$$
If $M=1$, all proposals are accepted and this limit is degenerate.

Conditional on $N=m$, the accepted sample is iid from $f$. Since $N/n\to p>0$, its size tends to infinity, and the ordinary target-sample CLT therefore gives
$$
\boxed{\sqrt N\left(\frac1N\sum_{i=1}^N\phi(Y_i)-\theta\right)\ \Longrightarrow\ N(0,v_f).}
$$
Assign any fixed value to the estimator on $N=0$; the probability of that event tends to zero, so it does not change this limit. This is the <random-count central limit theorem for accepted rejection samples>.

For comparison at the same budget of $n$ proposals, Slutsky's theorem rescales this as
$$
\boxed{\sqrt n(\widehat\theta_2-\theta)\ \Longrightarrow\ N(0,Mv_f).}
$$
The distinction between accepted-sample size and proposal count is essential for the final efficiency comparison.