# Calculating Probabilities from a Joint Distribution

• Nov 2nd 2012, 06:44 PM
tangibleLime
Calculating Probabilities from a Joint Distribution
I spent a solid 35 minutes writing out a long and extensive post then the forum software decided I was on the page for too long and erased everything. So here it goes again... This is for studying, it was from a past homework assignment.

I have a joint probability distribution, P(X,Y) that is a 4x4 matrix.

 X 1 2 3 4 1 1/4 0 1/8 1/8 Y 2 1/8 0 1/16 1/16 3 1/16 0 1/32 1/32 4 1/16 0 1/32 1/32

I need to, and cannot, find P(Y|X) and P(X=3|Y).

Below I use the notation P(x,y) to denote the probability at the coordinates (x,y).

My attempt for P(Y|X):

P(Y|X) = Each vector in X..?? (Isn't that just the original table?)
So,
P(Y|X) = { P(Y|X=1), P(Y|X=2), P(Y,X=3), P(Y,X=4) }

(X is across, Y is vertical)
 Y / X 1 2 3 4 1 1/4 0 1/8 1/8 2 1/8 0 1/16 1/16 3 1/16 0 1/32 1/32 4 1/6 0 1/32 1/32

This is just the original table, but I'm not sure what else P(Y|X) could mean.

My attempt for P(X=3|Y):

I think this wants the probabilities at every point where X=3 and for each Y.

So,
P(X=3|Y) = { P(3,1), P(3,2), P(3,3), P(3,4) }
= { 1/8, 1/16, 1/32, 1/32 }

Any help is appreciated, thanks!
• Nov 2nd 2012, 11:00 PM
chiro
Re: Calculating Probabilities from a Joint Distribution
Hey tangibleLime.

For P(Y|X) you will need to consider each slice of X (i.e. each value of x for X = x) and the distribution will still be a bi-variate distribution with four slices for each X=x. Just do it for a fixed x and then you will have a bi-variate distribution with a conditional distribution for P(Y=y) given a particular value of x observed (so four of these distributions).

For the second one you need to normalize this distribution by P(Y=y): Recall P(X=x|Y=y) = P(X=x and Y=y)/P(Y=y) so as an example P(X=3|Y=1) = P(X=3 and Y=1)/P(Y=1) = (1/8)/(1/2) = 1/4.
• Nov 3rd 2012, 04:33 PM
tangibleLime
Re: Calculating Probabilities from a Joint Distribution
So I solve P(Y|X) by putting together essentially a table of the normalized marginals of Y?

P(Y|X=1) = { P(1,1), P(1,2), P(1,3), P(1,4) } = { 1/4, 1/8, 1/16, 1/16 } => normalizing => { 1/2, 1/4, 1/8, 1/8 }
P(Y|X=2) = { P(2,1), P(2,2), P(2,3), P(2,4) } = { 0, 0, 0, 0 } => normalizing => { Undefined, Undefined, Undefined, Undefined }
P(Y|X=3) = { P(3,1), P(3,2), P(3,3), P(3,4) } = { 1/8 + 1/16 + 1/32 + 1/32 } => normalizing => { 1/2, 1/4, 1/8, 1/8 }
P(Y|X=4) = { P(4,1), P(4,2), P(4,3), P(4,4) } = { 1/8 + 1/16 + 1/32 + 1/32 } => normalizing => { 1/2, 1/4, 1/8, 1/8 }

Then putting it in a table for easier viewing... (Y is y-axis, X is x-axis)
 1 2 3 4 1 1/2 Undef 1/2 1/2 2 1/4 Undef 1/4 1/4 3 1/8 Undef 1/8 1/8 4 1/8 Undef 1/8 1/8

Does this look correct?
• Nov 3rd 2012, 04:39 PM
chiro
Re: Calculating Probabilities from a Joint Distribution
The undefined part should be 0 since 0*anything is 0 (also probabilistically you have a null event which has probability zero).

Otherwise though, it looks good (I'm assuming also P(a,b) is P(y=a,x=b)).