0% found this document useful (0 votes)
11 views48 pages

Lecture2b - Conditional Probability

The document covers the concepts of probability and conditional probability, including definitions, rules, and applications using contingency tables. It explains how to calculate marginal, joint, and conditional probabilities, and introduces tools like the Multiplication Rule and the Law of Total Probability. Additionally, it provides examples and exercises to illustrate these concepts in real-life scenarios.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views48 pages

Lecture2b - Conditional Probability

The document covers the concepts of probability and conditional probability, including definitions, rules, and applications using contingency tables. It explains how to calculate marginal, joint, and conditional probabilities, and introduces tools like the Multiplication Rule and the Law of Total Probability. Additionally, it provides examples and exercises to illustrate these concepts in real-life scenarios.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

ISOM 2500

Business Statistics
Lecture 2b: Conditional Probability
Lecturer: Dr. Xinyu Sun
Outline
Probability and Conditional Probability:
basic concepts, basic probability rules,
relationships of events
Probability
and Random Discrete Random Variable: basic properties,
Bernoulli Distribution and Binomial Distribution
Variables
Continuous Random Variable: basic
properties, Normal Distribution and Student’s t-
distribution
Conditional
Probability
Goal for this Topic 2b
Understand how the probability of events changes when additional
information is known
Understand how to convert counts in contingency table to marginal
probability, joint probability and conditional probability
Apply two important tools to analyze real-life problems involving
conditional probability
❑ Multiplication Rule
❑ Total Probability Theorem
Learn the relationship of events: Independence
Revisit Contingency Table
Contingency table shows counts of cases for every combination of both variables

Check Out or Not

Yes No Total What’s the probability that the


Organic 30 1000 1030 next customer to Walmart
Traffic from Email will check out?
Type Email 50 400 450
Direct 60 300 360
Paid 80 1200 1280
Total 220 2900 3120
Convert Counts to Probabilities
Assume the next visitor to Walmart behaves like a random choice from the
3120 cases in the contingency table. Divide each count by 3120 to get
proportions (≈probabilities by Law of Large Numbers)
Check Out or Not

Yes No Total

Traffic Organic 0.0096 0.3205 0.3301


Type Email 0.0160 0.1282 0.1442
Direct 0.0192 0.0962 0.1154
Paid 0.0256 0.3846 0.4103
Total 0.0705 0.9295 1
Marginal Probability
Marginal probability is the probability of observing an outcome with a single
attribute, regardless of its other attributes. It is in the margins of a contingency
table
Check Out or Not

Yes No Total
Organic 0.0096 0.3205 0.3301
Traffic
Type Email 0.0160 0.1282 0.1442
Direct 0.0192 0.0962 0.1154 The probability that the next
customer from any of these
Paid 0.0256 0.3846 0.4103 marketing vehicle will check out
Total 0.0705 0.9295 1 is 7.05%
Joint Probability
A joint probability measures the likelihood that two or more events will happen
concurrently, the probability that event 𝐴 and event 𝐵 occur jointly is denoted as
𝑃(𝐴 ∩ 𝐵), it is in the cells of the inner contingency table
Check Out or Not

Yes No Total

Traffic Organic 0.0096 0.3205 0.3301


The probability that the next
Type Email 0.0160 0.1282 0.1442 customer from Email and check out
Direct 0.0192 0.0962 0.1154 is
Paid 0.0256 0.3846 0.4103 P(Email & Yes) = 1.60%
Total 0.0705 0.9295 1
Conditional Probability
Conditional probability is the probability of event 𝐴 given that the event 𝐵
occurred, it is denoted as 𝑃(𝐴|𝐵), read “ the probability of 𝐴, given 𝐵”

Check Out or Not


The probability that the next
Yes No Total
customer who is from Email will
Traffic Organic 0.0096 0.3205 0.3301 check out is
Type Email 0.0160 0.1282 0.1442
Direct 0.0192 0.0962 0.1154 P(Yes|Email)
= 0.0160/(0.0160+0.1282)
Paid 0.0256 0.3846 0.4103 = P(Yes & Email)/P(Email)
Total 0.0705 0.9295 1 = 11.11%
Conditional Probability
Assuming 𝑃(𝐵) ≠ 0, the probability of 𝐴 occurred conditional on (or given
that) 𝐵 occurred is defined as
𝑃 𝐴∩𝐵
𝑃 𝐴𝐵 =
𝑃(𝐵)

If 𝑃(𝐵) = 0, 𝑃(𝐴|𝐵) is undefined. The conditional probability is directly


calculated as the ratio of the joint probability to the marginal (or
unconditional) probability
Example: Movie Recommendation

𝑃 𝑀𝑜𝑎𝑛𝑎 2 = 1% 𝑃 𝐴𝑣𝑎𝑡𝑎𝑟 2 = 3% 𝑃 𝑍𝑜𝑜𝑡𝑜𝑝𝑖𝑎 2 = 2%

𝑃 𝐴𝑣𝑎𝑡𝑎𝑟 2|𝑀𝑜𝑎𝑛𝑎 2 = 10% 𝑃 𝑍𝑜𝑜𝑡𝑜𝑝𝑖𝑎 2|𝑀𝑜𝑎𝑛𝑎 2 = 30%

Should I recommend Avatar 2 or Zootopia 2 to the customer?


Exercise: University Demographics
Med Business
College Arts-Sci Educ Eng Law Undeclared Total
School School
Female 500 1500 400 1000 200 100 800 4500
Male 900 1200 500 500 1300 200 900 5500
Totals 1400 2700 900 1500 1500 300 1700 10000

If select a student at random, calculate the probabilities of following events


❑ P(Female OR Male)
❑ P(NOT Med School)
❑ P(Female|Business School)
❑ P(Male AND Arts-Sci)
Counts in Contingency Table
Joint Probability
𝑛11
𝐵2 𝑃 𝐴1 𝑎𝑛𝑑 𝐵1 =
𝐵1 Total 𝑛

𝐴1 𝑛11 + 𝑛12 𝑎1 Marginal Probability


+ + 𝑃 𝐴1 =
𝑎1
𝐴2 𝑛21 + 𝑛22 𝑎2 𝑛
𝑎1 + 𝑎2
Total = 𝑏1 + 𝑏2 Conditional Probability
𝑏1 𝑏2 𝑛11
=𝑛 𝑃 𝐴1 |𝐵1 =
𝑏1
𝑛12
Exercise: complete the calculation 𝑃 𝐵2 |𝐴1 =
𝑎1
Probabilities in Contingency Table
𝐵1 𝐵2 Total

𝐴1 +
𝑃(𝐴1 𝑎𝑛𝑑 𝐵1 ) 𝑃(𝐴1 𝑎𝑛𝑑 𝐵2 ) 𝑃(𝐴1 )
+ +
𝐴2 𝑃(𝐴2 𝑎𝑛𝑑 𝐵1 ) +𝑃(𝐴2 𝑎𝑛𝑑 𝐵2 ) 𝑃(𝐴2 )
Total 𝑃(𝐵1 ) 𝑃(𝐵2 ) 1

𝑃(𝐴1 ), 𝑃(𝐴2 ), 𝑃(𝐵1 ) and 𝑃(𝐵2 ) are the marginal probabilities; and the
rest are the joint probabilities
Example: Draw a Card
You randomly draw a card from a full deck of 52 cards. You are concerned
about whether it is an Ace and whether it is red or black

Fill in the contingency table with counts

Ace Not Ace Total


Black 2 24 26
Red 2 24 26
Total 4 48 52
Example: Draw a Card
You randomly draw a card from a full deck of 52 cards. You are concerned
about whether it is an Ace and whether it is red or black

Fill in the contingency table with joint probabilities

Ace Not Ace Total The probability of getting


an Ace given that it is a
Black 2/52 24/52 26/52 red card:
Red 2/52 24/52 26/52 1/13 = (2/52)/(26/52)
Total 4/52 48/52 1
Two Tools
Multiplication Rule
From the definition of conditional probability

𝑃(𝐴|𝐵) = 𝑃(𝐴 ∩ 𝐵) / 𝑃(𝐵) (if 𝑃(𝐵) = 0, 𝑃(𝐴|𝐵) is undefined)

we can derive the joint probability of 𝐴 and 𝐵 occurred:

𝑃 𝐴∩𝐵 = 𝑃 𝐵 𝑃 𝐴 𝐵 = 𝑃 𝐴 𝑃 𝐵 𝐴

Multiplication Rule: the joint probability of two events is the product of


the marginal probability of one event and the conditional probability of
the second event, given the first event occurred
Example: Draw Cards Without
Replacement
You randomly draw 2 cards from a full deck of 52 cards, one after the other,
without replacement. What is the probability of drawing two aces in a row?
Define events:
𝐴 be the event of drawing an ace on the first draw
𝐵 be the event of drawing an ace on the second draw
4 3
𝑃 𝐴∩𝐵 = 𝑃 𝐴 𝑃 𝐵 𝐴 = ∗
52 51
Example: Supply of Bicycle Parts
A Bicycle company gets 60% of its supply for a particular part from
manufacturer A, with the remaining from manufacturer Z. The quality of the
parts delivered by each manufacturer is given below:

Manufacturer % of Good Parts % of Bad Parts


A 97% 3%
Z 93% 7%

What is the probability of receiving a bad part?


Example: Supply of Bicycle Parts
Draw the Tree Diagram
Marginal Conditional Joint Probability
Probability Probability (Multiplication Rule)
97% Good 𝑃 𝐴 ∩ 𝐺 = 𝑃 𝐴 𝑃 𝐺 𝐴 = 0.582

60% From A
Bad 𝑃 𝐴 ∩ 𝐵 = 𝑃 𝐴 𝑃 𝐵 𝐴 = 0.018
3%
Get a part
93% 𝑃 𝑍 ∩ 𝐺 = 𝑃 𝑍 𝑃 𝐺 𝑍 = 0.372
40% Good
From Z
Bad 𝑃 𝑍 ∩ 𝐵 = 𝑃 𝑍 𝑃 𝐵 𝑍 = 0.028
7%
The probability of receiving a bad part:
𝑃 𝐵 = 𝑃 𝐴 ∩ 𝐵 + 𝑃 𝑍 ∩ 𝐵 = 0.018 + 0.028 = 0.046
Exercise: Supply of Bicycle Parts
Could you make a contingency table based on the tree diagram?

Is Good Part Is Bad Parts Total


From A
From Z
Total 1
Law of Total Probability
More generally, suppose a sample space 𝑆 is composed of partition
𝐵1 , 𝐵2 , ⋯ , 𝐵𝑛 , that is 𝑆 = 𝐵1 ∪ 𝐵2 ∪ ⋯ ∪ 𝐵𝑛
𝑛 𝑛
For an event 𝐴: 𝑃(𝐴) = ∑ 𝑃(𝐴 ∩ 𝐵𝑖 ) = ∑ 𝑃(𝐴|𝐵𝑖 )𝑃(𝐵𝑖 )
𝑖=1 𝑖=1

Law of Total Probability helps calculate the overall probability of an event


by considering all possible ways it can happen. It is especially useful when
an event depends on different conditions
Law of Total Probability

𝐶
𝐵 𝐵
𝐴

𝑆
The transition from
first line of the
𝑃 𝐴 = 𝑃 𝐴∩𝐵 + 𝑃 𝐴∩ 𝐵 𝐶 equation to second
𝐶 𝐶 line is based on
=𝑃 𝐵 𝑃 𝐴 𝐵 +𝑃 𝐵 𝑃 𝐴 𝐵
Multiplication Rule
Example: Draw a Card
You randomly draw a card from a full deck of 52 cards. What is the probability of
getting an Ace?

Ace Not Ace Total


Black 2/52 24/52 26/52
Red 2/52 24/52 26/52
Total 4/52 48/52 1

𝑃(𝐴𝑐𝑒)
= 𝑃(𝐴𝑐𝑒 𝑎𝑛𝑑 𝑅𝑒𝑑) + 𝑃(𝐴𝑐𝑒 𝑎𝑛𝑑 𝐵𝑙𝑎𝑐𝑘)
= 2/52 + 2/52 = 4/52
Exercise: Investment Options
A company offers three different investment options to clients: Stocks, Bonds, and
Real Estate. The proportion of clients choosing each investment is as follows:

Probability of Earning a
Asset Type % of clients
Profit in a Given Year
Stocks 40% 60%
Bonds 35% 70%
Real Estate 25% 50%

What is the probability that a randomly chosen client will earn a profit on his/her
investment?
Example: Filtering Junk Email
Past data indicates the following probabilities
❑ P(Donald Trump| Junk email) = 0.20
❑ P(Donald Trump| Not Junk email) = 0.001
❑ P(Junk email) = 0.5
What is the probability that an email is a junk mail given the appearance of
term “Donald Trump” in title?

Hint: this is a conditional probability


Example: Filtering Junk Email
Method 1: to get P(Junk email | Donald Trump)
Event A: Donald Trump appears and Event B: It is a Junk Email

Definition of
𝑃 𝐴∩𝐵 Conditional Probability
𝑃 𝐵𝐴 =
𝑃 𝐴
𝑃 𝐴𝐵 𝑃 𝐵 Multiplication Rule
= 𝑐 𝑐
𝑃 𝐴 𝐵 𝑃 𝐵 +𝑃 𝐴 𝐵 𝑃 𝐵 Law of Total Probability
0.2 ∗ 0.5
= = 0.995
0.2 ∗ 0.5 + 0.001 ∗ 0.5
Example: Filtering Junk Email
Method 2: use contingency table to get P(Junk email | Donald Trump)
Fill in the blank cells

Junk Email Not Junk Email Total


“Donald Trump” appears 0.2*0.5 0.001*0.5 0.1005
Does not appear 0.5-0.2*0.5 0.5-0.001*0.5 0.8995
Total 0.5 0.5 1

𝑃(𝐽𝑢𝑛𝑘 𝐸𝑚𝑎𝑖𝑙 | 𝐷𝑜𝑛𝑎𝑙𝑑 𝑇𝑟𝑢𝑚𝑝) = (0.2 ∗ 0.5)/0.1005 = 0.995


Independence
Independent Events
Events are independent if the occurrence of one event does not affect the
occurrence of another
More formally, 𝑃 𝐴 𝐵 = 𝑃 𝐴 , occurrence of 𝐵 provides no information about
𝐴’s occurrence
Example: rolling a fair die twice
Event A: the result of the first roll is an even number, i.e., 2, 4, 6
Event B: the result of the second roll is an odd number, i.e., 1, 3, 5
❑ Event A and Event B are independent
Example: Independent or Not?

Raining and Winning


the Lottery

Rob a bank and Go to


Jail
Multiplication Rule for Independent
Events
Two events A and B are independent if and only if the probability that both A and
B occur is the product of the probabilities of the two events:
𝑃(𝐴 ∩ 𝐵) = 𝑃(𝐴|𝐵)𝑃(𝐵) = 𝑃(𝐴)𝑃(𝐵)

Example: rolling a fair die twice


Event A: the result of the first roll is an even number, i.e., 2, 4, 6
Event B: the result of the second roll is an odd number, i.e., 1, 3, 5
𝑃( 𝐹𝑖𝑟𝑠𝑡 𝑛𝑢𝑚𝑏𝑒𝑟 𝑖𝑠 𝑒𝑣𝑒𝑛 𝑎𝑛𝑑 𝑆𝑒𝑐𝑜𝑛𝑑 𝑛𝑢𝑚𝑏𝑒𝑟 𝑖𝑠 𝑜𝑑𝑑)
= 𝑃(𝐸𝑣𝑒𝑛𝑡 𝐴) ∗ 𝑃(𝐸𝑣𝑒𝑛𝑡 𝐵) = 1/2 ∗ 1/2 = 1/4
What if P(A) = 0?
Dependent Events
Two events A and B are dependent, then
𝑃(𝐴|𝐵) ≠ 𝑃(𝐴)
When one event occurs,
it alters your belief
Or 𝑃(𝐵|𝐴) ≠ 𝑃(𝐵) about the likelihood of
the other event
Or 𝑃(𝐴 ∩ 𝐵) ≠ 𝑃(𝐴) × 𝑃(𝐵)

Question: is drawing a black card independent of the event of drawing an Ace?


Example: Draw Cards
Event A: draw a black card and Event B: draw an Ace
1 1
𝑃 𝐴 = and 𝑃 𝐵 =
2 13
Ace Not Ace Total
1
𝑃 𝐴𝐵 = =𝑃 𝐴 Black 2/52 24/52 26/52
2
1 Red 2/52 24/52 26/52
𝑜𝑟 𝑃 𝐵 𝐴 = =𝑃 𝐵
13
Total 4/52 48/52 1
2
𝑜𝑟 𝑃 𝐴 ∩ 𝐵 = =𝑃 𝐴 ×𝑃 𝐵
52
Drawing a black card and drawing an Ace are independent
Example: Rolling a Fair Dice Once
Event A: the result of the roll is an even number, i.e., 2, 4, 6
Event B: the result of the roll is an odd number, i.e., 1, 3, 5
Event A and Event B are dependent, because if Event A happens, then B cannot
happen (or Event B happens, then Event A cannot happen). Mutually Exclusive
Events are dependent.

Note: mutually exclusive events are NEVER independent


Exercise: 𝐴 and 𝐵 Independent?

1
𝑃 𝐴 =
4
1
𝑃 𝐵 =
2
1
𝑃 𝐴∩𝐵 =
8
Exercise: 𝐴 and 𝐵 Independent?
𝑪 𝑪

𝐶
3
𝑃 𝐴 =1−𝑃 𝐴 =
4
𝐶
1
𝑃 𝐵 =1−𝑃 𝐵 =
2
𝐶 𝐶
3 𝐶 𝐶
𝑃 𝐴 ∩ 𝐵 = = 𝑃 𝐴 ∗ 𝑃(𝐵 )
8
How to get the
gray area?

𝑨𝑪 and 𝑩𝑪 are independent


Exercise: 𝐴 and 𝐵 Independent?
Use a real-life example: In a sample of 400 students, 100 said they had a
camera, 200 said they had an iPhone, and 32 said they had both

Event 𝐴 (Yellow): have a camera


Event 𝐵 (Blue): have an iPhone,
1
𝑃 𝐴 =
4
1
𝑃 𝐵 =
2
1
𝑃 𝐴 ∩ 𝐵 = = 𝑃 𝐴 ∗ 𝑃(𝐵)
8

Having a camera and having an iPhone are independent


Mutually Exclusive vs Independence
Mutually Exclusive: event A Independent: the outcome of
and B cannot happen at the event A has no effect on the
same time (they are disjoint) outcome of event B

𝑃(𝐴 𝑎𝑛𝑑 𝐵) = 0 𝑃 𝐴 𝐵 = 𝑃(𝐴)

Makes OR easy: Makes AND easy:

𝑃 𝐴 𝑜𝑟 𝐵 = 𝑃 𝐴 + 𝑃(𝐵) 𝑃(𝐴 𝑎𝑛𝑑 𝐵) = 𝑃(𝐴) ∗ 𝑃(𝐵)


Addition Rule Multiplication Rule
Exercise: Independent Events
For independent events A and B, 𝑃(𝐴) = 0.68 and 𝑃(𝐵) = 0.37
❑ Find 𝑃(𝐴 ∩ 𝐵)
❑ Find 𝑃(𝐴|𝐵)
❑ Find 𝑃(𝐵|𝐴)
Exercise: Mutually Exclusive
Events
For events A and B, 𝑃(𝐴) = 0.7 and 𝑃(𝐵) = 0.3. Can we compute the
following probabilities, or explain why there is not enough information to
do so
❑ Find 𝑃(𝐴 ∩ 𝐵)
❑ Find 𝑃 𝐴 ∩ 𝐵 if we know events A and B are independent
❑ Find 𝑃 𝐴 ∩ 𝐵 if we know events A and B are mutually exclusive
❑ Find 𝑃 𝐴 ∩ 𝐵 if we know 𝑃 𝐴 ∪ 𝐵 = 0.8
Exercise: Four Rolls of a
Tetrahedral Die
❑ Is the second roll independent with first roll?

❑ What is the number of the outcomes in the sample space?

❑ What is the probability of seeing a sequence of {2,3,3,1}?

❑ What is the probability of seeing different numbers in each roll e.g. {1,3,4,2}?
Exercise: Bicycle Parts
The bicycle company buys in equal volume from three suppliers, the company
take a random sample of 3000 parts
❑ The defect rate of Manufacture A is 15%
❑ Among all the bad parts, 50% are from Manufacture H, among all the good
parts, 30% are from Manufacture H
❑ What is the probability of getting a bad part? 𝑃(𝐵) = ?
Bad Parts Good Parts Total
Manufacture A 1000
Manufacture Z 1000
Manufacture H 1000
Total 3000
Exercise: Bicycle Parts Cont.
We can answer more questions, e.g.
❑ What is the probability of getting a bad part conditional on it is from
Manufacture Z?
❑ Conditional on the next part is good, what is the probability that it is from
Manufacture Z?
Take Away for Topic 2b
Joint probability, marginal probability, and conditional probability
Two tools or the applications of conditional probability:
❑ Multiplication rule Joint Probability

❑ Law of total probability Divide and Conquer

Computational method based on contingency table


How to verify independence
Summary of Topic 2b
Conditional probability: 𝑃(𝐴|𝐵) = 𝑃(𝐴 ∩ 𝐵) / 𝑃(𝐵), given that 𝑃 𝐵 ≠ 0

Multiplication rule: 𝑃 𝐴 ∩ 𝐵 = 𝑃 𝐴 𝐵 × 𝑃 𝐵 = 𝑃 𝐵 𝐴 × 𝑃 𝐴 , for


independent events 𝑃 𝐴 ∩ 𝐵 = 𝑃 𝐴 × 𝑃 𝐵

𝑛 𝑛
Law of total probability: 𝑃(𝐴) = ∑ 𝑃(𝐴 ∩ 𝐵𝑖 ) = ∑ 𝑃(𝐴|𝐵𝑖 )𝑃(𝐵𝑖 )
𝑖=1 𝑖=1

where 𝐵1 , 𝐵2 , ⋯ , 𝐵𝑛 is a set of partition


Notations
Given
Or Conditional
AND OR
Or Knowing that

𝑃 𝐴 𝑎𝑛𝑑 𝐵
𝑃 𝐴 𝑜𝑟 𝐵 𝑃 𝐴|𝐵
𝑃 𝐴∩𝐵
𝑃 𝐴∪𝐵
𝑃(𝐴𝐵)

You might also like