# Bayes Theorem Formula

Bayes Theorem Formula –  Bayes’ theorem Formula states the probability of an event occurring under any given situation. It is also taken into account while calculating conditional probability. The Bayes theorem is frequently referred to as the “causes” probability formula. For example, suppose we need to determine the chance of selecting a white ball from the second of three separate bags of balls, each containing three different colours: red, white, and black. Conditional probability refers to the calculation of the probability of an occurrence based on other factors. This article will cover the statement and proof of the Bayes theorem, as well as its formula, derivation, and several solved questions.

## Bayes Theorem Formula

Based on a past occurrence, the likelihood of an event may be ascertained using the Bayes theorem, which is named for the Reverend Thomas Bayes and applies to statistics and probability. Bayes rule has several uses, like Bayesian interference in the healthcare industry, which determines the likelihood of acquiring health problems at one age, among others.  The Bayes theorem is based on determining P(A | B) when P(B | A) is known.

We will use examples to explain the usage of the Bayes rule in determining the likelihood of events, as well as its proof, formula, and derivation.

## Bayes Theorem Statement

Bayes Theorem is a method for calculating the probability of an event depending on the occurrence of previous events. It is used to determine Conditional Probability. The Bayes theorem computes the probability based on a hypothesis. Let us now declare and verify Bayes’ Theorem. According to the Bayes theorem formula, the conditional probability of an event A occurring in the presence of another event B is equal to the product of the probability of B given A and Divide the probability of A by the probability of . It’s given as:

P(A|B) = P(B|A)P(A) / P(B)

Where

• P(A|B) –The probability of event A occurring, provided that event B has happened
• P(B|A) – The probability of event B occurring, provided that event A has happened
• P(A) – The probability of event A
• P(B) – The probability of event B

## Bayes Theorem Proof

Using the Conditional Probability Formula,

P(A|B) = P(A⋂B)P(B) Where, P(B) ≠ 0

Applying the Probability Multiplication Rule,

P(A⋂B) = P(B|A)P(A) ………(1)

According to the total Probability Theorem on the event B,

P(B) = k = 1nP(An) P(B|An) …….(2)

Put the value of P(A⋂B) and  P(B) in the conditional probability formula, then we  get-

 P(A|B) = P(B|A)P(A)k = 1nP(An) P(B|An)

Where , P(An) = Priori Probability

P(B| An) = Posteriori Probability

## Bayes Theorem Derivation

The concept of conditional probability is used to derive the Bayes theorem. There are two conditional probabilities in the formula for the Bayes theorem.

According to the formula of conditional probability, The Bayes theorem can be stated as follows.

P(A|B) = P(A⋂B)/P(B) Where, P(B) ≠ 0

P(A⋂B) = P(A|B)/P(B) ………… (3)

P(B|A)= P(B⋂A)/P(A) Where, P(A) ≠ 0

P(B⋂A) = P(B|A)/P(A) ………..(4)

The Joint Probability P(A ⋂B) of both occurrences A and B being true is as follows:

P(B ⋂A) = P(A ⋂ B)

Put the value of P(B ⋂A) and P(A ⋂ B) from the equation (3) and (4) –

P(B|A)P(A) = P(A|B)P(B)

Therefore,

 P(A|B) = P(B|A)P(A)/P(B) Where P(B) 0

Also, Check: Important Questions of  Probability

## Application of Bayes Theorem

Bayesian inference, a statistical inference approach, is one of the many applications of Bayes’ theorem. It has been used in several fields, such as health, science, philosophy, engineering, sports, and law. For example, we can use Bayes’ theorem to describe medical test accuracy by taking into account the Probability of every specific person having an illness as well as the overall accuracy of the test. Bayes’ theorem uses prior probability distributions to derive posterior probabilities. Prior probability in Bayesian statistical inference refers to the likelihood of an event occurring before fresh evidence is obtained.

Also Read : Probability Distribution Formula

## Bayes Theorem Questions With Solutions

Q.1. It is estimated that 50% of all emails are spam. There is software available that detects spam mail before it arrives at the inbox. It has a 99% accuracy rate for identifying spam mail and a 5% possibility of misclassifying non-spam mail. Determine the probability that a given email is not spam.

Solution: Let E1 = Occurrence of spam mail

E2 = Occurrence of non-spam mail

A =  Occurrence of identifying a spam mail

Then, P(E1) = P(E2) = 12 = 0.5

P(A|E1) = 0.99

P(A|E2) = 0.05

By Bayes Theorem Formula,

P(E) = P(A) P(E1) + P(B) P(E2)

P(E|A) = (0.05) (0.5) /((0.99 )(0.5) + (0.05)( 0.5))

P(E|A) = 0.048 = 48%

Therefore,  the probability that a given email is not spam is 48%.

Q.2. Three urns contain white and black balls: the first urn contains three white and two black balls, the second urn has two white and three black balls, and the third urn has four white and one black ball. Without any bias, one urn is selected from that one ball, which is white. What is the probability that it originated from the third urn?

Solution : Let E1 = Occurrence that the ball is picked from the first urn

E2 =Occurrence that the ball is picked from the second urn

E3 = Occurrence that the ball is picked from the third urn

A = occurrence that the Selected ball is White.

Then, P(E1) = P(E2) = P(E3) = 13

P(A|E1) =  35

P(A|E2) =  25

P(A|E3) =  45

By Bayes Theorem Formula,

P(E3|A) = P(A|E3) P(E3)/(P(A|E1) P(E1) + P(A|E2) P(E2) + P(A|E3) P(E3))

P(E3|A) = (45)(13)/((35) (13) + (25) (13) + (45) (13))

P(E3|A) = 49

Therefore,   the probability that it originated from the third urn is 49.