Chapter2 Probability
Chapter2 Probability
Chapter2 Probability
Chapter 2: Probability
Fall 2020
1 / 44
Chapter 2: Probability
Learning Objectives:
1. Understand and describe sample spaces and events
2. Interpret probabilities and calculate probabilities of events
3. Use permutations and combinations to count outcomes
4. Calculate the probabilities of joint events
5. Interpret and calculate conditional probabilities
6. Determine independence and use independence to calculate
probabilities
7. Understand Bayes’ theorem and when to use it
2 / 44
Random Experiment
3 / 44
The set of all possible outcomes of a random experiment is called
the sample space, denoted by S.
I S is discrete if it consists of a finite or countable infinite set
mmmm
of outcomes.
I S is continuous if it contains an interval of real numbers.
Examples:
1. Randomly select a camera and record the recycle time of a
flash: S = R+ = (0, 1), all the positive real numbers, is contino
continuous.
2. Suppose we know all the recycle times are between 1.5 and 5ly
seconds. Then S = (1.5, 5) is continuous.
o
3. It is known that the recycle time has only three values(low,
medium or high). Then S = {low, medium, high} is discrete. disente
4. Does the camera conform to minimum recycle time
specifications? S = {yes, no} is discrete.
f
4 / 44
Tree diagram to list a discrete sample space
e
Messages are classified as on-time(o) or late(l). Classify the next 3
messages.
This only works for small sample spaces. Think we have 30 messages,
the size of S is 230 = 1, 073, 741, 824.
5 / 44
Counting Techniques
6 / 44
Multiplication Rule
n1 · n2 · · · nk .
7 / 44
Permutation Rule
by definition 0! = 1.
8 / 44
Subset Permutations
How many different ways to permute r items from a set of n distinct
items?
n!
Prn = n(n 1)(n 2) · · · (n r + 1) =
(n r )!
nPr(n,r)
Example
A printed circuit board has eight different locations in which a
component can be placed. If four different components are to be
placed on the board, how many designs are possible?
Answer: Order is important! Using the permutation formula with
n = 8, r = 4:
8!
P48 = = 8 · 7 · 6 · 5 = 1680.
(8 4)!
nPr(8,4)
9 / 44
Similar Item (not distinct) Permutations
Suppose the n items are not totally distinct. We have
I n = n1 + n2 + · · · + nr items of which
I n1 , n2 , . . . , nr are identical.
The number of permutations of these n items is
n!
n1 !n2 ! · · · nr !
SimPerm(c(n1,n2,...,nr))
Example
In a hospital, an operating room needs to schedule 2 (identical)
brain surgeries, 3 (identical) knee surgeries and 2 (identical) hip
surgeries in a day. How many schedules are there?
(2 + 3 + 2)!
= 210.
2!3!2!
SimPerm(c(2,3,2))
10 / 44
Combination Rule
A combination is a selection of r items from a set of n where order
does not matter.
Example
If S = {a, b, c}, n = 3. Then
I If pick r = 3 out, we have 1 combination: abc (the same as
acb, bca,...)
I If pick r = 2 out, we have 3 combinations: ab, bc, ac.
nCr(n,r)
11 / 44
Example: Combination Rule
Answer:
Step 1: We need to sample 2 defectives out of the 3 defectives,
which has C23 = 3 different ways.
Step 2: To sample the remaing 4 non-defective parts out of the toal
47 ones, which has C447 = 178, 365 different ways.
Thus, in total, there are C23 ⇥C447 = 3⇥178, 365 = 535, 095 different
ways.
nCr(3,2)*nCr(47,4)
12 / 44
Events and Set Operations
13 / 44
Example: Discrete Events
Suppose that the recycle times of two cameras are recorded. Con-
sider only whether or not the cameras conform to the manufacturing
specifications. We abbreviate yes and no as y and n. The sample
space is S = {yy , yn, ny , nn}. Let
I E1 denote an event that at least one camera conforms to
specifications, then E1 = {yy , yn, ny },
I E2 an event that no camera conforms to specifications, then
E2 = {nn},
I and E3 an event that at least one camera does not conform,
then E3 = {yn, ny , nn}.
We have
I E1 [ E3 = S
I E1 \ E3 = {yn, ny }
I E1c = {nn}
14 / 44
Example: Continuous Events
15 / 44
Venn Diagrams
16 / 44
Mutually Exclusive Events
17 / 44
Some laws of set operations
I Commutative law:
A\B =B \A
A [ B = B [ A.
I Distributive law:
A \ (B [ C ) = (A [ C ) \ (A [ B)
A [ (B \ C ) = (A \ C ) [ (A \ B)
I Associative law:
(A \ B) \ C = A \ (B \ C )
(A [ B) [ C = A [ (B [ C )
I Complement law: (Ac )c = A
I De Morgan’s law:
(A [ B)c = Ac \ B c
(A \ B)c = Ac [ B c
18 / 44
Probability
Probability is the likelihood or chance that a particular outcome or
event from a random experiment will occur.
Denote by P(E ) the probability of event E will occur.
Mathematically, probability P(E ) is a number between 0 and 1 that
is assigned to the event E from a random experiment.
How to assign probabilities?
I Subjective probability: a "degree of belief." (e.g., There is a
50% chance that I will study tonight.")
I Relative frequency probability: based on how often an event
occurs over a very large sample space; i.e.,
P(E ) = limn!1 n(A)/n.
I Equally-likely rule: proability of each member of the sample
space is the same.
I ...
19 / 44
Relative frequency probability
Flip a fair coin repeatedly, the relative frequency of observing "head"
approaches the probability P(”head”) = 0.5.
1.0
0.9
0.8
0.7
n(E)/n
0.6
0.5
0.4
21 / 44
Example
Again, from a bin of 50 parts, 6 parts are selected randomly without
replacement. The bin contains 3 defective parts and 47 nondefective
parts. What is the probability that exactly 2 defective parts are
selected in the sample?
Answer: when randomly appears, it means equally-likely rule!
22 / 44
Probability of an Event (Discrete)
23 / 44
Example
24 / 44
Example
A wafer is randomly selected from a batch that is classified by con-
tamination and location.
27 / 44
Addition Rules: 3 or more events
k
X
P(E1 [ E2 [ · · · [ Ek ) = P(Ei ).
i=1
Example
Let X denote the pH of a sample. Consider the event that X is
greater than 6.5 but less than or equal to 7.8. Then P(6.5 < X
7.8) = P(6.5 < X 7) + P(7 < X 7.5) + P(7.5 < X 7.8).
28 / 44
Conditional Probability
P(B|A) is the probability of event B occurring, given that event A
has already occurred.
P(A \ B)
P(B|A) = for P(A) > 0.
P(A)
30 / 44
Example
31 / 44
Example
Answer: Let A and B denote the events that the first and second
stages meet specifications, respectively. The probability requested is
32 / 44
Total Probability Rule
For any two events A and B:
P(B) = P(B \ A) + P(B \ Ac ) = P(B|A)P(A) + P(B|Ac )P(Ac ).
For more than 2 events:
Assume E1 , E2 , . . . , Ek are k mutually exclusive and exhaustive sets;
i.e.,
I Ei \ Ej = ; for i 6= j (mutually exclusive)
I E1 [ E2 [ · · · [ Ek = S (exhaustive)
Then
33 / 44
Example
Let F denote the event that the product fails, and H the event that
the chip is exposed to high levels of contamination. Find P(F ).
Answer: The third column tells us that P(H) = 0.2 and P(H c ) =
0.8. The first column tells P(F |H) = 0.1 and P(F |H c ) = 0.005.
We can use total probability rule to find P(F ):
34 / 44
Example
Find P(F ) based on the following information.
Probability Level of Probability
of Failure Contamination of Level
0.100 High 0.2
0.010 Medium 0.3
0.001 Low 0.5
Answer: The third column tells us that P(H) = 0.2, P(M) = 0.3
and P(L) = 0.8. We see that H, M, L are mutually exclusive and
P(H) + P(M) + P(L) = 1 indicating they are also exhaustive.
The first column tells P(F |H) = 0.1, P(F |M) = 0.01, and P(F |L) =
0.001. We can use total probability rule to find P(F ):
P(F ) =P(F |H)P(H) + P(F |M)P(M) + P(F |L)P(L)
=0.1 ⇥ 0.2 + 0.01 ⇥ 0.3 + 0.001 ⇥ 0.5
=0.0235.
35 / 44
Independence
36 / 44
Independence
Two events are independent if any one of the following equivalent
statements is true:
1. P(A|B) = P(A)
2. P(B|A) = P(B)
3. P(A \ B) = P(A) · P(B)
This means that occurrence of one event has on impact on the prob-
ability of occurrence of the other event.
I If A and B are mutually exclusive, are they independent?
I If (A and B) are independent, so are (A and B c ), (Ac and B),
(Ac and B c ).
Independence with multiple events
The events E1 , E2 , . . . , En are independent, if and only if, for any
subsets of these events:
37 / 44
Circuit Operation
The following circuit operates only if there is a path of functional
devices from left to right. The probability that each device functions
is shown on the graph. Assume that devices fail independently.
What is the probability that the circuit operates?
Answer:
P(L \ M \ R) =P(L)P(M)P(R)
= (1 0.13 )(1 0.052 )0.99 = 0.987.
40 / 44
Bayes’ Theorem
P(B|A)P(A)
P(A|B) = for P(B) > 0.
P(B)
Example
Let F denote the event that the product fails, and H the event that
the chip is exposed to high levels of contamination. Find P(H|F ),
the conditional probability that a high level of contamination was
present when a failure occurred is to be determined.
P(B|E1 )P(E1 )
P(E1 |B) =
P(B)
P(B|E1 )P(E1 )
= .
P(B|E1 )P(E1 ) + P(B|E2 )P(E2 ) + · · · + P(B|Ek )P(Ek )
43 / 44
Example: Bayesian Network
44 / 44