# Bayes’ Rule in Data Structure

A way to update our beliefs depended on the arrival of new, relevant pieces of evidence are provided by Bayes rule. For example, if we were trying to provide the probability that a given person has cancer, we would initially just conclude it is whatever percent of the population has cancer. However, given extra evidence such as the fact that the person is a smoker, we can update our probability, since the probability of having cancer is greater given that the person is a smoker. This allows us to utilize prior knowledge to improve our probability estimations.

The rule is explained below -

$$P\lgroup C|D \rgroup=\frac{P \lgroup D|C \rgroup P \lgroup C \rgroup}{P\lgroup D \rgroup}$$

In this formula, C is the event we want the probability of, and D is the new evidence that is related to C in some way.

P(C|D) is denoted as the posterior; this is what we are trying to estimate. In the above example, it is concluded that the “probability of having cancer given that the person is a smoker”.

P(D|C) is denoted as the likelihood; this is the probability of observing the new evidence, provided our initial hypothesis. In the above example, it is concluded that the “probability of being a smoker given that the person has cancer”.

P(C) is denoted as prior; this is the probability of our hypothesis without any extra prior information. In the above example, it is concluded that the “probability of having cancer”.

P(D) is denoted as the marginal likelihood; this is the total probability of observing the evidence. In the above example, it is concluded that the “probability of being a smoker”. In several applications of Bayes Rule, this is ignored, as it mainly serves as normalization.

Published on 16-Jan-2020 12:05:07