100% found this document useful (1 vote)
650 views5 pages

Law of Total Probability and Bayes' Theorem Examples

This document provides 7 examples demonstrating how to use the law of total probability and Bayes' theorem to calculate probabilities. The examples involve calculating the probability of selecting items like dead light bulbs, girls in class groups, and defective bolts from various populations where the items are distributed across different groups. In each case, the total probability rule or Bayes' theorem is applied to calculate the overall probability by considering the probabilities within each individual group.

Uploaded by

zainab alshatter
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
650 views5 pages

Law of Total Probability and Bayes' Theorem Examples

This document provides 7 examples demonstrating how to use the law of total probability and Bayes' theorem to calculate probabilities. The examples involve calculating the probability of selecting items like dead light bulbs, girls in class groups, and defective bolts from various populations where the items are distributed across different groups. In each case, the total probability rule or Bayes' theorem is applied to calculate the overall probability by considering the probabilities within each individual group.

Uploaded by

zainab alshatter
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Law of Total Probability and Bayes’ Theorem Examples

Example 1
A different number of light bulbs are present in three boxes. The first box has 12 bulbs, out of which 5
are dead. The second box has eight bulbs, out of which the dead ones are 3. The third box has nine
bulbs, out of which two are dead. Find the probability of selecting a dead bulb randomly from one of the
three boxes.

Solution
Total number of boxes = 3
The number of boxes from which the bulbs will be chosen = 1
D = {Selecting a dead light bulb}
B1 = {Selecting a light bulb from box 1}
B2 = {Selecting a light bulb from box 2}
B3 = {Selecting a light bulb from box 3}
P{B1} = P{B2} = P{B3} =1/3

Total number of bulbs in the first box = 12


Number of dead bulbs = 5
Therefore P(D|B1) = 5/12

Total number of bulbs in the second box = 8


Number of dead bulbs = 3
Therefore P(D|B2) =3/8

Total number of bulbs in the third box = 9


Number of dead bulbs = 2
Therefore P(D|B3) = 2/9

Using Law of total Probability: P(D) = P(D|B1)P(B1) + P(D|B2)P(B2) + P(D|B3)P(B3)


P(D) = (5/12)(1/3) + (3/8)(1/3) + (2/9)(1/3) = 73/216
 
Example 2
There are three groups in the class. Each group contains a different number of students. The first group
has 15 students, out of which 8 are girls. The second group has 9 students, out of which the girls are 4.
The third group has 12 students, out of which 7 are girls. Find the probability of selecting a girl randomly
from one of the three groups.
Solution
G ={A girl is selected}
GR1 = {selecting a girl from group 1}
GR2 = {selecting a girl from group 2}
GR3 = { selecting a girl from group 3}
P{GR1}=p{GR2}=p{GR3}=1/3

Total number of students in the first group = 15


Number of girls = 8
P(G|GR1} = 8/15
Total number of students in the second group = 9
Number of girls in that group = 4
P(G|GR2} = 4/9

Total number of students in the third group = 12


Number of girls in the third group = 7
P P(G|GR3} = 7/12

The probability of choosing the girl from one of the three groups will be calculated using the total
probability rule.
P(G) = P(G|GR1)P(G1) + P(G|GR2)P(GR2) + P(D|G3)P(GR3)
P(G) = (8/15)(1/3)+(4/9)(1/3)+(7/12)(1/3) = 281/540

Example 3
There are four bags. Each bag has 50 balls in it. There are 30 blue balls in the first bag, 45 blue balls in
the second bag, 35 blue balls in the third bag, and 15 blue balls in the fourth bag. Find the probability of
selecting a blue ball from one of the four bags at random.
Solution
Total number of bags = 4
B1 = {Selecting a ball from bag 1}
B2 = {Selecting a ball from bag 2}
B3 = {Selecting a ball from bag 3}
B4 = {Selecting a ball from bag 3}
B = {Selecting a blue ball}

P(B1)= P(B2) = P(B3) =P(B4) = ¼

Total number of balls in the first bag = 50


Number of blue balls = 30
P(B|B1) = 30/50 = 3/5

Total number of balls in the second bag = 50


Number of blue balls in the second bag = 45
P(B|B2) = 45/50 = 9/10

Total number of balls in the third bag = 50


Number of blue balls in the third bag = 35
P(B|B3) = 35/50 = 7/10

Total number of balls in the fourth bag = 50


Number of blue balls in the fourth bag = 15
P(B|B4) = 15/50 = 3/10

P (blue ball) = P(B|B1)P(B1) + P(B|B2)P(B2) + P(B|B3)P(B3) + P(B|B4)P(B4) =


= (3/5)(1/4) +(9/10)(1/4) + (7/10)(1/4) + (3/10)(1/4) = 5/8
Example 4
Alice wants to go on the trip. The probabilities of going on the trip on a certain day with or without her
friend are 0.90 and 0.15 respectively. If the probability that her friend is going on the trip is 0.65, then
determine the probability that Alice will go on the trip?
Solution
A = {Alice will go on the trip}
B = {Friend is going}
P(B) = 0.65
P(friend not going) = P(B′) = 1 − P(B) = 1 − 0.65 = 0.35
The conditional probabilities of these events will be:
P(A|B) = 0.90
P(A|B') = 0.15
Because the events B and B' form the partitions of the sample space, S, hence, by the total probability
theorem, we will calculate the probability like this:
P(A) = P(B) P(A|B) + P(B′) P(A|B′)
= 0.65 x 0.90 + 0.35 x 0.15 =0.585 + 0.0525 = 0.6375
Hence, the probability that Alice will go and her friend is also going on the trip is 0.6375 or 63.75%.

Example 5
Three identical boxes contain red and white balls. The first box contains 3 red and 2 white balls, the
second box has 4 red and 5 white balls, and the third box has 2 red and 4 white balls. A box is chosen at
random and a ball is drawn from it. If the ball that is drawn out is red, what will be the probability that
the second box is chosen?
Let
A₁ = {Choosing the ball from the first box}
A₂= {Choosing the ball from the second box}
A₃ = {Choosing the ball from the third box}
R = {Drawing a Red ball}

P(A₁) = P(A₂) = P(A₃) = 1/3


P(R|A₁) = 3/5
P(R|A₂) = 4/9         
P(X|A₃) = 1/3

Using Bayes’ theorem, we get:

P(A₂|R)=
4 1
( )( )
P( R∨ A ₂)P( A ₂) 9 3
= =¿10/31
P ( R∨ A ₁)P( A ₁)+ P( R∨ A ₂)P( A ₂)+ P( R∨A ₃)P (A ₃) ( 3 )( 1 ) .+( 4 )( 1 ) .+( 1 )( 1 )
5 3 9 3 3 3

Example 6
Two urns contain respectively 2 red, 3 white, and 3 red, 5 white balls. One ball is drawn at random from
the first urn and transferred into the second one. A ball is then drawn from the second urn and it turns
out that the ball is red. What will be the probability that the transferred ball was white? 

Let
WT = {White ball transferred from the first urn to the second}
RT = {Red ball transferred from the first urn to the second}
P(WT) = 3/5
P(RT) = 2/5
R = {Red ball drawn the second urn after the occurrence of A₁ or A₂}

P(R|WT) = 3/9
P(R|RT) = 4/9 

Using the Bayes' theorem formula we get, 

3 3
( )( )
P(R∨WT ) P(WT ) 9 5
P(WT|R) = = =¿ 9/17
P ( R∨WT )P(WT )+ P( R∨RT ) P( RT ) ( 3 )( 3 ) .+( 4 )( 2 )
9 5 9 5

Example 7
In a bolt factory, three machines M₁, M₂, and M₃ manufacture 2000, 2500, and 4000 bolts every day. Of
their output 3%, 4%, and 2.5% are defective bolts. One of the bolts is drawn very randomly from a day’s
production and is found to be defective. What is the probability that it was produced by machine M₂?

M₁ = {The randomly drawn bolt from a day’s production was manufactured by machines M₁}
M₂ = {The randomly drawn bolt from a day’s production was manufactured by machines M2}
M₃ = {The randomly drawn bolt from a day’s production was manufactured by machines M3}
D = {The drawn bolt is defective}

Need to solve for P(M₂|D)

P(M₁) = 2000/(2000+2500+4000) = 2000/8500 = 4/17


P(M₂) = 2500/(2000+2500+4000) = 2500/8500 = 5/17
P(M₃) = 4000/(2000+2500+4000) = 4000/8500 = 8/17
P(D|M₁) = 3/100
P(D|M₂) = 4/100
P(D|M₃) = 2.5/100

P(M₂|D)=
4 5
( )( )
P(D∨M ₂) P(M ₂) 100 17
= =¿
P ( D∨M ₁) P(M ₁)+ P(D∨M ₂) P(M ₂)+ P(D∨M ₃) P( M ₃) 3 4 4 5 2.5 8
( )( ).+( )( ).+( )( )
100 17 100 17 100 17
5/13
Problems are found from following sites:
https://www.vedantu.com/formula/bayes-theorem-formula
https://www.superprof.co.uk/resources/academic/maths/probability/normal-distribution/law-of-total-probability.html

You might also like