# Joint probabilities, conditional probabilities with the chain rule.

I'm reading through a book, and it walks through a problem. We need to compute $p(a | e, f)$. It says that by applying the chain rule we can see:

$$p(a|e,f) = \frac{p(e,a|f)}{p(e|f)}$$

Looking at the chain rule, I do not understand how that was arrived at.

I imagine there is a simple explanation (since no further working was shown in the book), is anyone able to provide one?

-
What is $a,e,f$ and $p$? – Stefan Hansen May 8 '12 at 9:33

$$p(a\mid e,f)=\frac{p(a,e,f)}{p(e,f)}=\frac{\frac{p(a,e,f)}{p(f)}}{\frac{p(e,f)}{p(f)}}=\frac{p(a,e\mid f)}{p(e\mid f)}$$
Using the words "chain rule" is a poetic way of talking about formulas that look similar. In your case it's the old formula for computing conditional probabilities. (Note that the event $f$ is irrelevant here and may as well be all of probability space $\Omega$.)
What is the probability that $a$ and $e$ occur simultaneously, given that $f$ occurs? It is the probability that $e$ occurs, given $f$, times the probability that $a$ occurs after we have already observed $e$ and $f$. Written as a formula: $$p(a\wedge e\ |\ f)=p(e\ |\ f)\cdot p(a\ |\ e\wedge f)\ .$$ If you solve this equation for $p(a\ |\ e\wedge f)$ you get the formula allegedly obtained by the "chain rule": $$p(a\ |\ e\wedge f)={p(a\wedge e\ |\ f)\over p(e\ |\ f)}\ .$$