# Conditional probability binomial distribution

$$X$$ is a random variable that follows a binomial distribution with parameters $$n, p_1$$.

$$Y$$ is a random variable that follows a binomial distribution with parameters $$n, p_2$$.

I do not know whether the two variables are dependent or not.

How do I find

$$P(X=x|Y=y)=\frac{P(X = x \bigcap Y=y)}{P(Y=y)}$$

We have : $$P(Y=y)= {n \choose y} p^y (1-p)^{n-y}$$

But I don't know how to proceed from there.

• Are $X$ and $Y$ independent? If so, $P(X=x|Y=y)=P(X=x)$. Commented Jul 18, 2020 at 0:19
• What does "I am given $P(X\mid Y)$" mean to you? Because to most people, it would mean that you are given the values of $P(X=x\mid Y=y)$ for all integers $x$ and $y$ in the range $[0, n]$. So, the rest of your question "How do I find...." is vacuous: look at what has been given to you. As to the question about independence of $X$ and $Y$, just check if the given $P(X\mid Y)$ equals $P(X)$ or not. Commented Jul 18, 2020 at 15:43
• I don't understand how the question is vacuous : I am also given $P(Y)=0.718$, but $P(Y=8)=0.0534$. I'm sorry if my question is not formulated correctly. Thanks for the tip about independence!
– Sol
Commented Jul 18, 2020 at 15:48

Unfortunately it's not so easy: you need to know joint distribution unless rvs are independent, in which case you can just take the product of distributions. If they are not, it is found by taking marginalizing out the distribution of the second rv: $$f_{X\mid Y}(x\mid y) = \frac{f_{X,Y}(x,y)}{f(y)} = \frac{f_{X,Y}(x,y)}{\int_A f_{X,Y}(x,y) dy}$$