You are on page 1of 19

Chapter 2.

Probability (part 3)

Nguyễn Văn Hạnh


Department of Applied Mathematics
School of Applied Mathematics and Informatics

Second semester, 2022-2023

NV HANH Probability and statistics Second semester, 2022-2023 1 / 19


Contents

5 Total Probability Rule and Bayes’ Rule


Probability Tree
Total Probability Rule and Bayes’ Rule

6 Bernoulli Rule

NV HANH Probability and statistics Second semester, 2022-2023 2 / 19


Total Probability Rule and Bayes’ Rule Probability Tree

The Probability Tree

An effective and simpler method of applying the probability rules is


the probability tree, wherein the events in an experiment are
represented by lines.
The resulting figure resembles a tree, hence the name.
We can extend the tree diagram to two tosses of a coin:

NV HANH Probability and statistics Second semester, 2022-2023 3 / 19


Total Probability Rule and Bayes’ Rule Probability Tree

The 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.

NV HANH Probability and statistics Second semester, 2022-2023 4 / 19


Total Probability Rule and Bayes’ Rule Probability Tree

The Probability Tree

Aanlysis of Example 2.29:


When we observe a flight, there are outcomes: the flight departs on
time or not.
Given that the flight has departed on time or not, it will arrive on
time or not.
We have the following probability tree:

NV HANH Probability and statistics Second semester, 2022-2023 5 / 19


Total Probability Rule and Bayes’ Rule Probability Tree

The Probability Tree


Problem:
Solution:
Let A be the event that "the flight departs on time" and let B be the
event that "the flight arrives on time".
Then the system {A, Ā} is mutually exclusive and exhaustive.
We have B = B ∩ S = B ∩ (A + Ā) = AB + ĀB, then
P(B) = P(AB) + P(ĀB) = P(A)P(B|A) + P(Ā)P(B|Ā)
So the probability that a plane arrives on time is
P(B) = 0.83 ∗ 0.9 + 0.17 ∗ 0.4 = 0.815
81.5% of flights will arrive on time.
The probability that a plane departed on time, given that it has
arrived on time is
P(AB) P(A)P(B|A) 0.83 ∗ 0.9
P(A|B) = = = = 0.917
P(B) P(B 0.815
NV HANH Probability and statistics Second semester, 2022-2023 6 / 19
Total Probability Rule and Bayes’ Rule Total Probability Rule and Bayes’ Rule

Total Probability Rule and Bayes’ Rule

Total Probability Rule and Bayes’ Rule


The formula:
P(B) = P(AB) + P(ĀB) = P(A)P(B|A) + P(Ā)P(B|Ā) is called the
Total Probability Rule .
P(A)P(B|A)
The formula: P(A|B) = P(B) is called the Bayes’ Rule.

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 )

NV HANH Probability and statistics Second semester, 2022-2023 7 / 19


Total Probability Rule and Bayes’ Rule Total Probability Rule and Bayes’ Rule

Total Probability Rule and Bayes’ Rule

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 ?

NV HANH Probability and statistics Second semester, 2022-2023 8 / 19


Total Probability Rule and Bayes’ Rule Total Probability Rule and Bayes’ Rule

Total Probability Rule and Bayes’ Rule

Let Bi be the event that "the product chosen is made by machine Bi ;


with i = 1, 2, 3" and let A be the event that "the product chosen is
defective".
We have: {B1 , B2 , B3 } is a system of mutually exclusive and
exhautive events and: P(B1 ) = 0.3; P(B2 ) = 0.45; P(B3 ) = 0.25 and
P(A|B1 ) = 0.02; P(A|B2 ) = 0.03; P(A|B3 ) = 0.02
We have the following probability tree:

NV HANH Probability and statistics Second semester, 2022-2023 9 / 19


Total Probability Rule and Bayes’ Rule Total Probability Rule and Bayes’ Rule

Total Probability Rule and Bayes’ Rule

By the Total Probability Rule, the probability that "the product


chosen is defective" is
P(A) = P(B1 )P(A|B1 ) + P(B2 )P(A|B2 ) + P(B3 )P(A|B3 )
= 0.3 ∗ 0.02 + 0.45 ∗ 0.03 + 0.25 ∗ 0.02 = 0.0245

NV HANH Probability and statistics Second semester, 2022-2023 10 / 19


Total Probability Rule and Bayes’ Rule Total Probability Rule and Bayes’ Rule

Total Probability Rule and Bayes’ Rule

By the Bayes’ Rule, the probability that the product chosen was made
by machine B3 , given that it was found to be defective is:

P(B3 )P(A|B3 ) 0.25 ∗ 0.02 10


P(B3 |A) = = =
P(A) 0.0245 49

NV HANH Probability and statistics Second semester, 2022-2023 11 / 19


Total Probability Rule and Bayes’ Rule Total Probability Rule and Bayes’ Rule

Total Probability Rule and Bayes’ Rule

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?

NV HANH Probability and statistics Second semester, 2022-2023 12 / 19


Total Probability Rule and Bayes’ Rule Total Probability Rule and Bayes’ Rule

Total Probability Rule and Bayes’ Rule

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?

NV HANH Probability and statistics Second semester, 2022-2023 13 / 19


Bernoulli Rule

Bernoulli Rule

Bernoulli Trial:
A Bernoulli trial is a random experiment that
results two posibble outcomes labeled by "success" and "failure"
the probability of success is a constant p and the probability of failure
is a constant q = 1 − p.

Exapmle 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.

NV HANH Probability and statistics Second semester, 2022-2023 14 / 19


Bernoulli Rule

Bernoulli Rule

Exapmle 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.

Exapmle 2.33:
"A salesperson called to a customer" is a Bernoulli trial:
results two posibble 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.

NV HANH Probability and statistics Second semester, 2022-2023 15 / 19


Bernoulli Rule

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 n trials is Pn (k)
The Bernoulli rule: Pn (k) = Cnk p k q n−k

NV HANH Probability and statistics Second semester, 2022-2023 16 / 19


Bernoulli Rule

Bernoulli Rule

Exapmle 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

NV HANH Probability and statistics Second semester, 2022-2023 17 / 19


Bernoulli Rule

Bernoulli Rule

Exapmle 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

NV HANH Probability and statistics Second semester, 2022-2023 18 / 19


Bernoulli Rule

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.

NV HANH Probability and statistics Second semester, 2022-2023 19 / 19

You might also like