Probability, Statistic & Random Process -Lecture 3 - Calculating .pdf
SThyNguyn
1 views
130 slides
May 22, 2025
Slide 1 of 130
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
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...
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 settings. Students learn to compute expected values, variances, and probabilities for random experiments and basic stochastic processes like Markov chains. Practical applications in fields like engineering and data analysis are emphasized, with hands-on exercises using tools like Python or R.
Size: 1.08 MB
Language: en
Added: May 22, 2025
Slides: 130 pages
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
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
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
Example
A group of five people is to be se-
lected at random. What is the prob-
abilitythattwoormoreofthemhave
thesamebirthday? Forsimplicity,we
ignoreFebruary29.
17 / 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
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
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
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
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
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
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
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
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
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
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
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
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
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
Tableofcontents
1Probabilityforequallylikelyout-
comes
2Inclusion - Exclusion principle3Conditional probability4Independence5Multiplication formula and Tree
diagram
6Total probability law7Bayes’ Theorem
91 / 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