# How do I factor this conditional probability?

I am having a brain freeze. Could you show the steps to get from line 1 to line 2?

Thanks!

• You must have a condition: $D$ is independent of $\omega$ given $\theta$. – Zhanxiong Nov 15 '19 at 5:04

In general, you can't. The second term in the first line, i.e. $$p(\theta|\omega)$$ corresponds to second and third terms in the second line, i.e. $$p(\theta|\omega)p(\omega)$$, which means you need to have $$p(D|\theta,\omega)=P(D|\theta)$$. It means $$D,\omega$$ are independent given $$\theta$$, as also noted in the comments. Probably, in your book, there is context indicating this information, e.g. a Bayes net or an experimental setup. A possible scenario is $$D$$ is your coin toss experiment, $$\theta$$ is your head probability of your coins. And $$\omega$$ is a parameter in the prior of $$\theta$$.