Thanks.
Do feel it is a little weird as in
ProbabilityDistribution[
Piecewise[{{1 + x, -1 < x < 1},
{1/x, 1 < x < 2}}],
{x, -Infinity, Infinity},
Method -> "Normalize"]
Outside of the Piecewise
, there is {x, -Infinity, Infinity}
. As Piecewise
have given the range of the function, why should we add {x, -Infinity, Infinity}
after it?
Another question:
D[Probability[Sin[X] < y,
Distributed[X,
ProbabilityDistribution[
Piecewise[{{2*x/(Pi^2), 0 < x < Pi}, {0,
x <= 0 || x >= Pi}}], {x, -Infinity, Infinity}]]],
y] // Simplify
outputs

Do you think this is the right answer? I think in this Piecewies
limits, the answer should be
2/(\[Pi] Sqrt[1 - y^2]), 0<y<1 and 0, y equals others.