# Conditional probability of two conditional independent events in Bayesian Networks

I have a common Bayesian Networks example

I need to estimate probablity of JohnCalls given MaryCalls. Other words I need to find

$P(JohnCalls = True|MaryCalls=True)$

From product rule, I know that

$P(JohnCalls = True|MaryCalls=True) = \dfrac{P(JohnCalls, True|MaryCalls=True)}{P(MaryCalls=True)}$

But how can I calculate $P(JohnCalls, True|MaryCalls=True)$ I understand, that it should depend on $Alarm$ variable, but I don't know how.

The equation you have immediately after "From the product rule, I know that..." is incorrect. The definition of conditional probability states that for two random variables $X$ and $Y$,

$$P(X = x | Y= y) = \frac{P(X=x, Y=y)}{P(Y=y)}.$$

So you should have

$$P(JohnCalls = True|MaryCalls=True) = \dfrac{P(JohnCalls = True, MaryCalls=True)}{P(MaryCalls=True)}.$$

Note that the expression $P(JohnCalls, True|MaryCalls=True)$ doesn't even really make sense.

Now to compute the probabilities in the numerator and denominator, use the graph structure to factor the joint probability over all the random variables, then marginalize out so that you are left with just the random variable(s) that you care about.