Chapter #2 Probability Part II
Chapter #2 Probability Part II
Chapter 2: Probability
1
Learning Objectives
2
2-2 Interpretations and Axioms of Probability
Introduction
4
2-4. Conditional Probability
Definition
P (B | A): means the probability that event B occurs given that A has
occurred.
Example:
Bag containing three white balls and two red balls:
5
Conditional Prob: Example Tree Diagram
Machines A and B make components, which are then placed on a
conveyor belt. Of those made by machine A, 93% are acceptable. Of those
made by machine B, 95% are acceptable. Machine A makes 60% of the
components and machine B makes the rest.
Find the probability that a component selected at random from the conveyor
belt is
a) made by machine A
b) made by machine A and acceptable
c) made by machine B and acceptable
d) made by machine B and unacceptable
e) acceptable
f) made by machine A given it is acceptable
6
7
Conditional Probability (2)
Example: In a manufacturing process, 10% of parts contain visible surface
flaws (F) and 25% of these parts are defective (D). 5% of parts without surface
flaws are defective.
D: Defective
F: Surface Flaw
P(D|F) = 25%
P(D|F’) = 5%
Example: The table below shows an example of 400 parts classified by surface flaws
and functionality defective.
9
Compound Probability
In general if A and B are two events, the compound probability of both A and
B event occurring is given by
P(A ∩ B) = P(A) P(B | A) (I)
Note that if A and B are independent events the from Equation (I)
P(A ∩ B) = P(A)P(B) ⇒ P(B | A) = P(B)
Example: Bag containing three white balls and two red balls
10
11
2-5. Multiplication and Total Probability
Rules
Multiplication Rule
12
Multiplication and Total Probability Rules
Let E denote the outcomes with the first part from tool 1 and the
second part from tool 2.
Find P(E)?
P(E) represents the outcome of selecting part of tool 1 and then followed
by the outcome of the conditional probability of selecting a part of tool 2
given that a part of tool 1 is already selected.
13
Total Probability Rule (Multiple Events)
14
Example 17: Semiconductor Failures-1
15
Example 17: Semiconductor Failures-2
16
Multiplication and Total Probability Rules
Total Probability Rule:
Sometimes the probability of an event is given under each of
several conditions.
18
Multiplication and Total Probability Rules
Example:
19
2-5 Multiplication and Total Probability
Rules
20
2-6. Independence
Example:
–The circuit fails if one of the devices fails.
–The probability that each device functions is shown in the graph.
–Assume that devices fail independently.
–What is the probability that the circuit operates?
21
Independence
Example (cont.):
L R
Let L and R denote the events that the left and right
devices operate, respectively. 0.8 0.9
The probability that the circuit operates is:
𝑃𝑃 𝐿𝐿 𝑎𝑎𝑎𝑎𝑎𝑎 𝑅𝑅 = 𝑃𝑃 𝐿𝐿∩𝑅𝑅 = 𝑃𝑃 𝐿𝐿 𝑃𝑃 𝑅𝑅
𝑃𝑃 𝐿𝐿∩𝑅𝑅 = 0.8 0.9 = 0.72
T
0.95
Example: a
0.95
b
– The circuit operates if at least one device functions
– What is the probability that the circuit operates? B
22
Independence
Example (cont.):
Let T and B denote the events that the top and bottom devices operate,
respectively.
The probability that the circuit operates is:
𝑃𝑃(𝑇𝑇 𝑜𝑜𝑜𝑜 𝐵𝐵) = 1 − 𝑃𝑃[(𝑇𝑇 𝑜𝑜𝑜𝑜 𝐵𝐵)’] = 1 − 𝑃𝑃[𝑇𝑇𝑇 𝑎𝑎𝑎𝑎𝑎𝑎 𝐵𝐵𝐵]
= 1 − 𝑃𝑃[𝑇𝑇𝑇] ∗ 𝑃𝑃[𝐵𝐵𝐵]
𝑃𝑃 𝑇𝑇 ∪ 𝐵𝐵 = 𝑃𝑃 𝑇𝑇 ∩ 𝐵𝐵 = 𝑃𝑃 𝑇𝑇 × 𝑃𝑃 𝐵𝐵 = 1 − 𝑃𝑃 𝑇𝑇 × 1 − 𝑃𝑃 𝐵𝐵
= (1 − 0.95) (1 − 0.95) = (0.05)2
=
𝑷𝑷(𝑻𝑻 𝒐𝒐𝒐𝒐 𝑩𝑩) = 𝟏𝟏 − (𝟎𝟎. 𝟎𝟎𝟎𝟎) 𝟐𝟐 𝟎𝟎. 𝟗𝟗𝟗𝟗𝟗𝟗𝟗𝟗
23
Independence
Definition (two events)
24
Independence
25
Independence
Example:
The circuit below operates if there is a path of functional devices from
left to right.
What is the probability that the circuit operates?
26
2-7. Bayes’ Theorem
Remember what we mentioned about total probability rules that
sometimes information is given in terms of conditional probability.
In other words; you would like to know the chance that the failure is
due to the high contamination condition.
27
Bayes’ Theorem (cont.)
Thomas Bayes addressed this issue in 1700 and developed the Bayes’
theorem.
Example: recall the example solved on slide 12:
28
Bayes’ Theorem
𝑃𝑃 𝐹𝐹 𝐻𝐻 𝑃𝑃 𝐻𝐻
𝑃𝑃 𝐻𝐻 𝐹𝐹 = Multiplication Rule slide # 2-15
𝑃𝑃(𝐹𝐹)
0.10 × 0.20
𝑃𝑃 𝐻𝐻 𝐹𝐹 = = 0.83
0.024
29
Bayes’ Theorem
Bayes’ Theorem
There are many conditions that could cause the outcome B (E1, E2, …, EK).
All of these conditions are mutually exclusive. What is the chance that the
current outcome has been caused by the E1 condition.
30
Example: Bayesian Network:
Bayesian networks are used on the web sites of high technology
manufacturers to allow customers to quickly diagnose problems with
products.
A printer manufacturer obtained the following probabilities from a
database of test results.
Printer failures are associated with three types of problems: HW, SW
and Others (such as connectors) with probabilities of 0.1, 0.6 and 0.3
respectively.
The probability of a printer failure given HW problem is 0.9, given SW
problem is 0.3 and given any other of problem is 0.5.
If a customer enters the manufacturer's web site to diagnose a
printer failure, what is the most likely cause of the problem??
31
Example 2.38: Bayesian Network (2)
Let H, S, and O denote a HW , SW and other problems respectively, and let F
denote a printer failure.
𝑃𝑃 𝐹𝐹\𝐻𝐻 𝑃𝑃 𝐻𝐻
Baye’s Theorem : 𝑃𝑃 𝐻𝐻\F =
𝑃𝑃(𝐹𝐹)
The most likely cause of the problem is the one that corresponds to the
largest of 𝑃𝑃 𝐻𝐻\F , 𝑃𝑃 𝑆𝑆\F and 𝑃𝑃 𝑂𝑂\F
Baye’s theorem Denominator:
𝑃𝑃 𝐹𝐹 = 𝑃𝑃 F\H 𝑃𝑃 𝐻𝐻 + 𝑃𝑃 F\S 𝑃𝑃 𝑆𝑆 + 𝑃𝑃 F\O 𝑃𝑃 𝑂𝑂
= 0.9 0.1 + 0.3 0.6 + 0.5 0.3 = 0.42
Then
𝑃𝑃 𝐹𝐹\𝐻𝐻 𝑃𝑃 𝐻𝐻 0.9 0.1
𝑃𝑃 𝐻𝐻\F = = = 0.21
𝑃𝑃 𝐹𝐹 0.42
𝑃𝑃 𝐹𝐹\S 𝑃𝑃 𝑆𝑆 0.3 0.6
𝑃𝑃 𝑆𝑆\F = = = 0.43
𝑃𝑃 𝐹𝐹 0.42
𝑃𝑃 𝐹𝐹\O 𝑃𝑃 𝑂𝑂 0.5 0.3
𝑃𝑃 𝑂𝑂\F = = = 0.36
𝑃𝑃 𝐹𝐹 0.42
Notice: 𝑃𝑃 𝐻𝐻\F + 𝑃𝑃 𝑆𝑆\F + 𝑃𝑃 𝑂𝑂\F = 1 cause the 3 types of problems is
responsible for failure.
Because 𝑷𝑷 𝑺𝑺\𝑭𝑭 is the largest, the most cause of the problem is the SW
category
32
Permutations and Combinations
Another way to determine the number of outcomes of an event is to use the permutation
rules. An arrangement of n distinct objects in a specific order is called a permutation.
EXAMPLE: Art dealer has 3 paintings, say A, B, and C, to arrange in a row on a wall.
There would be 6 distinct ways to display the paintings. They are: ABC BAC CAB ACB
BCA CBA
The total number of different ways can be found using the fundamental counting rule.
There are 3 ways to select the first object, 2 ways to select the second object, and 1 way to
select the third object. Hence, there are 3 × 2 × 1 = 6 different ways to arrange three
objects in a row on a shelf.
Another way to solve this kind of problem is to use permutations. The number of
permutations of n different objects using all the objects is n! = n×(n-1)×(n-2)…2×1
EXAMPLE: In how many different ways can 6 people be arranged in a row for a
photograph?
SOLUTION: This is a permutation of 6 objects. Hence 6! = 5 × 4 × 3 × 2 = 720 ways.
33
Permutations
34
Permutations of Subsets
marbles of different
colors
35
Permutations of Subsets: Example 2-10
Different
components
Holes
36
Permutations of Similar Objects
37
Permutations Similar Objects: Example 2-11
4!
2! 2!
n d d n
n d n d
n n d d
38
Permutations of Similar Objects: Example 2-12
9!
4! 3! 2!
39
Counting–Subset Permutations and an
example
40
Combinations
Combination is a selection of r distinct objects from n distinct objects
Example: Suppose two letters are selected from the four letters, A, B, C, and D.
The different permutations are shown on the left and the different combinations
are shown on the right.
Permutations: Combinations:
AB BA CA DA AB BC
AC BC CB DB AC BD
AD BD CD DC AD CD
Example: There are three routes, A, B and C, joining two computers. In how
many ways can two routes can be chosen from A, B and C.
Example:
marbles
42
Combinations: Example 2-13
8! 8!
C 8,5 = =
(8 − 5)! 5! 5! 3!
43
Permutations and Combinations
Notice the difference between Permutations and Combinations:
44
Tutorial
A computer system uses passwords that are exactly seven characters
and each character is one of the 26 letters (a-z) or 10 integers (0-9).
Uppercase letters are not used. Every character is used only once.
36!
𝑃𝑃(36, 7) = = 42072307200
(36−7=29)!
47
Tutorial
2. If a password consists of exactly 6 letters and one number,
how many passwords are possible?
a. For a particular layout (the number is the last digit)
How many password can be generated?
L L L L L L #
26! 10!
P(26,6)*P(10,1)=
26−6=20 ! 10−1=9 !
= 26 ∗ 25 ∗ 24 ∗ 23 ∗ 22 ∗ 21 ∗ 10=1.657.656.000
26! 10!
P(26,5)*P(10,2)=
26−5=21 ! 10−2=8 !
= 26 ∗ 25 ∗ 24 ∗ 23 ∗ 22 ∗ 10*9 =
b. but how many possible layout? (possible ways to place the two numbers)
it is equivalent to a selection of 2 item out 7 (combination of 2 out of 7): 72 = 21
53
Tutorial 1 (cont.)
6. The lifespans L of 2500 components were measured and the results were
recorded in the table below
Lifespan(hours) Number of components
0 ≤ L < 200 76
200 ≤ L < 300 293
300 ≤ L < 400 574
400 ≤ L < 500 1211
500 ≤ L < 600 346
a) Calculate the probability that a component has a lifespan of over 400 hours
b) Calculate the probability that a component has a life span of less than 300
Hours
c) Calculate the probability that a component that lasts for 300 hours will continue
to last for at least 500 hours.
7. Two people, A and B, rolled an unbiased die. The first to toss a 6 wins
Dhs10. Find A’s expected winnings if A goes first.
54