In Mathematica 8, I want to define a discrete distribution with density mass given as a list. For example,
In[1] f = ProbabilityDistribution[{2/3, 1/3}[[x]], {x, 1, 2, 1}];
This seems to work. However, this emitted a twice-repeated warning:
"Part::pspec: Part specification x is neither an integer nor a list of integers."
Nevertheless, f seems to work correctly. This message got me thinking that there may be a better way to define the same distribution. How can I define a discrete distribution using a list but without invoking the warning?