Bayes' theorem applied to conditional probability distributions

282 Views Asked by At

While doing a probability course, I encountered the following formula in the derivation of a Beta distribution :

$$f(X=x|Y=y) = \frac{P(Y=y|X=x)f(X=x)}{P(Y=y)}$$

Where $f$ denotes the probability density function and $P$ the probability of an event. I did not quite understand why the equation includes the probability $P(Y=y|X=x)$ instead of $f(Y=y|X=x)$ (same for the denominator), as I would expect the formula to be this : $$f(X=x|Y=y) = \frac{f(Y=y|X=x)f(X=x)}{f(Y=y)}$$ Is this right? If not, what is the intuition behind applying Bayes theorem to conditional probability density functions?

Update :

So far, I have found this resource (page 4), that supports the second equation. However, this course from Harvard uses the first equation (at 11:50). Which one is right?