How do you calculate marginal, joint, and conditional probabilities from a two-way table?

1 Answer
May 18, 2015

If you are given a pmf = p_(XY)(x,y)pXY(x,y)

and you would like to find the marginal p_Y(y)pY(y)

we would use the formula p_y(y) = sum_ip(x_i,y)py(y)=ip(xi,y)

in other words you would sum over all of xx at the point yy

enter image source here

So if we look at this table and want to find the marginal p_Y(3)pY(3)

we go:

p_Y(3) = P( Y = 3)pY(3)=P(Y=3)
= P(Y = 3, X = 3) + P(Y = 3, X=4)=P(Y=3,X=3)+P(Y=3,X=4)
= 0.1 + 0.2=0.1+0.2
=0.3=0.3

Now to look at the formula for the conditional probability

we can look at the formula for xx given yy which is a conditional probability.

p_(X|Y)(x|y) = P(X = x_i | Y = y_j) = (P(X = x_i, Y= y_j))/(P(Y = y_j))pXY(xy)=P(X=xiY=yj)=P(X=xi,Y=yj)P(Y=yj)

=(p_(XY)(x_i,y_j))/(p_Y(y_i))=pXY(xi,yj)pY(yi)

now to use an example, we will look back at our table.

let us look for the conditional probability of:

p_(X|Y)(3|4) = 0.1/0.4 = 0.25pXY(34)=0.10.4=0.25

Thus, the probability that X = 3X=3 given that Y=4Y=4 is 0.250.25