Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
19 views

02 Probability

This document discusses probability and where probabilities come from. It covers careful counting, data, subjective judgment, and other probabilities. Conditional probability is introduced as the probability of one event given that another event has occurred.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

02 Probability

This document discusses probability and where probabilities come from. It covers careful counting, data, subjective judgment, and other probabilities. Conditional probability is introduced as the probability of one event given that another event has occurred.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 72

Probability

 Where do probabilities come from?


 Conditional probability: the art of
asking the right question
 Calculating probabilities from tables
 Introduction to R

STA 309 – Business Statistics


September 1, 2020
Dr. Shannon Provost
Department of Information, Risk, & Operations Management
Probability is a science
of uncertainty.

https://www.visualcapitalist.com/measuring-perceptions-of-uncertainty/
Probability notation

 The probability of some event is a number between zero and one.


0 ≤ 𝑃(𝑠𝑜𝑚𝑒 𝑒𝑣𝑒𝑛𝑡) ≤ 1
 An event with probability 1 is certain to occur; an event with
probability 0 is certain not to occur.
 For example:
 𝑃 𝑐𝑜𝑖𝑛 𝑙𝑎𝑛𝑑𝑠 ℎ𝑒𝑎𝑑𝑠 = 0.5
 𝑃 𝑓𝑙𝑖𝑔ℎ𝑡 𝑑𝑒𝑝𝑎𝑟𝑡𝑠 𝑜𝑛 𝑡𝑖𝑚𝑒 = 0.79
 𝑃 𝑟𝑎𝑖𝑛 𝑖𝑛 𝐴𝑢𝑠𝑡𝑖𝑛 = 0.2
 𝑃 𝑟𝑎𝑖𝑛 𝑖𝑛 𝐷𝑢𝑏𝑙𝑖𝑛 = 0.4
 𝑃 𝑐𝑜𝑙𝑑 𝑑𝑎𝑦 𝑖𝑛 𝐻𝑒𝑙𝑙 = 0.000000000000001
Where do probabilities come from?

 Careful counting
 Data
 Subjective judgment
 Other probabilities
Where do probabilities come from?

 Careful counting
 Data
 Subjective judgment
 Other probabilities
Example: draw a card at random
from a standard 52-card deck

What is 𝑃 𝑑𝑖𝑎𝑚𝑜𝑛𝑑 ?

What is 𝑃 𝑘𝑖𝑛𝑔 𝑜𝑟 𝑞𝑢𝑒𝑒𝑛 ?


13
𝑃 𝑑𝑖𝑎𝑚𝑜𝑛𝑑 =
52
13
𝑃 𝑑𝑖𝑎𝑚𝑜𝑛𝑑 =
52
8
𝑃 𝑘𝑖𝑛𝑔 𝑜𝑟 𝑞𝑢𝑒𝑒𝑛 =
52
8
𝑃 𝑘𝑖𝑛𝑔 𝑜𝑟 𝑞𝑢𝑒𝑒𝑛 =
52
The counting principle:

# 𝑜𝑢𝑡𝑐𝑜𝑚𝑒𝑠 𝑜𝑓 𝑖𝑛𝑡𝑒𝑟𝑒𝑠𝑡 𝑌
𝑃= =
𝑡𝑜𝑡𝑎𝑙 # 𝑜𝑓 𝑜𝑢𝑡𝑐𝑜𝑚𝑒𝑠 𝑁

Key assumption: All outcomes equally likely


Example: rolling two fair dice

Let 𝑆 be the sum of the two numbers.

Clearly 𝑆 is random: it varies


from one roll to the next.

What is 𝑃 𝑆 ≥ 9 ?
10
𝑃 𝑆≥9 = ≈ 0.28
36
10
𝑃 𝑆≥9 = ≈ 0.28
36
Where do probabilities come from?

 Careful counting
 Data
 Subjective judgment
 Other probabilities
𝑃 𝑛𝑒𝑤𝑏𝑜𝑟𝑛 𝑏𝑎𝑏𝑦 𝑖𝑠 𝑎 𝑔𝑖𝑟𝑙
100
=
206
≈ 0.485
Joe will be in a
P ≈ 0.009
car accident this year
 Emma Pierson & Stanford colleagues analyzed racial bias across
100 million traffic stops
 Data set incorporates 21 state patrol agencies and 35 municipal police
departments over 10 years

 Goal: test the Grogger & Ridgeway “veil of darkness” hypothesis


 Prediction: the probability that a stopped driver is Black will be
lower at night, when it’s harder to see the race of the driver.
An illustration of the veil-of-darkness test for stops
occurring in three short time windows in Texas.

Each panel shows a different time for the onset of dusk (end of civil twilight).
Where do probabilities come from?

 Careful counting
 Data
 Subjective judgment
 Other probabilities
𝑊𝑖𝑙𝑙𝑖𝑎𝑚𝑠 𝑤𝑖𝑛𝑠
P 𝑎𝑛𝑜𝑡ℎ𝑒𝑟
𝑊𝑖𝑚𝑏𝑙𝑒𝑑𝑜𝑛

= 0.3 ?
= 0.2 ?
𝑃 = 0.2 𝑃 = 0.3
Give me $10.
If Serena wins another Wimbledon,
I’ll repay your $10…and I’ll pay you
another $30.
Expected payoff:

𝐸 = 10 ∗ 0.8 − 30 ∗ 0.2
=8−6
=2
Expected payoff:

𝐸 = 30 ∗ 0.3 − 10 ∗ 0.7
=9−7
=2
OK!
𝑃 𝐴𝑝𝑝𝑙𝑒 𝑠𝑡𝑜𝑐𝑘 𝑢𝑝 𝑛𝑒𝑥𝑡 𝑦𝑒𝑎𝑟 = 0.7 ? ≈(Buy!)
0.28

𝑃 𝐴𝑝𝑝𝑙𝑒 𝑠𝑡𝑜𝑐𝑘 𝑢𝑝 𝑛𝑒𝑥𝑡 𝑦𝑒𝑎𝑟 = 0.4 ? ≈(Sell!)


0.28
Where do probabilities come from?

 Careful counting
 Data
 Subjective judgment
 Other probabilities
Where do probabilities come from?

 Careful counting
 Data
 Subjective judgment
 Other probabilities
Negation Rule

 In general, for any event 𝐴, 𝑃 𝑛𝑜𝑡 𝐴 = 1 − 𝑃(𝐴)


 Also known as the “complement rule”
 Let’s pretend that the probability of rain tomorrow is 0.3
 Then clearly the probability that it will NOT rain tomorrow is 0.7

 Say the probability that Tiger Woods wins the Masters


tournament in November is 0.13.
 Then the probability that Tiger Woods does not win the Masters is 0.87.
Addition Rule

 Draw a card at random. What is 𝑃 𝑐𝑎𝑟𝑑 𝑖𝑠 𝐴𝑐𝑒 𝑜𝑟 𝑆𝑝𝑎𝑑𝑒 ?


 Key insight: “Ace” and “Spade” are not mutually exclusive outcomes.
 Therefore we cannot simply add 𝑃 𝐴𝑐𝑒) + 𝑃(𝑆𝑝𝑎𝑑𝑒 because we will
double count the Ace of Spades
 Of the 52 cards:
 4 are aces: 𝑃 𝐴𝑐𝑒 = 4Τ52
 13 are spades: 𝑃 𝐴𝑐𝑒 = 4Τ52
 1 is both an ace and a spade: 𝑃 𝐴𝑐𝑒, 𝑆𝑝𝑎𝑑𝑒 = 1Τ52
4
𝑃 𝐴𝑐𝑒 𝑜𝑟 𝑆𝑝𝑎𝑑𝑒 = +⋯
52
4
𝑃 𝐴𝑐𝑒 𝑜𝑟 𝑆𝑝𝑎𝑑𝑒 = +⋯
52
4 13
𝑃 𝐴𝑐𝑒 𝑜𝑟 𝑆𝑝𝑎𝑑𝑒 = + +⋯
52 52
4 13 1
𝑃 𝐴𝑐𝑒 𝑜𝑟 𝑆𝑝𝑎𝑑𝑒 = + − …
52 52 52
4 13 1 𝟏𝟔
𝑃 𝐴𝑐𝑒 𝑜𝑟 𝑆𝑝𝑎𝑑𝑒 = + − =
52 52 52 𝟓𝟐
Addition Rule

 Consider two events A and B, not necessarily mutually exclusive.


 Let 𝑃(𝐴, 𝐵) be the joint probability that both A and B happen.

 Then 𝑃 𝐴 𝑜𝑟 𝐵 =
𝑃 𝐴 + 𝑃 𝐵 − 𝑃(𝐴, 𝐵)
Combining probability rules
Hogwarts has 280 students: 70 each in Gryffindor, Ravenclaw, Hufflepuff,
and Slytherin. There are 40 first-year students, 10 in each house. A
student is randomly selected for the next Tri-Wizard Tournament.
What is 𝑃(𝑛𝑒𝑖𝑡ℎ𝑒𝑟 𝑌𝑒𝑎𝑟 1 𝑛𝑜𝑟 𝑅𝑎𝑣𝑒𝑛𝑐𝑙𝑎𝑤)?

𝑃(𝑌1 𝑜𝑟 𝑅) = 𝑃(𝑌1) + 𝑃(𝑅) − 𝑃(𝑌1, 𝑅)


40 70 10 100
= + − = ≈ 0.357
280 280 280 280

And so by the negation rule,


180
𝑃 𝑛𝑒𝑖𝑡ℎ𝑒𝑟 𝑌𝑒𝑎𝑟 1 𝑛𝑜𝑟 𝑅𝑎𝑣𝑒𝑛𝑐𝑙𝑎𝑤 = ≈ 0.643
280
Where do probabilities come from?

 Careful counting
 Data
 Subjective judgment
 Other probabilities
What questions are there?
Conditional Probability

 A conditional probability is the chance that one event (A)


happens given that some other event (B) has already happened.
 Our notation: 𝑃 𝐴 𝐵 is the “probability of A given B”
 Conditional probabilities reflect our uncertainty in light of partial
knowledge:
 𝑃 𝑟𝑎𝑖𝑛 𝑡ℎ𝑖𝑠 𝑎𝑓𝑡𝑒𝑟𝑛𝑜𝑜𝑛 𝑐𝑙𝑜𝑢𝑑𝑦 𝑡ℎ𝑖𝑠 𝑚𝑜𝑟𝑛𝑖𝑛𝑔
 𝑃 𝑈𝑇 𝑏𝑒𝑎𝑡𝑠 𝑂𝑈 𝑈𝑇 𝑎ℎ𝑒𝑎𝑑 𝑏𝑦 𝑎 𝑡𝑜𝑢𝑐ℎ𝑑𝑜𝑤𝑛 𝑎𝑡 ℎ𝑎𝑙𝑓𝑡𝑖𝑚𝑒)
 𝑃 𝑎𝑐𝑐𝑒𝑝𝑡𝑒𝑑 𝑡𝑜 𝑚𝑒𝑑𝑖𝑐𝑎𝑙 𝑠𝑐ℎ𝑜𝑜𝑙 𝑐𝑜𝑙𝑙𝑒𝑔𝑒 𝐺𝑃𝐴 > 3.6)
 …
Example: Recommender Systems

 Instagram: P follow @LeoMessi follow @Cristiano)


 Amazon: P buy organic dog food bought GPS dog collar
 Netflix: P watch 𝑇𝑖𝑛𝑘𝑒𝑟 𝑇𝑎𝑖𝑙𝑜𝑟 𝑆𝑜𝑙𝑑𝑖𝑒𝑟 𝑆𝑝𝑦 watch 𝑆ℎ𝑒𝑟𝑙𝑜𝑐𝑘)
Example: Recommender Systems

 Instagram: P follow @LeoMessi follow @Cristiano)


 Amazon: P buy organic dog food bought GPS dog collar
 Netflix: P watch 𝑇𝑖𝑛𝑘𝑒𝑟 𝑇𝑎𝑖𝑙𝑜𝑟 𝑆𝑜𝑙𝑑𝑖𝑒𝑟 𝑆𝑝𝑦 watch 𝑆ℎ𝑒𝑟𝑙𝑜𝑐𝑘)
Perhaps the single most important fact to
remember about conditional probabilities:

𝑃(𝐴|𝐵) ≠ 𝑃(𝐵|𝐴)
Perhaps the single most important fact to
remember about conditional probabilities:

𝑃(𝐴|𝐵) ≠ 𝑃(𝐵|𝐴)

A: You can dribble a basketball


B: You play in the NBA
𝑃 𝐶𝑎𝑛 𝑑𝑟𝑖𝑏𝑏𝑙𝑒 𝑃𝑙𝑎𝑦𝑠 𝑖𝑛 𝑁𝐵𝐴 = 1)
𝑃 𝑃𝑙𝑎𝑦𝑠 𝑖𝑛 𝑁𝐵𝐴 𝐶𝑎𝑛 𝑑𝑟𝑖𝑏𝑏𝑙𝑒 ≈ 0
Perhaps the single most important fact to
remember about conditional probabilities:

𝑃(𝐴|𝐵) ≠ 𝑃(𝐵|𝐴)
Moral of the story:
Always be specific about what’s on the left-hand side
and what’s on the right-hand side.
Where do probabilities come from?

 Careful counting
 Data
 Subjective judgment
 Other probabilities

It’s just the same for conditional probabilities!


Example: Mammograms

P cancer = 15Τ200
P die, cancer = 3Τ200
P die|cancer = 3Τ15
In general, we can estimate 𝑃(𝐴|𝐵) as:

𝐹𝑟𝑒𝑞𝑢𝑒𝑛𝑐𝑦 𝑜𝑓 𝐴 𝑎𝑛𝑑 𝐵 𝑏𝑜𝑡ℎ ℎ𝑎𝑝𝑝𝑒𝑛𝑖𝑛𝑔


𝑃 𝐴𝐵 =
𝐹𝑟𝑒𝑞𝑢𝑒𝑛𝑐𝑦 𝑜𝑓 𝐵 ℎ𝑎𝑝𝑝𝑒𝑛𝑖𝑛𝑔
Multiplication Rule

 The probability of A given B is equal to the frequency of A and B


both happening divided by the frequency of B happen.

 The multiplication rule expresses this idea in general terms:

𝑃(𝐴, 𝐵)
𝑃 𝐴𝐵 =
𝑃(𝐵)
Multiplication Rule

 We can also use the alternate version below if we want to go in


reverse, from a conditional probability to a joint probability.

 This says the same thing with the terms re-arranged:

𝑃 𝐴, 𝐵 = 𝑃(𝐴 𝐵 ∗ 𝑃(𝐵)
Example: Mammograms

P cancer = 15Τ200
P die, cancer = 3Τ200
P die|cancer = 3Τ15
Using the multiplication rule:

𝑃(𝑑𝑖𝑒, 𝑐𝑎𝑛𝑐𝑒𝑟)
𝑃 𝑑𝑖𝑒 𝑐𝑎𝑛𝑐𝑒𝑟 =
𝑃(𝑐𝑎𝑛𝑐𝑒𝑟)
Example: Mammograms

P cancer = 15Τ200
P die, cancer = 3Τ200
P die|cancer = 3Τ15
Using the multiplication rule:

𝑃(𝑑𝑖𝑒, 𝑐𝑎𝑛𝑐𝑒𝑟)
𝑃 𝑑𝑖𝑒 𝑐𝑎𝑛𝑐𝑒𝑟 =
𝑃(𝑐𝑎𝑛𝑐𝑒𝑟)
3Τ200 3
= = ≈ 0.2
15Τ200 15
Example: Mammograms

P cancer = 15Τ200
P die, cancer = 3Τ200
P die|cancer = 3Τ15
Or the re-arranged multiplication rule:

𝑃 𝑑𝑖𝑒, 𝑐𝑎𝑛𝑐𝑒𝑟 = 𝑃 𝑑𝑖𝑒 𝑐𝑎𝑛𝑐𝑒𝑟 ∗ 𝑃 𝑐𝑎𝑛𝑐𝑒𝑟


Example: Mammograms

P cancer = 15Τ200
P die, cancer = 3Τ200
P die|cancer = 3Τ15
Or the re-arranged multiplication rule:

𝑃 𝑑𝑖𝑒, 𝑐𝑎𝑛𝑐𝑒𝑟 = 𝑃 𝑑𝑖𝑒 𝑐𝑎𝑛𝑐𝑒𝑟 ∗ 𝑃 𝑐𝑎𝑛𝑐𝑒𝑟


3 15 3
= ∗ = ≈ 0.015
15 200 200
Probability
and
Contingency
Tables
Pretend that you’re on the Data Science team at

 What we want to know (A): Maria likes Saving Private Ryan?


 What we already know (B): Maria likes Band of Brothers
 Key question: what is 𝑃(𝑨 | 𝑩)?
 Answer: go to the data and use the multiplication rule!

𝐹𝑟𝑒𝑞𝑢𝑒𝑛𝑐𝑦 𝑜𝑓 𝐴 𝑎𝑛𝑑 𝐵 𝑏𝑜𝑡ℎ ℎ𝑎𝑝𝑝𝑒𝑛𝑖𝑛𝑔


𝑃 𝐴𝐵 =
𝐹𝑟𝑒𝑞𝑢𝑒𝑛𝑐𝑦 𝑜𝑓 𝐵 ℎ𝑎𝑝𝑝𝑒𝑛𝑖𝑛𝑔
Probability and
Contingency Tables Liked Saving
Didn’t like it
Private Ryan

Liked Band of
Brothers
56 6

Didn’t like it
14 24
Probability and
Contingency Tables Liked Saving
Didn’t like it
Private Ryan

Liked Band of
Brothers
56 6

Didn’t like it
14 24

56
P Likes 𝑆𝑃𝑅 Likes 𝐵𝐵 = ≈ 0.9
56 + 6
Some numbers

Network TV
 $130 million for one  $400 million
season of 10 episodes commissioning pilots
 7,000 individual period  113 shows
costumes
 13 make it to a
One $35,000 royal
second season

wedding dress (300 annual


Netflix subscriptions)
Band ACL Bonnaroo Coachella Lollapalooza Outside Lands

Jimmy Cliff 0 1 0 1 0

Pretty Lights 1 1 0 1 0

Lila Downs 0 0 0 0 1

Rebelution 1 1 0 1 0

Black Joe Lewis and the Honeybears 0 0 1 0 0

Explosions In The Sky 0 1 0 1 0

Brand New 0 0 0 1 0

Frank Turner 1 0 1 0 0

Local Natives 0 0 0 1 0

Nas & Damian Marley 0 0 1 0 0

(+ 1,228 more rows)


Probability and
Contingency Tables
Didn’t play Lolla Played Lolla

Didn’t play ACL


719 361
Played ACL
81 77

𝑃(𝑝𝑙𝑎𝑦𝑒𝑑 𝐴𝐶𝐿, 𝑝𝑙𝑎𝑦𝑒𝑑 𝐿𝑜𝑙𝑙𝑎)?

𝑃 𝑝𝑙𝑎𝑦𝑒𝑑 𝐴𝐶𝐿 𝑝𝑙𝑎𝑦𝑒𝑑 𝐿𝑜𝑙𝑙𝑎)?


Probability and
Contingency Tables
Didn’t play Lolla Played Lolla

Didn’t play ACL


719 361
Played ACL
81 77

77
𝑃 𝑝𝑙𝑎𝑦𝑒𝑑 𝐴𝐶𝐿, 𝑝𝑙𝑎𝑦𝑒𝑑 𝐿𝑜𝑙𝑙𝑎 = ≈ 0.062
(719 + 361 + 81 + 77)
Probability and
Contingency Tables
Didn’t play Lolla Played Lolla

Didn’t play ACL


719 361
Played ACL
81 77

77
𝑃 𝑝𝑙𝑎𝑦𝑒𝑑 𝐴𝐶𝐿 𝑝𝑙𝑎𝑦𝑒𝑑 𝐿𝑜𝑙𝑙𝑎) = ≈ 0.176
(361 + 77)
Let’s try this out together with the music festivals data!

Download aclfest files on Canvas:

You might also like