The Law of Total Probability, Bayes Rule, and Random Variables (Oh My!)

Similar documents
Introduction to Regression

Maximum A Posteriori (MAP) CS 109 Lecture 22 May 16th, 2016

Introduction to Spacetime Geometry

Differentiation Applications 1: Related Rates

4th Indian Institute of Astrophysics - PennState Astrostatistics School July, 2013 Vainu Bappu Observatory, Kavalur. Correlation and Regression

CHAPTER 24: INFERENCE IN REGRESSION. Chapter 24: Make inferences about the population from which the sample data came.

Math 105: Review for Exam I - Solutions

Chapter Summary. Mathematical Induction Strong Induction Recursive Definitions Structural Induction Recursive Algorithms

Section 5.8 Notes Page Exponential Growth and Decay Models; Newton s Law

Thermodynamics Partial Outline of Topics

Public Key Cryptography. Tim van der Horst & Kent Seamons

, which yields. where z1. and z2

Department of Economics, University of California, Davis Ecn 200C Micro Theory Professor Giacomo Bonanno. Insurance Markets

Associated Students Flacks Internship

Getting Involved O. Responsibilities of a Member. People Are Depending On You. Participation Is Important. Think It Through

Fall 2013 Physics 172 Recitation 3 Momentum and Springs

CAUSAL INFERENCE. Technical Track Session I. Phillippe Leite. The World Bank

LHS Mathematics Department Honors Pre-Calculus Final Exam 2002 Answers

Lab #3: Pendulum Period and Proportionalities

IB Sports, Exercise and Health Science Summer Assignment. Mrs. Christina Doyle Seneca Valley High School

Distributions, spatial statistics and a Bayesian perspective

Chapter 8: The Binomial and Geometric Distributions

Individual Events 5 I3 a 6 I4 a 8 I5 A Group Events

Lab 1 The Scientific Method

Physics 2010 Motion with Constant Acceleration Experiment 1

Internal vs. external validity. External validity. This section is based on Stock and Watson s Chapter 9.

Phys. 344 Ch 7 Lecture 8 Fri., April. 10 th,

How do scientists measure trees? What is DBH?

Medium Scale Integrated (MSI) devices [Sections 2.9 and 2.10]

READING STATECHART DIAGRAMS

Department: MATHEMATICS

Purpose: Use this reference guide to effectively communicate the new process customers will use for creating a TWC ID. Mobile Manager Call History

If (IV) is (increased, decreased, changed), then (DV) will (increase, decrease, change) because (reason based on prior research).

CS 477/677 Analysis of Algorithms Fall 2007 Dr. George Bebis Course Project Due Date: 11/29/2007

Physics 212. Lecture 12. Today's Concept: Magnetic Force on moving charges. Physics 212 Lecture 12, Slide 1

making triangle (ie same reference angle) ). This is a standard form that will allow us all to have the X= y=

Five Whys How To Do It Better

Computational modeling techniques

AP Literature and Composition. Summer Reading Packet. Instructions and Guidelines

COMP 551 Applied Machine Learning Lecture 11: Support Vector Machines

Lecture 13: Markov Chain Monte Carlo. Gibbs sampling

Biochemistry Summer Packet

Activity Guide Loops and Random Numbers

We can see from the graph above that the intersection is, i.e., [ ).

COMP 551 Applied Machine Learning Lecture 5: Generative models for linear classification

ENSC Discrete Time Systems. Project Outline. Semester

CHM112 Lab Graphing with Excel Grading Rubric

Trigonometric Ratios Unit 5 Tentative TEST date

Experiment #3. Graphing with Excel

It is compulsory to submit the assignment before filling in the exam form.

6.3: Volumes by Cylindrical Shells

Monroe Township School District Monroe Township, New Jersey

/ / Chemistry. Chapter 1 Chemical Foundations

Homology groups of disks with holes

This section is primarily focused on tools to aid us in finding roots/zeros/ -intercepts of polynomials. Essentially, our focus turns to solving.

Dataflow Analysis and Abstract Interpretation

Lesson Plan. Recode: They will do a graphic organizer to sequence the steps of scientific method.

Relationships Between Frequency, Capacitance, Inductance and Reactance.

Our Lady Star of the Sea Religious Education CIRCLE OF GRACE LESSON PLAN - Grade 1

AP Physics. Summer Assignment 2012 Date. Name. F m = = + What is due the first day of school? a. T. b. = ( )( ) =

CHEM 103 Calorimetry and Hess s Law

BASD HIGH SCHOOL FORMAL LAB REPORT

Introduction to Models and Properties

AIP Logic Chapter 4 Notes

Group Color: Subgroup Number: How Science Works. Grade 5. Module 2. Class Question: Scientist (Your Name): Teacher s Name: SciTrek Volunteer s Name:

Credits: 4 Lecture Hours: 4 Lab/Studio Hours: 0

Part One: Heat Changes and Thermochemistry. This aspect of Thermodynamics was dealt with in Chapter 6. (Review)

[COLLEGE ALGEBRA EXAM I REVIEW TOPICS] ( u s e t h i s t o m a k e s u r e y o u a r e r e a d y )

Thermodynamics and Equilibrium

Bootstrap Method > # Purpose: understand how bootstrap method works > obs=c(11.96, 5.03, 67.40, 16.07, 31.50, 7.73, 11.10, 22.38) > n=length(obs) >

I. Analytical Potential and Field of a Uniform Rod. V E d. The definition of electric potential difference is

End of Course Algebra I ~ Practice Test #2

Hypothesis Tests for One Population Mean

IAML: Support Vector Machines

Math Foundations 20 Work Plan

CS 109 Lecture 23 May 18th, 2016

AP Statistics Notes Unit Two: The Normal Distributions

Instructional Plan. Representational/Drawing Level

3. Classify the following Numbers (Counting (natural), Whole, Integers, Rational, Irrational)

Physics 2B Chapter 23 Notes - Faraday s Law & Inductors Spring 2018

PHYS 314 HOMEWORK #3

B. Definition of an exponential

CHAPTER 2 Algebraic Expressions and Fundamental Operations

Admin. MDP Search Trees. Optimal Quantities. Reinforcement Learning

Who is the Holy Spirit?

Please Stop Laughing at Me and Pay it Forward Final Writing Assignment

Algebra2/Trig: Trig Unit 2 Packet

Chapter 8 Predicting Molecular Geometries

New SAT Math Diagnostic Test

Flipping Physics Lecture Notes: Simple Harmonic Motion Introduction via a Horizontal Mass-Spring System

Sections 15.1 to 15.12, 16.1 and 16.2 of the textbook (Robbins-Miller) cover the materials required for this topic.

MATHEMATICS SYLLABUS SECONDARY 5th YEAR

Being able to connect displacement, speed, and acceleration is fundamental to working

Chapter 3: Cluster Analysis

Physics 101 Math Review. Solutions

SPECIMEN. Candidate Surname. Candidate Number

City of Angels School Independent Study Los Angeles Unified School District

x 1 Outline IAML: Logistic Regression Decision Boundaries Example Data

CHAPTER 3 INEQUALITIES. Copyright -The Institute of Chartered Accountants of India

Math 9 Year End Review Package. (b) = (a) Side length = 15.5 cm ( area ) (b) Perimeter = 4xside = 62 m

Transcription:

The Law f Ttal Prbability, Bayes Rule, and Randm Variables (Oh My!)

Administrivia Hmewrk 2 is psted and is due tw Friday s frm nw If yu didn t start early last time, please d s this time. Gd Milestnes: Finish Prblems 1-3 this week. Mre math, sme prgramming. Finish Prblems 4-5 next week. Less math, mre prgramming.

Administrivia Reminder f the curse Cllabratin Plicy: Inspiratin is Free: yu may discuss hmewrk assignments with anyne. Yu are especially encuraged t discuss slutins with yur instructr and yur classmates. Plagiarism is Frbidden: the assignments and cde that yu turn in shuld be written entirely n yur wn. D NOT Search fr a Slutin On-Line: Yu may nt actively search fr a slutin t the prblem frm the internet. This includes psting t surces like StackExchange, Reddit, Chegg, etc Vilatin f ANY f the abve will result in an F in the curse / trip t Hnr Cuncil

Previusly n CSCI 3022 Cnditinal Prbability: The prbability that A ccurs given that C ccurred P (A C) P (A C) P (C) Multiplicatin Rule: P (A C) P (A C) P (C) Independence: Events A and B are independent if 1. 2. P (A B) P (A) P (B A) P (B) 3. P (A B) P (A)P (B)

Law f Ttal Prbability Example: Suppse I have tw bags f marbles. The first bag cntains 6 white marbles and 4 black marbles. The secnd bag cntains 3 white marbles and 7 black marbles. Nw suppse I put the tw bags in a bx. If I clse my eyes, grab a bag frm the bx, and then grab a marble frm the bag, what is the prbability that it is black? H BLACK 20 0 0.55. t + ± E + E- ' t

Law f Ttal Prbability Example: Same scenari as befre, but nw suppse that the first bag is much larger than the secnd bag, s that when I reach int the bx I m twice as likely t grab the first bag as the secnd. What is the prbability f grabbing a black marble? P ( B.) % P(Bz) 1/3 25. t + I. E 8%+30. T. ±

Law f Ttal Prbability Def: Suppse C 1,C 2,...,C m are disjint events such that C 1 C 2 C m. The prbability f an arbitrary event A can be expressed as: P (A) P (A C 1 )P (C 1 )+P(A C 2 )P (C 2 )+ + P (A C m )P (C m ) E I n YFE #

Let s Flip Things Arund PCB, )PlB) Example: Suppse I have tw bags f marbles. The first bag cntains 6 white marbles and 4 black marbles. The secnd bag cntains 3 white marbles and 7 black marbles. Nw suppse I put the tw bags in a bx. If I clse my eyes, grab a bag frm the bx, reach int the bag and pull ut a white marble. What is the prbability that I picked Bag 1? cmplete PCB, )P( Bil - tz PCB, ( WHITE ) PCB.tk ) PC WHITE ) PIWHHEIB,) PIWHITEIBD 340 PCB, NWHITE ) PC WHITE IBDPCB, )

Let s Flip Things Arund Example: Suppse I have tw bags f marbles. The first bag cntains 6 white marbles and 4 black marbles. The secnd bag cntains 3 white marbles and 7 black marbles. Nw suppse I put the tw bags in a bx. If I clse my eyes, grab a bag frm the bx, reach int the bag and pull ut a white marble. What is the prbability that I picked Bag 1? Hw culd we cmpute this? PCB, 1 WHITE ) - PCWHITEIBDPIBDPCWHITE ) PC WHITE 1 B. ) DPIB, % Yz white IBDPCB, ) + PIWHHI 1132 )MB2 ) g.tt?. Esque % - PD }

Let s Flip Things Arund Example: Suppse I have tw bags f marbles. The first bag cntains 6 white marbles and 4 black marbles. The secnd bag cntains 3 white marbles and 7 black marbles. Nw suppse I put the tw bags in a bx. If I clse my eyes, grab a bag frm the bx, reach int the bag and pull ut a white marble. What is the prbability that I picked Bag 1? Hw culd we cmpute this? Let s write dwn literally everything we knw

Let s Flip Things Arund Example: Suppse I have tw bags f marbles. The first bag cntains 6 white marbles and 4 black marbles. The secnd bag cntains 3 white marbles and 7 black marbles. Nw suppse I put the tw bags in a bx. If I clse my eyes, grab a bag frm the bx, reach int the bag and pull ut a white marble. What is the prbability that I picked Bag 1? Hw culd we cmpute this? Let s write dwn literally everything we knw

Let s Flip Things Arund Example: Suppse I have tw bags f marbles. The first bag cntains 6 white marbles and 4 black marbles. The secnd bag cntains 3 white marbles and 7 black marbles. Nw suppse I put the tw bags in a bx. If I clse my eyes, grab a bag frm the bx, reach int the bag and pull ut a white marble. What is the prbability that I picked Bag 1? Hw culd we cmpute this? Let s write dwn literally everything we knw

Bayes Rule The ntin f using evidence (the marble is White) t update ur belief abut an event (that we selected Bx 1 frm the bx) is the crnerstne f a statistical framewrk called Bayesian Reasning. The frmulas we derived in the previus example are called Bayes Rule r Bayes Therem P (A C) t f P (C A)P (A) P (C) y PROB LIKELIHOOD a- PRIOR P (C A)P (A) P (C A)P (A)+P (C A c )P (A c ) OF EVIDENCE

Bayes Rule The ntin f using evidence (the marble is White) t update ur belief abut an event (that we selected Bx 1 frm the bx) is the crnerstne f a statistical framewrk called Bayesian Reasning. The frmulas we derived in the previus example are called Bayes Rule r Bayes Therem P (A C) P (C A)P (A) P (C) P (C A)P (A) P (C A)P (A)+P (C A c )P (A c )

Bayes Rule Bayes Rule has applicatins all ver science. Shuld we test men fr prstate cancer? Bayes Rule allws us t write dwn the prbability that smene wh tests psitive fr prstate cancer actually has prstate cancer. False psitives may cause huge amunts f stress, heartache, and pain. On the ther hand, if yu dn t test fr cancer, yu may nt discver it until it s t late Things are slightly mre cmplicated than this: Other factrs are age, PSA cutffs, etc.

Bayes Rule Classic Example: Suppse that 1% f men ver the age f 40 have prstate cancer. Als suppse that a test fr prstate cancer exists with the fllwing prperties: 90% f peple have cancer will test psitive and 8% f peple wh d nt have cancer will als test psitive. What is the prbability that a persn wh tests psitive fr cancer actually has cancer? C Have cancer + ps test - neg test PCC It ) PCt1c)PK). e Pct ) Pct 1C ) Pcc ). 'ftp.tp.ge?py@ 0.07

Bayes Rule Classic Example: Suppse that 1% f men ver the age f 40 have prstate cancer. Als suppse that a test fr prstate cancer exists with the fllwing prperties: 90% f peple have cancer will test psitive and 8% f peple wh d nt have cancer will als test psitive. What is the prbability that a persn wh tests psitive fr cancer actually has cancer?

Bayes Rule Classic Example: Suppse that 1% f men ver the age f 40 have prstate cancer. Als suppse that a test fr prstate cancer exists with the fllwing prperties: 90% f peple have cancer will test psitive and 8% f peple wh d nt have cancer will als test psitive. What is the prbability that a persn wh tests psitive fr cancer actually has cancer? Pct ) PAI c) Pcc ) + Pct Icc ) PKD E t + Is! 8.8%

Randm Variables Suppse that I rll tw dice What is the mst cmbinatin? What is the mst likely sum?

Randm Variables Suppse that I rll tw dice What is the mst cmbinatin? What is the mst likely sum?

Randm Variables What is the sample space? w, 1st pll we 2nd pll 123456-2 -1 a E

Randm Variables What is the sample space? The Key: the dice are randm, s the sum is randm. Let s sidestep the sample space entirely and just g straight t the thing we care abut: the sum. We call the sum f the dice a randm variable.

Randm Variables What is the sample space? The Key: the dice are randm, s the sum is randm. Let s sidestep the sample space entirely and just g straight t the thing we care abut: the sum. We call the sum f the dice a randm variable. Def: a discrete randm variable is a functin that maps the elements f the sample space T a finite number f values a 1,a 2,...,a n r an infinite number f values a 1,a 2,... Examples: Sum f the dice, difference f the dice, maximum f the dice Number f cin flips until we get a heads

Prbability Mass Functin. Def: a prbability mass functin is the map between the randm variable s values and the prbabilities f thse values f(a) P (X a) 9 RU. Called a prbability mass functin (PMF) because each f the randm variable values has sme prbability mass (r weight) assciated with it Because the PMF is a prbability functin, the sum f all the masses must be what? El, Fla ;) /

PCHKP Prbability Mass Functin Questin: what is the prbability mass functin fr the number f cin flips until a biased cin cmes up heads? R { H, TH, TTH, TTTH,. -. } I 2 3 4 - - - f p ctpp I. ppp ' c ppp - - -

Cumulative Distributin Functin Def: a cumulative distributin functin (CDF) is a functin whse value at a pint a is the cumulative sum f prbability masses up until a. F (a) P (X a) F (6) - prb OF Rlling A sum Questin: What is the relatinship between the PMF and the CDF? I 6 Fca ) Z, Fca ) X a

Cumulative Distributin Functin Questin: what is the prbability that I rll tw dice and they add up t at least 9? PCX - { 9,10,k,z})P( > 9) 1- P( < 9) 1- P(X±8 ) 1- FC8) I

OK! Let s G t Wrk! Get in grups, get ut laptp, and pen the Lecture 6 In-Class Ntebk Let s: Get sme mre practice with the Law f Ttal Prbability and Bayes Rule Lk at a famus Bayesian example called the Mnte Hall Prblem