Top Banner
HUDM4122 Probability and Statistical Inference February 18, 2015
83

HUDM4122 Probability and Statistical Inference February 18, 2015.

Dec 17, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: HUDM4122 Probability and Statistical Inference February 18, 2015.

HUDM4122Probability and Statistical Inference

February 18, 2015

Page 2: HUDM4122 Probability and Statistical Inference February 18, 2015.

HW

• Getting harder…

Page 3: HUDM4122 Probability and Statistical Inference February 18, 2015.

HW

• Getting harder…

Page 4: HUDM4122 Probability and Statistical Inference February 18, 2015.

Difficulties

Page 5: HUDM4122 Probability and Statistical Inference February 18, 2015.

A lot of trouble with sample space calculation

Page 6: HUDM4122 Probability and Statistical Inference February 18, 2015.

A reminder

• The sample space is the total number of combination of things that can happen

• If you flip a fair coin twice, the sample space is 4: HHTH HT TT

Page 7: HUDM4122 Probability and Statistical Inference February 18, 2015.

Problem 1

• What is the sample space if you flip a coin 6 times?

• Correct answer: 2x2x2x2x2x2 = 64• Most common answer: 12• Also: 1/64

Page 8: HUDM4122 Probability and Statistical Inference February 18, 2015.

Problem 2

• You have made friends with a specially trained mouse, who, on a given step, randomly goes left 1/3 of the time, forwards 1/3 of the time, and right 1/3 of a time. If the mouse takes 7 steps, what is the sample space?

• Correct answer: 3x3x3x3x3x3x3• Common wrong answer: 21

Page 9: HUDM4122 Probability and Statistical Inference February 18, 2015.

Problem 5

• You and your friends order a pizza with 8 slices. One of the slices, for some obscure reason, has anchovies. You *HATE* anchovies. Before you get to the pizza, each of your 7 friends takes a single slice, apparently at random. What is the sample space of this meal?

• Correct answer: 8*7*6*5*4*3*2*1• Common wrong answers: 8, 8^7– Why are these wrong?

Page 10: HUDM4122 Probability and Statistical Inference February 18, 2015.

Probability Calculation

Page 11: HUDM4122 Probability and Statistical Inference February 18, 2015.

Problem 6

• You and your friends order a pizza with 8 slices. One of the slices, for some obscure reason, has anchovies. You *HATE* anchovies. Before you get to the pizza, each of your 7 friends takes a single slice, apparently at random. What is the probability that you end up with anchovies?

• Correct answer: 1/8• Common wrong answer: 1/40320

Page 12: HUDM4122 Probability and Statistical Inference February 18, 2015.

Problem 8

• You and your friends order a pizza with 8 slices. One of the slices, for some obscure reason, has anchovies. You *HATE* anchovies. Before you get to the pizza, 2 of your 7 friends take a single slice, apparently at random. They both did not get anchovies. What is the probability that you end up with anchovies?

• Correct answer: 0%– Why?

• Common wrong answers: 1/6, 1/5

Page 13: HUDM4122 Probability and Statistical Inference February 18, 2015.

Problem 11

• 21% of Americans went to an art gallery or museum in the last year. 23% of Americans went to a baseball game last year. 4% of Americans went to both (I totally made that last one up). What percent of americans went to a art gallery OR a museum OR a baseball game last year?

• What’s the answer?

Page 14: HUDM4122 Probability and Statistical Inference February 18, 2015.

Problem 11

• 21% of Americans went to an art gallery or museum in the last year. 23% of Americans went to a baseball game last year. 4% of Americans went to both (I totally made that last one up). What percent of americans went to a art gallery OR a museum OR a baseball game last year?

• Correct answer: 40%• Common wrong answers: 44%, 48%

Page 15: HUDM4122 Probability and Statistical Inference February 18, 2015.

Problem 14

• The probability that a New Yorker takes the subway is 37%. Let's say that the probability that a New Yorker goes to a museum or gallery each year is 34%. The probability that a New Yorker goes to a museum or gallery each year, if they take the subway, is 41%. What is the probability that a New Yorker takes the subway AND goes to a museum or gallery each year?

• Correct answer: 15%• Common wrong answer: 41%– Why is this wrong?

Page 16: HUDM4122 Probability and Statistical Inference February 18, 2015.

Problem 14

• The probability that a New Yorker takes the subway is 37%. Let's say that the probability that a New Yorker goes to a museum or gallery each year is 34%. The probability that a New Yorker goes to a museum or gallery each year, if they take the subway, is 41%. What is the probability that a New Yorker takes the subway AND goes to a museum or gallery each year?

• Correct answer: 15%• Another common wrong answer: 13%– Why is this wrong?

Page 17: HUDM4122 Probability and Statistical Inference February 18, 2015.

Problem 15

• The probability that a student passes "Intro to Basketweaving" is 72%. The probability that a student passes "Intro to Psychoceramics" is 21% if they fail "Intro to Basketweaving", and is 94% if they pass "Intro to Basketweaving". What is the probability that a student passes both classes?

• Why is the correct answer 68% rather than 20%?

Page 18: HUDM4122 Probability and Statistical Inference February 18, 2015.

Combinations and Permutations

Page 19: HUDM4122 Probability and Statistical Inference February 18, 2015.

Problem 10

• Professor Padeiro owns 7 computers. She wants to take 3 of them with her on a trip. How many combinations of computers could she take?

• What is the correct answer?

Page 20: HUDM4122 Probability and Statistical Inference February 18, 2015.

Problem 10

• Professor Padeiro owns 7 computers. She wants to take 3 of them with her on a trip. How many combinations of computers could she take?

• What is the correct answer?=35

Page 21: HUDM4122 Probability and Statistical Inference February 18, 2015.

Problem 10

• Professor Padeiro owns 7 computers. She wants to take 3 of them with her on a trip. How many combinations of computers could she take?

• What is the correct answer?=35

• Common wrong answer = 210

Page 22: HUDM4122 Probability and Statistical Inference February 18, 2015.
Page 23: HUDM4122 Probability and Statistical Inference February 18, 2015.

What we didn’t cover last time

Page 24: HUDM4122 Probability and Statistical Inference February 18, 2015.

General Multiplication Rule

• What if A and B are independent?

• Like two flips of a fair coin

Page 25: HUDM4122 Probability and Statistical Inference February 18, 2015.

General Multiplication Rule

• What if A and B are independent?

• Like two flips of a fair coin

• In that case, P(B|A)=P(B)

Page 26: HUDM4122 Probability and Statistical Inference February 18, 2015.

Multiplication Rule For Independent Events

• If A and B are independent

Page 27: HUDM4122 Probability and Statistical Inference February 18, 2015.

Multiplication Rule For Independent Events

• If A and B are independent

• This is the rule we were using, when we computed…– Multiple coin flips– Multiple rolls of a 6-sided die

Page 28: HUDM4122 Probability and Statistical Inference February 18, 2015.

Any last comments or questions for the day?

Page 29: HUDM4122 Probability and Statistical Inference February 18, 2015.

Today

• Ch. 4.7 in Mendenhall, Beaver, & Beaver

Page 30: HUDM4122 Probability and Statistical Inference February 18, 2015.

Today

• Bayes’ Rule

Page 31: HUDM4122 Probability and Statistical Inference February 18, 2015.

Today

• Bayes’ Rule

• Also (more frequently) called– Bayes’ Theorem– Bayes’ Law

Page 32: HUDM4122 Probability and Statistical Inference February 18, 2015.

Very Important Rule in Statistics

• Underpins Bayesian Statistics– One of the two core branches of Statistics– Not a focus of this class, which is focused on the

other branch, Frequentist statistics

• Underpins major areas of Data Mining and Machine Learning– Including core methods of educational data

mining, such as Bayesian Knowledge Tracing

Page 33: HUDM4122 Probability and Statistical Inference February 18, 2015.

Classic Version

𝑃 ( 𝐴|𝐵 )=𝑃 (𝐵|𝐴 )𝑃 (𝐴)

𝑃 (𝐵)

Page 34: HUDM4122 Probability and Statistical Inference February 18, 2015.

Let’s apply it

• P(B|A) = 0.4• P(A) = 0.7• P(B) = 0.3• P(A|B)=?

Page 35: HUDM4122 Probability and Statistical Inference February 18, 2015.

Let’s apply it

• P(B|A) = 0.4• P(A) = 0.7• P(B) = 0.3• P(A|B)= 0.93

Page 36: HUDM4122 Probability and Statistical Inference February 18, 2015.

Example

• Maria is using Reasoning Mind software to learn mathematics

• If she knows a skill, there’s a 60% chance she gets the problem right

• There’s a 40% chance she knows the skill• There’s a 70% chance she gets the problem right

• What’s the probability that if she gets the problem right, she knows the skill?

Page 37: HUDM4122 Probability and Statistical Inference February 18, 2015.

A = knows skill, B = gets problem right

• Maria is using Reasoning Mind software to learn mathematics

• If she knows a skill, there’s a 60% chance she gets the problem right

• There’s a 40% chance she knows the skill• There’s a 70% chance she gets the problem right

• What’s the probability that if she gets the problem right, she knows the skill?

Page 38: HUDM4122 Probability and Statistical Inference February 18, 2015.

A = knows skill, B = gets problem right

• Maria is using Reasoning Mind software to learn mathematics

• If she knows a skill, there’s a 60% chance she gets the problem right. P(B|A)

• There’s a 40% chance she knows the skill. P(A)• There’s a 70% chance she gets the problem right. P(B)

• What’s the probability that if she gets the problem right, she knows the skill?

Page 39: HUDM4122 Probability and Statistical Inference February 18, 2015.

Example

• Maria is using Reasoning Mind software to learn mathematics

• If she knows a skill, there’s a 60% chance she gets the problem right

• There’s a 40% chance she knows the skill• There’s a 70% chance she gets the problem right

• What’s the probability that if she gets the problem right, she knows the skill?– 34.2%

Page 40: HUDM4122 Probability and Statistical Inference February 18, 2015.

Be careful…

• About what your A is• And what your B is

Page 41: HUDM4122 Probability and Statistical Inference February 18, 2015.

Do this one in pairs

• Dan is taking an online course using the Purdue Course Signals platform, that detects when a student is at-risk of failing the course

• If he is at-risk, there’s a 80% chance he skips the first homework• There’s a 50% chance he is at-risk• There’s a 60% chance he skips the first homework

• What’s the probability that if he skips the first homework, he is at-risk?

Page 42: HUDM4122 Probability and Statistical Inference February 18, 2015.

Do this one in pairs

• Dan is taking an online course using the Purdue Course Signals platform, that detects when a student is at-risk of failing the course

• If he is at-risk, there’s a 80% chance he skips the first homework

• There’s a 50% chance he is at-risk• There’s a 60% chance he skips the first homework

• What’s the probability that if he skips the first homework, he is at-risk?– 66.7%

Page 43: HUDM4122 Probability and Statistical Inference February 18, 2015.

Do this one in pairs

• The Yonkers College of Holistic Phrenology just had an unspeakably embarrassing scandal

• Historically, among colleges of this type that are denied accreditation, 20% have had a recent scandal

• There’s a 4% chance of a college of this type being denied accreditation

• There’s a 1% chance of a college of this type having a scandal

• Given that this college just had a scandal, what is the probability it will be denied accreditation?

Page 44: HUDM4122 Probability and Statistical Inference February 18, 2015.

Do this one in pairs

• The Yonkers College of Holistic Phrenology just had an unspeakably embarrassing scandal

• Historically, among colleges of this type that are denied accreditation, 20% have had a recent scandal

• There’s a 4% chance of a college of this type being denied accreditation

• There’s a 1% chance of a college of this type having a scandal

• Given that this college just had a scandal, what is the probability it will be denied accreditation?– 80%

Page 45: HUDM4122 Probability and Statistical Inference February 18, 2015.

Questions? Comments?

Page 46: HUDM4122 Probability and Statistical Inference February 18, 2015.

Where did Bayes’ Rule come from?

Page 47: HUDM4122 Probability and Statistical Inference February 18, 2015.

Where did Bayes’ Rule come from?

Page 48: HUDM4122 Probability and Statistical Inference February 18, 2015.

Where did Bayes’ Rule come from?

P(Actually Bayes) = 0.1

Page 49: HUDM4122 Probability and Statistical Inference February 18, 2015.

Where did Bayes’ Rule come from?

• Simple to derive

Page 50: HUDM4122 Probability and Statistical Inference February 18, 2015.

Recall General Multiplication Rule

Page 51: HUDM4122 Probability and Statistical Inference February 18, 2015.

Note Also That

Page 52: HUDM4122 Probability and Statistical Inference February 18, 2015.

Which Means That

• P(B)P(A|B) =

Page 53: HUDM4122 Probability and Statistical Inference February 18, 2015.

Divide Both Sides by P(B)

Page 54: HUDM4122 Probability and Statistical Inference February 18, 2015.

Questions? Comments?

Page 55: HUDM4122 Probability and Statistical Inference February 18, 2015.

This was the Classic Version of Bayes’ Rule

• When people talk about Bayes’ Rule, they generally mean this version

Page 56: HUDM4122 Probability and Statistical Inference February 18, 2015.

This was the Classic Version of Bayes’ Rule

• When people talk about Bayes’ Rule, they generally mean this version

• There is also a General Version seen in the book

Page 57: HUDM4122 Probability and Statistical Inference February 18, 2015.

Before we get there…

• Law of Total Probability

Page 58: HUDM4122 Probability and Statistical Inference February 18, 2015.

Law of Total Probability

Page 59: HUDM4122 Probability and Statistical Inference February 18, 2015.

Example

• I’m wondering whether a student will quit the problem set before completing

• The student might be (exhaustively, mutually exclusively)– Working in System Appropriately– Gaming the System– Getting Answers From a Friend

Page 60: HUDM4122 Probability and Statistical Inference February 18, 2015.

Example

• I’m wondering whether a student will quit the problem set before completing

• The student might be (exhaustively, mutually exclusively)– P(Working in System Appropriately) = 0.7– P(Quit | WSA) = 0.02

– P(Gaming the System) = 0.1– P(Quit | GS) = 0.01

– P(Getting Answers From a Friend) = 0.2– P(Quit | GAFF) = 0.3

Page 61: HUDM4122 Probability and Statistical Inference February 18, 2015.

Note that P(WSA)+P(GS)+P(GAFF) = 1

• I’m wondering whether a student will quit the problem set before completing

• The student might be (exhaustively, mutually exclusively)– P(Working in System Appropriately) = 0.7– P(Quit | WSA) = 0.02

– P(Gaming the System) = 0.1– P(Quit | GS) = 0.01

– P(Getting Answers From a Friend) = 0.2– P(Quit | GAFF) = 0.3

Page 62: HUDM4122 Probability and Statistical Inference February 18, 2015.

Note that P(WSA)+P(GS)+P(GAFF) = 1If this isn’t true,

it’s not exhaustive or not mutually exclusive

• I’m wondering whether a student will quit the problem set before completing

• The student might be (exhaustively, mutually exclusively)– P(Working in System Appropriately) = 0.7– P(Quit | WSA) = 0.02

– P(Gaming the System) = 0.1– P(Quit | GS) = 0.01

– P(Getting Answers From a Friend) = 0.2– P(Quit | GAFF) = 0.3

Page 63: HUDM4122 Probability and Statistical Inference February 18, 2015.

Example

• P(Quit) = P(Working in System Appropriately) * P(Quit | WSA) +P(Gaming the System) * P(Quit | GS) +P(Getting Answers From a Friend) * P(Quit | GAFF)

Page 64: HUDM4122 Probability and Statistical Inference February 18, 2015.

Example

• P(Quit) = P(Working in System Appropriately) * P(Quit | WSA) +P(Gaming the System) * P(Quit | GS) +P(Getting Answers From a Friend) * P(Quit | GAFF)

• P(Quit) = 0.7*0.02+ 0.1*0.01 + 0.2*0.3

Page 65: HUDM4122 Probability and Statistical Inference February 18, 2015.

Example

• P(Quit) = P(Working in System Appropriately) * P(Quit | WSA) +P(Gaming the System) * P(Quit | GS) +P(Getting Answers From a Friend) * P(Quit | GAFF)

• P(Quit) = 0.7*0.02+ 0.1*0.01 + 0.2*0.3 = 0.014+0.001+0.06 = 0.075

Page 66: HUDM4122 Probability and Statistical Inference February 18, 2015.

Do this one in pairs

• I’m wondering whether my kiddo has stomach flu

• The kiddo might be (exhaustively, mutually exclusively)– P(Puking) = 0.05– P(Stomach Flu | Puking) = 0.4

– P(Not Puking) = 0.95– P(Stomach Flu | Not Puking) = 0.01

• Your answer?

Page 67: HUDM4122 Probability and Statistical Inference February 18, 2015.

Questions? Comments?

Page 68: HUDM4122 Probability and Statistical Inference February 18, 2015.

If we take the law of total probability

• And compare it to the multiplied probability coming out of one event…

• We get…

Page 69: HUDM4122 Probability and Statistical Inference February 18, 2015.

Extended Form of Bayes’ Rule

• What the book simply refers to as Bayes’ Rule(but most people don’t)

Page 70: HUDM4122 Probability and Statistical Inference February 18, 2015.

Extended Form of Bayes’ Rule

• ) =

• A is an event• S1 through Sk represent a group of mutually

exclusive and exhaustive sub-populations

Page 71: HUDM4122 Probability and Statistical Inference February 18, 2015.

Example

• In ASSISTments, on the first attempt at problem P, a student can request a hint, give a common incorrect answer, give an uncommon incorrect answer, or give a correct answer

• P(hint) = 0.3• P(common incorrect) = 0.2• P(uncommon incorrect) = 0.4• P(correct) = 0.1

Page 72: HUDM4122 Probability and Statistical Inference February 18, 2015.

Example

• P(hint) = 0.3• P(common incorrect) = 0.2• P(uncommon incorrect) = 0.4• P(correct) = 0.1

• P(knows skill | hint) = 0.1• P(knows skill | common incorrect) = 0.2• P(knows skill | uncommon incorrect) = 0.1• P(knows skill | correct) = 0.7

Page 73: HUDM4122 Probability and Statistical Inference February 18, 2015.

Example

• P(hint) = 0.3• P(common incorrect) = 0.2• P(uncommon incorrect) = 0.4• P(correct) = 0.1

• P(knows skill | hint) = 0.1• P(knows skill | common incorrect) = 0.2• P(knows skill | uncommon incorrect) = 0.1• P(knows skill | correct) = 0.7

• What is P(correct | knows skill)?

Page 74: HUDM4122 Probability and Statistical Inference February 18, 2015.

Example• P(hint) = 0.3 P(S1)• P(common incorrect) = 0.2 P(S2)• P(uncommon incorrect) = 0.4 P(S3)• P(correct) = 0.1 P(S4)

• P(knows skill | hint) = 0.1 P(A|S1)• P(knows skill | common incorrect) = 0.2 P(A|S2)• P(knows skill | uncommon incorrect) = 0.1 P(A|S3)• P(knows skill | correct) = 0.7 P(A|S4)

• What is P(correct | knows skill)? P(S4|A)

Page 75: HUDM4122 Probability and Statistical Inference February 18, 2015.

• P(hint) = 0.3 P(S1)• P(common incorrect) = 0.2 P(S2)• P(uncommon incorrect) = 0.4 P(S3)• P(correct) = 0.1 P(S4)

• P(knows skill | hint) = 0.1 P(A|S1)• P(knows skill | common incorrect) = 0.2

P(A|S2)• P(knows skill | uncommon incorrect) = 0.1 P(A|S3)• P(knows skill | correct) = 0.7 P(A|S4)

• What is P(correct | knows skill)? P(S4|A)

• ) =

Page 76: HUDM4122 Probability and Statistical Inference February 18, 2015.

• P(hint) = 0.3 P(S1)• P(common incorrect) = 0.2 P(S2)• P(uncommon incorrect) = 0.4 P(S3)• P(correct) = 0.1 P(S4)

• P(knows skill | hint) = 0.1 P(A|S1)• P(knows skill | common incorrect) = 0.2 P(A|S2)• P(knows skill | uncommon incorrect) = 0.1 P(A|S3)• P(knows skill | correct) = 0.7 P(A|S4)

• What is P(correct | knows skill)? P(S4|A)

• ) =

Page 77: HUDM4122 Probability and Statistical Inference February 18, 2015.

• P(hint) = 0.3 P(S1)• P(common incorrect) = 0.2 P(S2)• P(uncommon incorrect) = 0.4 P(S3)• P(correct) = 0.1 P(S4)

• P(knows skill | hint) = 0.1 P(A|S1)• P(knows skill | common incorrect) = 0.2 P(A|S2)• P(knows skill | uncommon incorrect) = 0.1 P(A|S3)• P(knows skill | correct) = 0.7 P(A|S4)

• What is P(correct | knows skill)? P(S4|A)

• ) =

Page 78: HUDM4122 Probability and Statistical Inference February 18, 2015.

• P(hint) = 0.3 P(S1)• P(common incorrect) = 0.2 P(S2)• P(uncommon incorrect) = 0.4 P(S3)• P(correct) = 0.1 P(S4)

• P(knows skill | hint) = 0.1 P(A|S1)• P(knows skill | common incorrect) = 0.2 P(A|S2)• P(knows skill | uncommon incorrect) = 0.1 P(A|S3)• P(knows skill | correct) = 0.7 P(A|S4)

• What is P(correct | knows skill)? P(S4|A)

• ) = =0.39

Page 79: HUDM4122 Probability and Statistical Inference February 18, 2015.

Comments? Questions?

Page 80: HUDM4122 Probability and Statistical Inference February 18, 2015.

Any last comments or questions for the day?

Page 81: HUDM4122 Probability and Statistical Inference February 18, 2015.

Upcoming Classes

• 2/23 Discrete Random Variables and Their Probability Distributions– Ch. 4-8

• 2/25 Binomial Probability Distribution– Ch. 5-2– HW 4 due

Page 82: HUDM4122 Probability and Statistical Inference February 18, 2015.

Homework 4

• Due in 7 days• In the ASSISTments system

Page 83: HUDM4122 Probability and Statistical Inference February 18, 2015.

Questions? Comments?