# I was doing this course ' Bayesian Methods for machine learning' on coursera and I got stuck on few conditional statements expansion and manipulation

I have doubt in three conditional expansions :

1. How is P(w,y|x) = P(y|w,x).P(w) ?
2. How is P(w|y,x) = P(y,w|x)/P(y|x) ?
3. How is P(y|w,x).P(w|x) = P(y|x.w).P(w)?

Also,Do suggest me some reference material to understand the same. Also, If possible write the important expansions and trick on how to expand conditional probablities.

## 1 Answer

Just for the record even if i think i will lose reputation point because this question must have been answered multiple times on stackExchange.

And the first one is false (i think or i did a mistake :D). I let you the last one (which is nothing?)

I think you miss one important point here, x and w must be independent and in this case one is true and three is true too.

This use Bayes Rule.

$$\mathbb{P}(A|B)=\mathbb{P}(B|A)*\mathbb{P}(A)/\mathbb{P}(B)=P(A,B)/P(B)$$

From there for the first point this is $$P(w,y|x) = P(w,y,x)/P(x) = P(y|w,x)P(w,x)/P(x) = P(y|w,x)P(w|x)$$

$$P(w|y,x) = P(w,y,x)/P(y,x)=P(y,w|x)P(x)/P(y,x)= P(y,w|x)/P(Y|x)$$

• Any explaination for the third one P(y|w,x).P(w|x) = P(y|x.w).P(w) ? – Akash Dubey Aug 23 at 10:31