Lecture 2 - Chapter 2
Lecture 2 - Chapter 2
Definition 1.1
A result of an experiment is called an outcome.
An experiment that can result in different outcomes, even though it is
repeated in the same manner every time, is called a random
experiment.
The set of all possible outcomes of a random experiment is called the
sample space of the experiment. The sample space is denoted by S.
Example 1.1
Consider the experiment of:
Flipping a coin: the sample space S = {H, T }
Tossing a 6-sided die printed with little dots numbering 1, 2, 3, 4, 5,
and 6: the sample space S = {1, 2, 3, 4, 5, 6}
Tossing a 6-sided die printed with little dots numbering 2, 2, 3, 4, 5,
and 6: the sample space S = {2, 3, 4, 5, 6}.
Example 1.2
An experiment consists of flipping a coin and then flipping it a second time
if a head occurs, if a tail occurs on the first flip, then a die is tossed once.
The sample space S = {HH, HT , T 1, T 2, T 3, T 4, T 5, T 6}
Remark
A sample space is often defined based on the objectives of the analysis.
Example 1.3
Consider an experiment in which you select a molded plastic part, such as
a connector, and measure its thickness.
The sample space S = R+ = {x|x > 0}.
If it is known that all connectors will be between 10 and 11
millimeters thick, the sample space could be S = {x|10 < x < 11}.
If the objective of the analysis is to consider only whether a particular
part is low, medium, or high for thickness, then the sample space is
S = {low, medium, high}.
Definition 1.2
A sample space is discrete if it consists of a finite or countable infinite set
of outcomes.
A sample space is continuous if it contains an interval (either finite or
infinite) of real numbers.
Example 1.4
In Example 2.3, the choice S = {x|x > 0} is an example of a continuous
sample space, whereas S = {low, medium, high} is a discrete sample
space.
Remark
The best choice of a sample space depends on the objectives of the study.
Example 1.5
Randomly select a camera and record the recycle time of a flash.
Then S = R + = {x|x > 0}, the positive real numbers
Suppose it is known that all recycle times are between 1.5 and 5
seconds. Then S = {x|1.5 < x < 5} is continuous.
It is known that the recycle time has only three values (low, medium
or high). Then S = {low, medium, high} is discrete.
Does the camera conform to minimum recycle time specifications?
Then S = {yes, no} is discrete.
Events
Definition 1.3
An event is a subset of the sample space of a random experiment,
and is denoted by A, B, C , ....
Each outcome is called a simple event.
The entire sample space S is called the certain event. The null event,
denoted by the symbol ∅, is an empty subset of S, and has no
outcomes.
Example 2.6
Consider the experiment of tossing a 6-sided die printed with little dots
numbering 1, 2, 3, 4, 5 and 6. The sample space S = {1, 2, 3, 4, 5, 6}.
Let A be the event that the outcome is divisible by 3: A = {3, 6}
Let B be the event that the outcome is an even number: B = {2, 4, 6}
The simple events are Ai = {i}, i = 1, 2, ..., 6
Trần Ngọc Khuê Probability and Statistics Second semester, 2023-2024 8 / 75
Sample space and Events
Events
Example 1.7
Consider the experiment of observing the life in years of a certain
electronic component. The sample space S = {t|t ≥ 0}, where t is the life
of an electronic component.
S is uncountable, a simple event is any nonnegative real number.
Let A be the event that the component fails before the end of the
fifth year: then A = {t|0 ≤ t < 5}
Let B be the event that the component will not fail before the end of
the sixth year: then B = {t|t ≥ 6}
Definition 1.4
The complement of an event A is the subset of all elements of S
that are not in A and denoted by the symbol Ac or Ā.
Definition 1.5
The intersection of two events A and B, denoted by the symbol
A ∩ B or AB, is the event containing all elements that are common to
A and B.
The intersection AB occurs if and only if A and B occur together.
Definition 1.6
The union of the two events A and B, denoted by the symbol A ∪ B
or A + B, is the event containing all the elements that belong to A or
B or both.
The union A + B occurs if and only if A occurs or B occurs, or both
occur.
Events relation
Example 1.8
Consider the experiment of tossing a 6-sided die. The sample space
S = {1, 2, 3, 4, 5, 6}. Let A = {3, 6} (outcome is divisible by 3) and
B = {2, 4, 6} (outcome is even). Then
The complement of A is: Ā = {1, 2, 4, 5}
The intersection of A and B is: AB = {6}
The union of A and B is: A + B = {2, 3, 4, 6}
The difference of A and B is: A − B = {3}. The difference of B and
A is: B − A = {2, 4}.
Relation of events
Example 1.9
Consider the experiment of observing the life in years of a certain
electronic component. The sample space S = {t|t ≥ 0}, where t is the life
of an electronic component. Let A = {t|0 ≤ t < 5}, B = {t|3 < t < 8}
and C = {t|t > 4}. Then:
Ā = {t|t ≥ 5}; B̄ = {t|0 ≤ t ≤ 3 or t ≥ 8} and C̄ = {t|0 ≤ t ≤ 4}.
AB = {t|3 < t < 5}, AC = {t|4 < t < 5}; BC = {t|4 < t < 8} and
ABC = {t|4 < t < 5}
A + B = {t|0 ≤ t < 8}; A + C = S; B + C = {t|t > 3} and
A + B + C = S.
A − B = {t|0 ≤ t ≤ 3} and B − A = {t|5 ≤ t < 8};
Example 1.10
Consider the experiment of tossing a 6-sided die. Then
S = {1, 2, 3, 4, 5, 6}. Let Ai = {i}, i = 1, 2, .., 6 and A = {2, 4, 6};
B = {3, 5}; C = {1, 2, 4, 6}.
A and B are mutually exclusive but not exhaustive.
B and C are mutually exclusive and exhaustive.
{A1 , A2 , ..., A6 } are mutually exclusive and exhaustive.
Example 1.11
Consider the experiment of observing the life in years of a certain
electronic component. Then S = {t|t ≥ 0} and let A = {t|0 ≤ t < 5},
B = {t|5 ≤ t < 8} and C = {t|t ≥ 8}. Then:
{A, Ā} are are mutually exclusive and exhaustive.
A and C are mutually exclusive but not exhaustive.
{A, B, C } are are mutually exclusive and exhaustive.
Laws of Events
Counting Techniques
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
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)
Number of permutations for a set of n items is:
Pn = n! = n(n − 1)(n − 2) . . . 2.1
7! = 7.6.5.4.3.2.1 = 5040
By convention: 0! = 1
Counting–Subset Permutations
Subset Permutations
For a sequence of r items from a set of n items:
n!
Arn = n(n − 1)(n − 2) . . . (n − r + 1) =
(n − r )!
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!
Cnr =
r !(n − r )!
4 47! 47.46.45.44.43!
C47 = = = 178365 different ways
4!43! 4.3.2.1.43!
Now, how many ways are there to obtain:
– 2 from 3 defectives, and
– 4 from 47 non-defectives?
Answer:
C32 C47
4
= 3.178365 = 535095 different ways
Introduction to Probability
Example 1.16
Consider the experiment of tossing a fair 6-sided die printed with little
dots numbering 1, 2, 3, 4, 5, and 6.
The sample space is S = {1, 2, 3, 4, 5, 6}.
The 6 outcomes are equally likely.
Let A be the event that the outcome is divisible by 3: A = {3, 6}.
The probability of A is
#A 2 1
P(A) = = =
n 6 3
Let B be the event that the outcome is even: B = {2, 4, 6}. The
probability of B is
#B 3 1
P(B) = = =
n 6 2
Trần Ngọc Khuê Probability and Statistics Second semester, 2023-2024 34 / 75
Probability of Events Definition of Probability
Example 1.17
A fair coin is tossed twice. What is the probability of getting "exactly one
head"? What is the probability that at least one head occurs?
The sample space is S = {HH, HT , TH, TT }.
The 4 outcomes are equally likely.
Let A be the event of "getting exactly one head": A = {HT , TH}.
The probability of A is P(A) = #A 2
n = 4 = 0.5
Let B be the event that at least one head occurs:
#B 3
B = {HH, HT , TH}. The probability of B is P(B) = n = 4 = 0.75
Example 1.18
Consider the experiment of tossing a fair 6-sided die that 2 faces printed
with 2 dots and the other 4 faces printed with 3, 4, 5, and 6 dots
respectively.
The sample space S = {2, 3, 4, 5, 6}.
2 1
The 5 outcomes are not equally likely: P({2}) = 6 and P({i}) = 6
for i = 3, .., 6
Let A be the event of "getting an even number": A = {2, 4, 6}. The
probability of A is
2 1 1 2
P(A) = P({2}) + P({4}) + P({6}) = + + =
6 6 6 3
Trần Ngọc Khuê Probability and Statistics Second semester, 2023-2024 36 / 75
Probability of Events Definition of Probability
Example 1.19
An experiment consists of flipping a fair coin and then flipping it a second
time if a head occurs, if a tail occurs on the first flip, then a fair die is
tossed once.
The sample space S = {HH, HT , T 1, T 2, T 3, T 4, T 5, T 6}
1
The outcomes are not equally likely: P(HH) = P(HT ) = 4 and
1
P(Ti) = 12 for i = 1, .., 6
Let A be the event that the second toss is tail or an even number:
A = {HT , T 2, T 4, T 6}.
The probability of A is
1 1+1+1 1
P(A) = P(HT ) + P(T 2) + P(T 4) + P(T 6) = + =
4 12 2
Practice 1.1
Choose randomly two ball from a box that consists of 4 red balls and 6
white balls with the same size. Find the probability of the following events.
Example 2.21
A computer shop tracks the number of desktop computer systems it sold
over a month (30 days) and there are 12 days it sold 3 desktops per day.
We can approximate that
12
P(the shop will sell 3 desktops on a given day) = = 0.4
30
Trần Ngọc Khuê Probability and Statistics Second semester, 2023-2024 41 / 75
Probability of Events Definition of Probability
Example 2.22:
An online retailer knows that 30% of customers spend more than $100 per
transaction. What is the probability that a customer spends at most $100
per transaction?
Let A be the event of spending more than $100 per transaction.
The event of spending at most $100 per transaction is the
complement of A.
Then P(Ā) = 1 − P(A) = 1 − 0.3 = 0.7.
Trần Ngọc Khuê Probability and Statistics Second semester, 2023-2024 43 / 75
Probability of Events Probability of the Union of Events – Addition Rule
Addition Rule:
The probability of the union of event A and B is
P(A ∪ B) = P(A) + P(B) − P(A ∩ B)
If A and B are mutually exclusive then P(A ∪ B) = P(A) + P(B)
P(A ∪ B ∪ C ) = P(A) + P(B) + P(C ) − P(A ∩ B) − P(B ∩ C )
−P(C ∩ A) + P(A ∩ B ∩ C )
In generral, P( ni=1 Ai ) = ni=1 P(Ai ) − i<j P(Ai Aj ) +
P P P
n−1 P(A A ...A )
P
i<j<k P(Ai Aj Ak ) − ... + (−1) 1 2 n
Example 2.23:
At a local language school, 40% of the students are learning Spanish, 20%
of the students are learning German, and 8% of the students are learning
both Spanish and German. Select at random a student at this school. (a)
What is the probability that he/she is learning Spanish or German? (b)
What is the probability that he/she is learning Spanish but is not learning
German?
Let A be the event that he/she is learning Spanish and let B be the
event that he/she is learning German.
We have P(A) = 0.4; P(B) = 0.2 and P(A ∩ B) = 0.08
(a) The probability that he/she is learning Spanish or German is
P(A ∪ B) = P(A) + P(B) − P(A ∩ B) = 0.4 + 0.2 − 0.08 = 0.52
(b) The probability that he/she is learning Spanish but is not learning
German is P(A ∩ B̄) = P(A) − P(A ∩ B) = 0.4 − 0.08 = 0.32
Example 2.24:
Suppose that 4 guests check their hats when they arrive at a restaurant,
and that these hats are returned to them in a random order when they
leave. Determine the probability that no guest will receive the proper hat.
Let A be the event that no guest will receive the proper hat and let
Ai be the event that the i th guest receives his proper hat.
Then Ā is the event that at least one guest will receive the proper hat
and A = A1 + A2 + A3 + A4 .
So P(Ā) = 4i=1 P(Ai ) − i<j P(Ai Aj ) + i<j<k P(Ai Aj Ak )
P P P
−P(A1 A2 A3 A4 ).
We have P(Ai ) = 3! 1
4! = 4 ; P(Ai Aj ) =
2!
4! = 1
12 ; P(Ai Aj Ak ) = 1!
4! =
1 1 1
24 ; P(A1 A2 A3 A4 ) = 4! = 24 .
Then P(Ā) = 4. 14 − 6. 12
1 1
+ 4. 24 − 1
24 = 5
8 and P(A) = 1 − P(Ā) = 38 .
Conditional Probability
Conditional Probability
NOTE:
The conditional probability P(A|B) is NOT the same as P(A ∩ B).
In the conditional probability P(A|B), we want to find the probability
of A occurring after B has already happened. In the conditional
probability the sample space is restricted to just event B before we
calculate the probability of A in the restricted sample space.
In P(A ∩ B) we want to find the probability of events A and B
happening at the same time in the unrestricted sample space.
P(A ∩ B)
P(A|B) =
P(B)
Example 2.25:
At a local language school, 40% of the students are learning Spanish, 20%
of the students are learning German, and 8% of the students are learning
both Spanish and German. (a) Select at random a student at this school
and suppose that he is learning Spanish. What is the probability that he is
also learning German?
Let A be the event that he/she is learning Spanish and let B be the
event that he/she is learning German.
We have P(A) = 0.4; P(B) = 0.2 and P(A ∩ B) = 0.08
The probability that he is learning German given that he is learning
Spanish is
P(A ∩ B) 0.08
P(B|A) = = = 0.2
P(A) 0.4
(b) Select at random a student at this school and suppose that he is
learning German. What is the probability that he does not learn Spanish?
Exercise:
A system consists of two components. The probability that the first
component functions in a satisfactory manner during its design life is 0.8;
the probability that at least one of the two components does so is 0.87;
and the probability that both components do so is 0.72. Given that the
second component functions in a satisfactory manner throughout its
design life, what is the probability that the first one does also?
Multiplication Rule
Multiplication Rule:
From the conditional probability rule:
P(AB) P(AB)
P(A|B) = and P(B|A) =
P(B) P(A)
In general, we have
P(A1 A2 ...An ) = P(A1 )P(A2 |A1 )P(A3 |A1 A2 )...P(An |A1 ...An−1 )
Multiplication Rule
Example 2.26:
An aerospace company has submitted bids on two separate federal
government defense contracts. The company president believes that there
is a 40% probability of winning the first contract. If they win the first
contract, the probability of winning the second is 70%. What is the
probability that they win both contracts?
Let A be the event winning the first contract and let B be the event
winning the second contract.
We have P(A) = 0.4; P(B|A) = 0.7
The probability that that they win both contracts is
Exercise:
A box contains 5 light bulbs, of which 2 are bad. The bulbs are tested one
after another without replacement. Let Ai be the event that the number
of bulbs tested until the first bad bulb is found is i. Determine the
probability P(Ai ) with i ∈ {1, 2, 3, 4, 5}.
Independence
Independent events:
Definition 2.9: Two events A and B are said to be independent if
the probability of one event is not affected by the occurrence of the
other event:
P(A|B) = P(A) or P(B|A) = P(B)
Hence, two events A and B are said to be independent if
P(A ∩ B) = P(A)P(B)
The events A1 , A2 , ..., An are called independent in pairs if
P(Ai ∩ Aj ) = P(Ai )P(Aj ), ∀i 6= j.
The events A1 , A2 , ..., An are called totally independent if for any
events Ai1 , Ai2 , ..., Aik , k ≥ 2, we have
Independence
Example 2.27:
At a local language school, 40% of the students are learning Spanish, 20%
of the students are learning German, and 8% of the students are learning
both Spanish and German. Select at random a student at this school and
suppose that he is learning Spanish. What is the probability that he is also
learning German.
Let A be the event that he/she is learning Spanish and let B be the
event that he/she is learning German.
We have P(A) = 0.4; P(B) = 0.2 and P(AB) = 0.08
The probability that he is learning German given that he is learning
Spanish is P(B|A) = P(AB) 0.08
P(A) = 0.4 = 0.2 = P(B)
So A and B are independent.
Independent events
Example 2.28:
A fair coin is tossed twice. Let A be the event that the first toss is head, B
is the event that the second toss is head and C be the event that all two
tosses are the same. Are the events A, B, C independent in pairs or totally
independent?
The sample sapce S = {HH, HT , TH, TT } and A = {HH, HT };
B = {HH, TH} and C = {HH, TT }. So
P(A) = P(B) = P(C ) = 0.5.
We have AB = BC = CA = ABC = {HH}, then
P(AB) = P(BC ) = P(CA) = P(ABC ) = 0.25
Hence, P(AB) = P(A)P(B); P(BC ) = P(B)P(C ) and
P(AC ) = P(A)P(C ), then A, B, C are independent in pairs.
Since P(ABC ) = 0.25 6= P(A)P(B)P(C ) = 0.125, then A, B, C are
not totally independent.
Trần Ngọc Khuê Probability and Statistics Second semester, 2023-2024 56 / 75
Conditional Probability Independence
Practice
Practice 2.2:
Suppose that out of all customers entered a bookstore, there are 30% of
them who asked the salesperson, 20% of them who bought books and
15% of them who did both of these 2 things. Select at random a customer
entered the store.
What is the probability that he/she did not neither ask the
salesperson nor buy books?
What is the probability that he/she did not buy books given that
he/she has asked the salesperson?
Practice
Practice 2.3: The personnel department of an insurance company has
compiled data on promotion, classified by gender. The joint probability
table based on the data collected from 200 managers for the investigation
are given below:
Manager Promoted Not promoted
Male 0.17 0.68
Female 0.03 0.12
Select at random a manager.
What is the probability that the manager selected is promoted?
What is the probability that the manager selected is not promoted or
a female?
What is the probability that the manager selected is a male given that
he is promoted ?
Are promotion and gender dependent on each another?
Trần Ngọc Khuê Probability and Statistics Second semester, 2023-2024 58 / 75
Total Probability Rule and Bayes’ Rule Probability Tree
Example 2.29:
It is known that 83% of regularly scheduled flights depart on time. Of
those flights depart on time, 90% of them arrive on time and of those
flights do not depart on time, 40% them arrive on time.
Find the probability that a plane arrives on time.
Find the probability that a plane departed on time, given that it has
arrived on time.
In general:
Let {A1 , ..., An } be a system of mutually exclusive and exhautive events.
Total Probability Rule:
P(B) = P(A1 )P(B|A1 ) + ... + P(An )P(B|An ) = ni=1 P(Ai )P(B|Ai )
P
P(Aj )P(B|Aj ) P(Aj )P(B|Aj )
Bayes’ Rule: P(Aj |B) = P(B) = Pn
i=1 P(Ai )P(B|Ai )
Example 2.30:
In a certain assembly plant, three machines, B1 , B2 , and B3 , make
30%, 45%, and 25%, respectively, of the products. It is known from past
experience that 2%, 3%, and 2% of the products made by each machine,
respectively, are defective. Now, suppose that a finished product is
randomly selected.
What is the probability that it is defective?
If a product was chosen randomly and found to be defective, what is
the probability that it was made by machine B3 ?
By the Bayes’ Rule, the probability that the product chosen was made
by machine B3 , given that it was found to be defective is:
Practice 2.4:
A paint-store chain produces and sells latex and semigloss paint. Based on
long-range sales, the probability that a customer will purchase latex paint
is 0.75. Of those that purchase latex paint, 60% also purchase rollers. But
only 30% of semigloss paint buyers purchase rollers. A randomly selected
buyer purchases a roller and a can of paint. What is the probability that
the paint is latex?
Practice 2.5:
Researchers have developed statistical models based on financial ratios
that predict whether a company will go bankrupt over the next 12 months.
In a test of one such model, the model correctly predicted the bankruptcy
of 85% of firms that did in fact fail, and it correctly predicted
nonbankruptcy for 74% of firms that did not fail. Suppose that we expect
8% of the firms in a particular city to fail over the next year.
What is the probability that model predicts bankruptcy for a firm that
you own?
Suppose that the model predicts bankruptcy for a firm that you own.
What is the probability that your firm will fail within the next 12
months?
Bernoulli Rule
Bernoulli Trial:
A Bernoulli trial is a random experiment that
results two possible outcomes labeled by A "success" and Ā "failure"
the probability of success is a constant p = P(A) and the probability
of failure is a constant P(Ā) = q = 1 − p.
Example 2.31:
Tossing a fair coin is a Bernoulli trial:
results two posibble outcomes: Head (labeled by "success") or Tail
(labeled by "failure")
P(success) = p = 0.5 and P(failure) = q = 1 − p = 0.5.
Bernoulli Rule
Example 2.32:
The defective rate in a production line is 5%; testing an item is a Bernoulli
trial:
results two posibble outcomes: the item is defective (labeled by
"success") or it is non-defective (labeled by "failure")
P(success) = p = 0.05 and P(failure) = q = 1 − p = 0.95.
Example 2.33:
"A salesperson called to a customer" is a Bernoulli trial:
results two possible outcomes: she closed a sale (labeled by
"success") or she did not close a sale (labeled by "failure")
P(success) = p = 0.6 and P(failure) = q = 1 − p = 0.4.
Bernoulli Rule
Bernoulli Rule
Consider a Bernoulli trial where P(success) = p and
P(failure) = q = 1 − p
Repeat the Bernoulli trial n times.
The probability that there are exactly k successes out of n trials is
Pn (k)
The Bernoulli rule:
Bernoulli Rule
Example 2.34:
Consider the Bernoulli trial of tossing a fair coin: p = P(Head) = 0.5
and q = P(Tail) = 0.5
The probability that there are exactly three heads out of 4 tosses is
P4 (3) = C43 0.53 0.51 = 0.25
Explanation:
The event "there are exactly three heads out of 4 tosses" = HHHT +
HHTH + HTHH + THHH.
Then P4 (3) = P(HHHT ) + P(HHTH) + P(HTHH) + P(THHH) =
C43 0.53 0.51 = 0.25
Bernoulli Rule
Example 2.35:
The defective rate in a production line is supposed to be 5%. Tested 10
items from the production line.
The probability that there are exactly 2 defective items out of 10
2 0.052 0.958 = 0.075
selected items is: P10 (2) = C10
The probability that there are at least one defective item out of 10
0 0.050 0.9510 = 0.401
selected items is: 1 − P10 (0) = 1 − C10
Bernoulli Rule
Exapmle 2.36:
Suppose that the probability that a salesperson closed a sale in each call to
a customer is 70%. How many calls will she have to make such that the
probability that she will close at least one sale is more than 0.99?
Suppose that she will have to make at leat n calls.
The probability she will close at least one sale out of n calls is
1 − Pn (0) = 1 − Cn0 0.70 0.3n = 1 − 0.3n > 0.99 ⇔ 0.3n < 0.01 ⇔ n >
3.82
So she will have to make at leat n = 4 calls.
Exercise:
Three balls are randomly chosen with replacement from an urn containing
5 blue, 4 red, and 2 yellow balls. Let Ai denote the event that the number
of red balls chosen is i for i ∈ {0, 1, 2, 3}. Determine the probability P(Ai ).