2 - Calculating Prob
2 - Calculating Prob
2 - Calculating Prob
1 / 87
Objectives
1 Evaluate probability of joint events such as unions
and intersections from the probabilities of
individual events with additive rule
2 Interpret and calculate conditional probabilities of
events.
3 Use conditional probability to
• understand the independent concept
• derive multiple law, total law and Bayes’ rule
to compute probability or conditional
probability of complicated events
2 / 87
Inclusion - Exclusion principle
Table of contents
1 Inclusion - Exclusion principle
2 Conditional probability
3 Multiplication formula and Tree diagram
4 Total probability law
5 Bayes’ Theorem
6 Independence
3 / 87
Inclusion - Exclusion principle
P (A ∪ B) = P (A) + P (B) − P (A ∩ B)
5 / 87
Inclusion - Exclusion principle
P (A ∪ B) = P (A) + P (B) − P (A ∩ B)
Example
After being interviewed at two companies he likes,
John assesses that his probability of getting an
offer from company A is 0.8, and his probabil-
ity of getting an offer from company B is 0.6.
If he believes that the probability that he will
get offers from both companies is 0.5, what is
the probability that he will get at least one of-
fer from these two companies?
7 / 87
Inclusion - Exclusion principle
Solution
Denote
• A: he gets offer from company A
• B: he gets offer from company B
then the event
• A: get offers from both companies is A ∩ B
• B: get at least one offer is A ∪ B
We have
P (A) = 0.8, P (B) = 0.6, P (A ∩ B) = 0.5
We need to compute
P (A ∪ B)
8 / 87
Inclusion - Exclusion principle
9 / 87
Inclusion - Exclusion principle
Exercise
A customer will invest in tax-free bonds with a
probability of 0.6, will invest in mutual funds
with a probability of 0.3, and will invest in both
tax-free bonds and mutual funds with a probabil-
ity of 0.15. Find the probability that a customer
will invest
1 in either tax-free bonds or mutual funds;
2 in neither tax-free bonds nor mutual funds.
10 / 87
Conditional probability
Table of contents
1 Inclusion - Exclusion principle
2 Conditional probability
3 Multiplication formula and Tree diagram
4 Total probability law
5 Bayes’ Theorem
6 Independence
11 / 87
Conditional probability
12 / 87
Conditional probability
Example
Select randomly one out of the 10 balls and then, without
returning this to the box, we take another one.
What is the prob that the second ball is blue if the first ball
is white?
14 / 87
Conditional probability
Example
Select randomly one out of the 10 balls and then, without
returning this to the box, we take another one.
What is the prob that the second ball is blue if the first ball
is white? 49
14 / 87
Conditional probability
Example
A class contains 26 students. Of these, 14 are
economics majors, 15 are first-year students, and
7 are neither. A person is selected at random
from the class.
1 What is the probability that the person is
both an economics major and a first- year
student?
2 Given that (i.e. it is known that ) the per-
son selected is a first-year student. What is
the probability that he or she is also an eco-
nomics major?
15 / 87
Conditional probability
Solution
5
1
13
2
2
3
16 / 87
Conditional probability
• 2 events A and B
17 / 87
Conditional probability
• 2 events A and B
• If we know for sure that A happens, how
does the likelihood of B change?
seek to construct a new probability law, which
takes into account this knowledge and which, for
any event A, gives us the conditional probability
of B given A, denoted by P (B|A)
17 / 87
Conditional probability
18 / 87
Conditional probability
18 / 87
Conditional probability
Meaning
19 / 87
Conditional probability
Properties
1 Complement rule
P (B c|A) = 1 − P (B|A)
2 Additive rule
P (B ∪ C|A) = P (B|A) + P (C|A) − P (BC|A)
20 / 87
Conditional probability
Example
21 / 87
Conditional probability
Solution
• H = “earns more than $50,000 per year”
• C = “college graduate.”
• We need to compute P (H|C)
• Given data P (C) = 0.2, P (H ∩ C) = 0.15
•
P (H ∩ C) 0.15
P (H|C) = = = 0.75
P (C) 0.2
22 / 87
Conditional probability
Practice
The probability that a regularly scheduled flight
departs on time is P (D) = 0.83; the probability
that it arrives on time is P (A) = 0.82; and the
probability that it departs and arrives on time is
P (A ∩ D) = 0.78. Find the probability that a
plane
1 arrives on time, given that it departed on
time
2 departed on time, given that it has arrived
on time.
23 / 87
Conditional probability
Interpretation
24 / 87
Conditional probability
Example
Education Male Female
Elementary 38 45
Secondary 28 50
College 22 17
If a person is picked at random from this group,
find the probability that the person is a male,
given that the person has a secondary education.
25 / 87
Conditional probability
26 / 87
Conditional probability
26 / 87
Conditional probability
Solution - 1st
approach
• Sample size: number of ways to pick a person
randomly is
|Ω| = 38 + 45 + 28 + 50 + 22 + 17 = 200
• Convert data into probability
Education Male Female Sum
38
Elementary 200 = .19 .225
Secondary .14 .25 .39
College .11 .085 .195
Sum .44 .56 1
27 / 87
Conditional probability
P (AB) .14
P (A|B) = =
P (B) .39
28 / 87
Conditional probability
Solution - 2nd
approach
• New sample space is B with 78 elements
• In new sample space, the number of ways
to pick a male is 28
• The probability that the person is a male,
given that the person has a secondary
education is
28
≈ 0.36
78
29 / 87
Conditional probability
Intepretation
30 / 87
Multiplication formula and Tree diagram
Table of contents
1 Inclusion - Exclusion principle
2 Conditional probability
3 Multiplication formula and Tree diagram
4 Total probability law
5 Bayes’ Theorem
6 Independence
31 / 87
Multiplication formula and Tree diagram
Multiplication Formula
32 / 87
Multiplication formula and Tree diagram
Example
Draw 2 balls without replacement from the box.
Solution
34 / 87
Multiplication formula and Tree diagram
Multistep
Sequence of events A1, A2, . . . , Ak
P (A1A2 . . . Ak ) =P (A1) × P (A2|A1) × P (A3|A1A
× P (Ak |A1 . . . Ak−1)
35 / 87
Multiplication formula and Tree diagram
Example - Qualify
control
A box contains five good lightbulbs and two de-
fective ones.
Bulbs are selected one at a time (without replace-
ment) until a good bulb is found. Find the prob-
ability that the number of bulbs selected is
36 / 87
Multiplication formula and Tree diagram
Solution
Initial situation A bulb selected at random
will be
• good (G) with
probability 57
• defective (D) with
probability 27
38 / 87
Multiplication formula and Tree diagram
Practice
41 / 87
Multiplication formula and Tree diagram
Practice
42 / 87
Multiplication formula and Tree diagram
Practice
43 / 87
Total probability law
Table of contents
1 Inclusion - Exclusion principle
2 Conditional probability
3 Multiplication formula and Tree diagram
4 Total probability law
5 Bayes’ Theorem
6 Independence
44 / 87
Total probability law
Partition
A1 , . . . , An is a partition of Ω if
• mutually exclusive: Ai Aj = ∅ for i ̸= j
• A 1 ∪ A 2 ∪ . . . An = Ω
45 / 87
Total probability law
Partition
A1 , . . . , An is a partition of Ω if
• mutually exclusive: Ai Aj = ∅ for i ̸= j
• A 1 ∪ A 2 ∪ . . . An = Ω
Total probability
formula - divide - and -
conquer
• Partition sample space into A1, A2, . . . , An
• Know P (B|Ai) for every i
• Compute P (B)
Xn
P (B) = P (BAi)
i=1
Xn
= P (B|Ai)P (Ai)
46 / 87
Total probability law
Example
47 / 87
Total probability law
Solution
Denote
• B2: the second ball is blue
• G1: the first ball is green
• B1: the first ball is blue
We need to compute P (B2).
48 / 87
Total probability law
49 / 87
Total probability law
Example
50 / 87
Total probability law
Solution
• Ai: your opponent is of type i
• W : you win
• The event that you win can be divided into
three cases according to the type of your
opponent
W = (A1W ) ∪ (A2W ) ∪ (A2W )
51 / 87
Total probability law
52 / 87
Total probability law
Example
53 / 87
Total probability law
Solution
Denote
• A: the selected product is defective
• Bi: the selected product is made by
machine Bi
The event that the selected product is defective
can be divided into three cases according to which
machine made it
A = (AB1) ∪ (AB2) ∪ (AB3)
54 / 87
Total probability law
55 / 87
Total probability law
Re-evaluate
56 / 87
Total probability law
Solution
P (B3A)
P (B3|A) =
P (A)
0.005 10
= =
0.0245 49
57 / 87
Bayes’ Theorem
Table of contents
1 Inclusion - Exclusion principle
2 Conditional probability
3 Multiplication formula and Tree diagram
4 Total probability law
5 Bayes’ Theorem
6 Independence
58 / 87
Bayes’ Theorem
Bayes’ Theorem
P (Bk )P (A|Bk )
P (Bk |A) =
P (B1 )P (A|B1 ) + · · · + P (Bn )P (A|Bn )
for k = 1, 2, . . . , n
59 / 87
Bayes’ Theorem
Meaning
• Prior probability P (Bi) - initial belief
• Know P (A|Bi) for each i
• Given A occurs, wish to revise (update)
”belief” P (Bk |A)
P (A|Bk )P (Bk )
P (Bk |A) = Pn
i=1 P (A|Bi )P (Bi )
60 / 87
Bayes’ Theorem
61 / 87
Bayes’ Theorem
Exercise
There is 0.25% of the general population suffer
from Covid. To diagnose whether someone suf-
fers from Covid, there is a medical examination
which has a probability 1% of giving a false re-
sult if someone has Covid and 2% if someone
does not have Covid. If we select at random a
person from the general population and he/she
tests positive for Covid, what is the probability
that this person actually suffers from Covid?
62 / 87
Bayes’ Theorem
Exericse
A contestant on a television show has to answer
multiple choice questions with four possible an-
swers. The probability that the contestant knows
the answer to a question is 75%. If the contestant
does not know the answer to a particular ques-
tion, she gives an answer at random. If she has
answered the first question correctly, what is the
probability that she knew the answer?
63 / 87
Bayes’ Theorem
Example
64 / 87
Bayes’ Theorem
Solution
65 / 87
Bayes’ Theorem
Solution
65 / 87
Bayes’ Theorem
Solution
65 / 87
Bayes’ Theorem
Solution
Need to find
P (AiB) and P (B)
with information
• P (Ai) = 31
• P ( plane is found in region i|Ai) = 1 − α
66 / 87
Bayes’ Theorem
Solution
P (A1B) =?
67 / 87
Bayes’ Theorem
Solution
P (A1B) =?
A1B means that
• Plane is in region 1
• Search in region 1 was unsuccessful =
plane was not found in region 1
67 / 87
Bayes’ Theorem
Solution
P (A1B) =?
A1B means that
• Plane is in region 1
• Search in region 1 was unsuccessful =
plane was not found in region 1
1 α1
P (A1B) = P (A1)P (B|A1) = ∗ α1 =
3 3
67 / 87
Bayes’ Theorem
Solution
68 / 87
Bayes’ Theorem
Solution
68 / 87
Bayes’ Theorem
Solution
69 / 87
Bayes’ Theorem
Solution
69 / 87
Bayes’ Theorem
Solution
70 / 87
Bayes’ Theorem
Solution
70 / 87
Bayes’ Theorem
Solution
P (A1B) α1
P (A1|B) = =
P (B) α1 + 2
71 / 87
Bayes’ Theorem
Solution
P (A1B) α1
P (A1|B) = =
P (B) α1 + 2
P (A2B) 1
P (A2|B) = =
P (B) α1 + 2
71 / 87
Bayes’ Theorem
Solution
P (A1B) α1
P (A1|B) = =
P (B) α1 + 2
P (A2B) 1
P (A2|B) = =
P (B) α1 + 2
P (A3B) 1
P (A3|B) = =
P (B) α1 + 2
71 / 87
Independence
Table of contents
1 Inclusion - Exclusion principle
2 Conditional probability
3 Multiplication formula and Tree diagram
4 Total probability law
5 Bayes’ Theorem
6 Independence
72 / 87
Independence
Idea
73 / 87
Independence
Idea
73 / 87
Independence
Idea
73 / 87
Independence
Independent events
74 / 87
Independence
Complement
75 / 87
Independence
Example
Two successive rolls of a fair 6-sided die
76 / 87
Independence
Solution
• P (A) = 16
• P (B) = 16
• 1
P (AB) = 36 = P (A)P (B)
• A and B are independent
77 / 87
Independence
Practice
78 / 87
Independence
Practice
400 parts classified by surface flaws and as (func-
tionally) defective
Independence of a set
of events
A set of events is said to be independent if, for
each collection of events chosen from them, say,
E1, E2, ..., En, we have
P (E1 ∩ · · · ∩ En) = P (E1) . . . P (En)
80 / 87
Independence
Example
2 Calculate P (A ∩ C).
81 / 87
Independence
Example
A company manufactures stereo components. Ex-
perience shows that defects in manufacture are
independent of one another. Quality-control stud-
ies reveal that
2% of CD players are defective,
3% of amplifiers are defective,
7% of speakers are defective.
A system consists of a CD player, an amplifier,
and two speakers. What is the probability that
the system is not defective?
82 / 87
Independence
Example
83 / 87
Independence
Example
A parallel system is up if any one of its compo-
nent is up
85 / 87
Independence
85 / 87
Independence
85 / 87
Independence
Example
An electronic system consists of 4 independent
components. Find the probability that entire sys-
tem works.
86 / 87
Independence
Solution
• Probability that the subsystem CD in
parallel is up
pCD = 1 − (1 − pC )(1 − pD )
= 1 − (1 − .8)(1 − .8) = .96
• Probability that the whole system is up
pApB pCD = (.9)(.9)(.96) =
87 / 87