Probability, Statistic & Random Process -Lecture 3 - Calculating .pdf

SThyNguyn 1 views 130 slides May 22, 2025
Slide 1
Slide 1 of 130
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63
Slide 64
64
Slide 65
65
Slide 66
66
Slide 67
67
Slide 68
68
Slide 69
69
Slide 70
70
Slide 71
71
Slide 72
72
Slide 73
73
Slide 74
74
Slide 75
75
Slide 76
76
Slide 77
77
Slide 78
78
Slide 79
79
Slide 80
80
Slide 81
81
Slide 82
82
Slide 83
83
Slide 84
84
Slide 85
85
Slide 86
86
Slide 87
87
Slide 88
88
Slide 89
89
Slide 90
90
Slide 91
91
Slide 92
92
Slide 93
93
Slide 94
94
Slide 95
95
Slide 96
96
Slide 97
97
Slide 98
98
Slide 99
99
Slide 100
100
Slide 101
101
Slide 102
102
Slide 103
103
Slide 104
104
Slide 105
105
Slide 106
106
Slide 107
107
Slide 108
108
Slide 109
109
Slide 110
110
Slide 111
111
Slide 112
112
Slide 113
113
Slide 114
114
Slide 115
115
Slide 116
116
Slide 117
117
Slide 118
118
Slide 119
119
Slide 120
120
Slide 121
121
Slide 122
122
Slide 123
123
Slide 124
124
Slide 125
125
Slide 126
126
Slide 127
127
Slide 128
128
Slide 129
129
Slide 130
130

About This Presentation

The lecture "Calculating in Probability, Statistics & Random Processes" at HCMIU focuses on computational techniques for solving problems in probability and statistics. It covers permutations, combinations, and the inclusion-exclusion principle to calculate probabilities in discrete se...


Slide Content

Computing
Probability
1 / 104

Objectives
1Use counting technique to calculate
probability of an event in a sample
space with equally likely outcomes
2Calculate the probabilities of joint
events such as unions and intersections
from the probabilities of individual
events
3Interpret and calculate conditional
probabilities of events
2 / 104

4Determine the independence of events
and use independence to calculate
probabilities
5Use multiple law to compute
probabilities of joint events
6Use total law to compute probability
of event with divide - conquer strategy
7Use Bayes’ theorem to calculate
conditional probabilities
3 / 104

Tableofcontents
1Probabilityforequallylikelyout-
comes
2Inclusion - Exclusion principle3Conditional probability4Independence5Multiplication formula and Tree
diagram
6Total probability law7Bayes’ Theorem
4 / 104

ExperimentswithEqually
LikelyOutcomes
LetSbeasamplespaceconsistingof
finiteequallylikelyoutcomes
•Probabilityofeachoutcomeis
1
number of outcomes inΩ
•ProbabilityofeventE
P(E) =
numberofoutcomesinE
numberofoutcomesinΩ
5 / 104

Example
Anurncontainseightwhiteballsand
two green balls. A sample of three
balls is selected at random. What is
theprobabilityofselectingonlywhite
balls?
6 / 104

Solution
•Theexperimentconsistsof
selecting3ballsfromthe
•Thetotalnumberofoutcomesis
n(Ω) =C(10,3),
•E=“allthreeballsselectedare
white.”
•thenumberofdifferentsamples
inwhichallarewhiteis
n(E) =C(8,3)

P(E) =
n(E)
n(Ω)
=
C(8,3)
C(10,3)
=
7
15
7 / 104

Practice
Atoymanufacturerinspectsboxesof
toys before shipment. Each box con-
tains 10 toys. The inspection proce-
dure consists of randomly selecting
threetoysfromthebox. Ifanyarede-
fective, the box is not shipped. Sup-
pose that a given box has two defec-
tivetoys. Whatistheprobabilitythat
itwillbeshipped?
8 / 104

Practice
A batch of 140 semiconductor chips
is inspected by choosing a sample of
five chips. Assume 10 of the chips
do not conform to customer require-
ments.
Findprobabilitythatasampleoffive
containexactlyonenonconformingchip
9 / 104

Tableofcontents
1Probabilityforequallylikelyout-
comes
2Inclusion - Exclusion principle3Conditional probability4Independence5Multiplication formula and Tree
diagram
6Total probability law7Bayes’ Theorem
10 / 104

Inclusion-Exclusion
formula
P(A∪B) =P(A)+P(B)−P(A∩B)
IfAandBaremutuallyexclusive(AB=
∅)then
P(A∪B) =P(A)+P(B)
11 / 104

Inclusion-Exclusion
formula
P(A∪B) =P(A)+P(B)−P(A∩B)
IfAandBaremutuallyexclusive(AB=
∅)then
P(A∪B) =P(A)+P(B)
11 / 104

General Inclusion - Exclusion Formula
•P(A∪B∪C) =
P(A)+P(B)+P(C)−P(AB)−
P(BC)−P(CA)+P(ABC)

P(A1∪A2∪...∪An)
=P(A1)+P(A2)+···+P(An)

X
i
1<ij
P(AiA)j+
X
i<j<k
P(AiAjAk)
+···+(−1)
n−1
P(A1A2...An)
12 / 104

Example
After being interviewed at two com-
panieshelikes,Johnassessesthathis
probability of
companyA
of
0.6. Ifhebelievesthattheprobability
thathewill
panies whatistheprobability
thathewill
thesetwocompanies?
13 / 104

Solution
Denote
•A: hegetsofferfromcompany
A
•B: hegetsofferfromcompany
B
Wehave
P(A) =0.8,P(B) =0.6,P(AB) =0.5
Weneedtocompute
P(A∪B)
14 / 104

Applying inclusion - exclusion for-
mula,weobtain
P(A∪B) =P(A)+P(B)−P(AB)
so
P(A∪B) =0.8+0.6−0.5=0.9
15 / 104

Complementrule
P(A

) =1−P(A)
16 / 104

Example
A group of five people is to be se-
lected at random. What is the prob-
abilitythattwoormoreofthemhave
thesamebirthday? Forsimplicity,we
ignoreFebruary29.
17 / 104

Solution
•Pickoutfivepeople,and
observetheirbirthdays. The
outcomesofthisexperimentare
stringsoffivedates,
correspondingtothebirthdays.
Forexample,oneoutcomeof
theexperimentis(June2,April
6,Dec. 20,Feb. 12,Aug. 5).
•thetotalnumberofpossible
outcomes365
5
18 / 104

Solution
•Pickoutfivepeople,and
observetheirbirthdays. The
outcomesofthisexperimentare
stringsoffivedates,
correspondingtothebirthdays.
Forexample,oneoutcomeof
theexperimentis(June2,April
6,Dec. 20,Feb. 12,Aug. 5).
•thetotalnumberofpossible
outcomes365
5
18 / 104

•E: twoormoreof5selected
peoplehavethesamebirthday
•E

: all5peoplehavedifferent
birthdays
•TotalnumberofoutcomesinE

:
365.364.363.362.361
•P(E

) =
365.364.363.362.361
365
5 ≈...3
⇒P(E) =1−P(E

) =...
19 / 104

•E: twoormoreof5selected
peoplehavethesamebirthday
•E

: all5peoplehavedifferent
birthdays
•TotalnumberofoutcomesinE

:
365.364.363.362.361
•P(E

) =
365.364.363.362.361
365
5 ≈...3
⇒P(E) =1−P(E

) =...
19 / 104

•E: twoormoreof5selected
peoplehavethesamebirthday
•E

: all5peoplehavedifferent
birthdays
•TotalnumberofoutcomesinE

:
365.364.363.362.361
•P(E

) =
365.364.363.362.361
365
5 ≈...3
⇒P(E) =1−P(E

) =...
19 / 104

•E: twoormoreof5selected
peoplehavethesamebirthday
•E

: all5peoplehavedifferent
birthdays
•TotalnumberofoutcomesinE

:
365.364.363.362.361
•P(E

) =
365.364.363.362.361
365
5 ≈...3
⇒P(E) =1−P(E

) =...
19 / 104

Practice
Anurncontainseightwhiteballsand
two green balls. A sample of three
balls is selected at random. What is
the probability that the sample con-
tainsatleastonegreenball?
20 / 104

Exercise
Acustomerwillinvestintax-freebonds
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 prob-
ability of 0.15. Find the probability
thatacustomerwillinvest
1ineithertax-freebondsor
mutualfunds;
2inneithertax-freebondsnor
mutualfunds.
21 / 104

Tableofcontents
1Probabilityforequallylikelyout-
comes
2Inclusion - Exclusion principle3Conditional probability4Independence5Multiplication formula and Tree
diagram
6Total probability law7Bayes’ Theorem
22 / 104

Conditional probability provides us with a
way to reason about the outcome of an ex-
periment, based onpartial information.
Example
In an experiment involving two successive
rolls of a fair die, you are told that the sum
of the two rolls is 9. How likely is it that the
first roll was a 6?
23 / 104

Conditional probability provides us with a
way to reason about the outcome of an ex-
periment, based onpartial information.
Example
In an experiment involving two successive
rolls of a fair die, you are told that the sum
of the two rolls is 9. How likely is it that the
first roll was a 6?
23 / 104

•Restrictpossibleoutcomeson
newsamplespace
{(3,6),(4,5),(5,4),(6,3)}
•Firstrollwas6={(6,3)}
•theprobabililtyisequalto
1
4
=0.25
24 / 104

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?
4
9
25 / 104

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?
4
9
25 / 104

Example
Aclasscontains26students. Ofthese,
14areeconomicsmajors,15arefirst-
year students, and 7 are neither. A
personisselectedatrandomfromthe
class.
1What is the probability that the
personisbothaneconomicsma-
jorandafirst-yearstudent?
2Given thatthe person selected
is a first-year student. What is
the probability that he or she is
alsoaneconomicsmajor?
26 / 104

Solution
1
5
13
2
2
3
27 / 104

•2eventsAandB
•IfweknowforsurethatA
happens,howdoesthe
likelihoodofBchange?
seek to construct a new probability
law,whichtakesintoaccountthisknowl-
edgeandwhich,foranyeventA,gives
ustheconditionalprobabilityofBgiven
A,denotedbyP(B|A)
28 / 104

•2eventsAandB
•IfweknowforsurethatA
happens,howdoesthe
likelihoodofBchange?
seek to construct a new probability
law,whichtakesintoaccountthisknowl-
edgeandwhich,foranyeventA,gives
ustheconditionalprobabilityofBgiven
A,denotedbyP(B|A)
28 / 104

•2eventsAandB
•IfweknowforsurethatA
happens,howdoesthe
likelihoodofBchange?
seek to construct a new probability
law,whichtakesintoaccountthisknowl-
edgeandwhich,foranyeventA,gives
ustheconditionalprobabilityofBgiven
A,denotedbyP(B|A)
28 / 104

ConditionalProbability
TheconditionalprobabilityofBgiven
A,denotedbyP(B|A),isdefinedby
P(B|A) =
P(AB)
P(A)
ifP(A)>0
MeasurethelikelihoodofBinthenew
samplespaceA
29 / 104

ConditionalProbability
TheconditionalprobabilityofBgiven
A,denotedbyP(B|A),isdefinedby
P(B|A) =
P(AB)
P(A)
ifP(A)>0
MeasurethelikelihoodofBinthenew
samplespaceA
29 / 104

Meaning
Conditional probability provides the
capability of reevaluating the idea of
probabilityofaneventinlightofad-
ditional information, that is, when it
is known that another event has oc-
curred.The probabilityP(A|B)is
an updating ofP(A)based on the
knowledgethateventBhasoccurred.
30 / 104

Properties
1Complementrule
P(B
c
|A) =1−P(B|A)
2Additiverule
P(B∪C|A) =P(B|A)+P(C|A)−P(BC|A)
31 / 104

Example
Twenty percent of the employees of
AcmeSteelCompanyarecollegegrad-
uates. Of all of its employees, 20%
arecollegegraduateand15%arecol-
legegraduatesearningmorethan$50,000.
What is theprobability that an em-
ployeeselectedatrandomearnsmore
than$50,000peryear,
orsheisacollegegraduate?
32 / 104

Solution
•H=“earnsmorethan$50,000
peryear”
•C=“collegegraduate.”
•WeneedtocomputeP(H|C)
•GivendataP(C) =0.2,
P(H∩C) =0.15

P(H|C) =
P(H∩C)
P(C)
=
0.15
0.2
=0.75
33 / 104

Practice
Theprobabilitythataregularlysched-
uled flight departs on time isP(D) =
0.83;theprobabilitythatitarriveson
time isP(A) =0.82; and the prob-
ability that it departs and arrives on
time isP(A∩D) =0.78. Find the
probabilitythataplane
1arrivesontime,giventhatit
departedontime
2departedontime,giventhatit
hasarrivedontime.
34 / 104

Interpretation
In the group of employees which are
college graduate, there are 75% earn
morethan$50,000peryear
35 / 104

Example
EducationMaleFemale
Elementary38 45
Secondary28 50
College22 17
If a person is picked at random from
this group, find the probability that
the person is a male, given that the
personhasasecondaryeducation.
36 / 104

Question: findtheprobabilitythat
thepersonisamale
| {z }
A: interested event
,
giventhat
thepersonhasasecondaryeducation
| {z }
B: addition information - condition or new sample space
Find
P(A|B) =
P(AB)
P(B)
37 / 104

Question: findtheprobabilitythat
thepersonisamale
| {z }
A: interested event
,
giventhat
thepersonhasasecondaryeducation
| {z }
B: addition information - condition or new sample space
Find
P(A|B) =
P(AB)
P(B)
37 / 104

Solution-1stapproach
•Sample size: number of ways to pick a
person randomly is
|Ω|=38+45+28+50+22+17=200
•Convert data into probability
EducationMaleFemaleSum
Elementary
38
200
=.19.225
Secondary.14 .25.39
College .11 .085.195
Sum .44 .561
38 / 104

EducationMaleFemaleSum
Elementary.19 .225
Secondary.14 .25.39
=P(AB) =P(B)
College.11.085.195
Sum .44 .56 1
P(A|B) =
P(AB)
P(B)
=
.14
.39
39 / 104

Solution-2ndapproach
•NewsamplespaceisBwith78
elements
•Innewsamplespace,the
numberofwaystopickamale
is28
•Theprobabilitythattheperson
isamale,giventhattheperson
hasasecondaryeducationis
28
78
≈0.36
40 / 104

Intepretation
Amongallthepersonwithsecondary
education,thefractionofmaleis36%
41 / 104

Practice
400 parts classified by surface flaws
andas(functionally)defective
Selectrandomlyapart. Findthe
ability that the selected part is defec-
tivegiventhat
1thepartwithsurfaceflaws2thepartwithoutsurfaceflaws
42 / 104

Example
A fair coin is flipped twice. what is
the conditional probability that both
flipslandonheads,giventhat
(a)thefirstfliplandsonheads?
(b)atleastonefliplandsonheads?
43 / 104

Solutionfor(a)
•A={HH}(bothhead)
•F={HH,HT}(firstishead)
P(A|F) =
P(AF)
P(F)
=
P({HH})
P({HH,HT})
=
1/4
2/4
=
1
2
44 / 104

Solutionfor(b)
•B={HH,HT,TH}(atleastone
head)
P(A|B) =
P(AB)
P(B)
=
P({HH})
P({HH,HT,TH})
=
1
3
45 / 104

Practice
Tossafaircointwice. Compute
P(2ndtossishead)
and
P(2ndtossishead|1sttossishead)
46 / 104

Comment
P(A) =
1
4
whileP(A|B) =
1
3
̸=P(A)
indicatesthatAdependsonB
P(2ndtossisHead|1sttossisHead)
=P(2ndcoinisHead) =
1
2
Resultofthe2ndtossdoesnotthede-
pendofthe1sttossresult
47 / 104

Comment
P(A) =
1
4
whileP(A|B) =
1
3
̸=P(A)
indicatesthatAdependsonB
P(2ndtossisHead|1sttossisHead)
=P(2ndcoinisHead) =
1
2
Resultofthe2ndtossdoesnotthede-
pendofthe1sttossresult
47 / 104

Idea
•UsuallyP(A|B)̸=P(A).
•IfP(A|B) =P(A),Bhasno
effectonAorknowingBdoes
notchangetheprobabilitythat
Ahappensthen
•AandBhavenorelation
48 / 104

Idea
•UsuallyP(A|B)̸=P(A).
•IfP(A|B) =P(A),Bhasno
effectonAorknowingBdoes
notchangetheprobabilitythat
Ahappensthen
•AandBhavenorelation
48 / 104

Idea
•UsuallyP(A|B)̸=P(A).
•IfP(A|B) =P(A),Bhasno
effectonAorknowingBdoes
notchangetheprobabilitythat
Ahappensthen
•AandBhavenorelation
48 / 104

Tableofcontents
1Probabilityforequallylikelyout-
comes
2Inclusion - Exclusion principle3Conditional probability4Independence5Multiplication formula and Tree
diagram
6Total probability law7Bayes’ Theorem
49 / 104

Independentevents
AandBareindependentif
P(A|B) =P(A)
or
P(AB) =P(A)P(B).
50 / 104

Complement
IfAis independent ofBthen it is in-
dependentofB
c
.
51 / 104

Example
Twosuccessiverollsofafair6-sided
die
A: the1strollresultsin2
B: the2ndrollresultsin4
AreAandBindependent?
52 / 104

Solution
•P(A) =
1
6
•P(B) =
1
6
•P(AB) =
1
36
=P(A)P(B)
•AandBareindependent
53 / 104

Practice
Suppose thatP(A|B) =0.4,P(B) =
0.8 andP(A) =0.5. AreAandBare
independent?
54 / 104

Practice
400 parts classified by surface flaws
andas(functionally)defective
Selectrandomlyapart. Let
D=”thepartisdefective”
F=”theparthassurfaceflaw”
AreDandFindependent?
55 / 104

Independenceofasetof
events
A set of events is said to be indepen-
dent if, for each collection of events
chosenfromthem,say,E1,E2,...,En,
wehave
P(E1∩···∩En) =P(E1)...P(En)
56 / 104

Example
Three eventsA,B, andCare inde-
pendent:P(A) =.5,P(B) =.3, and
P(C) =.2.
1CalculateP(A∩B∩C).2CalculateP(A∩C).
57 / 104

Example
Acompanymanufacturesstereocom-
ponents. Experience shows that de-
fects in manufacture are independent
of one another. Quality-control stud-
iesrevealthat
2%ofCDplayersaredefective,
3%ofamplifiersaredefective,
7%ofspeakersaredefective.
A system consists of a CD player, an
amplifier, and two speakers. What is
the probability that the system is not
defective?
58 / 104

Example
•Aseriessystemisupifallofits
componentisup
•Componentsoperate
independently
•pi: probthatcomponentiisup
•Probthatseriessystemisup:
p1p2...pn
59 / 104

Example
A parallel system is up if any one of
itscomponentisup
Assume that all component operates
independently
60 / 104

•pi: probabilitythatcomponenti
isup
•Probabilitythattheparallel
systemisdown:
(1−p1)(1−p2)...(1−pn)
•Probabilitythattheparallel
systemisup:
1−(1−p1)(1−p2)...(1−pn)
61 / 104

•pi: probabilitythatcomponenti
isup
•Probabilitythattheparallel
systemisdown:
(1−p1)(1−p2)...(1−pn)
•Probabilitythattheparallel
systemisup:
1−(1−p1)(1−p2)...(1−pn)
61 / 104

•pi: probabilitythatcomponenti
isup
•Probabilitythattheparallel
systemisdown:
(1−p1)(1−p2)...(1−pn)
•Probabilitythattheparallel
systemisup:
1−(1−p1)(1−p2)...(1−pn)
61 / 104

Example
Anelectronicsystemconsistsof4in-
dependentcomponents. Findtheprob-
abilitythatentiresystemworks.
62 / 104

Solution
•Probabilitythatthesubsystem
CDinparallelisup
pCD=1−(1−pC)(1−pD)
=1−(1−.8)(1−.8) =.96
•Probabilitythatthewhole
systemisup
pApBpCD= (.9)(.9)(.96) =
63 / 104

Tableofcontents
1Probabilityforequallylikelyout-
comes
2Inclusion - Exclusion principle3Conditional probability4Independence5Multiplication formula and Tree
diagram
6Total probability law7Bayes’ Theorem
64 / 104

MultiplicationFormula
P(AB) =P(B|A)P(A).
Think ofABas event with 2 steps,
thenprobabilityequalsprobabilityof
firststepmultiplywiththeconditional
probability of second step given first
step
65 / 104

Example
Draw2ballswithoutreplacementfrom
thebox.
Whatistheprobabilitythatbothballs
arewhite?
66 / 104

Solution
•Ai: theithdrawiswhite
•P(A1) =
6
10
•P(A2|A1) =
5
9
•P(A1A2) =P(A1)P(A2|A1) =

6
10
·−
5
9
˙
=
1
3
67 / 104

Multistep
SequenceofeventsA1,A2,...,Ak
P(A1A2...Ak) =P(A1)×P(A2|A1)×P(A3|A1A2)...
×P(Ak|A1...Ak−1)
68 / 104

Example-Qualifycontrol
A box contains five good lightbulbs
andtwodefectiveones.
Bulbsareselectedoneatatime(with-
out replacement) until a good bulb is
found. Find theprobabilitythatthe
numberofbulbsselectedis
(i)one, (ii)two, (iii)three.
69 / 104

Solution
Initial
situation
Abulbselectedat
randomwillbe
•good(G)with
probability
5
7
•defective(D)
withprobability
2
7
Ifagoodbulbisselectedthentheac-
tivitystops
70 / 104

Situation if the first selected bulb
isdefective
Thesecondbulb
selectedatrandom
willbe
•good(G)with
probability
5
6
•defective(D)
withprobability
1
6
Ifagoodbulbisselectedthentheac-
tivitystops
71 / 104

Situationifthefirstandsecondse-
lectedbulbsaredefective
Thethirdbulb
selectedatrandom
willbe
•good(G)with
probability1
•defective(D)
withprobability
0
Theactivitystops
72 / 104

EachofthethreepathsleadingtoaG
hasadifferentlength.
(i)P(1) =
5
7
(ii)P(2) =
2
7
.
5
6
=
5
21
(iii)P(3) =
2
7
.
1
6
.1=
1
21
73 / 104

Practice
Alotof100semiconductorchipscon-
tains20thataredefective.
Three are selected, at random, with-
out replacement, from the lot. Deter-
mine the probability that all are de-
fective.
74 / 104

Practice
Suppose thatP(A|B) =0.4,P(B) =
0.5. Determine
1P(A∩B)2P(A

∩B)
75 / 104

Practice
Theprobabilitythattheheadofahouse-
hold is home when a telemarketing
representativecallsis0.4. Giventhat
the head of the house is home, the
probabilitythatgoodswillbebought
from the company is 0.3. Find the
probabilitythattheheadofthehouse
is home and goods are bought from
thecompany.
76 / 104

Tableofcontents
1Probabilityforequallylikelyout-
comes
2Inclusion - Exclusion principle3Conditional probability4Independence5Multiplication formula and Tree
diagram
6Total probability law7Bayes’ Theorem
77 / 104

Partition
A1,...,Anis a partition ofΩif
•mutually exclusive:AiAj=∅fori̸=j
•A1∪A2∪...An= Ω
BA1, ...,BAnis a partition ofB
B=BA1∪BA2∪...∪BAn 78 / 104

Partition
A1,...,Anis a partition ofΩif
•mutually exclusive:AiAj=∅fori̸=j
•A1∪A2∪...An= Ω
BA1, ...,BAnis a partition ofB
B=BA1∪BA2∪...∪BAn
78 / 104

Totalprobabilityformula-
divide-and-conquer
•PartitionsamplespaceintoA1,
A2,...,An
•KnowP(B|Ai)foreveryi
•ComputeP(B)
P(B) =
n
X
i=1
P(BAi)
=
n
X
i=1
P(B|Ai)P(Ai)
79 / 104

Example
Select randomly one out of the a box
of6blueballsand4greenballs. Then
without returning this to the box, we
takeanotherone.
What is the probability that the sec-
ondballisblue?
80 / 104

Solution
Denote
•B2: thesecondballisblue
•G1: thefirstballisgreen
•B1: thefirstballisblue
WeneedtocomputeP(B2).
81 / 104

There are two possible cases that the
2ndballisblue
B2= (B1G1)∪(B2G2)
Bytotallaw,
P(B2) =P(B2∩G1)+P(B2∩B1)
=P(G1)P(B2|G1)+P(B1)P(B2|B1)
=
4
10
×
6
9
+
6
10
×
5
9
=
54
90
=0.6
82 / 104

Example
Youenterachesstournamentwhereyourprob-
ability of winning a game is 0.3 against half
the players (call them type 1), 0.4 against
a quarter of the players (call them type 2),
and 0.5 against the remaining quarter of the
players (call them type 3). You play a game
against a randomly chosen opponent. What
is the probability of winning?
83 / 104

Solution
•Ai: youropponentisoftypei
•W: youwin
•Theeventthatyouwincanbe
dividedintothreecases
accordingtothetypeofyour
opponent
W= (A1W)∪(A2W)∪(A2W)
84 / 104

P(Ai)P(W|Ai)P(AiW)
1
2
0.3
1
2
(0.3) =0.15
1
4
0.4
1
4
(0.4) =0.1
1
4
0.5
1
4
(0.5) =0.125
P(W) =0.15+0.16+0.2=0.375
85 / 104

Example
In a certain assembly plant, three machines,
B1,B2, andB3, make 30%, 45%, and 25%,
respectively, of the products. It is known
frompastexperiencethat2%,3%,and2%of
the products made by each machine, respec-
tively, are defective. Now, supposethat afin-
ished product is randomly selected. What is
the probability that it is defective?
86 / 104

Solution
Denote
•A: theselectedproductis
defective
•Bi: theselectedproductismade
bymachineBi
The event that the selected product
is defective can be divided into three
casesaccordingtowhichmachinemade
it
A= (AB1)∪(AB2)∪(AB3)
87 / 104

•P(AB1) =P(B1)P(A|B1) =
(.3)(.02) =.006
•P(AB2) =P(B2)P(A|B2) =
(.45)(.03) =.0135
•P(AB3) =P(B1)P(A|B1) =
(.25)(.02) =.005
SoP(A) =P(AB1)+P(AB2)+P(AB3) =
0.0245
88 / 104

Re-evaluate
ifaproductwaschosenrandomlyand
foundtobedefective,whatistheprob-
ability that it was made by machine
B3?
89 / 104

Solution
P(B3|A) =
P(B3A)
P(A)
=
0.005
0.0245
=
10
49
90 / 104

Tableofcontents
1Probabilityforequallylikelyout-
comes
2Inclusion - Exclusion principle3Conditional probability4Independence5Multiplication formula and Tree
diagram
6Total probability law7Bayes’ Theorem
91 / 104

Bayes’Theorem
•B1,B2,...,Bn
aremutually
exclusive
•B1∪B2∪···∪
Bn=S
P(Bk|A) =
P(Bk)P(A|Bk)
P(B1)P(A|B1) +···+P(Bn)P(A|Bn)
fork=1,2,...,n
92 / 104

Meaning
•PriorprobabilityP(Bi)-initial
belief
•KnowP(A|Bi)foreachi
•GivenAoccurs,wishtorevise
(update)”belief”P(Bk|A)
P(Bk|A) =
P(A|Bk)P(Bk)
P
n
i=1
P(A|Bi)P(Bi)
93 / 104

Bayes’ rule is often used forinfer-
ence. Thereareanumberof“causes”
that may result in a certain “effect.”
We observe the effect, and we wish
toinferthecause
94 / 104

Exercise
There is 0.25% of the general pop-
ulation suffer from Covid. To diag-
nose whether someone suffers from
Covid, there is a medical examina-
tion which has a probability 1% of
giving a false result 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 per-
sonactuallysuffersfromCovid?
95 / 104

Exericse
Acontestantonatelevisionshowhas
to answer multiple choice questions
withfourpossibleanswers. Theprob-
ability that the contestant knows the
answer to a question is 75%. If the
contestant does not know the answer
to a particular question, she gives an
answeratrandom. Ifshehasanswered
thefirstquestioncorrectly,whatisthe
probabilitythatsheknewtheanswer?
96 / 104

Example
A plane is missing and it was equally likely
to have gone down in any of three possible
regions. Let 1−αidenote the probability the
plane will be found upon a search of the i-
th region when the plane is, in fact, in that
region,i=1,2,3. What is the conditional
probabilitythattheplaneisinthei-thregion,
given that a search of region 1 is unsuccess-
ful,i=1,2,3?
97 / 104

Solution
•Ai={theplaneisinregioni}
•B={searchofregion1was
unsuccessful}
•NeedP(Ai|B) =?
98 / 104

Solution
•Ai={theplaneisinregioni}
•B={searchofregion1was
unsuccessful}
•NeedP(Ai|B) =?
98 / 104

Solution
•Ai={theplaneisinregioni}
•B={searchofregion1was
unsuccessful}
•NeedP(Ai|B) =?
98 / 104

Solution
Needtofind
P(AiB)andP(B)
withinformation
•P(Ai) =
1
3

P(planeisfoundinregioni|Ai) =
1−α
99 / 104

Solution
P(A1B) =?
A1Bmeansthat
•Planeisinregion1
•Searchinregion1was
unsuccessful=planewasnot
foundinregion1
P(A1B) =P(A1)P(B|A1) =
1
3
∗α1=
α1
3
100 / 104

Solution
P(A1B) =?
A1Bmeansthat
•Planeisinregion1
•Searchinregion1was
unsuccessful=planewasnot
foundinregion1
P(A1B) =P(A1)P(B|A1) =
1
3
∗α1=
α1
3
100 / 104

Solution
P(A1B) =?
A1Bmeansthat
•Planeisinregion1
•Searchinregion1was
unsuccessful=planewasnot
foundinregion1
P(A1B) =P(A1)P(B|A1) =
1
3
∗α1=
α1
3
100 / 104

Solution
A2Bmeansthat
•Planeisinregion2
•Searchinregion1was
unsuccessful=planewasnot
foundinregion1
P(A2B) =P(A2)P(B|A2) =
1
3
∗1=
1
3
101 / 104

Solution
A2Bmeansthat
•Planeisinregion2
•Searchinregion1was
unsuccessful=planewasnot
foundinregion1
P(A2B) =P(A2)P(B|A2) =
1
3
∗1=
1
3
101 / 104

Solution
A3Bmeansthat
•Planeisinregion3
•Searchinregion1was
unsuccessful=planewasnot
foundinregion1
P(A3B) =P(A3)P(B|A3) =
1
3
∗1=
1
3
102 / 104

Solution
A3Bmeansthat
•Planeisinregion3
•Searchinregion1was
unsuccessful=planewasnot
foundinregion1
P(A3B) =P(A3)P(B|A3) =
1
3
∗1=
1
3
102 / 104

Solution
P(B) =P(A1B)+P(A2B)+P(A3B)
=α1×
1
3
+1×
1
3
+1×
1
3
=
α1+2
3
103 / 104

Solution
P(B) =P(A1B)+P(A2B)+P(A3B)
=α1×
1
3
+1×
1
3
+1×
1
3
=
α1+2
3
103 / 104

Solution
P(A1|B) =
P(A1B)
P(B)
=
α1
α1+2
P(A2|B) =
P(A2B)
P(B)
=
1
α1+2
P(A3|B) =
P(A3B)
P(B)
=
1
α1+2
104 / 104

Solution
P(A1|B) =
P(A1B)
P(B)
=
α1
α1+2
P(A2|B) =
P(A2B)
P(B)
=
1
α1+2
P(A3|B) =
P(A3B)
P(B)
=
1
α1+2
104 / 104

Solution
P(A1|B) =
P(A1B)
P(B)
=
α1
α1+2
P(A2|B) =
P(A2B)
P(B)
=
1
α1+2
P(A3|B) =
P(A3B)
P(B)
=
1
α1+2
104 / 104