# Why do we have $p ( x , y | z ) = p ( x | z ) p ( y | x , z )$ [closed]

Could anyone derive or explain why the formula $p ( x , y | z ) = p ( x | z ) p ( y | x , z )$ is true?

## closed as off-topic by Did, user91500, Najib Idrissi, Aloizio Macedo♦, user223391 Oct 3 '15 at 17:08

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level." – Did, user91500, Najib Idrissi, Aloizio Macedo, Community
If this question can be reworded to fit the rules in the help center, please edit the question.

• Have you tried write the definition of $P(A|B)$ and the check the formula? – Nikita Evseev Oct 2 '15 at 10:55
• No indication about what you tried, how can we help? – Did Oct 2 '15 at 11:54
• $$P(x,y|z) = \frac{P(x\cap y)(\cap z)}{P(z)}$$ $$P(x,y|z) P(z) = P(x\cap y)(\cap z)$$ $$\frac {P(x,y|z) P(z)}{P(z)} = P(x\cap y)(\cap z)$$ $$P(x,y|z) = P(x\cap y)(\cap z)$$ – Siemens Oct 2 '15 at 13:05
• @Siemens Indeed one can run in circles as you do in your comment, for a long time (but note that identities 1 and 2 hold provided one replaces the absurd P(x∩y)(∩z) by P(x∩y∩z), while 3 and 4 are squarely wrong). Is this all you tried? So you never even considered p(x|z)p(y|x,z)? – Did Oct 3 '15 at 8:18

Take the defintion (for $P(B) \neq 0$): $$P(A|B) := \frac{P(A\cap B)}{P(B)}$$ Just use that for every term and you will see that the equation holds.

Edit
I'll make it clearer and use your notation:
$$p(x,y|z)=\frac{p(x,y,z)}{p(z)}$$ and $$p(y|x,z)=\left(\frac{p(y,x,z)}{p(x,z)}= \right)\frac{p(x,y,z)}{p(x,z)}.$$ And this holds by definition.
There is no computation done here.

• i know this formula but when i use i can not prove that is true. – Siemens Oct 2 '15 at 10:53
• @Siemens Hint: $(x\cap y)\cap z = (x\cap z)\cap y$ – Graham Kemp Oct 2 '15 at 10:57
• for example P(x,y|z) = P(x|z) * P(y|z) then P(x)P(z|x) P(y) P(z|X) i stuck here – Siemens Oct 2 '15 at 10:59
• i i can wrote this formula correctly for you guys to see what I've done – Siemens Oct 2 '15 at 11:01
• @Siemens No. $P(x,y\mid z) = \dfrac{P(x,y,z)}{P(z)}$. – Graham Kemp Oct 2 '15 at 11:04

To get you started. We use: $\mathsf P(\alpha\mid \beta)\;\mathsf P(\beta)=\mathsf P(\alpha\cap \beta)$

\begin{align} \mathsf P ( x \cap y \mid z ) & = \frac{\mathsf P((x\cap y)\cap z)}{\mathsf P(z)} & \text{if } \mathsf P(z)\neq 0 \\[1ex] & = \frac{\mathsf P((x\cap z)\cap y)}{\mathsf P(z)} \end{align}

Can you take it from here?

• i i can wrote this formula correctly for you guys to see what I've done. I already did this step. – Siemens Oct 2 '15 at 11:04
• $$P(x,y|z) = \frac{P(x\cap y)(\cap z)}{P(z)}$$ $$P(x,y|z) P(z) = P(x\cap y)(\cap z)$$ $$\frac {P(x,y|z) P(z)}{P(z)} = P(x\cap y)(\cap z)$$ $$P(x,y|z) = P(x\cap y)(\cap z)$$ – Siemens Oct 2 '15 at 13:05
• @Siemens No; try again. Aside from misplacing the bracket in the RHS of first line, you divided by $P(z)$ on the LHS of the third line without also doing so to the RHS. – Graham Kemp Oct 3 '15 at 15:48