# Marginalisation on conditional probability

I'm afraid this is an extremely simple question, but I didn't understand completely why if both $O_1$ and $O_2$ can be marginalised over $R$ the following holds:

$P(O_2 = o_i | O_1 = o_j) = \sum_r P(O_2 = o_i | R = r) P(R = r | O_1 = o_j)$

Thanks

• Is this a self-study question (they are handled differently)? Please add the self-study tag if appropriate. – QuantIbex May 10 '14 at 12:03
• Are you sure about the first term on the right hand-side of your expression? – QuantIbex May 10 '14 at 12:32
• Have you worked it out? Would you consider to write your solution as en edit/addition to your question or an answer (for the benefit of others)? – QuantIbex May 14 '14 at 11:26
• @QuantIbex I think I have, I'm quite busy atm, but will edit the question asap. – JTulip May 14 '14 at 21:36

## 1 Answer

The question seems to by a self-study question. For the moment I'll provide hints that will hopefully lead to the correct expression.

Assuming that $P(O_1 = o_j) > 0$ and by the definition of conditional probability $$P(O_2 = o_i \mid O_1 = o_j) = \frac{P(O_2 = o_i , O_1 = o_j)}{P(O_1 = o_j)} .$$ Moreover, by the law of total probability $$P(O_2 = o_i, O_1 = o_j) = \sum_r P(O_2 = o_i, O_1 = o_j, R = r) .$$ Combining these two expressions and further applications of both the definition of conditional probability as well as the loaw of total probability should lead to the correct expression.