1
$\begingroup$
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

$\endgroup$
1
$\begingroup$

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]
$\endgroup$
  • $\begingroup$ How would you compute: $P((X \leq 2 ) \cup ( Y\leq 2 ))$ $\endgroup$ – Jens Jensen Aug 13 '13 at 8:04
  • $\begingroup$ Okay I got it now. Thanks a lot! $\endgroup$ – Jens Jensen Aug 13 '13 at 8:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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