Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.
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

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

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]
share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.