Normalization of Formula Distributions
Use ProbabilityDistribution with option Method->"Normalize" to automatically compute the normalization coefficient.
In[1]:=
uv\[ScriptCapitalD] =
ProbabilityDistribution[Sin[x] Exp[-x], {x, 0, Pi},
Method -> "Normalize"]
Out[1]=
Sample from the distribution and compare the histogram with the density function.
show complete Wolfram Language input
Out[2]=
Normalize a multivariate distribution with option Method->"Normalize".
In[3]:=
mv\[ScriptCapitalD] =
ProbabilityDistribution[Boole[x^2 + y^2 < 1], {x, 0, 1}, {y, 0, 1},
Method -> "Normalize"]
Out[3]=
show complete Wolfram Language input
Out[4]=