Question: ProbabilityTable starts with zero?

How do I use ProbabilityTable so that the first element in P denotes the probability of zero, and not one? That is I have three states: 0,1, and 2, and I want them be an immediate output of my Sample. Thanks.

with(Statistics):
P:= [1/2,1/8,3/8];
X:= RandomVariable(ProbabilityTable(P));
ProbabilityFunction(X, 0);
Sample(X, 10);
 

Please Wait...