A simple error with stochastic variables

f = Piecewise[{
{0.1, x == 1 && y == 1}, {0.1, x == 2 && y == 1}, {0.0,
x == 3 && y == 1}, {0.3, x == 1 && y == 2}, {0.1,
x == 2 && y == 2}, {0.2, x == 3 && y == 2}, {0.0,
x == 1 && y == 3}, {0.2, x == 2 && y == 3}, {0.1,
x == 3 && y == 3}, {0, True}}];
fi = ProbabilityDistribution[f, {x, 1, 3, 1}, {y, 1, 3, 1}];
Probability[
x <= 2 && y <= 2, {x \[Distributed] fi, y \[Distributed] fi}]


I am trying to compute this problem. The result I am looking for is 0.9

Your probability distribution is not valid. This can be seen:

Probability[x > 0 || y > 0, {x, y} \[Distributed] fi]


which yields 1.1 and can be seen by looking at the definition of the PMF:

PDF[fi, {x, y}]


This is probably a small error you can correct. Once you correct f, you can call the probability for the joint distribution (below is still erroneous):

f = Piecewise[{{0.1, x == 1 && y == 1}, {0.1, x == 2 && y == 1}, {0.0,
x == 3 && y == 1}, {0.3, x == 1 && y == 2}, {0.1,
x == 2 && y == 2}, {0.2, x == 3 && y == 2}, {0.0,
x == 1 && y == 3}, {0.2, x == 2 && y == 3}, {0.1,
x == 3 && y == 3}, {0, True}}];
fi = ProbabilityDistribution[f, {x, 1, 3, 1}, {y, 1, 3, 1}];
Probability[x <= 2 && y <= 2, {x, y} \[Distributed] fi]

• How would you compute: $P((X \leq 2 ) \cup ( Y\leq 2 ))$ – Jens Jensen Aug 13 '13 at 8:04
• Okay I got it now. Thanks a lot! – Jens Jensen Aug 13 '13 at 8:06