# How is Bayes theorem being applied in expanding the formula of Binary Independence Model?

The BIM formula makes use of Bayes theorem. Can anyone please explain:

• How to read the probability of the form P(R=1|x,q)? Is it P((R=1|x),q) or P(R=1|(x,q))? Does , stand for AND here?
• How exactly Bayes theorem being applied to expand it?

It can be read as the probability of R=1, given (x and y) as your second formula. Anything after | stand for the given part.

Since:

$$P(x | r=1 \wedge q) = \frac{P(x \wedge R=1 \wedge q)}{P(R=1 \wedge q)}$$

$$P(R=1|q) = \frac{P(R=1 \wedge q)}{P(q)}$$

$$P(x|q) = \frac{P(x \wedge q)}{p(q)}$$

Therefore:

$$P(R=1|x,q) = \frac{P(x | R=1 \wedge q)*P(R=1|q)}{P(x|q)} =$$

$$\frac{P(x \wedge R=1 \wedge q)}{P(R=1 \wedge q)} * \frac{P(R=1 \wedge q)}{P(q)}* \frac{P(q)}{P(x \wedge q)} =$$ $$\frac{P(x \wedge R=1 \wedge q)}{P(x \wedge q)}$$