QMEF Session04
QMEF Session04
1
1
2
2
BASIC COUNTING PRINCIPLE
> Do you know how to count?
How large is 2 ? How many elements?
Recall:
• 2 is the set of all subsets of the sample space.
> If 𝑆 = 𝐻, 𝑀, 𝐹 , how many elements are in 2 ?
3
3
4
4
BASIC COUNTING PRINCIPLE
If 𝐴 is a set that contains 4 elements, then the number of
elements is noted as:
#𝐴 = 4
E.g.: 𝑆 = 𝐻, 𝑀, 𝐹 , then
#𝑆 = 3
5
5
7
7
8
8
BASIC COUNTING PRINCIPLE
Notion: Basic Counting Principle
• A principle that determines the number of possibilities in a procedure.
• If the procedure involves a sequence of k stages, and if each stage has n
possibilities.
• Then: the total number of possibilities is:
𝑛 ⋅ 𝑛 ⋅ 𝑛 ⋅…⋅𝑛
𝑛 = 𝑛 ⋅𝑛 ⋅…⋅𝑛
12
12
COMBINATIONS
> Quality Control in Manufacturing
You are the Chief Operating Officer (COO) of the small business. You want to
determine whether there are many defective 3D printers that come out of the
production line.
When you select a printer, there are 2 possibilities:
• Defective: 𝐷
• Good to go: 𝐺
Remark
• We are not in the classical context anymore. The events of defect and good to
go are not equally likely.
• The random experiment here is the 3D printer being either defective or good
to go.
13
13
COMBINATIONS
> As the COO, you select randomly five 3D printers for testing.
> You find one defective printer.
> How many possibilities are there, for which you can find one
defective printer out of five selected printers?
> Let’s list them: Possibility Printer 1 Printer 2 Printer 3 Printer 4 Printer 5
1 D G G G G
2 G D G G G
3 G G D G G
4 G G G D G
5 G G G G D
There are 5 possibilities. 14
14
COMBINATIONS
Notion: Combination
• A way of selecting items from a group, where the order of selection does not
matter.
• In mathematical terms, the number of ways to choose 𝑟 items out of a group
of 𝑛.
15
15
COMBINATIONS
Formula:
𝑛!
𝐶 =
𝑟! 𝑛 − 𝑟 !
where ! stands for the factorial function.
Recall factorials:
• 𝑛! = 𝑛 ⋅ 𝑛 − 1 ⋅ 𝑛 − 2 ⋅ … ⋅ 1
• Example: 3! = 3 × 2 × 1 = 6
• 0! = 1 by definition.
• 𝑘! for any 𝑘 < 0 is undefined.
* Can you find the button nCr on your calculator?
16
16
COMBINATIONS
> Return to our example:
> How many ways can we have one defective 3D printer out of five
different printers?
5!
𝐶 =
1! 5 − 1 !
5!
=
4!
5 × 4!
=
4!
= 5
17
17
COMBINATIONS
Exercise:
Assume there are two defective 3D printer in five different printers.
What are the possible ways we can choose two defective printers out
of five?
1. Make a list and count the possibilities.
2. Use the formula for 𝐶 .
3. Use your calculator.
18
18
COMBINATIONS
Exercise:
Assume there are two defective 3D printer out of five different printers.
What are the possible ways we can choose two defective printers out
of five?
1. Make a list and count the possibilities.
Possibility 1 2 3 4 5 Possibility 1 2 3 4 5
1 D D G G G 6 G D G D G
2 D G D G G 7 G D G G D
3 D G G D G 8 G G D D G
4 D G G G D 9 G G D G D
5 G D D G D 10 G G G D D
19
19
COMBINATIONS
Exercise:
Assume there are two defective 3D printer out of five different printers.
What are the possible ways we can choose two defective printers out
of five?
2. Use the formula for 𝐶 .
5!
𝐶 =
2! 5 − 2 !
5! 5 × 4 × 3! 5 × 4 20
= = = = = 10
2! 3! 2! 3! 2! 2
20
20
BERNOULLI TRIALS
Notion: Bernoulli trial
• A random experiment where there are two possible outcomes: “success” and
“failure”.
• The probability of getting a “success” and is denoted by 𝑝.
• The probability of getting a “failure” and is denoted by 𝑞 .
• Since these two events are mutually exclusive and exhaustive, we have
𝑝 + 𝑞 = 1.
• The probability of success remains the same for each trial of the random
experiment.
o E.g. the probability of having a defective 3D printer is the same, whether it is the 1st
printer, the 2nd one, etc.
• Because of that, we say that each Bernoulli trial is independent from the
others.
21
21
BINOMIAL DISTRIBUTION
> You take five 3D printers out of your production line.
> The probability of a printer being defective is 5%.
> What is the probability of having zero defective printers in this group
of five printers?
22
22
BINOMIAL DISTRIBUTION
> Case of 0 defective printer
Combination: how many possibilities are there to find 0 defective printer in a
group of 5?
!
• “Out of 5 printers, choose 0”: 𝐶 = =1
! !
Bernoulli trial: Out of 5 trials, what is the probability of 0 “success”, thus 5
“failures”?
• We have 𝑝 = 0.05 and 𝑞 = 0.95
• Since all trials are independent, we use the multiplication law for independent
events:
𝑞 ⋅ 𝑞 ⋅ 𝑞 ⋅ 𝑞 ⋅ 𝑞 = 𝑞 = 0.95 = 0.77378 …
Since there is only 1 combination, the probability of having 0 defective
printer is
𝐶 𝑞 = 1 × 0.77378 … = 0.77373 …
23
23
BINOMIAL DISTRIBUTION
> Case of 1 defective printer
Combination: how many possibilities are there to find 1 defective printer in a
group of 5?
!
• “Out of 5 printers, choose 1”: 𝐶 = ! !
=5
Bernoulli trial: Out of 5 trials, what is the probability of 1 “success” and 4
“failures”?
• We have 𝑝 = 0.05 and 𝑞 = 0.95
• Since all trials are independent, we use the multiplication law for independent
events:
𝑝 ⋅ 𝑞 ⋅ 𝑞 ⋅ 𝑞 ⋅ 𝑞 = 𝑝 ⋅ 𝑞 = 0.05 × 0.95 = 0.0407 …
Since there are 5 combinations, the probability of having 1 defective printer
is
𝐶 𝑝𝑞 = 5 × 0.0407 … = 0.2036 …
24
24
BINOMIAL DISTRIBUTION
> Case of 2 defective printer
Combination: how many possibilities are there to find 2 defective printers in
a group of 5?
!
• “Out of 5 printers, choose 2”: 𝐶 = = 10
! !
Bernoulli trial: Out of 5 trials, what is the probability of 2 “successes” and 3
“failures”?
• We have 𝑝 = 0.05 and 𝑞 = 0.95
• Since all trials are independent, we use the multiplication law for independent
events:
𝑝 ⋅ 𝑝 ⋅ 𝑞 ⋅ 𝑞 ⋅ 𝑞 = 𝑝 ⋅ 𝑞 = 0.05 × 0.95 = 0.00214 …
Since there are 10 combinations, the probability of having 2 defective
printers is
𝐶 𝑝 𝑞 = 10 × 0.00214 … = 0.0214 …
25
25
BINOMIAL DISTRIBUTION
And so on.
26
26
BINOMIAL DISTRIBUTION
> With the previous results, you can show the probability distribution
of the number of defective 3D printers out of 5.
𝑥 𝑓 𝑥 𝐹 𝑥
0 0.773781 0.773781
1 0.203627 0.977408
2 0.021434 0.998842
3 0.001128 0.99997
4 2.97E-05 1
5 3.13E-07 1
27
27
BINOMIAL DISTRIBUTION
> With the previous results, you can show the probability distribution
of the number of defective 3D printers out of 5.
Probability Mass Function of X
0.8
0.6
P(X=x)
0.4
0.2
0.0
0 1 2 3 4 5
X
28
28
BINOMIAL DISTRIBUTION
Notion: The Binomial Distribution
• The probability distribution of the number of successes from 𝑛 independent
Bernoulli trials with probability of success 𝑝.
• The probability mass function is given by:
𝑃 𝑋=𝑥 =𝑓 𝑥 = 𝐶 𝑝 𝑞
where 𝑞 = 1 − 𝑝 is the probability of failure.
• In this distribution, 𝑥 is an integer from 0 to 𝑛: 𝑅 = 0,1, … , 𝑛 .
Notion: Binomial Coefficient
• The name given to the combination used in the binomial distribution.
• 𝐶
Notion: Binomial Random Variable
• A R.V. that follows a binomial distribution.
29
29
BINOMIAL DISTRIBUTION
> Now that you know the probabilities of default 3D printers, you want
to know 2 things:
> How many defective 3D printers can you expect to have every day?
> By how much can this number change from day to day?
Notion: The Expected Value and Variance of a Binomial Random
Variable
• It can be shown that the expected value is:
𝐸 𝑋 = 𝜇 = 𝑛𝑝
• The variance and standard deviation are:
𝑉𝑎𝑟 𝑋 = 𝑛𝑝𝑞
𝜎 = 𝑛𝑝𝑞
30
30
QUALITY CONTROL IN MANUFACTURING
> Your production line allows you to produce
10 printers per day
> Based on your experience, you estimate the
probability of producing a defective printer is
5%.
1. Calculate probability of producing more
than 2 defective printers in a day?
2. Calculate the expected number of defective
printers per day.
3. Calculate the standard deviation of the
number of defective printers in a day.
31
31
KEY TAKEAWAYS
1. Understand Counting and Combinations
• The basic counting principle helps determine the total number of
possible outcomes in a procedure by multiplying possibilities
across stages.
• Combinations allow us to calculate how many ways items can be
selected when the order does not matter.
𝑛!
𝐶 =
𝑟! 𝑛 − 𝑟 !
2. Bernoulli Trials
• A Bernoulli trial is a random experiment with two outcomes:
success or failure. The probability of success (𝑝) and failure (𝑞 =
1 − 𝑝) remains constant across trials, and the trials are
independent. 32
32
KEY TAKEAWAYS
3. Binomial Distribution
• Models the number of successes in 𝑛 independent Bernoulli
trials.
• The probability mass function (PMF) is given by:
𝑃 𝑋=𝑥 = 𝐶 𝑝 𝑞
4. Expected Value and Variance
• The expected value of a binomial random variable is
𝐸 𝑋 = 𝑛𝑝
• The variance is 𝑉𝑎𝑟 𝑋 = 𝑛𝑝𝑞, and the standard deviation
is 𝜎 = 𝑛𝑝𝑞. 33
33
HOMEWORK
Re-read the slides and review your notes
Problem set Session 4
Study the notions using DeepMemory
flashcards
34
34