Using importance sampling to simulate the mean of a normal distribution truncated to interval [0,1] So in these notes it says that importance sampling is:
$$\int_F sf(s)ds = \int_G s \frac{f(s)}{g(s)}g(s)ds$$
And then it proceeds to give the following example:



In this example, if we draw from $f(x)$, are we effectively drawing from the truncated standard normal distribution? Also, can someone explain why it says that $g(x)=1$ if we draw $x$ from $U[0,1]$?

Importance sampling means: to compute an average of $h$ against the pdf $f$, draw samples from the pdf $g$, and average $\frac{h f}{g}$. The goal is to choose $g$ which is nearly directly proportional to $hf$, so that $\frac{hf}{g}$ is nearly constant (and therefore has small variance). On the other hand, if $hf$ has one sign and you could draw directly from $g=C hf$, then you would already know what the integral of $hf$ was: it would just be $1/C$. So you would already be done. So there is a compromise to be made.
In the problem you are looking at, if you were drawing from $f$, then yes you would be drawing from the truncated normal distribution. When you are drawing from $g$, the pdf of $U[0,1]$, that pdf is just $1$ on $(0,1)$ and zero elsewhere, by the definition of the uniform distribution.
