dist1=DiscreteUniformDistribution[{1,6}];(*rolling1die*)dist2=TransformedDistribution[Y=+,{dist1,dist1}];(*sumof2dice*)expr=PDF[dist2,y](*outputisaPiecewise[]expressioncontainingseveralEqual[]expressions*)
x
1
x
2
x
1
x
2
Out[]=
|
For discrete distributions the shown output of PDF[dist,y] often contains Equal[y,val] expressions. I am interested in a sorted list of all those values vals. I was thinking that pattern matching on Equal[] should do the trick but my attempts failed.
Basically i am looking for a general way to produce a sorted list of all values vals, for which the transformed random variable Y has non-zero probability. Please could you show me a way/ways to get there:
Basically i am looking for a general way to produce a sorted list of all values vals, for which the transformed random variable Y has non-zero probability. Please could you show me a way/ways to get there:
{2,3,4,5,6,7,8,9,10,11,12}(*desiredoutput*)
Thanks for your help, appreciated!