Elementary Probability Theory
Elementary Probability Theory
MAT 222
TOPIC 3
Key terms
• Probability
• Conditional probability
• Bayes rule
Page 1 of 14
[email protected]
3.2 Basic probability terms
Example
In throwing a coin, sample space is the set S={H,T} where H means head and T means tail.
In throwing a die sample space is the set S={1,2,3,4,5,6}
Example
A family has three children. Write the sample space.
Solution
We may be helped by the tree diagram:
The sample space consists of eight possibilities. {BBB, BBG, BGB, BGG, GBB, GBG, GGB,
GGG}. The possibility BGB, for example, indicates that the first born is a boy, the second born
a girl, and the third a boy.
Page 2 of 14
[email protected]
Example
Two dice are rolled. Write the sample space.
Solution
We assume one of the dice is red, and the other green. We have the following 36 possibilities.
S=
The entry (2, 5), for example, indicates that the red die shows a two, and the green a 5.
n( E )
Probability: P ( E )
n( S )
Activity3.1
A coin and a die are thrown, write the sample space.
Suppose P(A) is the probability of some event defined by A. P(A) is always in the interval
[0, 1] i.e 0 ≤ 𝑃(𝐴) ≤ 1. Now P(A) = 1 means the event occurs with certainty and P(A) = 0
means that it will certainly not occur. The probability of all events put together must add up to
1, so long as we don’t double-count by including events that overlap. For example, consider a
sample space of an experiment of throwing a coin, . Now p(H)+p(T)=1. The complement of
event A also known as not event A is denoted by ~A (or in other books A/ ). This is the
probability that A will not occur. P(~A) = 1 – P(A), and P(A) + P(~A) = 1.
Page 3 of 14
[email protected]
Activity 3.2
The metrological department says that probability that it will rain in central region
today is 0.8. What do you think is the probability that it will not rain today?
Page 4 of 14
[email protected]
If the two events A and B are mutually exclusive, in the equation
P(A U B) = P(A) + P(B) – P(A ∩ B) meaning they cannot happen at the same time, then the
formula simplifies to P(A U B) = P(A) + P(B).
Note that if event A and B are mutually exclusive their intersection is 0, i.e A ∩ B=0,
see below
Example
In a class there are 210 students, 60 take Mathematics and Statistics, 40 take Mathematics only,
and 50 take Statistics only, 60 take neither Mathematics nor Statistics. Find
Page 5 of 14
[email protected]
Solution
Sketch of events:
(a) Let the event of picking mathematics student be M and that of picking statistics student
be S, then probability of picking Mathematics or statistics student is denoted as p(M or S)
sometimes p(M U S) which is defined as
𝑝( 𝑀 ∪ 𝑆 ) = 𝑝 ( 𝑀 ) + 𝑝( 𝑆 ) − 𝑝( 𝑀 ∩ 𝑆 )
100 110 60
= + −
210 210 210
5
=
7
(b) Let event of neither M nor S be N, we need p(M or N) also denoted as p(M U N) defined
as p(M U N)=p(M)+p(N)-p(M and N)
=p(M)+p(N), because event M and N is impossible
100 60
= 210 + 210
16
=
21
Page 6 of 14
[email protected]
Activity 3.3
Let E1 be an event a cow gives birth to male cow and E2 be an event a cow gives birth
to a female cow, how can we find 𝑝(𝐸1 ∪ 𝐸2)
𝑃(𝐵 ∩ 𝐴)
𝑃 (𝐵 |𝐴 ) =
𝑃 (𝐴 )
Example
Find probability of picking a mathematics pupil given that he also take statistics
Solution
𝑃 (𝑀 ∩ 𝑆 ) 60 110
𝑃 (𝑀|𝑆) = = ÷
𝑃 (𝑆 ) 210 210
6
=
11
Page 7 of 14
[email protected]
Example
The following table shows the distribution by gender of students at DCE Campus who use public
transport and the ones who drive to school.
The events M, F, P, and D are self explanatory. Find the following probabilities.
a. P(D | M) b. P(F | D) c. P(M | P)
Solution
𝑃(𝐸∩𝐹)
We use the conditional probability formula 𝑃(𝐸 |𝐹 ) = 𝑃(𝐹)
𝑃(𝐷∩𝑀) 39 47
a. 𝑃 (𝐷|𝑀) = = 100 ÷ 100
𝑃(𝑀)
39
= 47
𝑃(𝐹∩𝐷) 40 79
b. P(F | D) = = 100 ÷ 100
𝑃(𝐷)
40
= 79 .
𝑃(𝑀∩𝑃) 8 21
c. P(M | P) = = 100 ÷ 100
𝑃(𝑃)
8
= 21 .
Page 8 of 14
[email protected]
Multiplication Rule
Events are called independent if the occurrence of one does not affect the probability of the other.
That is, P(A|B) = P(A).
𝑃(𝐴∩𝐵)
So P(A | B) = = 𝑃(𝐴)
𝑃(𝐵)
𝐵𝑢𝑡 𝑃(𝐴 ∩ 𝐵) = 𝑃(𝐴) ⋅ 𝑃(𝐵)
∴ P(A | B) = P(A) for independent events
This would mean, P(A ∩ B) = P(A) ∙ P(B). Thus the multiplication rules says that if A and B
are independent events, then you can multiply the probabilities together to get the joint
probability (the probability of the intersection). That is, P(A ∩ B) = P(A) ∙ P(B)
Example
A die and a coin are thrown together once, what is the probability of getting an even number on
a die and a head on a coin.
Solution
Let event of even on die be denoted as E and head on coin as H. Then we need event E and H
also denoted as E ∩ H. But these two events are independent, that is, can not
influence each other since are occurring on two different objects. Thus
P(E ∩ H)=P(E)×P(H)
=3/6×1/2
1
=4
Example
The probability that Jaime will visit his aunt in Mzuzu this year is 0.30, and the probability that
he will go river rafting on Rukuru river is 0.50. If the two events are independent, what is the
probability that Jaime will do both?
Solution:
Let A be the event that Jaime will visit his aunt this year, and R be the event that he will go
river rafting. We are given P(A) = 0.30 and P(R) = 0.50, and we want to find P(A R). Since
we are told that the events A and R are independent, P(A R) = P(A)× P(R) = (0.30)(0.50) =
0.15.
Page 9 of 14
[email protected]
Example
Given P(B | A) = 0.4. If A and B are independent, find P(B).
Solution
If A and B are independent, then by definition P(B | A) = P(B). Therefore, P (B) =0 .4
Activity 3.4
A cow gives birth twice in ten years. How can you get probability of a female birth at second
birth given a male birth at first birth?
Page 10 of 14
[email protected]
Prove
𝑃(𝐵) = p(B|A1)p(A1)+p(B|A2)p(A2)+……+p(B|An)p(An),
proof
Note 𝐵 = (𝐵 ∩ 𝐴1 ) ∪ (𝐵 ∩ 𝐴2 ) ∪ (𝐵 ∩ 𝐴3 ) ∪ … .∪ ( 𝐵 ∩ 𝐴𝑛 )
𝑃(𝐵) = 𝑝 (𝐵 ∩ 𝐴1 ) + 𝑝(𝐵 ∩ 𝐴2 ) + 𝑝 (𝐵 ∩ 𝐴3 ) + ⋯ . . + p( 𝐵 ∩ 𝐴𝑛 )
𝑃(𝐵∩𝐴)
𝑏𝑢𝑡 𝑃 (𝐵|𝐴) = 𝑃(𝐴)
Example
The following contingency table gives the results of operations in a hospital according to the
complexity of the operation.
Simple Complex Total
Successful 1990 950 2940
Unsuccessful 10 50 60
Total 2000 1000 3000
Solution
Let A be the event that an operation is simple and B the event that an operation is successful
and C be the event that the operation s unsuccessful
P (A)=P(A|B)×P(B)+P(A| C )×p(C) , because for A to occur its either due to occurrence of B
or not B.
𝑃 (𝐴) = 𝑃(𝐴|𝐵) × 𝑃 (𝐴) + 𝑃(𝐴|𝐶) × 𝑃(𝐶)
1990 2940 10 60
= × + ×
3000 3000 3000 3000
1219
=
1875
Page 11 of 14
[email protected]
3.6.2 Bayes rule
The Bayes rule of probability was coined by Thomas Bayes (1761).
Now B may be occur after occurrence of A1, A2, A3,….., or An and thus by law of total probability
P(B)= p(B|A1)p(A1)+p(B|A2)p(A2)+……+p(B|An)p(An).
Now suppose B has occurred, after Ak occurred, we want probability of any of the event Ak for
k=1,2,3,…,n that made B to occur given that B has occurred, denoted as p(Ak|B). This probability is
found by the Bayes Theorem:
𝑃 (𝐵 |𝐴 𝐾 )𝑃 (𝐴 𝑘 )
𝑃 (𝐴 𝑘 |𝐵 ) =
𝑃 (𝐵 )
𝑃(𝐵|𝐴𝑘 )𝑃(𝐴𝑘 )
= 𝑛
∑𝑖=1 𝑃(𝐵|𝐴𝑖 )𝑃(𝐴𝑖 )
Note p(Bt) has to be total probability of B. The Bayes theorem seeks to find the probability of
cause (𝐴𝑘 ) given the effect (B).
Example
In a binary communication system a zero and a one are transmitted with probability 0.6 and 0.4
respectively. Due to error in the communication system a zero becomes a one with a probability
0.1 and a one becomes a zero with a probability 0.08. Determine the probability
(i) of receiving a one
(ii) that a one was transmitted when the received message is one.
Solution
Let S be the sample space corresponding to binary communication. Suppose T0 be event of transmitting
0 and T1 be the event of transmitting 1 and R0 and R1 be corresponding events of receiving 0 and 1
respectively.
Given:
𝑃(𝑇0 ) = 0.6 , 𝑃 (𝑇1 ) = 0.4 , 𝑃(𝑅1 |𝑇0 ) = 0.1 𝑃(𝑅0 |𝑇1 ) = 0.08
𝑃(𝑅0 |𝑇0 ) = 0.9 , 𝑃(𝑅1 |𝑇1 ) = 0.92
By using total probability
i 𝑃(𝑅1 ) =, 𝑃(𝑅1 |𝑇0 )𝑃(𝑇0 ) + 𝑃(𝑅1 |𝑇1 )𝑃(𝑇1 )
= 0.1 × 0.6 + 0.92 × 0.4
= 0.428
by using Bayes rule
ii P(Sent |received)
𝑃 (𝑅1 |𝑇1 ) × 𝑃(𝑇1 )
𝑃(𝑇1 |𝑅1 ) =
𝑃 (𝑅1 )
Page 12 of 14
[email protected]
0.92 × 0.4
=
0.428
= 0.8598
Example
In an electronics laboratory, there are identically looking capacitors of three makes
A1, A2 and A3 in the ratio 2:3:4. It is known that 1% of A1,1.5% of A2 and 2% of A3 are defective.
a. What percentage of capacitors in the laboratory are defective?
b. If a capacitor picked at defective is found to be defective, What is the probability it is of
make A3 ?
Solution
Let D be the event that the item is defective. Here we have to find :
𝑃(𝐷) and 𝑃(𝐴3 |𝐷)
2 3 1 4
We are given 𝑃(𝐴1 ) = 9 , 𝑃(𝐴2 ) = 9 = 3 , 𝑃(𝐴3 ) = 9
𝑃(𝐷|𝐴1 ) = 0.01
𝑃(𝐷|𝐴2 ) = 0.015
𝑃(𝐷|𝐴3 ) = 0.02
a. 𝑃(𝐷) = 𝑃(𝐷|𝐴1 ) × 𝑃(𝐴1 ) + 𝑃(𝐷|𝐴2 ) × 𝑃(𝐴2 ) + 𝑃(𝐷|𝐴3 ) × 𝑃(𝐴3 )
2 1 4
= 0.01 × + 0.015 × + 0.02 ×
9 3 9
= 0.0161
𝑃(𝐷|𝐴3 )×𝑃(𝐴3 )
b. 𝑃(𝐴3 |𝐷) =
𝑃(𝐷)
4
0.02 ×
= 9
0.0161
= 0.552
example
a factory uses 3 machines 𝑥 , 𝑦, 𝑎𝑛𝑑 𝑧 to produce lighting bulbs. Suppose
machine x produces 50% of the bulbs which are 3 % defective, machine y
produces 30% of the bulbs which are 4% defective and machine z produces 20%
of the bulbs which are 5% defective.
a. Find the probability that a randomly selected bulb is defective.
b. Find the probability that a given defective bulb found was produced
by machine y
Page 13 of 14
[email protected]
Given 𝑃(𝑥 ) = 0.5, 𝑃(𝑦) = 0.3, 𝑃(𝑧) = 0.2
𝑃(𝐷|𝑥 ) = 0.03, 𝑃(𝐷|𝑦) = 0.04, 𝑃(𝐷|𝑧) = 0.05
a. 𝑃(𝐷 ) = 𝑃(𝐷|𝑥 ) × 𝑃(𝑥 ) + 𝑃(𝐷|𝑦) × 𝑃 (𝑦) + 𝑃(𝐷|𝑧) × 𝑃(𝑧)
= 0.03 × 0.5 + 0.04 × 0.3 + 0.05 × 0.2
= 0.037
𝑃(𝐷 |𝑦 )×𝑃(𝑦)
b. 𝑃(𝑦|𝐷 ) =
𝑃(𝐷)
0.04 × 0.3
=
0.037
= 0.324
Activity 3.5
A chicken has birds’ flue in Malawi if it is from Madagascar or
Indonesia. It is known that 1% chickens are from Madagascar and 15%
chickens are from Indonesia. The probability that a chicken has flue
that it is from Madagascar is 0.2 and that it has flue given it is from
Indonesia is 0.06. Find probability that chicken has flue.
Practice activity
1. In a recent survey in a Statistics class, it was determined that only 60% of the students
attend class on Thursday. From past data it was noted that 98% of those who went to
class on Thursday pass the course, while only 20% of those who did not go to class on
Thursday passed the course.
(a) What percentage of students is expected to pass the course?
(b) Given that a student passes the course, what is the probability that he/she attended
classes on Thursday?
2. A prisoner has just escaped from jail. There are three roads leading away from the jail. If the
prisoner selects road A to make good her escape, the probability that she succeeds is 0.25. If
she selects road B, the probability that she succeeds is 0.2. If she selects road C, the
probability that she succeeds is (1/6). Furthermore, the probability that she selects each of
these roads is the same. It is (1/3). If the prisoner succeeds in her escape,
What is the probability that she made good escape by using road B?
Page 14 of 14
[email protected]