Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If $p_X(k)$ and $p_{Y|X}(y|k)$ are given, how can we calculate $p_Y(y)$? We cannot assume that $p_Y(y)$ and $p_X(k)$ are independent.

I know that $p_X(k) \cdot p_{Y|X}(y|k) = p_{Y,X}(y,k)$ but how can I isolate $p_Y(y)$?

share|cite|improve this question
What do you mean by $p_X(k)$ and $p_{X|Y}(y|k)$? What probabilities (or densities) of what exactly are those? Of $X$ respectively $X|Y$? Of $k$? – fgp Oct 11 '12 at 22:23
X and Y are random variables. y and k are the values that you put into the probability mass functions. – Dimme Oct 11 '12 at 22:27
Also there is a typo by you, $p_X(x) \cdot p_{Y|X}(y|x)=p_{X,Y}(x,y)$ and not the way you wrote. – TheJoker Oct 11 '12 at 22:28
Thanks I corrected it – Dimme Oct 11 '12 at 22:28
Just integrate the product w.r.t. $x$ to getthe answer. It is standard way to find marginal density from joint density. – TheJoker Oct 11 '12 at 22:30
up vote 2 down vote accepted

Since you are dealing with discrete random variables, the way you find $p_Y(y)$ is using summations:

$$p_Y(y) = \sum_k p_{Y,X}(y,k) = \sum_k p_{Y\mid X}(y\mid k)p_X(k)$$

where the sum on the right should be recognized as coming from the law of total probability. Note that $p_{Y\mid X}(y\mid k)$ is the conditional probability of the event $A = \{Y = y\}$ given that the event $B_k = \{X = k\}$ has occurred, while $p_X(k) = P\{X = k\}$ is just $P(B_k)$. The law of total probability tells us that

$$P(A) = \sum_k P(A\mid B_k)P(B_k)$$

where the events $B_k$ are a (countable) partition of the sample space.

share|cite|improve this answer


Use $$p_Y(y)=\int_x p_{Y,X}(y,x) dx = \int_x p_X(x) \cdot p_{Y|X}(y|x) dx$$


For discrete case, just replace integration by summation as pointed out by Dilip.

P.S: How come you knew that he meant discrete and not continuous random variable??

share|cite|improve this answer
The title of the question is "Probability mass function and conditional probabilities" and so I assumed that the OP meant to ask about discrete random variables. – Dilip Sarwate Oct 12 '12 at 1:27
Thanks.You have keen sense of observation. – TheJoker Oct 13 '12 at 13:08

Your Answer


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.