# Where can we use the Bayes' theorem in artificial intelligence?

Th Bayes' rule specifies how an agent should update its belief in a proposition based on a new piece of evidence. Suppose an agent has a current belief in proposition $$h$$ based on evidence $$k$$ already observed, given by $$P(h \mid k)$$, and subsequently observes $$e$$.

In artificial intelligence, where can we use the Bayes' rule? I am unable to understand this concept.

A toy example:

Suppose an agent has information about the reliability of fire alarms. It may know how likely it is that an alarm will work if there is a fire i.e. $$P(alarm | fire)$$. But, if the problem is tweaked a bit and if the agent must know the probability that there is a fire, given that there is an alarm, it can use Bayes' rule:

$$P(fire | alarm) = [P(alarm | fire) ×P(fire )] / P(alarm )$$

where:

$$P(alarm | fire)$$ is the probability that the alarm worked, assuming that there was a fire. It is a measure of the alarm's reliability.

The expression $$P(fire)$$ is the probability of a fire given no other information. It is a measure of how fire-prone the building is.

$$P(alarm)$$ is the probability of the alarm sounding, given no other information.