Probability & Statistics Overview
Probability & Statistics Overview
Probability
Istanbul Technical University
Department of Mechanical Engineering
Important Terms
Random Experiment – a process leading to an uncertain
outcome
Basic Outcome – a possible outcome of a random experiment
Sample Space – the collection of all possible outcomes of a
random experiment
Event – any subset of basic outcomes from the sample space
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 1 /77
1
Random Experiments
The goal is to understand, quantify and model the variation
affecting a physical system’s behavior.
The model is used to analyze and predict the physical system’s
behavior as system inputs affect system outputs.
The predictions are verified through experimentation with the
physical system.
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 2 /77
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 3 /77
2
Random Experiments
An experiment is an operation or procedure, carried out under
controlled conditions, executed to discover an unknown result or to
illustrate a known law.
An experiment that can result in different outcomes, even if
repeated in the same manner every time, is called a random
experiment.
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 4 /77
Figure: A closer examination of the system identifies deviations from the model.
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 5 /77
3
Sample Spaces
Random experiments have unique outcomes.
The set of all possible outcome of a random experiment is called
the sample space, S.
S is discrete if it consists of a finite or countable infinite set of
outcomes.
S is continuous if it contains an interval (either a finite or infinite
width) of real numbers.
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 6 /77
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 7 /77
4
Example: Defining Sample Spaces, n=2
Two parts are randomly selected & measured.
S = R+ * R+, S is continuous.
Do the 2 parts conform to specifications?
S = {yy, yn, ny, nn}, S is discrete.
Number of conforming parts?
S = {1, 1, 2}, S is discrete.
Parts are randomly selected until a non-conforming part is found.
S = {n, yn, yyn, yyyn, …}, S is countably infinite.
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 8 /77
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 9 /77
5
Tree Diagrams Can Fit The Situation
Example: New cars can be equipped with selected options as follows:
1. Manual or automatic transmission
2. With or without sunroof
3. Three choices of stereo sound systems
4. Four exterior color choices
Figure: Tree diagram for different configurations of vehicles. Note that S has 2*2*3*4
= 48 outcomes.
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 10 /77
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 11 /77
6
Example: Discrete Events
Suppose that the recycle times of two cameras are recorded. Consider
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}.
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 13 /77
7
Venn Diagrams Show Event Relations
Intersection of Events – If A and B are two events in a sample space
S, then the intersection, A ∩ B, is the set of all outcomes in S that
belong to both A and B
A AB B
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 14 /77
A B
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 15 /77
8
Venn Diagrams Show Event Relations
Union of Events – If A and B are two events in a sample space
S, then the union, A U B, is the set of all outcomes in S that
belong to either
A or B
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 16 /77
S
A
A
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 17 /77
9
Venn Diagrams Show Event Relations
Events A & B contain their respective outcomes. The shaded regions
indicate the event relation of each diagram.
Example
Let the Sample Space be the collection of all possible outcomes
of rolling one die:
S = [1, 2, 3, 4, 5, 6]
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 19 /77
10
Example
Complements:
A [1, 3, 5] B [1, 2, 3]
Intersections:
A B [4, 6] A B [5]
Unions:
A B [2, 4, 5, 6]
A A [1, 2, 3, 4, 5, 6] S
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 20 /77
Example
Mutually exclusive:
A and B are not mutually exclusive
The outcomes 4 and 6 are common to both
Collectively exhaustive:
A and B are not collectively exhaustive
A U B does not contain 1 or 3
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 21 /77
11
Event Relation Laws
Commutative law (event order is unimportant):
A ∩ B = B ∩ A and A ∪ B = B ∪ A
Distributive law (like in algebra):
(A ∪ B) ∩ C = (A ∩ C) ∪ (B ∩ C)
(A ∩ B) ∪ C = (A ∪ C) ∩ (B ∪ C)
Associative law (like in algebra):
(A ∪ B) ∪ C = A ∪ (B ∪ C)
(A ∩ B) ∩ C = A ∩ (B ∩ C)
DeMorgan’s law:
(A ∪ B) = A ∩ B The complement of the union is the intersection
of the complements.
(A ∩ B) = A ∪ B The complement of the intersection is the union
of the complements.
Complement law: (A) = A
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 22 /77
Counting Techniques
In many of the examples in this chapter, it is easy to determine the
number of outcomes in each event. In more complicated examples,
determining the outcomes in the sample space (or an event)
becomes more difficult.
These are three special rules, or counting techniques, used to
determine the number of outcomes in the events and the
sample space.
They are the:
Multiplication rule
Permutation rule
Combination rule
Each has its special purpose that must be applied properly – the
right tool for the right job.
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 23 /77
12
Counting – Multiplication Rule
Multiplication rule:
Let an operation consist of k steps and there are
n1 ways of completing step 1,
n2 ways of completing step 2, … and
nk ways of completing step k.
Then, the total number of ways to perform k steps is:
n1 · n2 · … · nk
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 24 /77
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 25 /77
13
Counting – Permutation Rule
A permutation is a unique sequence of distinct items.
If S = {a, b, c}, then there are 6 permutations
Namely: abc, acb, bac, bca, cab, cba (order matters)
The number of ways 3 people can be arranged.
Number of permutations for a set of n items is n!
n! = n·(n-1)·(n-2)·…·2·1
7! = 7·6·5·4·3·2·1 = 5,040 = FACT(7) in Excel
By definition: 0! = 1
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 26 /77
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 27 /77
14
Example: Circuit Board Designs
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: Each design consists of selecting a location from the eight
locations for the first component, a location from the remaining
seven for the second component, a location from the remaining six
for the third component, and a location from the remaining five for
the fourth component. Therefore, Order is important, so use the
permutation formula with n = 8, r = 4.
8! 8 7 6 5 4!
P48 8 7 6 5 1,680
(8 4)! 4!
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 28 /77
n!
n1 ! n2 ! ... nr !
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 29 /77
15
Example: Hospital Schedule
In a hospital, a operating room needs to schedule three knee
surgeries and two hip surgeries in a day. The knee surgery is
denoted as k and the hip as h.
How many sequences are there?
Since there are 2 identical hip surgeries and 3 identical knee
surgeries, then
5! 5 4 3!
10
2!3! 2 1 3!
What is the set of sequences?
{kkkhh, kkhkh, kkhhk, khkkh, khkhk, khhkk, hkkkh, hkkhk, hkhkk,
hhkkk}
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 30 /77
In Excel:
1,260 = FACT(9) / (FACT(4)*FACT(3)*FACT(2))
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 31 /77
16
Counting – Combination Rule
A combination is a selection of r items from a set of n where order
does not matter.
If S = {a, b, c}, n =3, then
If r = 3, there is 1 combination, namely: abc
If r = 2, there are 3 combinations, namely ab, ac, and bc
# of permutations ≥ # of combinations
Since order does not matter with combinations, we are dividing the
# of permutations by r!, where r! is the # of arrangements of r
elements.
n n!
Crn
r r !(n r )!
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 32 /77
Excel:
56 = COMBIN(8,5)
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 33 /77
17
Application: Sampling w/o Replacement-1
A bin of 50 parts contains 3 defectives and 47 non-defective
parts. A sample of 6 parts is selected from the 50 without
replacement. How many samples of size 6 contain 2 defective
parts?
First, how many ways are there for selecting 2 parts from the 3
defective parts?
3!
C23 3 different ways
2!1!
In Excel:
3 = COMBIN(3,2)
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 34 /77
47! 47 46 45 44 43!
C447 178,365 different ways
4! 43! 4 3 2 1 43!
In Excel:
178,365 = COMBIN(47,4)
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 35 /77
18
Application: Sampling w/o Replacement-3
Now, how many ways are there to obtain:
2 from 3 defectives, and
4 from 47 non-defectives?
In Excel:
535,095 = COMBIN(3,2)*COMBIN(47,4)
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 36 /77
What is Probability?
Probability is the likelihood or chance that a particular outcome or
event from a random experiment will occur.
Here, only finite sample spaces ideas apply.
Probability is a number in the [0,1] interval. 1 Certain
May be expressed as a:
proportion (0.15)
percent (15%)
.5
fraction (3/20)
A probability of:
1 means certainty
0 means impossibility
0 Impossible
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 37 /77
19
Types of Probability
Subjective probability is a “degree of belief.”
Example: “There is a 50% chance that I’ll study tonight.”
Relative frequency probability is based on how often an event
occurs over a very large sample space.
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 39 /77
20
Example: Laser Diodes
Assume that 30% of the laser diodes in a batch of 100 meet a
customer requirements.
A diode is selected randomly. Each diode has an equal chance of
being selected. The probability of selecting an acceptable diode is
0.30.
Figure: Probability of the event E is the sum of the probabilities of the outcomes in E.
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 40 /77
Probability of an Event
For a discrete sample space, the probability of an event E, denoted
by P(E), equals the sum of the probabilities of the outcomes in E.
The discrete sample space may be:
A finite set of outcomes
A countably infinite set of outcomes.
Further explanation is necessary to describe probability with
respect to continuous sample spaces.
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 41 /77
21
Example: Probabilities of Events
A random experiment has a sample space {a,b,c,d}. These outcomes
are not equally-likely; their probabilities are: 0.1, 0.3, 0.5, 0.1.
Let Event A = {a,b}, B = {b,c,d}, and C = {d}
P(A) = 0.1 + 0.3 = 0.4
P(B) = 0.3 + 0.5 + 0.1 = 0.9
P(C) = 0.1
P(A ) = 0.6 and P(B ) = 0.1 and P(C ) = 0.9
Since event A∩B = {b}, then P(A ∩ B) = 0.3
Since event A ∪ B = {a,b,c,d}, then P(A ∪ B) = 1.0
Since event A ∩ C = {null}, then P(A ∩ C ) = 0
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 42 /77
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 43 /77
22
Axioms of Probability
Probability is a number that is assigned to each member of a
collection of events from a random experiment that satisfies the
following properties:
If S is the sample space and E is any event in the random
experiment,
1. P(S) = 1
2. 0 ≤ P(E) ≤ 1
3. For any two events E1 and E2 with E1 ∩ E2 = Ø,
P(E1 ∪ E2) = P(E1) + P(E2)
The axioms imply that:
P(Ø) =0 and P(E′ ) = 1 – P(E)
If E1 is contained in E2, then P(E1) ≤ P(E2).
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 44 /77
Addition Rules
Joint events are generated by applying basic set operations to
individual events, specifically:
Unions of events, A ∪ B
Intersections of events, A ∩ B
Complements of events, A
Probabilities of joint events can often be determined from the
probabilities of the individual events that comprise them.
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 45 /77
23
A Probability Table
Probabilities and joint probabilities for two events A and B are summarized in
this table:
B B
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 46 /77
24
Probability of a Union
For any two events A and B, the probability of union is given by:
P( A B) P( A) P( B) P( A B)
P( A B) ,
and therefore:
P( A B) P( A) P( B)
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 48 /77
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 49 /77
25
Addition Rule: 3 or More Events
P( A B C ) P( A) P( B) P(C ) P( A B)
P( A C ) P( B C ) P( A B C )
Ei E j , for all i, j
k
Then: P( E1 E2 ... Ek ) P( Ei )
i 1
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 50 /77
26
Conditional Probability
A conditional probability is the probability of one event,
given that another event has occurred:
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 52 /77
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 53 /77
27
Example: Conditional Probability
Of the cars on a used car lot, 70% have air conditioning
(AC) and 40% have a CD player (CD).
20% of the cars have both.
CD No CD Total
AC .2 .5 .7
No AC .2 .1 .3
Total .4 .6 1.0
P(CD AC) .2
P(CD | AC) .2857
P(AC) .7
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 54 /77
CD No CD Total
AC .2 .5 .7
No AC .2 .1 .3
Total .4 .6 1.0
P(CD AC) .2
P(CD | AC) .2857
P(AC) .7
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 55 /77
28
Conditional Probability Rule
The conditional probability of an event B given an event A, denoted
as P(B | A), is:
P(B | A) = P(A ∩ B) / P(A) for P(A) > 0
From a relative frequency perspective of n equally likely outcomes:
P(A) = (number of outcomes in A) / n
P(A ∩ B) = (number of outcomes in A ∩ B) / n
P(B | A) = number of outcomes in A ∩ B / number of outcomes in
A
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 56 /77
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 57 /77
29
Multiplication Rule
The conditional probability can be rewritten to generalize a
multiplication rule.
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 58 /77
Let A and B denote the events that the part has met 1st and 2nd
stage specifications, respectively.
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 59 /77
30
Two Mutually Exclusive Subsets
A and A are mutually exclusive.
A∩B and A ∩B are mutually exclusive
B = (A ∩ B) ∪ (A ∩ B)
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 60 /77
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 61 /77
31
Total Probability Rule (multiple events)
A collection of sets E1, E2, … Ek such that
P( B) P( B E1 ) P( B E2 ) ... P( B Ek )
P( B | E1 ) P( E1 ) P( B | E2 ) P( E2 ) ... P( B | Ek ) P( Ek )
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 62 /77
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 63 /77
32
Example: Semiconductor Failures
Let F denote the event that a chip fails
Let H denote the event that a chip is exposed to high levels of
contamination
Let M denote the event that a chip is exposed to medium
levels of contamination
Let L denote the event that a chip is exposed to low levels of
contamination.
Using Total Probability Rule,
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
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 64 /77
Event 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)
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 65 /77
33
Statistical Independence Example
Of the cars on a used car lot, 70% have air conditioning (AC)
and 40% have a CD player (CD).
20% of the cars have both.
CD No CD Total
AC .2 .5 .7
No AC .2 .1 .3
Total .4 .6 1.0
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 66 /77
AC .2 .5 .7
No AC .2 .1 .3
Total .4 .6 1.0
P(AC ∩ CD) = 0.2
P(AC) = 0.7
P(AC)P(CD) = (0.7)(0.4) = 0.28
P(CD) = 0.4
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 67 /77
34
Example: Sampling With Replacement
A production lot of 850 parts contains 50 defectives. Two parts are
selected at random, but the first is replaced before selecting the 2nd.
Let A denote the event that the 1st part selected is defective.
P(A) = 50/850
Let B denote the event that the 2nd part selected is defective.
P(B) = 50/850
What is the probability that the 2nd is defective, given that the first
part is defective? The same.
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 68 /77
Bayes’ Theorem
Thomas Bayes (1702-1761) was an English mathematician and
Presbyterian minister.
His idea was that we observe conditional probabilities through prior
information.
Bayes’ theorem states that,
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 69 /77
35
Example
The conditional probability that a high level of contamination was
present when a failure occurred is to be determined. The information
from the aforementioned example is summarized here.
Probability Level of Probability
of Failure Contamination of Level
0.1 High 0.2
0.005 Not High 0.8
Solution:
Let F denote the event that the product fails, and let H denote the
event that the chip is exposed to high levels of contamination. The
requested probability is P(F).
P ( F | H ) P ( H ) 0.10 0.20
P( H | F ) 0.83
P( F ) 0.024
P( F ) P( F | H ) P( H ) P( F | H ' ) P( H ' )
0.1 0.2 0.005 0.8 0.024
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 70 /77
P B | E1 P E1
P E1 | B
P B | E1 P E1 P B | E2 P E2 ... P B | Ek P Ek
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 71 /77
36
Example: Bayesian Network
A printer manufacturer obtained the following three types of printer
failure probabilities. Hardware P(H) = 0.3, software P(S) = 0.6, and
other P(O) = [Link], P(F | H) = 0.9, P(F | S) = 0.2, and P(F | O) = 0.5.
If a failure occurs, determine if it’s most likely due to hardware,
software, or other.
P( F ) P( F | H ) P( H ) P( F | S ) P( S ) P( F | O) P(O)
0.9(0.1) 0.2(0.6) 0.5(0.3) 0.36
P( F | H ) P( H ) 0.9 0.1
P( H | F ) 0.250
P( F ) 0.36
P( F | S ) P( S ) 0.2 0.6
P( S | F ) 0.333
P( F ) 0.36
P( F | O) P(O) 0.5 0.3
P(O | F ) 0.417
P( F ) 0.36
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 73 /77
37
Discrete & Continuous Random Variables
A discrete random variable is a random variable with a finite or
countably infinite range. Its values are obtained by counting. They are
usually integer counts, e.g., number of errors or number of bit
errors per 100,000 transmitted (rate). The ends of the range of rv
values may be finite (0 ≤ x ≤ 5) or infinite (x ≥ 0).
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 74 /77
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 75 /77
38
References
The lecture notes are mainly based on the following references.
• Montgomery, D. C. and Runger, G. C., (2014). Applied Statistics and Probability
for Engineers, 6th Edition. John Wiley and Sons, Inc.
• Bayazıt, M. and Oğuz, B., (1998). Probability and Statistics for Engineers,
Birsen Yayınevi.
• Statistics & Probability Lecture Notes, Prof. Dr. İrfan KAYMAZ
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 76 /77
Next Week
Introduction to Probability and Statistics
Descriptive Statistics
Measure of Central Tendency & Variation
Probability
Probability Distributions
Sampling Distributions
Estimation
Tests of Hypotheses
Analysis of Variance
Regression and Correlation Analysis
Istanbul Technical University | Department of Mechanical Engineering | MAK 211E – Probability & Statistics 77 /77
39