Careers360 Logo
Total Probability Theorem and Bayes' Theorem

Total Probability Theorem and Bayes' Theorem

Edited By Komal Miglani | Updated on Sep 10, 2024 02:24 PM IST

Probability is a part of mathematics that deals with the likelihood of different outcomes occurring. It plays an important role in estimating the outcome or predicting the chances of that event. It is useful in real-life applications that solve complex problems and provide insightful insights. Two fundamental concepts under Probability are the Total probability Theorem and Bayes' theorem. This theorem helps us to find out the likelihood of events under certain conditions.

Theorem of Total Probability

$
\begin{aligned}
&\text { Suppose } A_1, A_2, \ldots, A_n \text { are } n \text { mutually exclusive and exhaustive set of events and suppose that each of the events } A_1, A_2, \ldots, A_n \text { has a nonzero probability of occurrence. Let } A \text { be any event associated with } S \text {, then }\\
&P(A)=P\left(A_1\right) P\left(A \mid A_1\right)+P\left(A_2\right) P\left(A \mid A_2\right)+\ldots+P\left(A_n\right) P\left(A \mid A_n\right)
\end{aligned}
$

As from the image, $A_1, A_2, \ldots, A_n$ are $n$ mutually exclusive and exhaustive set of events
Therefore,

$
S=A_1 \cup A_2 \cup \ldots \cup A_n
$

And

$
A i \cap A j=\varphi, i \neq j, i, j=1,2, \ldots, n
$

Now, for any event A

$
\begin{aligned}
A & =A \cap S \\
& =A \cap\left(A_1 \cup A_2 \cup \ldots \cup A_n\right) \\
& =\left(A \cap A_1\right) \cup\left(A \cap A_2\right) \cup \ldots \cup\left(A \cap A_n\right)
\end{aligned}
$

Also $A \cap A i$ and $A \cap A j$ are respectively the subsets of $A i$ and $A j$
Since, $A i$ and $A j$ are disjoint, for $i \neq \ldots$, therefore, $A \cap A i$ and $A \cap A j$ are also disjoint for all $i \neq j, i, j=1,2, \ldots, n$.
Thus,

$
\begin{aligned}
P(A) & =P\left[\left(A \cap A_1\right) \cup\left(A \cap A_2\right) \cup \ldots . . \cup\left(A \cap A_n\right)\right] \\
& =P\left(A \cap A_1\right)+P\left(A \cap A_2\right)+\ldots+P\left(A \cap A_n\right)
\end{aligned}
$

Using multiplication rule of probability

$
P(A \cap A i)=P(A i) P(A \mid A i) \text { as } P(A i) \neq 0 \forall i=1,2, \ldots, n
$

Therefore, $\quad$

$
P(A)=P\left(A_1\right) P\left(A \mid A_1\right)+P\left(A_2\right) P\left(A \mid A_2\right)+\ldots+P\left(A_n\right) P\left(A \mid A_n\right)
$

or

$
\mathrm{P}(\mathrm{A})=\sum_{i=1}^n \mathrm{P}\left(\mathrm{A}_i\right) \mathrm{P}\left(\mathrm{A} \mid \mathrm{A}_i\right)
$

De'morgans Laws
If $A$ and $B$ are any two sets then

$
\begin{aligned}
& \Rightarrow(A \cup B)^{\prime}=A^{\prime} \cap B^{\prime} \\
& \Rightarrow(A \cap B)^{\prime}=A^{\prime} \cup B^{\prime} \\
& \Rightarrow P\left(A_1 \cap A_2 \cap A_3 \cdots \cap A_n\right)=P\left(A_1\right) P\left(\frac{A_2}{A_1}\right) P\left(\frac{A_3}{A_1 A_2}\right) \cdots P\left(\frac{A_n}{A_1 A_2 A_3 \cdots A_{n-1}}\right){, \text {where } \mathrm{A}_1, \mathrm{~A}_2 \ldots \mathrm{A} n \text { are } \mathrm{n} \text { events }}
\end{aligned}
$

Bayes’ Theorem

Suppose $\underline{A_1}, \underline{A_2}, \ldots, A_n$ are $n$ mutually exclusive and exhaustive set of events. Then the conditional probability that $\underline{A_i}$, happens (given that event $A$ has happened) is given by

$
\begin{aligned}
& \mathrm{P}\left(\mathrm{A}_i \mid \mathrm{A}\right)=\frac{\mathrm{P}\left(\mathrm{A}_{\mathrm{i}} \cap \mathrm{A}\right)}{\mathrm{P}(\mathrm{A})}=\frac{\mathrm{P}\left(\mathrm{A}_i\right) \mathrm{P}\left(\mathrm{A} \mid \mathrm{A}_i\right)}{\sum_{j=1}^n \mathrm{P}\left(\mathrm{A}_j\right) \mathrm{P}\left(\mathrm{A} \mid \mathrm{A}_j\right)} \\
& \text { for any } i=1,2,3, \ldots, n
\end{aligned}
$

Solved Examples Based on Bayes' theorem and Theorem of Total Probability:

Example 1: Out of three bags that each contains 10 marbles:
- Bag 1 has 6 red and 4 blue marbles
- Bag 2 has 5 red and 5 blue marbles.
- Bag 3 has 2 red and 8 blue marbles.

What is the Probability of choosing a red marble?
1) $\frac{11}{30}$
2) $\frac{13}{30}$
3) $\frac{17}{30}$
4) $\frac{7}{30}$

Solution
The law of Total Probability -
Let $S$ be the sample space and $E_1, E_2, \ldots . . E_n$ be $n$ mutually exclusive and exhaustive events associated with a random experiment.
- wherein

$
\Rightarrow P(A)=P\left(A \cap E_1\right)+P\left(A \cap E_2\right)+\cdots+P\left(A \cap E_n\right)
$

$
\Rightarrow P(A)=P\left(E_1\right) \cdot P\left(\frac{A}{E_1}\right)+P\left(E_2\right) \cdot P\left(\frac{A}{E_2}\right)+\cdots P\left(E_n\right) \cdot P\left(\frac{A}{E_n}\right)
$

where $A$ is any event which occurs with $E_1, E_2, E_3 \ldots \ldots E_n$.

$
\begin{aligned}
& P\left(\frac{R}{B_1}\right)=0.6 ; P\left(\frac{R}{B_2}\right)=0.2 \\
& \text { Thus } P(R)=\frac{1}{3}(0.6)+\frac{1}{3}(0.5)+\frac{1}{3}(0.2) \\
& =\frac{1.3}{3} \\
& =\frac{13}{30}
\end{aligned}
$
Hence, the answer is option 2.

Example 2: In a box, there are 20 cards, out of which 10 are labeled as A and the remaining 10 are labeled as B. Cards are drawn at random, one after the other, and with replacement, till a second A-card is obtained. The probability that the second A-card appears before the third B-card is:

1) $\frac{15}{16}$
2) $\frac{9}{16}$
3) $\frac{13}{16}$
4) $\frac{11}{16}$

Solution
$A A+A B A+B A A+A B B A+B B A A+B A B A$
$\frac{1}{4}+\frac{1}{8}+\frac{1}{8}+\frac{1}{16}+\frac{1}{16}+\frac{1}{16}=\frac{11}{16}$
Hence, the answer is the option 4.

Example 3: In a game two players, A and B take turns in throwing a pair of fair dice starting with player $A$ and a total of scores on the two dice, in each throw is noted $A$ he throws a total 7 before $A$ throws a total six. The game stops as soon as either of the players wins. The probability of $A$ winning the game is:
1) $\frac{5}{31}$
2) $\frac{31}{61}$
3) $\frac{5}{6}$
4) $\frac{30}{61}$

Solution
$
\begin{aligned}
& P(\text { Sum } 6)=\frac{5}{36} \\
& (1,5),(5,1),(2,4),(4,2),(3,3) \\
& P(\text { Sum } 7)=\frac{6}{36}=\frac{1}{6} \\
& (1,6),(6,1),(2,5),(5,2),(3,4),(4,3)
\end{aligned}
$
If A represents total of 6 for $A, A^{\prime}$ represents total which is other than 6, B represents total of 7 for $B$, and $B$ ' represents when it is not 7

$
\begin{aligned}
& \text { A wins when } A, A^{\prime} B^{\prime} A, A^{\prime} B^{\prime} A^{\prime} B^{\prime} A, \ldots \ldots \\
& \therefore P(\text { A wins })=\frac{5}{36}+\frac{31}{36} \times \frac{5}{6} \times \frac{5}{36}+\frac{31}{36} \times \frac{5}{6} \times \frac{31}{36} \times \frac{5}{6} \times \frac{5}{36}+\ldots \\
& =\frac{\frac{5}{36}}{1-\frac{31}{36} \times \frac{5}{6}}=\frac{30}{61}
\end{aligned}
$

Example 4: In a group of 400 people, 160 are smokers and non-vegetarians; 100 are smokers and vegetarians and the remaining 140 are non-smokers and vegetarians. Their chances of getting a particular chest disorder are 35%, 20% and 10% respectively. A person is chosen from the group at random and is found to be suffering from a chest disorder. The probability that the selected person is a smoker and non-vegetarian is :

1) $\frac{7}{45}$
2) $\frac{14}{45}$
3) $\frac{28}{45}$
4) $\frac{8}{45}$

Solution
Consider following events
A: The person chosen is a smoker and non-vegetarian.
B: The person chosen is a smoker and vegetarian.
C: The person chosen is a non-smoker and vegetarian.
E: The person chosen has a chest disorder.
Given

$
\begin{aligned}
& \mathrm{P}(\mathrm{A})=\frac{160}{400}, \mathrm{P}(\mathrm{B})=\frac{100}{400}, \mathrm{P}(\mathrm{C})=\frac{140}{400} \\
& \mathrm{P}\left(\frac{\mathrm{E}}{\mathrm{A}}\right)=\frac{35}{100}, \mathrm{P}\left(\frac{\mathrm{E}}{\mathrm{B}}\right)=\frac{20}{100}, \mathrm{P}\left(\frac{\mathrm{E}}{\mathrm{C}}\right)=\frac{10}{100}
\end{aligned}
$

We need to find the probability that the selected person is a smoker and non-vegetarian, that is

$
\begin{aligned}
& P\left(\frac{A}{E}\right)=\frac{P(A) P\left(\frac{E}{A}\right)}{P(A) \cdot P\left(\frac{E}{A}\right)+P(B) \cdot P\left(\frac{E}{B}\right)+P(C) \cdot P\left(\frac{E}{C}\right)} \\
& P\left(\frac{A}{E}\right)=\frac{\frac{160}{400} \times \frac{35}{100}}{\frac{160}{400} \times \frac{35}{100}+\frac{100}{400} \times \frac{20}{100}+\frac{140}{400} \times \frac{10}{100}}=\frac{28}{45}
\end{aligned}
$
Hence, the answer is the option 3.

Example 5: If A and B are any two events such that $\mathrm{P}(\mathrm{A})=2 / 5$ and $P(A \cap B)=3 / 20$ then the conditional probability, $P\left(A /\left(A^{\prime} \cup B^{\prime}\right)\right)$, where $A^{\prime}$ denotes the complement of A , is equal to :
1) $1 / 4$
2) $5 / 17$
3) $8 / 17$
4) $11 / 20$

Solution
Given:

$
P(A)=\frac{2}{5}, P(A \cap B)=\frac{3}{20}
$
Now,

$
P\left(\frac{A}{A^{\prime} \cup B^{\prime}}\right)=\frac{P\left(A \cap\left(A^{\prime} \cup B^{\prime}\right)\right)}{P\left(A^{\prime} \cup B^{\prime}\right)}
$
Here,

$
P\left(A^{\prime} \cup B^{\prime}\right)=P(A \cap B)^{\prime}=1-P(A \cap B)=1-\frac{3}{20}=\frac{17}{20}
$

(Using De-Morgan's Law)

$
\begin{aligned}
& \text { And } P\left(A \cap\left(A^{\prime} \cup B^{\prime}\right)\right)=P\left(\left(A \cap A^{\prime}\right) \cup\left(A \cap B^{\prime}\right)\right)=P\left(A \cap B^{\prime}\right)=P(A)-P(A \cap B) \\
& =\frac{2}{5}-\frac{3}{20}=\frac{5}{20} \\
& P\left(\frac{A}{A^{\prime} \cup B^{\prime}}\right)=\frac{\frac{5}{20}}{\frac{17}{20}}=\frac{5}{17}
\end{aligned}
$
Hence, the answer is the option 2.

Summary
By understanding Bayes' Theorem and Theorem of Total Probability is a fundamental concept. These terms help to solve complex problems in mathematics. These methods are widely used in real-life applications providing insights and solutions to complex problems. Mastery of these concepts can help in solving gaining deeper insights and contributing meaningfully to real-life problems.

Frequently Asked Questions (FAQs)

1. What is Probability?

Probability is defined as the ratio of the number of favorable outcomes to the total number of outcomes.

2. Give the De'morgans law.

If $A$ and $B$ are any two sets then

$
\begin{aligned}
& \Rightarrow(A \cup B)^{\prime}=A^{\prime} \cap B^{\prime} \\
& \Rightarrow(A \cap B)^{\prime}=A^{\prime} \cup B^{\prime} \\
& \Rightarrow P\left(A_1 \cap A_2 \cap A_3 \cdots \cap A_n\right)=P\left(A_1\right) P\left(\frac{A_2}{A_1}\right) P\left(\frac{A_3}{A_1 A_2}\right) \cdots P\left(\frac{A_n}{A_1 A_2 A_3 \cdots A_{n-1}}\right){, \text {where } \mathrm{A}_1, \mathrm{~A}_2 \ldots \mathrm{A} n \text { are } \mathrm{n} \text { events }}
\end{aligned}
$

3. Give the Bayes Theorem.

Suppose $\underline{A_1}, \underline{A_2}, \ldots, A_n$ are $n$ mutually exclusive and exhaustive set of events. Then the conditional probability that $\underline{A_i}$, happens (given that event $A$ has happened) is given by

$
\begin{aligned}
& \mathrm{P}\left(\mathrm{A}_i \mid \mathrm{A}\right)=\frac{\mathrm{P}\left(\mathrm{A}_{\mathrm{i}} \cap \mathrm{A}\right)}{\mathrm{P}(\mathrm{A})}=\frac{\mathrm{P}\left(\mathrm{A}_i\right) \mathrm{P}\left(\mathrm{A} \mid \mathrm{A}_i\right)}{\sum_{j=1}^n \mathrm{P}\left(\mathrm{A}_j\right) \mathrm{P}\left(\mathrm{A} \mid \mathrm{A}_j\right)} \\
& \text { for any } i=1,2,3, \ldots, n
\end{aligned}
$

Articles

Back to top