# Which is the probability of JohnCalls given Burglary? Why?

Questions:

1. P (JohnCalls|Burglary) ?
2. Why?

What do you know about Bayesian networks? I know they exist, but don't understand enough of how it works (i.e., I understand almost nothing). This example would help me gain comprehension about the inter-relation of the variables.

I know that P (JohnCalls|Burglary) would result in the probability of JohnCalls being divided by the probability of Burglary if these were the only two variables and there was a contingency table for just these two. But there is the Alarm in the middle impacting JohnCalls and I don't know what to do with Alarm.

My attempt at solving: using Bayes' Theorem

P(JohnCalls|Burglary) = P(J|B) = ( P(B|J) * P(J) / P(B) )

• P(B): 0.001
• P(J): it depends on the Alarm ringing or not ringing, so I cannot be sure about which probability to take in consideration.
• P(B|J): ??????

To figure out the probability of John calling (J) given a burglary (B), we need to think about the alarm system (A) as a middleman. John's call is directly influenced by the alarm, but the alarm itself can be triggered by both burglaries and earthquakes. This makes things a bit tricky.

Here's how we can approach the problem:

Two Scenarios:

• Scenario 1: The alarm goes off, and John calls. This makes a burglary more likely since burglaries often set off alarms, and alarms often lead to calls.
• Scenario 2: The alarm doesn't go off, but John calls anyway. This might mean John called for a different reason, so it doesn't tell us much about whether there was a burglary.

Combining the Scenarios:

• To get the overall probability of John calling given a burglary, we need to consider both scenarios and how likely each one is. We can express this mathematically:
P(JohnCalls | B) =  P(JohnCalls | Alarm)  * P(Alarm | B) +
P(JohnCalls | ~Alarm) * P(~Alarm | B) -----(equation 1)


Here, we know the relation of JohnCalls and Alarm from the table. But we don't know relation of Alarm and Burglary P(Alarm | B) and P(~Alarm | B). So we need to find that.

Let's find it.

To find these probabilities, we use the following logic:

Account for both Earthquake possibilities: We split the event "Alarm given Burglary" into two mutually exclusive cases:

• The alarm goes off, and there was an earthquake.
• The alarm goes off, and there was no earthquake.
P(Alarm | B)   =  sum of both probabilties of Earthquake(True and Flase)
=  P(Alarm, Earthquake | Burglary) +
P(Alarm, ~Earthquake | Burglary)

(Conditional Probability and Independence)
=   P(Alarm | Burglary, Earthquake) * P(Earthquake) +
P(Alarm | Burglary, ~Earthquake) * P(~Earthquake)

(From Table)
=   (0.95 * 0.002) +
(0.94 * 0.998)
=   0.9399


Therefore, the probability of the alarm going off given a burglary is approximately 94%.

In a case of No Alarm:

P(~Alarm | B) = 1 - P(Alarm | B)
= 1 - 0.9399
= 0.0601


Finally, we substitute all the probabilities we know back into the main equation to get the probability of John calling given a burglary:

P(JohnCalls | Alarm) = 0.90
P(JohnCalls | ~Alarm) = 0.05

P( Alarm | B)  = 0.9399
P(~Alarm | B)  = 0.0601

P(JohnCalls | B ) = (0.90 * 0.9399) + (0.05 * 0.0601) = 0.8489


Therefore, the probability of John calling given a burglary is approximately 84.9%.