# Conditional probability in Expectation Maximization (EM)

I've got the following equation:

$$p(j = 1 | x, \theta) = \frac{p(j=1,x | \theta)}{p(x | \theta)}$$

Why does it hold? Or maybe, how do I use Bayes Theorem in this case, i.e. if we do not only have $$p(j = 1 | x)$$ but $$p(j = 1 | x, \theta)$$?

In general we have: $$p(\theta,x,j=1) = p(j = 1 | x, \theta) \cdot p(x,\theta) \\ \Leftrightarrow \frac{p(\theta, x, j=1)}{p(x, \theta)} = p(j=1| x,\theta)$$
By using this, we get: $$p(j = 1 | x, \theta) = \frac{p(\theta, x, j=1)}{p(x,\theta)} = \frac{p(j=1,x|\theta) \cdot p(\theta)}{p(x|\theta) \cdot p(\theta)} = \frac{p(j=1,x | \theta)}{p(x|\theta)}$$