I have been staring at a bayesian net for an hour and can't understand why this is correct to write:
$$P(W|B,E)\cdot P(E)\cdot P(R|E)= P(W,R,E|B)$$
Note that the joint probability of $P(A,B,E,W,R)$ can be decomposed as follows according to the bayesian net structure:
$$P(A,B,E,W,R) = P(B)\cdot P(E)\cdot P(A|B,E)\cdot P(R|E)\cdot P(A|B,E)\cdot P(W|A)$$
By the Chain Rule, we have:
\begin{eqnarray*} P(W,R,E\mid B) &=& P(W\mid R,E,B)\;P(R\mid E,B)\;P(E\mid B) \\ &=& P(W\mid E,B)\;P(R\mid E)\;P(E). \end{eqnarray*}
This last equality because: