$n$ balls are put into three boxes $A$, $B$ and $C$ independently from each other with probability $p$,$q$, $1-p-q$.
Here $n$ is a natural number,and $p,q$ are real numbers such that $p + q \le 1$, $p>0$, and $q> 0$. The number of balls entering the box $A$ is $X$, and the number of balls entering the box $B$ is $Y$. The joint probability distribution of $(X, Y)$ is given as follows.
$$p(X=i,Y=j)= \frac{n!}{i!j!(n-i-j)!}{p^i}{q^j}(1-p-q)^{n-i-j}$$
where $i,j \ge 0, i+j<=n$
questions: find probability distribution of $X$, and show that X ~ Bin (n,p), find $E [Y | X = i]$ and $E[Y]$.
I dont quite understand how can to get the $X$ and $Y$ distributons from joint distribution with multiple distribution, for $X$ is $P(X=i)= \binom{n}{i} p^i (1-p)^{n-i}?$ and why this should use binomial distribution?
$P(X=i)= \binom{n}{i} p^i(1-p)^{n-i}$
$P(Y=j)= \binom{n-i}{j}q^j(1-p-q)^{n-i-ij}$
so the joint distributions $P(x=i,y=j)=\binom{n}{i} p^i(1-p)^{n-i} * \binom{n-i}{j}q^j(1-p-q)^{n-i-ij}$ is enough to show that binomial?