Bayes Theorem
Bayes' Theorem is one of the fundamental concepts in probability theory, named after the English statistician Thomas Bayes. It provides a powerful method for calculating conditional probabilities, which are the likelihoods of events based on prior knowledge or evidence. This theorem is particularly useful when new information becomes available, allowing us to update our predictions or beliefs accordingly.
In simple terms, Bayes' Theorem allows us to revise our initial assumptions about the probability of an event as new data is introduced. It connects prior probability, the likelihood of current evidence, and the overall probability of the observed data to give a more accurate estimation of the event in question.
1.0What is Bayes' Theorem?
Let E1, E2, …, En represent mutually exclusive and collectively exhaustive events in a random experiment, and let E be any event that occurs with some Ei. Then,
P\left(E_i\midE\right)=\frac{P\left(E\midE_i\right) \cdot P\left(E_i\right)}{\sum_{i=1}^n P\left(E \mid E_i\right) \cdot P\left(E_i\right)} ; \quad i=1,2,3, \ldots, n
Proof:
By the theorem of total probability, we have
…. (1)
[by multiplication theorem]
\begin{aligned}&=\frac{P\left(E\midE_i\right)\cdotP\left(E_i\right)}{\sum_{i=1}^n P\left(E \mid E_i\right) \cdot P\left(E_i\right)}\\&\text { [using (i)] }\end{aligned}
Hence,
P\left(E_i\midE\right)=\frac{P\left(E\midE_i\right)\cdot P\left(E_i\right)}{\sum_{i=1}^n P\left(E \mid E_i\right) \cdot P\left(E_i\right)}
Bayes' Theorem describes the probability of an event based on prior knowledge of conditions related to the event. It combines prior probability with the likelihood of new evidence to produce a revised probability.
2.0Bayes' Theorem Formula:
P\left(E_i\midE\right)=\frac{P\left(E\midE_i\right)\cdot P\left(E_i\right)}{\sum_{i=1}^n P\left(E \mid E_i\right) \cdot P\left(E_i\right)} Or P\left(E_i \mid E\right)=\frac{P\left(E \mid E_i\right) \cdot P\left(E_i\right)}{P(E)}
where:
- P(Ei |E) is the posterior probability (the probability of event Ei given that E is true).
- P(E | Ei) is the likelihood (the probability of event E given that Ei is true).
- P(Ei) is the prior probability (the initial probability of event Ei).
- P(E) is the marginal likelihood (the total probability of event E).
3.0Solved Examples of Bayes Theorem
Example 1: A factory operates three machines—X, Y, and Z—which produce 1000, 2000, and 3000 bolts daily, respectively. Machine X produces defective bolts at a rate of 1%, Y at 1.5%, and Z at 2%. At the end of the day, if a randomly selected bolt is found to be defective, what is the probability that it was produced by one of these machines?
Solution:
Total number of bolts produced in a day.
= (1000 + 2000 + 3000) = 6000.
Let E1, E2, and E3 be the events of drawing a bolt produced by machines X, Y, and Z respectively. Then,
Let E be the event of drawing a defective bolt. Then,
P(E |E1) = probability of drawing a defective bolt, given that it is produced by machine X.
P(E |E2) = probability of drawing a defective bolt, given that it is produced by the machine Y
P(E |E3) = probability of drawing a defective bolt, given that it is produced by the machine Z
Required Probability
= P(E1 |E)
= probability that the bolt drawn is produced by X, given that it is defective
=\frac{P\left(E_i\right) \cdot P\left(E \mid E_i\right)}{P\left(E_1\right) \cdotP\left(E\midE_1\right)+P\left(E_2\right)\cdotP\left(E\midE_2\right)+P\left(E_3\right) \cdot P\left(E \mid E_3\right)}
Hence, the required probability is 0.1.
Example 2: Bag A contains 2 white balls and 3 red balls, while bag B contains 4 white balls and 5 red balls. A ball is randomly drawn from one of the bags, and it turns out to be red. What is the probability that this red ball was drawn from bag B?
Solution:
Let
E1 = The event of ball being drawn from bag A
E2 = The event of the ball being drawn from bag B.
E = The event of the ball being red.
Since, both the bags are equally likely to be selected, therefore
∴ Required probability
Hence, the required probability is .
Example 3:
9 balls are transferred from A to B & then 9 balls are transferred from B to A then find the probability that the red ball is still in Bag A.
Solution:
n(F): red ball in Bag A.
Initially transferred from A to B: 1R + 8G or 9G
Now, number of balls in bag B: 1R + 18G or Zero R + 19G
Later: Balls transferred from B to A: 1R + 8G or 9G
...(1)
or
...(2)
Equation (1) + (2)
Example 4: There are 3 boxes containing respectively 1 white, 2 red and 3 black balls, 2 white, 3 red and 1 black balls, 3 white, 1 red and 2 black balls. One box is chosen at random, and then two balls are drawn at random from the selected box. The two balls are one red and one white. Find the probability that these came from the first box.
Solution:
If let E1, E2 and E3 be the events of the boxes containing balls in Box I, Box II and Box III respectively then,
,
,
Let E be the event that two balls picked are one red and one white.
Required probability = P(E1|E)
P(E1|E) = Probability that balls are one red and one white, and it is picked from Box I.
Hence the required probability is 0.1.
4.0Practice Questions Based on Bayes Theorem
- A car manufacturing company operates two plants, X and Y. Plant X produces 70% of the cars, while Plant Y produces 30%. Out of the cars manufactured, 80% at Plant X and 90% at Plant Y are rated as standard quality. If a car is selected at random and found to be of standard quality, what is the probability that it was produced by Plant X?
- Bag I contains 3 red balls and 5 black balls, while Bag II contains 4 red balls and 6 black balls. A ball is randomly selected from one of the bags and is found to be red. What is the probability that this red ball was drawn from Bag II?
- Consider three identical boxes—Box I, Box II, and Box III—each containing two coins. Box I contains two gold coins, Box II contains two silver coins, and Box III contains one gold coin and one silver coin. A person randomly selects a box and draws a coin, which turns out to be gold. What is the probability that the other coin in the same box is also gold?
5.0Sample Question on Bayes Theorem
1. What is the formula for Bayes' Theorem?
Ans: The formula is:
Table of Contents
- 1.0What is Bayes' Theorem?
- 2.0Bayes' Theorem Formula:
- 3.0Solved Examples of Bayes Theorem
- 4.0Practice Questions Based on Bayes Theorem
- 5.0Sample Question on Bayes Theorem
Frequently Asked Questions
Bayes' Theorem is a mathematical formula used to determine the probability of a hypothesis based on prior knowledge and new evidence. It allows for updating probabilities when additional information becomes available.
Prior probability (P(A)) represents the initial probability of an event before considering new evidence. Posterior probability (P(A|B)) is the updated probability after accounting for new data or evidence.
Bayes' Theorem provides a method to reverse conditional probabilities. It helps compute the probability of one event given another by using the known likelihood of the second event and the prior probability of the first event.
Yes, Bayes' Theorem can be extended to multiple events using the Law of Total Probability. This allows the calculation of probabilities when the outcome depends on several mutually exclusive and exhaustive events.
The likelihood P(B|A) represents how probable it is to observe evidence B, assuming that hypothesis A is true. It is a key factor in updating the prior probability to calculate the posterior probability.
Join ALLEN!
(Session 2025 - 26)