= Solution
Let $p=\Phi(1)-\Phi(0)$, and write $\varphi$ for the <standard normal distribution> density. For <importance sampling>, choose the proposal density $q(x)=\mathbf1_{[0,1]}(x)$, namely the <uniform distribution> on the target interval. Its <importance sampling> weight is
$$
\boxed{w(x)=\frac{f(x)}{q(x)}=\frac{\varphi(x)}p\quad(0\leq x\leq1).}
$$
For iid uniform draws $U_1,\ldots,U_N$,
$$
\boxed{\widehat\mu_{\mathrm{IS}}=\frac1N\sum_{i=1}^N\frac{U_i\varphi(U_i)}p}
$$
is an <unbiased estimator> of the target mean, since its expectation integrates $xf(x)$. If one chooses not to evaluate $p$, the <self-normalized importance sampling> alternative $\sum U_i\varphi(U_i)/\sum\varphi(U_i)$ has <statistical consistency>, but generally is not an <unbiased estimator>.
Alternatively, draw <independent random variables> $V_1,\ldots,V_N$ with the <standard normal distribution>, let $A_i=\mathbf1_{\{0\leq V_i\leq1\}}$ and $K=\sum A_i$, and use
$$
\boxed{\widehat\mu_{\mathrm{keep}}=\frac{\sum_iA_iV_i}{K}\quad(K>0).}
$$
Conditionally on $K=k>0$, the retained draws are iid from the <truncated normal distribution>, so their average is an <unbiased estimator> with <variance> $\tau^2/k$, where $\tau^2$ is its <variance>. If $K=0$ the ratio is undefined; one can continue drawing until a prescribed number of retained observations is obtained.
Here <importance sampling> uses every draw inside the interval, whereas only $p\approx0.3413$ of the normal proposals are retained. The advantage can also be quantified. Integration using $\varphi'(x)=-x\varphi(x)$ gives
$$
\mu=\frac{\varphi(0)-\varphi(1)}p\approx0.459862,
\qquad\tau^2=1-\frac{\varphi(1)}p-\mu^2\approx0.079652.
$$
For uniform <importance sampling>,
$$
N\operatorname{Var}(\widehat\mu_{\mathrm{IS}})=\frac1{p^2}\int_0^1x^2\varphi(x)^2\,dx-\mu^2\approx0.047336.
$$
For the retained-draw ratio with a fixed total proposal budget, its <asymptotic variance> coefficient is $\tau^2/p\approx0.233347$. Thus this importance choice has substantially smaller error for the same proposal count; it also avoids wasting about two thirds of the <standard normal distribution> draws. This comparison is specific to this well-matched <importance sampling> proposal; arbitrary proposal choices do not share this guarantee.
Back to article page