# conditional probability and Bayes' rule

What's the between $$P(x|y)P(y|z)$$ and $$P(x|y,z)P(y|z)$$, it seems to me they both equal to $$P(x,y|z)$$.

Does any condition should be satisfied if they both equal to $$P(x,y|z)$$.

By definition $$\mathsf P(x,y\mid z)~=~\mathsf P(x\mid y,z)~\mathsf P(y\mid z)$$ always holds for any random variables $$x,y,z$$ where $$\mathsf P(y\mid z)\neq 0$$.

Does any condition should be satisfied if they both equal to P(x,y|z).

Yes.   $$\mathsf P(x\mid y,z)=\mathsf P(x\mid y)$$ exactly when $$x\perp z\mid y$$ (that is, $$x$$ and $$z$$ are conditionally independent when given $$y$$).

Only when one this is so can we make the substitution to claim $$\mathsf P(x,y\mid z)~=~\mathsf P(x\mid y)~\mathsf P(y\mid z)$$.

Your second term rightly equals p(x,y|z):

$$P(x|y,z) P(y|z) = \frac{P(x,y,z)}{P(y,z)} \frac{P(y,z)}{P(z)} = P(x,y|z)$$

I don't quite see, how your first term derives from P(y|x,z), though.

• Thank you. But, can you tell me if $P(x|y)P(y|z)=P(x,y|z)$, I am confused😂. If it's wrong, then the first term should be wrong. Mar 11, 2019 at 23:22