Chain rule

 We can rearrange the formula for conditional probability to get the so-called product rule:

P(A,B) = p(A|B) p(B)

We can extend this for three variables:

P(A,B,C) = P(A| B,C) P(B,C) = P(A|B,C) P(B|C) P(C)

and in general to n variables:

P(A1, A2, ..., An) = P(A1| A2, ..., An) P(A2| A3, ..., An) P(An-1|An) P(An)

In general we refer to this as the chain rule.

This formula is especially significant for Bayesian Belief Nets . It provides a means of calculating the full joint probability distribution ; in BBNs many of the variables Ai will be conditionally independent which means that the formula can be simplified as shown here .