**Bayes’ Theorem Introduction**

**Bayes’ Theorem** governs the likelihood that one event is based on the occurrence of some other events. It depends upon the concepts of conditional probability. This theorem gives us the probability of some events depending on some conditions related to the event.

We know that the likelihood of heart disease increases with increasing age. So, if we know someone’s age and know the chances of getting heart disease, we can easily find the possibility of the person having a heart disease.

Let us take another example. We have been given a bag of green, white and red balls. It’s been said that we have to pick a green ball only after picking a blue ball. It’s been sure that we can only pick green balls after picking a blue ball. This makes the case of conditional probability.

**The Formula of Bayes’ Theorem**

Where:

P(A) = Probability of occurrence of event A

P(B) = Probability of occurrence of event B

P(A|B) = Probability of occurrence of event A given B

P(B|A) = Probability of occurrence of event B given A

**Bayes’ Theorem Statement**

Let B_{1, }B_{2}, B_{3}, ….., B_{n} be a series of n non-empty sets with sample space as X, where all the sets have a non-zero probability of occurrence, and they form a partition of X. Let E be an event associated with X, then by Bayes’ Theorem, we get:

For all i = 1, 2, 3, ……,n

### Bayes’ Theorem Derivation

According to conditional probability, we get,

Each of these occurrences B_{1, }B_{2}, B_{3}, ….., B_{n} is called a **hypothesis.**

The probability P(B_{i}) is known as a **prior probability** of the hypothesis B_{i.}

The probability of P(B_{i}|X) is called a **posteriori probability** of the hypothesis B_{i}.

The significance of Baye’s theorem can be understood in the following ways.

The experiment can be performed in n mutually exclusive and exhaustive ways B1, B2…Bn. The probability P(Bi) of the occurrence of event Bi, i = 1, 2, ..n is known. The experiment is done, and we know that event X has occurred. With this information, the probability P(Bi) is changed to P(Bi/X). This theorem enables us to evaluate P(Bi/X) if all the P(Bi) priori probabilities and P(X/Bi) likelihood probabilities are known.

### Bayes’ Theorem Problems

**Example 1:** Consider 2 bags. Bag 1 is made full by putting three red and four blue balls. Bag 2 is made full by putting four red and six blue balls. We need to find out the value of the probability of drawing a red ball from the second bag. So, we need to find out from which bag the red ball will be drawn.

**Solution:** Let us take B_{1} be the chance of choosing Bag 1,

B_{2 }to be the probability of choosing Bag 2,

A be the probability of drawing a red ball,

We know the probability of selecting any bag is equal to [P(B_{1}) = P(B_{2})] = 1/2.

Probability of drawing a red ball from the first bag = [P(A| B_{1})] = 3/7.

Probability of drawing a red ball from the second bag = [P(A| B_{2})] = 4/10.

So, the probability of drawing a red ball from the second bag will be P(B_{2}|A).

**Example 2: **

Consider there are three machines. All the machines can produce 1000 pins at a time. The rate of producing a faulty pin from Machine 1 is 10%, from Machine 2 is 20%, and from Machine 3 is 5%. What is the probability that a produced pin will be faulty and it will be from the first machine?

**Solution: **

Let us take the probability of choosing a faulty pin randomly to be represented by P(A).

The pin chosen from the first machine is represented by M_{1.}

The pin chosen from the second machine is represented by M_{2.}

The pin chosen from the third machine is represented by M_{3.}

Then, the chance of choosing a pin from any one of the three machines = P(M_{1}) = P(M_{2}) = P(M_{3}) = 1/3.

Therefore, the probability of choosing a faulty pin from the 1st machine is

**Example 3: **

You have been given a dice and a pack of 52 cards. You have to throw a dice, and then you have to pick up a card. What is the probability that you picked up a red card and threw 6 on the dice?

**Solution:**

Let us denote the probability of throwing 6 on an unbiased dice represented by P(D).

Then, P(D) = 1/6

So, the probability of throwing another number on the dice is represented by P(E) = 5/6.

The probability of picking up a red card=and it is denoted by P(R_{1}) = 1/2.

So, the probability of not picking up a red card = 1 – ½ = ½, and it is denoted by P(R_{2}) = 1/2

So, the probability of picking up a red card after drawing a 6 on the dice is

**Example 4: **

You have been given a dice. You tell a lie 4 out of 5 times. It is reported that an odd number appears on the dice. Find out the probability that an odd number actually appears.

**Solution: **

Let the probability of speaking the truth be represented by P(T), and its value is 4/5.

So, the probability of speaking a lie is represented by P(L), and its value is 1 – 4/5 = 1/5.

Let the probability of an odd number appearing on the dice be represented by P(0), and its value is given by 3/6 or 1/2 (as there are 3 odd numbers on the dice- 1,3,5).

The probability of an even number appearing is denoted by P(E), and its value is given by 1-1/2 = 1/2.

Therefore, the probability of an odd number really appearing will be given by

= 4/5

**Example 5:** If A and B are two events such that

**Solution:**

**Example 6:** Find the condition for E and F to be independent events such that

**Solution:**

Now,

Also

**Example 7: **For a biased die, the probabilities for different faces to turn up are as follows:

Face: | 1 | 2 | 3 | 4 | 5 | 6 |

Probability: | 0.2 | 0.22 | 0.11 | 0.25 | 0.05 | 0.17 |

The die is tossed, and you are told that either face 4 or face 5 has turned up. What is the probability that it faces 4?

**Solution: **

Let A be the event that faces 4 turns up and B be the event that faces 5 turns up, then P (A) = 0.25, P (B) = 0.05.

Since A and B are mutually exclusive, P (A ∪ B) = P (A) + P (B) = 0.25 + 0.05 = 0.30.

Therefore, we have to find

**Example 7: **In a bolt factory, machines A, B and C manufacture 25%, 35% and 40% of the total bolts, respectively. Of their outputs, 5, 4 and 2 per cent are, respectively, defective bolts. A bolt is drawn at random from the product. If the bolt drawn is found to be defective, what is the probability that it is manufactured by machine B?

**Solution:**

Let B1 be the event that the bolt is manufactured by machine A.

B2 be the event that the bolt is manufactured by machine B.

B3 be the event that the bolt is manufactured by machine C.

X be the event that the bolt is defective.

P(B1) = 25/100

P(B2) = 35/100

P(B3) = 40/100

P(X/B1) = Probability that the bolt drawn is defective so that it is manufactured by machine A = 5/100

P(X/B2) = Probability that the bolt drawn is defective so that it is manufactured by machine B = 4/100

P(X/B3) = Probability that the bolt drawn is defective so that it is manufactured by machine C = 2/100

Therefore, the probability that the bolt is manufactured by machine B, given that the bolt drawn is defective = P(B2/X).

= P(B2) P(X/B2) ÷ [P(B1)P(X/B1) +P(B2)P(X/B2)+P(B3)P(X/B3)]

= (35/100)(4/100) ÷ [(25/100)(5/100)+(35/100)(4/100)+(40/100)(2/100)]

= 140/(125+140+80) = 140/345 = 28/69

Hence, the required probability is 28/69.

**Example 8: **Bag A contains 3 red and 4 black balls, and bag B contains 4 red and 5 black balls. One ball is transferred from bag A to bag B, and then a ball is drawn from bag B. The ball so drawn is found to be red in colour. Find the probability that the transferred ball is black.

**Solution:**

Let E1 be the event that the ball transferred from bag A to B is red, E2 be the event that the ball transferred from bag A to B is black, and A be the event that the ball drawn from bag B is red.

P(E1) = 3/7

P(E2) = 4/7

P(A/E1) = 5/10 = ½

P(A/E2) = 4/10 = ⅖

So, the probability that the transferred ball is black = P(E2/A)

= P(E2) P(A/E2) ÷ [ P(E1) P(A/E1)+P(E2) P(A/E2)

= (4/7) ( 2/5) ÷ [(3/7)(½)+(4/7)(⅖) = 16/31

Hence, the required probability is 16/31.

## Also, Read:

Mutually exclusive events in probability

## Video Lessons

## Conditional Probability

## Probability – Important Questions

## Frequently Asked Questions

### Give the formula for Bayes’ theorem.

The formula for Bayes’ theorem is given by P(A|B) = P(A). P(B|A)/P(B).

Here, P(A|B) = Probability of occurrence of event A given B.

### What is the difference between Bayes’ theorem and conditional probability?

In Bayes’ theorem, two conditional probabilities for the events, say, A and B, are included.

We can say that conditional probability is the probability of occurrence of a certain event, say A, based on some other event, whether B is true or not.

### Give an application of Bayes’ theorem.

Bayes’ theorem is used in Bayesian inference.

### Give the formula for conditional probability.

The formula for conditional probability is P(A|B) = P(A⋂B)/P(B).

## Comments