What does independence look like?

Similar documents
Random Variables Chris Piech CS109, Stanford University. Piech, CS106A, Stanford University

STAT 430/510 Probability Lecture 7: Random Variable and Expectation

What is a random variable

Random Variables. Statistics 110. Summer Copyright c 2006 by Mark E. Irwin

Recitation 2: Probability

MATH 3510: PROBABILITY AND STATS July 1, 2011 FINAL EXAM

Review of Probability. CS1538: Introduction to Simulations

STAT2201. Analysis of Engineering & Scientific Data. Unit 3

MATH 3C: MIDTERM 1 REVIEW. 1. Counting

IAM 530 ELEMENTS OF PROBABILITY AND STATISTICS LECTURE 3-RANDOM VARIABLES

Math 151. Rumbos Fall Solutions to Review Problems for Exam 2. Pr(X = 1) = ) = Pr(X = 2) = Pr(X = 3) = p X. (k) =

CSC Discrete Math I, Spring Discrete Probability

Relationship between probability set function and random variable - 2 -

Discrete Random Variable Practice

Monty Hall Puzzle. Draw a tree diagram of possible choices (a possibility tree ) One for each strategy switch or no-switch

Lecture 10. Variance and standard deviation

1,1 1,2 1,3 1,4 1,5 1,6 2,1 2,2 2,3 2,4 2,5 2,6 3,1 3,2 3,3 3,4 3,5 3,6 4,1 4,2 4,3 4,4 4,5 4,6 5,1 5,2 5,3 5,4 5,5 5,6 6,1 6,2 6,3 6,4 6,5 6,6

MATH MW Elementary Probability Course Notes Part I: Models and Counting

Brief Review of Probability

Lecture 10: Probability distributions TUESDAY, FEBRUARY 19, 2019

Independence. CS 109 Lecture 5 April 6th, 2016

Lecture 10: Bayes' Theorem, Expected Value and Variance Lecturer: Lale Özkahya

ELEG 3143 Probability & Stochastic Process Ch. 2 Discrete Random Variables

Dept. of Linguistics, Indiana University Fall 2015

The enumeration of all possible outcomes of an experiment is called the sample space, denoted S. E.g.: S={head, tail}

n(1 p i ) n 1 p i = 1 3 i=1 E(X i p = p i )P(p = p i ) = 1 3 p i = n 3 (p 1 + p 2 + p 3 ). p i i=1 P(X i = 1 p = p i )P(p = p i ) = p1+p2+p3

Lecture 3. Discrete Random Variables

Random variables, Expectation, Mean and Variance. Slides are adapted from STAT414 course at PennState

1 INFO 2950, 2 4 Feb 10

Solutionbank S1 Edexcel AS and A Level Modular Mathematics


Problems and results for the ninth week Mathematics A3 for Civil Engineering students

Fundamentals. CS 281A: Statistical Learning Theory. Yangqing Jia. August, Based on tutorial slides by Lester Mackey and Ariel Kleiner

Expected Value. Lecture A Tiefenbruck MWF 9-9:50am Center 212 Lecture B Jones MWF 2-2:50pm Center 214 Lecture C Tiefenbruck MWF 11-11:50am Center 212

Lecture 2. October 21, Department of Biostatistics Johns Hopkins Bloomberg School of Public Health Johns Hopkins University.

Random Variables Example:

Chap 4 Probability p227 The probability of any outcome in a random phenomenon is the proportion of times the outcome would occur in a long series of

Probability measures A probability measure, P, is a real valued function from the collection of possible events so that the following

Probability & Statistics - FALL 2008 FINAL EXAM

MAS108 Probability I

6.041/6.431 Spring 2009 Quiz 1 Wednesday, March 11, 7:30-9:30 PM. SOLUTIONS

Analysis of Engineering and Scientific Data. Semester

CSE 312: Foundations of Computing II Random Variables, Linearity of Expectation 4 Solutions

Math 105 Course Outline

Chapter 2.5 Random Variables and Probability The Modern View (cont.)

HW MATH425/525 Lecture Notes 1

CSE 312, 2011 Winter, W.L.Ruzzo. 6. random variables

Lecture 1: Probability Fundamentals

p. 4-1 Random Variables

Lecture 9. Expectations of discrete random variables

Işık University Math 230 Exam I Exam Duration : 1 hr 30 min Nov. 12, Last Name : First Name : Student Number : Section :

Probability Theory for Machine Learning. Chris Cremer September 2015

Denker FALL Probability- Assignment 6

M378K In-Class Assignment #1

Conditional Probability

Topic -2. Probability. Larson & Farber, Elementary Statistics: Picturing the World, 3e 1

A brief review of basics of probabilities

STOR Lecture 4. Axioms of Probability - II

Probability and Independence Terri Bittner, Ph.D.

Topic 3: The Expectation of a Random Variable

MAT Mathematics in Today's World

Math 1313 Experiments, Events and Sample Spaces

Example. What is the sample space for flipping a fair coin? Rolling a 6-sided die? Find the event E where E = {x x has exactly one head}

Probabilistic models

18.05 Practice Final Exam

Compound Events. The event E = E c (the complement of E) is the event consisting of those outcomes which are not in E.

p. 6-1 Continuous Random Variables p. 6-2

MAT 271E Probability and Statistics

Discrete Random Variable

Course: ESO-209 Home Work: 1 Instructor: Debasis Kundu

Random Variables. Saravanan Vijayakumaran Department of Electrical Engineering Indian Institute of Technology Bombay

1 Random variables and distributions

Math 511 Exam #1. Show All Work No Calculators

STAT 516: Basic Probability and its Applications

18.05 Final Exam. Good luck! Name. No calculators. Number of problems 16 concept questions, 16 problems, 21 pages

Example 1. The sample space of an experiment where we flip a pair of coins is denoted by:

Review of probabilities

Chapter 3: Random Variables 1

Introduction to Probability 2017/18 Supplementary Problems

Lecture notes for probability. Math 124

Probabilistic models

Debugging Intuition. How to calculate the probability of at least k successes in n trials?

Statistical Theory 1

Math st Homework. First part of Chapter 2. Due Friday, September 17, 1999.

Independence Solutions STAT-UB.0103 Statistics for Business Control and Regression Models

Example A. Define X = number of heads in ten tosses of a coin. What are the values that X may assume?

DISCRETE RANDOM VARIABLES: PMF s & CDF s [DEVORE 3.2]

Fourier and Stats / Astro Stats and Measurement : Stats Notes

COMP 2804 Assignment 4

Refresher on Discrete Probability

Probability Notes (A) , Fall 2010

Discrete Random Variables

(i) Given that a student is female, what is the probability of having a GPA of at least 3.0?

Term Definition Example Random Phenomena

Basics on Probability. Jingrui He 09/11/2007

Probability and Statisitcs

Edexcel past paper questions

STAT:5100 (22S:193) Statistical Inference I

Lecture 4: Random Variables and Distributions

Notes 12 Autumn 2005

Transcription:

What does independence look like?

Independence S AB A Independence Definition 1: P (AB) =P (A)P (B) AB S = A S B S B Independence Definition 2: P (A B) =P (A) AB B = A S

Independence? S A Independence Definition 1: P (AB) =P (A)P (B) AB S 0 = A S B S B

Independence? S A AB B Independence Definition 2: P (A B)? = P (A) AB B? = A S 1 2 6= 2 16

When we introduced conditions

Identities of probability remained the same

But sometimes independence / dependence relationships change

Current goals: 1) Recognize conditional independence / dependence. 2) Get Intuition

Future goal: Use conditional independence / dependence in Machine Learning

Friday Night Fever Population of 10,000 people. Of those, 300 have Malaria (event M) and 200 have Bacterial Infection (event B). 6 people have both. Have Fever if and only if you have Malaria or Bacteria. Are M and B independent? Solution: P(M) = 300 / 10,000 = 0.03 P(B) = 200 / 10,000 = 0.02 P(MB) = 6 / 10,000 = 0.0006 P(M)P(B) = 0.0006 P(M)P(B) = P(MB) Independent

Friday Night Fever Population of 10,000 people. Of those, 300 have Malaria (event M) and 200 have Bacterial Infection (event B). 6 people have both. Have Fever if and only if you have Malaria or Bacteria. Are M and B independent given F? Solution: Total people with Fever = 200+300 6 = 494 P(M F) = 300 / 494 = 0.61 P(B F) = 200 / 494 = 0.40 P(MB F) = 6 / 494 = 0.012 P(M F)P(B F) = 0.224 P(M F)P(B F) P(MB F) Conditionally dependent

Conditional Dependence 10000 people =

Conditional Dependence P(M) = 0.03 300 have malaria

Conditional Dependence P(B) = 0.02 200 have bacteria

Conditional Dependence P(BM) = 0.006 6 have both

Conditional Dependence If we condition on B, the same ratio of people have malaria P(M B) = 6/200 = 0.03 P(M) = 300/10000 = 0.03 P(M) = P(M B) That s the math definition of independence

Conditional Dependence P(BM) = 0.006 6 have both

Conditional Dependence If we condition on M, the same ratio of people have bacteria P(B M) = 6/300 = 0.02 P(B) = 200/10000 = 0.02 P(B M) = P(B)

Conditional Dependence Malaria (M) Bacteria (B) P(F M) = 1 P(F B) = 1 Fever (F) *This is a causal diagram. It helps explain why things are independent

Conditional Dependence

Conditioned on Fever If we condition on F, we are left with only the people who have malaria and bacteria

Conditioned on Fever P(B F) = 200/494 = 0.40 P(M F) = 300/494 = 0.61 Conditioned on Fever

Conditioned on Fever P(B F) = 200/494 = 0.40 P(M F) = 300/494 = 0.61 Conditioned on Fever + Malaria Conditioned on Fever Test shows Malaria P(B MF) = 6/300 = 0.02 P(B F) P(B MF) That s the math definition of conditional dependence

Conditioned on Fever P(B F) = 200/494 = 0.40 P(M F) = 300/494 = 0.61 Conditioned on Fever + Malaria Conditioned on Fever Test shows Malaria P(B MF) = 6/300 = 0.02 P(B F)!= P(B MF) Conditioned on Fever + Bacteria Test shows Bacteria That s the math definition of conditional dependence If we condition on F, the events bacteria and malaria become dependent P(M BF) = 6/200 = 0.03 P(M F) P(M BF)

Conditional Dependence Malaria (M) Bacteria (B) P(F M) = 1 P(F B) = 1 Fever (F) *This is a causal diagram. It helps explain why things are independent

Parents With a Common Child Say two independent parents have a common child: When conditioned on the child they are no longer independent

Conditional Independence

House Voting 435 House Members 57 vote for gay marriage (M) 49 vote for graduated tax (T) Are M and T independent? P(M) = 57/435 = 0.13 P(T) = 49/435 = 0.11 P(M)P(T) = 0.014 P(MT) = 45/435 = 0.10 P(MT) P(M)P(T) M and T are dependent

House Voting 435 House Members 57 vote for gay marriage (M) 57 House Democrats (D) 49 vote for graduated tax (T)

Conditioned on Democrat 57 House Democrats (D) 53 vote for gay marriage (M D) Are M and T independent given D? P(M D) = 53/57 = 0.93 P(T D) = 42/57 = 0.74 P(M D)P(T D) = 0.69 P(MT D) = 39/57 = 0.68 P(MT D) P(M D)P(T D) M and T are conditionally independent 42 vote for graduated tax (T D)

Conditional Dependence Democrat (D) Tax (T) Marriage (M) *This is a causal diagram. It helps explain why things are independent

Netflix and Learn K 1 Like foreign emotional comedies P (E 4 E 1,E 2,E 3,K 1 )=P (E 4 K 1 ) E 1 E 2 E 3 E 4 Assume E 1, E 2, E 3 and E 4 are conditionally independent given K 1

Children with a Common Parent Siblings are dependent on one another. But in the presence of a common parent, Become independent

End Review

Remember Learning to Code? name int a = 5; double b = 4.2; bit c = 1; choice d = medium; z 2 {high, medium, low}

Random Variable A Random Variable is a real-valued function defined on a sample space Example: 3 fair coins are flipped. Y = number of heads on 3 coins Y is a random variable P(Y = 0) = 1/8 (T, T, T) P(Y = 1) = 3/8 (H, T, T), (T, H, T), (T, T, H) P(Y = 2) = 3/8 (H, H, T), (H, T, H), (T, H, H) P(Y = 3) = 1/8 (H, H, H) P(Y 4) = 0

A binary random variable is a random variable with 2 possible outcomes (e.g., coin flip) Now consider n coin flips, each which independently come up heads with probability p Y = number of heads on n flips P(Y = k) =, where k = 0, 1, 2,..., n So, Proof: k n k p p k n ) (1 1 ) (1 0 = = n k k n k p p k n 1 1 )) (1 ( ) (1 0 = = + = = n n n k k n k p p p p k n Binary Random Variable

Urn has 11 balls (3 blue, 3 red, 5 black) 3 balls drawn. +$1 for blue, -$1 for red, $0 for black Y = total winnings P(Y = 0) = P(Y = 1) = = P(Y = -1) P(Y = 2) = = P(Y = -2) P(Y = 3) = = P(Y = -3) 165 55 3 11 1 5 1 3 1 3 3 5 = + 165 39 3 11 1 3 2 3 2 5 1 3 = + 165 15 3 11 1 5 2 3 = 165 1 3 11 3 3 = Simple Game

Probability Mass Function A random variable X is discrete if it has countably many values (e.g., x 1, x 2, x 3,...) Probability Mass Function (PMF) of a discrete random variable is: p ( a) = P( X = a) i= 1 Since p( ) = 1, it follows that: x i P( X = a) = p( x p( x) where X can assume values x 1, x 2, x 3,... i ) = 0 for i = 1, 2,... 0 otherwise

PMF For a Single 6 Sided Dice 1/6 p(x) X = outcome of roll

PMF for the sum of two dice 6/36 5/36 p(x) 4/36 3/36 2/36 1/36 X = total rolled

Cumulative Distribution Function For a random variable X, the Cumulative Distribution Function (CDF) is defined as: F ( a) = P( X a) where < a < The CDF of a discrete random variable is: F( a) = P( X a) = all x p( x) a

CDF for a 6 sided dice 5/6 4/6 F(x) 3/6 2/6 1/6 X = outcome of roll

Expected Value The Expected Values for a discrete random variable X is defined as: E[ X ] = x x: p( x) > 0 p( x) Note: sum over all values of x that have p(x) > 0. Expected value also called: Mean, Expectation, Weighted Average, Center of Mass, 1 st Moment

Expected Value Roll a 6-Sided Die. X is outcome of roll p(1) = p(2) = p(3) = p(4) = p(5) = p(6) = 1/6 E[X] = 1 1 1 1 1 1 1 + 2 + 3 + 4 + 5 + 6 = 6 6 6 6 6 6 7 2 Y is random variable P(Y = 1) = 1/3, P(Y = 2) = 1/6, P(Y = 3) = 1/2 E[Y] = 1 (1/3) + 2 (1/6) + 3 (1/2) = 13/6

Indicator Variable A variable I is called an indicator variable for event A if I 1 = 0 if if A occurs c A occurs What is E[I]? p(i =1) = P(A), p(i = 0) = 1 P(A) E[I] = 1 P(A) + 0 (1 P(A)) = P(A) We ll use this property frequently!

Lying with Statistics There are three kinds of lies: lies, damned lies, and statistics Mark Twain School has 3 classes with 5, 10 and 150 students Randomly choose a class with equal probability X = size of chosen class What is E[X]? E[X] = 5 (1/3) + 10 (1/3) + 150 (1/3) = 165/3 = 55

Lying with Statistics There are three kinds of lies: lies, damned lies, and statistics Mark Twain School has 3 classes with 5, 10 and 150 students Randomly choose a student with equal probability Y = size of class that student is in What is E[Y]? E[Y] = 5 (5/165) + 10 (10/165) + 150 (150/165) = 22635/165 137 Note: E[Y] is students perception of class size But E[X] is what is usually reported by schools!

Let Y = g(x), where g is real-valued function = = j j y j p y E Y X g E ) ( ] [ )] ( [ = = j i i y j x i g i x p x g ) ( : ) ( ) ( = i i x i p x g ) ( ) ( = = j i j y j x i g i x p y ) ( : ) ( = = j i j y j x i g i x p y ) ( : ) ( Expectation of a Function

Properties of Expectation Linearity: Consider X = 6-sided die roll, Y = 2X 1. E[X] = 3.5 E[Y] = 6 N-th Moment of X: E [ ax + b] = ae[ X ] + b E[ X n ] = n x x : p( x) > 0 We ll see the 2 nd moment soon... p( x)