I'm going through a revision paper and looking at the solutions and I come across this.

Given a Bayesian Network (sorry I cannot post images):

$$\require{enclose}\def\circle#1{\enclose{circle} #1} \raise{4ex}\circle A\raise{2.5ex}\searrow\hspace{-6.75ex}\lower{4ex}\circle D\lower{2.5ex}\swarrow\circle C\raise{2ex}\swarrow\raise{4ex}\circle B\hspace{-6.5ex}\lower{2ex}\searrow\lower{4ex}\circle E$$

$A$ and $B$ are parents of $C$. And $C$ is parents of $D$ and $E$.

Solution says:

$\displaystyle P(A | D,B) = P (D | A,B) \frac{P (A | B)}{P (D | B)}$

Can someone explain to be how this happens? I tried joint probabilities and Bayes rule but in the end got something like this:

$P(D,A,B) = P(A,D,B)$ (by solving both sides of the equation).

This does not really make sense to me. As from what I know, for Bayesian Networks, $P(A,B,C) \ne P(C,B,A)$ for example.

Can someone correct me/help me out here?


  • $\begingroup$ related question: math.stackexchange.com/questions/142558/… $\endgroup$
    – amcnabb
    Commented Aug 16, 2013 at 19:12
  • 1
    $\begingroup$ The order of variables is a statement such as $P(A,B,C)$ has no meaning. So indeed $P(A,B,C)=P(C,B,A)$ in all cases (also for Bayesian networks). $\endgroup$ Commented Jun 14, 2019 at 5:41

2 Answers 2


No Bayesian network is needed here, the identity is completely general. To wit, $$ \mathbb P(A|DB)=\frac{\mathbb P(ADB)}{\mathbb P(DB)}=\frac{\mathbb P(D|AB)\mathbb P(AB)}{\mathbb P(D|B)\mathbb P(B)}, $$ and $\mathbb P(AB)=\mathbb P(A|B)\mathbb P(B)$, hence $$ \mathbb P(A|DB)=\frac{\mathbb P(D|AB)\mathbb P(A|B)}{\mathbb P(D|B)}. $$


\begin{align} RHS&=\dfrac{P(D|AB)\times P(A|B)}{P(D|B)}\\ &=\dfrac{P(ADB)\times P(AB)\times P(B)}{P(AB)\times P(B)\times P(BD)}\\ &=\dfrac{P(ADB)}{P(BD)}\\ &=P(A|DB) \end{align}


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .