# Deriving tri-nomial probability using conditional probability formula

I am familiar with the next reasoning for multinomial probability function: $$P(X_1 = x_1 , X_2 = x_2,...,X_k = x_k)$$ when $$x_1 +x_2+...+x_k =n$$ and $$p_1,p_2,...,p_k$$ are the probabilities to choose an element from kind $$X_i$$. So the probability for a specific sequence of $$n$$ elements $$(e_1,e_2,...,e_n)$$ such that the number of elements from type $$X_i$$ is $$x_i$$ for each $$1\le i \le k$$ is $$p_1^{x_1}p_2^{x_2}...p_k^{x_k}$$ and the number of sequences which fulfill those condition is $${n\choose x_1}{n-x_1\choose x_2}...{n-(x_1+x_2+...+x_{k-1})\choose x_k} = \frac{n!}{x_1!x_2!...x_k!}$$ so the probability $$P(X_1=x_1,...,X_k=x_k) = \frac{n!}{x_1!x_2!...x_k!} \cdot p_1^{x_1}p_2^{x_2}...p_k^{x_k}$$.

However I fail to derive this probability using conditional probability, what I tried to do for the tri-nomial case, i.e $$P(X_1 = x_1 , X_2 = x_2 , X_3 = x_3)$$ given $$x_1+x_2+x_3 = n$$ and the respective probabilities $$p_1,p_2,p_3$$. So, $$P(X_1=x_1 , X_2 = x_2, X_3 = x_3)=P(X_1=x_1 ,X_2 =x_2)$$ since in case $$P(X_1 = x_1 , X_2 =x_2)$$ and total number of elements is $$n$$ then $$X_3 = x_3$$. Using condition probability:

$$P(X_1 = x_1, X_2 = x_2) = P(X_1 = x_1 | X_2 = x_2) \cdot P(X_2 = x_2)$$, for $$P(X_2 = x_2)$$ we get $${n\choose x_2}p_2^{x_2}(1-p_2)^{n-x_2}$$ and $$P(X_1=x_2 | X_2 = x_2) = {n-x_2\choose x_1}p_1^{x_1}(1-(p_2-p_1))^{n-x_2-x_1} = {n-x_2\choose x_1}p_1^{x_1}(p_3)^{x_3}$$.

So multiplying gives: $${n\choose x_2}p_2^{x_2}(1-p_2)^{n-x_2} \cdot {n-x_2\choose x_1}p_1^{x_1}p_3^{x_3} = \frac{n!}{x_1 ! x_2 ! x_3 !}p_1^{x_1} p_2^{x_2} p_3 ^{x_3}(1-p_2)^{n-x_2}$$.

Well it is definitely wrong, but I don't see what am I doing wrong, I think I missed calculated the conditional probailty $$P(X_1 = x_1 | X_2 = x_2)$$ yet I don't see what is wrong.

Among the $$n-x_2$$ entries which are not $$X_2$$-kind, the probability that a particular one is $$X_1$$-kind is $${p_1 \over p_1 + p_3} = {p_1 \over 1 - p_2}$$. You are conditioning on that entry not being $$X_2$$-kind. So
$$P(X_1 = x_1 \mid X_2 = x_2) = {n-x_2 \choose x_1} ({p_1 \over 1-p_2})^{x_1} ({p_3 \over 1-p_2})^{x_3} = ({1\over 1-p_2})^{n-x_2} {n-x_2 \choose x_1} p_1^{x_1} p_3^{x_3}$$
Hint: next time try a very simple example. E.g. if you tried $$p_1=p_2=p_3 =1/3$$ and $$n=2, x_2=1$$, you could tell that $$P(X_1=1, X_3=0 \mid X_2=1)$$ should have been $$1/2$$ by symmetry, and therefore your original formula giving $$1/3$$ is wrong.