MetNum1 2023 1 Week 11 Corrected
MetNum1 2023 1 Week 11 Corrected
Semester 2023/1
Week 11
1
Topics covered in Part 1
Week Title
Week 9 Introduction to statistics and probability
Week 10 Descriptive statistics and sampling techniques
Week 11 Probability theory
Week 12 Discrete and continuous probability distributions
Week 13 Variance, co-variance, and correlation
Week 14 Statistical inference methods
Week 15 Statistical analysis using Octave/MATLAB
Week 16 UAS
2
Outline
1. Sample spaces
3. Conditional probability
4. Probability distributions
Meme of the week
4
Topic 1: sample spaces
5
Sample spaces
The individual outcomes are called elementary outcomes (denoted as e1, e2,
e3, … and so on), simple events, or elements of the sample space.
An event is said to occur when any one of the elementary outcomes in that
event occurs.
Sample spaces
Sample spaces can be either discrete (only having integer values) or continuous
(having any numerical value within a given range).
For example:
Ø Rolling a regular six-sided die
S = {1,2,3,4,5,6} à discrete
7
Sample spaces
To further illustrate sample spaces, let us revisit the situation of tossing a coin twice. The possible
outcomes for tossing a coin twice are HH, HT, TH, and TT. The corresponding sample space is
𝑛 𝑆 =4 𝑛 𝐴 =2 𝑛 𝐵 =1
Class Exercise 1: sample spaces
9
Topic 2: event relations and
Venn diagrams
10
Event relations
Union - A ∪ B
Ø The event consisting of all outcomes that are either in A or B or
both.
Intersection - A ∩ B
Ø The event consisting of all outcomes that are in both A and B (also
known as the joint probability).
0≤𝑃 𝐴 ≤1
𝑛(𝐴)
𝑃 𝐴 =
𝑛(𝑆)
𝑃 𝐴 = - 𝑃(𝑒)
!"" $ %& '
𝑃 ∅ =0
𝑃 𝑆 = - 𝑃(𝑒) = 1
𝑃 𝐴 +𝑃 𝐴) =1 !"" $ %& (
12
Worked Example 1: probabilities of events
A random experiment has the sample space {a,b,c,d}, with all outcomes being equally
likely. Let events A = {a,b}, B = {b,c,d}, and C = {d}.
Find (a) P(A), (b) P(B), (c) P(C), (d) P(A¢ ), (e) P(A ∩ B), (f) P(A U B), and (g) P(A ∩ C).
Solution:
(a) P(A) = P(a) + P(b) = 0.25 + 0.25 = 0.5
(b) P(B) = P(b) + P(c) + P(d) = 0.25 + 0.25 + 0.25 = 0.75
(c) P(C) = P(d) = 0.25
(d) P(A¢) = 1 – P(A) = 0.5
(e) A ∩ B = {b}, P(A ∩ B) = 0.25
(f) A U B = {a,b,c,d}, P(A U B) = 1.0
(g) A ∩ C = ∅, P(A ∩ C) = 0
13
Venn diagrams and event relations
• In a Venn diagram, a
rectangle represents the
sample space and circles (or
similar) drawn inside the
rectangle represent events.
14
Venn diagrams and event relations
For a sample space with three events, the Venn diagram contains eight distinct
regions. In the diagram below, these are labelled as a, b, c, d, e, f, g, and i.
D ∩ H = regions g and f
T ∩ H = regions g and e
D ∪ T = regions a, d, e, g, b, f
H ) ∩ D = regions b and d
D ∩ H ∩ T = region g
15
Worked Example 2: Venn diagrams and
event relations
Four puppy dogs from different litters
are available for a new method of
training. The dogs are labelled from
1-4, as shown in the table:
Two dogs will be selected by lottery (i.e., at random) to receive the training.
Considering all possible choices:
(a) Make a Venn diagram showing the following events:
A: The selected dogs are of the same sex.
B: The selected dogs are of the same age.
(b) Find (i) A ∪ B , (ii) A ∩ B and (iii) 𝐴!
Worked Example 2: Venn diagrams and
event relations
Solution:
The elementary outcomes are the possible choices of a pair of dogs, as follows:
e1 = {1,2}, e2 = {1,3}, e3 = {1,4}, e4 = {2,3}, e5 = {2,4}, e6 = {3,4}
& ' *
(b) 𝑃 𝐴 = & (
= +,
(c) 𝑆 − 𝐴 ∪ 𝐵 = 𝐴 ∪ 𝐵 ) = 7,8,11
)
3 1
∴𝑃 𝐴∪𝐵 = =
12 4
Mutually exclusive (disjoint) events
20
Addition rule of probability
For any two events A and B, the probability of union is given by:
𝑃 𝐴∪𝐵 =𝑃 𝐴 +𝑃 𝐵 −𝑃 𝐴∩𝐵
∴𝑃 𝐴∪𝐵 =𝑃 𝐴 +𝑃 𝐵
21
Worked Example 5: addition rule
In Worked Example 2, what is the probability that the selected puppies are either
of the same sex or the same age (or both)?
Solution:
A = [Same sex] = {e1, e6} à P(A) = 2/6
B = [Same age] = {e2, e3, e6} à P(B) = 3/6
A ∩ B = {e6} à P(A ∩ B) = 1/6
∴𝑃 𝐴∪𝐵 =𝑃 𝐴 +𝑃 𝐵 −𝑃 𝐴∩𝐵
! # $ % !
="+"−"="=#
Other rules for event relations
23
Class Exercise 2: event relations
(a) List the elementary outcomes (e1, e2, …) of tossing three coins.
(b) Define the sample space of each event and state which pairs of events are
mutually exclusive.
24
Topic 3: conditional
probability
25
Conditional probability
So far, we have looked at events that were independent, such as tossing
coins; in other words, the outcome of one event does not affect the
outcome of the other.
𝑃 𝐴∩𝐵
𝑃 𝐵|𝐴 =
𝑃(𝐴)
26
Worked Example 4: conditional probability
Complementary alternative medicine (CAM), including acupuncture, yoga, and
massage has become more popular. The table shows the proportion of people in
various weight categories who used CAM in the past year:
.38
(a) What is the probability that a person selected at random from this population will
have used CAM in the past year?
(b) A person selected at random is found to be overweight. What is the probability
that this person used CAM in the past year?
Worked Example 4: conditional probability
Solution:
A = a person used CAM
B = a person is overweight
(a) As 32% of the people used CAM and the individual was selected at random, the
unconditional probability of A, P(A) = 0.38.
(b) Given that the selected person is overweight, the third column shows that for the
subgroup of overweight persons, the proportion using CAM is 0.12 while the total
proportion is 0.33. Therefore, the conditional probability that the person used CAM given
that that they are overweight is
𝑃 𝐴∩𝐵 0.12
𝑃 𝐴|𝐵 = = = 0.316
𝑃(𝐵) 0.38
Worked Example 5: conditional probability
Of a sample of 400 machine parts, the table shows the number of parts that are
defective (D) and how many of these have surface flaws (F):
Parts Classified
Surface Flaws
Defective Total
Yes (F ) No (F' )
Yes (D ) 10 18 28
No (D' ) 30 342 372
Total 40 360 400
29
Worked Example 5: conditional probability
Solution:
Parts Classified
Surface Flaws 28 40
Defective Total 𝑃 𝐷 = 𝑃 𝐹 =
Yes (F ) No (F' ) 400 400
Yes (D ) 10 18 28
No (D' ) 30 342 372
Total 40 360 400
105 𝑃 𝐷 ∩ 𝐹′ 185
𝑃 𝐷∩𝐹 400 10 𝑃 𝐷|𝐹′ = = 400 = 18
𝑃 𝐷|𝐹 = = = 𝑃(𝐹′) 3605 360
𝑃(𝐹) 405 40 400
400
𝑃 𝐷′ ∩ 𝐹′ 3425
𝑃 𝐷′ ∩ 𝐹 305
400 30 𝑃 𝐷′|𝐹′ = = 400 = 342
𝑃 𝐷′|𝐹 = = = 𝑃(𝐹′) 3605 360
𝑃(𝐹) 405 40 400
400
30
Multiplication rule of probability
It states that the probability of two events occurring is equal to the conditional
probability of an event multiplied by the probability of the conditioning event.
In symbols:
𝑃 𝐴∩𝐵 = 𝑃 𝐴|𝐵 𝑃 𝐵
𝑃 𝐴∩𝐵 = 𝑃 𝐵|𝐴 𝑃 𝐴
31
Class Exercise 3: event relations
(b) Construct a Venn diagram of these events. Hence, shade the area 𝑃(𝐴> ∩ 𝐵) on the
diagram and calculate its value.
32
Worked Example 6: multiplication rule
The probability that a part made in the first stage of a machining operation meets
specifications is 0.90. The probability that it meets specifications in the second
stage, given that it met specifications in the first stage is 0.95. What is the
probability that both stages meet specifications?
Solution:
Let A and B denote the events that the part has met 1st and 2nd stage
specifications, respectively. Hence,
33
Event independence
Let us revisit the concept of independence. Two events A and B are said to be
independent if any one of the following equivalent statements is true:
1. 𝑃(𝐴 | 𝐵) = 𝑃(𝐴)
2. 𝑃(𝐵 | 𝐴) = 𝑃(𝐵)
3. 𝑃(𝐴 ∩ 𝐵) = P(𝐴) · P(𝐵)
This means that occurrence of one event has no impact on the probability of
occurrence of the other event.
Multiple events E1, E2, … , Ek are independent if and only if, for any subset of these
events:
𝑃(𝐸1 ∩ 𝐸2 ∩ … ∩ 𝐸𝑘) = 𝑃(𝐸1) · 𝑃(𝐸2) · ⋯ · 𝑃(𝐸𝑘)
34
Worked Example 7: event independence
Tables 1 and 2 are examples of 400 machine parts classified by whether they have surface
flaws (F) and/or are defective (D).
For each set of data, determine whether the two events are independent.
Table 1 Table 2
Surface Flaws Surface Flaws
Defective Yes (F) No (F') Total Defective Yes (F) No (F') Total
Yes (D) 10 18 28 Yes (D) 2 18 20
No (D') 30 342 372 No (D') 38 342 380
Total 40 360 400 Total 40 360 400
35
Worked Example 7: event independence
Solution:
Table 1 Table 2
Surface Flaws Surface Flaws
Defective Yes (F) No (F') Total Defective Yes (F) No (F') Total
Yes (D) 10 18 28 Yes (D) 2 18 20
No (D') 30 342 372 No (D') 38 342 380
Total 40 360 400 Total 40 360 400
36
Class Exercise 4: event independence
For a given chip manufacturer, the probability that a silicon wafer contains a
large contaminant particle is 0.01, and the wafers are assumed to be
independent (i.e., the probability that a wafer is contaminated does not depend
on the characteristics of any of the other wafers). If 15 random wafers are
analyzed, what is the probability that no large particles are found?
37
Counting possible outcomes
Two ways of counting the number of possibilities when selecting objects from a
larger group are combinations and permutations.
39
Combinations
The number of distinct subsets that can be formed taking r objects at a time from
a set of n different objects (when order does not matter) is known as the number
of combinations, denoted as
# 𝑛! 𝑛
𝐶$ = =
𝑟! 𝑛 − 𝑟 ! 𝑟
For example, the number of possible combinations of 3 objects taken from a set
of 5 objects is
5 5! 5 (4) 3 2 (1)
= = = 10
3 3! 5 − 3 ! 3 2 1 2 (1)
40
Worked Example 8: combinations
Five qualified individuals (two men and three women) wish to apply for two engineering job
positions in Pertamina. If the positions are filled by randomly selecting two of the five
applicants, what is the probability that neither of the men is selected?
Solution:
The number of ways two persons can be selected out of five is given by
5 5! 5 (4)
= = = 10
2 2! 5 − 2 ! 2 (1)
3
The number of possible pairs of women are =3
2
3
Let A be the event that both selected persons are women. 𝑃 𝐴 =
10
Permutations
The number of subsets that can be formed taking r objects at a time from a
set of n different objects (where order is important) is known as the number
of permutations, denoted as
- 𝑛!
𝑃. =
𝑛−𝑟 !
* 5!
𝑃A = = 5(4)(3) = 60
5−3 !
42
Worked Example 9: permutations
A scrabble player gets the tiles RWODIAL for his next turn. According to the TWL dictionary, there are
15 valid two-letter words he could make. What is the probability that he will get one of these words if
he picks two letters at random?
Solution:
The number of possible two-letter words
(with or without meaning) are
' 7!
𝑃( = = 7(6) = 42
7−2 !
How many numbers greater than 5000 may be formed by using some
combination of the digits 3, 4, 5, 6, and 7 (but only those), without
repetition?
44
Topic 4: probability
distributions
45
Random variables
For example, when tossing two coins, you could define a random variable X
as the number of heads obtained. Hence, the outcomes TT, HT, TH, and HH
take values of 0,1,1, and 2, respectively. The set of possible values of X
(also known as the range of X or RX) is {0,1,2}.
𝑓 𝑥% = 𝑃 𝑋 = 𝑥%
Note that:
1. 0 ≤ 𝑓 𝑥" ≤ 1
2. ∑%"#$ 𝑓 𝑥" = 1
48
Probability distributions
For example, if a fair coin is tossed three times, with X = number of heads, the
probability distribution of X is as follows:
𝒙𝒊
HHH 1/8 3 0.4
P(x = 0) = 1/8
HHT 1/8 2 P(x = 1) = 3/8 0.3
2 P(x = 2) = 3/8
HTH 1/8
P(X = xi)
P(x = 3) = 1/8 0.2
THH 1/8 2
0.1
HTT 1/8 1
Note: 0
THT 1/8 1 1 3 3 1
+ + + =1 0 1 2 3
TTH 1/8 1 8 8 8 8
xi
TTT 1/8 0
Cumulative distribution function
𝐹(𝑥) = 𝑃 𝑋 ≤ 𝑥 = - 𝑓 𝑥%
C! DC
50
Cumulative distribution function
𝐹(𝑥𝑖)
0.6
1 0.375 0.5
0.4
2 0.375 0.875 0.2
3 0.125 1 0
0 1 2 3
𝑥𝑖
51
Class Activity: random variables
Let X be a random variable corresponding to the sum of the numbers obtained from rolling
two fair dice, e.g.
+ = 7
Activity: Let each person in the class roll two dice (e.g. using freeonlinedice.com) and
record the frequency of the value of x obtained. What does the frequency distribution look
like?
If the experiment was repeated a very large number (say 1000) times, what would you
expect the frequency distribution to look like?
52
Problem Set 3
53
Question 1
54
Question 2
Location of Tool
Contamination Total
Center Edge
Low 514 68 582
High 112 246 358
Total 626 314 940
(a) What is the probability that the wafer has low contamination, given that it is
located at the center of the sputtering tool?
(b) Draw a Venn diagram of the information in the table.
55
Question 3
A chamber of commerce board has seven total members, drawn from a pool of
twenty candidates. There are two stages in the board's election process. First, a
president, secretary, and treasurer are chosen. After that, four general members
(without any specific title) are chosen. How many possible boards could be
chosen?
56
Questions 4, 5
5
Question 6
Question 7
59