How do I calculate expected value of partial normal distribution? Suppose you have a normal distribution with mean=0, and stdev=1.  So the expected value is 0.  
Now suppose you limit the outcomes, such that no values can be below 0.  So 50% of values now equal 0, and rest of distribution is still normal.  Running 1000000 trials, I come out with an expected value of .4  
My question is how can I get this expected value through calculation?  
Thanks
 A: The normal distribution has density function $f(x)=\frac{e^{-\frac{x^2}{2}}}{\sqrt{2\pi}}$; your new distribution has that density function on the positive reals, $P(0)=\frac{1}{2}$, and $P(x)=0$ for the negative reals.  The expected value is $0\cdot\frac{1}{2}+\int_{0}^{\infty}x\cdot f(x)dx=\frac{1}{\sqrt{2\pi}}\approx0.398942$.
edit: If you were to cut off at $x=c$ (assigning all the probability from below c to c itself) instead of $x=0$, your density function would be $f(x)=\frac{e^{-\frac{x^2}{2}}}{\sqrt{2\pi}}$ for $x>c$, $P(c)=\int_{-\infty}^{c}\frac{e^{-\frac{x^2}{2}}}{\sqrt{2\pi}}dx$, and $P(x)=0$ for $x<c$, so the expected value is $c\cdot P(c) + \int_{c}^{\infty}x\cdot \frac{e^{-\frac{x^2}{2}}}{\sqrt{2\pi}}dx$.
edit 2: note that the exponent on e in all of the above is $-\frac{x^2}{2}$ (the exponent 2 on the x is, in the current TeX rendering, positioned and sized such as to be somewhat ambiguous)
edit 3: my explanation incorrectly mixed probability density functions and literal probabilities--this was solely an issue of terminology and the analytic results still stand, but I have attempted to clarify the language above.
A: For the normal distribution: $\mu(1-N(z)+\sigma \cdot n(z)+N(z) \cdot Q$
where $\mu$ and $\sigma$ are the mean and std. dev. of your normal dist., $Q$ is the lower bound (in your case zero), $z=\frac{Q-\mu}{\sigma}$, and $N()$ and $n()$ are the standard normal cdf and pdf respectively.
This can be reversed for upper bounds as well. (see Winkler et al, 1972, "The Determination of Partial Moments".
