CS 441 Discrete Mathematics for CS Lecture 20. Probabilities. CS 441 Discrete mathematics for CS. Probabilities

Similar documents
CS 441 Discrete Mathematics for CS Lecture 19. Probabilities. CS 441 Discrete mathematics for CS. Probabilities

Sec$on Summary. Assigning Probabilities Probabilities of Complements and Unions of Events Conditional Probability

Chapter Summary. 7.1 Discrete Probability 7.2 Probability Theory 7.3 Bayes Theorem 7.4 Expected value and Variance

CSC Discrete Math I, Spring Discrete Probability

{ } all possible outcomes of the procedure. There are 8 ways this procedure can happen.

Mathematics. ( : Focus on free Education) (Chapter 16) (Probability) (Class XI) Exercise 16.2

13.1 The Basics of Probability Theory

Discrete Structures for Computer Science

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

Events A and B are said to be independent if the occurrence of A does not affect the probability of B.

STAT 430/510 Probability

Section 13.3 Probability

Chapter 13, Probability from Applied Finite Mathematics by Rupinder Sekhon was developed by OpenStax College, licensed by Rice University, and is

Conditional Probability

CS 361: Probability & Statistics

SDS 321: Introduction to Probability and Statistics

What is Probability? Probability. Sample Spaces and Events. Simple Event

ECE 340 Probabilistic Methods in Engineering M/W 3-4:15. Lecture 2: Random Experiments. Prof. Vince Calhoun

Deep Learning for Computer Vision

MODULE 2 RANDOM VARIABLE AND ITS DISTRIBUTION LECTURES DISTRIBUTION FUNCTION AND ITS PROPERTIES

Expected Value 7/7/2006

27 Binary Arithmetic: An Application to Programming

Homework 4 Solution, due July 23

Introduction to Probability and Sample Spaces

Chapter 1 Axioms of Probability. Wen-Guey Tzeng Computer Science Department National Chiao University

What is a random variable

Probability (10A) Young Won Lim 6/12/17

Outline. 1. Define likelihood 2. Interpretations of likelihoods 3. Likelihood plots 4. Maximum likelihood 5. Likelihood ratio benchmarks

CS206 Review Sheet 3 October 24, 2018

Probability: Terminology and Examples Class 2, Jeremy Orloff and Jonathan Bloom

Lecture 1 : The Mathematical Theory of Probability

Chapter 1 Axioms of Probability. Wen-Guey Tzeng Computer Science Department National Chiao University

9/6/2016. Section 5.1 Probability. Equally Likely Model. The Division Rule: P(A)=#(A)/#(S) Some Popular Randomizers.

More on Distribution Function

Chapter5 Probability.

Notes slides from before lecture. CSE 21, Winter 2017, Section A00. Lecture 15 Notes. Class URL:

First Digit Tally Marks Final Count

Notation: X = random variable; x = particular value; P(X = x) denotes probability that X equals the value x.

Probability. VCE Maths Methods - Unit 2 - Probability

Chapter 3: Random Variables 1

Lecture 3 - Axioms of Probability

NLP: Probability. 1 Basics. Dan Garrette December 27, E : event space (sample space)

Introduction Probability. Math 141. Introduction to Probability and Statistics. Albyn Jones

Probability Pearson Education, Inc. Slide

Part (A): Review of Probability [Statistics I revision]

Notes slides from before lecture. CSE 21, Winter 2017, Section A00. Lecture 16 Notes. Class URL:

CS4705. Probability Review and Naïve Bayes. Slides from Dragomir Radev

V. RANDOM VARIABLES, PROBABILITY DISTRIBUTIONS, EXPECTED VALUE

Producing data Toward statistical inference. Section 3.3

2. In a clinical trial of certain new treatment, we may be interested in the proportion of patients cured.

Review of probabilities

Discrete Probability

Discrete Random Variable

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

2. Conditional Probability

Lower bound for sorting/probability Distributions

PERMUTATIONS, COMBINATIONS AND DISCRETE PROBABILITY

Steve Smith Tuition: Maths Notes

A brief review of basics of probabilities

Probability Distributions. Conditional Probability.

Why should you care?? Intellectual curiosity. Gambling. Mathematically the same as the ESP decision problem we discussed in Week 4.

Mean, Median and Mode. Lecture 3 - Axioms of Probability. Where do they come from? Graphically. We start with a set of 21 numbers, Sta102 / BME102

Dept. of Linguistics, Indiana University Fall 2015

ACMS Statistics for Life Sciences. Chapter 9: Introducing Probability

Discrete random variables and probability distributions

Joint Distribution of Two or More Random Variables

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

Lecture 6 Random Variable. Compose of procedure & observation. From observation, we get outcomes

Chapter 4 Probability

Lecture Lecture 5

6.2 Introduction to Probability. The Deal. Possible outcomes: STAT1010 Intro to probability. Definitions. Terms: What are the chances of?

UNIT 5 ~ Probability: What Are the Chances? 1

Lecture Notes 1 Basic Probability. Elements of Probability. Conditional probability. Sequential Calculation of Probability

Chapter 2 PROBABILITY SAMPLE SPACE

ECE 450 Lecture 2. Recall: Pr(A B) = Pr(A) + Pr(B) Pr(A B) in general = Pr(A) + Pr(B) if A and B are m.e. Lecture Overview

Quantitative Methods for Decision Making

Two Heads Are Better Than None

Bayes Rule for probability

Probabilistic models

LECTURE NOTES by DR. J.S.V.R. KRISHNA PRASAD

Outline. 1. Define likelihood 2. Interpretations of likelihoods 3. Likelihood plots 4. Maximum likelihood 5. Likelihood ratio benchmarks

Lecture 4: Probability, Proof Techniques, Method of Induction Lecturer: Lale Özkahya


Chapter 1 Probability Theory

Conditional Probability

Probability deals with modeling of random phenomena (phenomena or experiments whose outcomes may vary)

TA Qinru Shi: Based on poll result, the first Programming Boot Camp will be: this Sunday 5 Feb, 7-8pm Gates 114.

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

CISC 1100/1400 Structures of Comp. Sci./Discrete Structures Chapter 7 Probability. Outline. Terminology and background. Arthur G.

Applied Statistics I

Chapter 3: Random Variables 1

324 Stat Lecture Notes (1) Probability

AMS7: WEEK 2. CLASS 2

Review of probability

Lecture 4: Probability and Discrete Random Variables

Lecture 2. Constructing Probability Spaces

Chapter 2. Conditional Probability and Independence. 2.1 Conditional Probability

With Question/Answer Animations. Chapter 7

Key Concept. Properties. February 23, S6.4_3 Sampling Distributions and Estimators

ELEG 3143 Probability & Stochastic Process Ch. 1 Experiments, Models, and Probabilities

Transcription:

CS 441 Discrete Mathematics for CS Lecture 20 Probabilities Milos Hauskrecht milos@cs.pitt.edu 5329 Sennott Square CS 441 Discrete mathematics for CS Probabilities Three axioms of the probability theory: (1) Probability of a discrete outcome is: 0 < = P(s) <= 1 (2) Sum of probabilities of all (disjoint) outcomes is = 1 (3) For any two events E1 and E2 holds: P(E1 E2) = P(E1) + P(E2) P(E1 E2) 1

Probability distribution Definition: A function p: S [0,1] satisfying the three conditions is called a probability distribution a biased coin Probability of head 0.6, probability of a tail 0.4 Probability distribution: Head 0.6 The sum of the probabilities sums to 1 Tail 0.4 Note: a uniform distribution is a special distribution that assigns equal probabilities to each outcome. Probability of an Event Definition: The probability of the event E is the sum of the probabilities of the outcomes in E. Note that now no assumption is being made about the distribution. Complement: P(~E) = 1 P(E) 2

Complements Let E and F are two events. Then: P(F) = P(F E) + P(F ~E) Sample space ~E E F Conditional probability Definition: Let E and F be two events such that P(F) > 0. The conditional probability of E given F P(E F) = P(E F) / P(F) Corrolary: Let E and F be two events such that P(F) > 0. Then: P(E F) = P(E F) * P(F) This result is also referred to as a product rule. 3

Conditional probability Product rule: P(E F) = P(E F) P(F) Assume the probability of getting a flu is 0.2 Assume the probability of having a high fever given the flu: 0.9 What is the probability of getting a flu with fever? P(flu fever) = P(fever flu)p(flu) = 0.9*0.2 = 0.18 When is this useful? Sometimes conditional probabilities are easier to estimate. Bayes theorem Definition: Let E and F be two events such that P(F) > 0. Then: P(E F) = P(F E)P(E) / P(F) = P(F E)P(E) / (P(F E)P(E) + P(F ~E)P(~E)) Proof: P(E F) = P(E F) / P(F) = P( F E) P(E) / P(F) P(F) = P(F E) + P(F ~E) = P( F E) P(E) + P( F ~E) P(~E) Hence: P(E F) = P(F E)P(E) / (P(F E)P(E) + P(F ~E)P(~E)) Idea: Simply switch the conditioning events. 4

Bayes theorem Definition: Let E and F be two events such that P(F) > 0. Then: P(E F) = P(F E)P(E) / P(F) = P(F E)P(E) / (P(F E)P(E) + P(F ~E)P(~E)) Assume the probability of getting a flu is 0.2 Assume the probability of getting a fever is 0.3 Assume the probability of having a high fever given the flu: 0.9 What is the probability of having a flu given the fever? Bayes theorem Definition: Let E and F be two events such that P(F) > 0. Then: P(E F) = P(F E)P(E) / P(F) = P(F E)P(E) / (P(F E)P(E) + P(F ~E)P(~E)) Assume the probability of getting a flu is 0.2 Assume the probability of getting a fever is 0.3 Assume the probability of having a fever given the flu: 0.9 What is the probability of having a flu given the fever? P(flu fever) = P(fever flu) P(flu) / P(fever) = = 0.9 x 0.2/0.3 = 0.18/0.3 = 0.6 5

Bayes theorem Definition: Let E and F be two events such that P(F) > 0. Then: P(E F) = P(F E)P(E) / P(F) = P(F E)P(E) / (P(F E)P(E) + P(F ~E)P(~E)) Example (same as above but different probabilities are given): Assume the probability of getting a flu is 0.2 Assume the probability of having a fever given the flu: 0.9 Assume the probability of having a fever given no flue: 0.15 What is the probability of having a flu given the fever? Bayes theorem Definition: Let E and F be two events such that P(F) > 0. Then: P(E F) = P(F E)P(E) / P(F) = P(F E)P(E) / (P(F E)P(E) + P(F ~E)P(~E)) Assume the probability of getting a flu is 0.2 Assume the probability of having a fever given the flu: 0.9 Assume the probability of having a fever given no flue: 0.15 What is the probability of having a flu given the fever? P(flu fever) = P(fever flu) P(flu) / P(fever) P(fever) = P(fever flu) P(flu) + P(fever ~flu) P(~flu) = 0.9*0.2 + 0.15*0.8 = 0.3 P(flu fever) = 0.9 x 0.2/0.3 = 0.18/0.3 = 0.6 6

Independence Definition: The two events E and F are said to be independent if: P(E F) = P(E)P(F) Independence Definition: The events E and F are said to be independent if: P(E F) = P(E)P(F) Example. Assume that E denotes the family has three children of both sexes and F the fact that the family has at most one boy. Are E and F independent? All combos = {BBB, BBG, BGB, GBB,BGG,GBG,GGB,GGG} the number of elements = 8 Both sexes = {BBG BGB GBB BGG GBG GGB} # = 6 At most one boy = {GGG GGB GBG BGG} # = 4 E F = {GGB GBG BGG} # = 3 P(E F) = 3/8 and P(E)*P(F)= 4/8 6/8 = 3/8 The two probabilities are equal E and F are independent 7

Independence Assume the probability of getting a flu is 0.2 Assume the probability of getting a fever is 0.3 Assume the probability of having a fever given the flu: 0.9 Are flu and fever independent? P(flu fever) = P( fever flu) * P(flu) = 0.2 * 0.9 = 0.18 P(flu) * P(fever) = 0.2 * 0.3 = 0.06 Independent or not? Not independent Bernoulli trial Assume: p = 0.6 is a probability of seeing head 0.4 is the probability of seeing tail Assume we see a sequence of independent coin flips: HHHTTHTHHT The probability of seeing this sequence: 0.6 6 * 0.4 4 What is the probability of seeing a sequence of with 6 Heads and 4 tails? The probability of each such sequence is 0.6 6 * 0.4 4 How many such sequences are there: C(10,4) P(6H and 4T) = C(10,4) *0.6 6 * 0.4 4 CS 1571 Intro to AI 8

Random variables Definition: A random variable is a function from the sample space of an experiment to the set of real numbers f: S R. A random variable assigns a number to each possible outcome. The distribution of a random variable X on the sample space S is a set of pairs (r p(x=r) ) for all r in S where r is the number and p(x=r) is the probability that X takes a value r. Random variables Let S be the outcomes of a two-dice roll Let random variable X denotes the sum of outcomes (1,1) 2 (1,2) and (2,1) 3 (1,3), (3,1) and (2,2) 4 Distribution of X: 2 1/36, 3 2/36, 4 3/36 12 1/36 9

Probabilities Assume a repeated coin flip P(head) =0.6 and the probability of a tail is 0.4. Each coin flip is independent of the previous. What is the probability of seeing: HHHHH - 5 heads in a row P(HHHHH) = 0.6 5 = Assume the outcome is HHTTT P(HHTTT)= 0.6*0.6*0.4 3= 0.6 2 *0.4 3 Assume the outcome is TTHHT P(TTHHT)=0.4 2* 0.6 2 *0.4 = 0.6 2 *0.4 3 What is the probability of seeing three tails and two heads? The number of two-head-three tail combinations = C(5,2) P(two-heads-three tails) = C(5,2) *0.6 2 * 0.4 3 Probabilities Assume a variant of a repeated coin flip problem The space of possible outcomes is the count of occurrences of heads in 5 coin flips. For example: TTTTT yields outcome 0 HTTTT or TTHTT yields 1 HTHHT yields 3 What is the probability of an outcome 0? P(outcome=0) = 0.6 0 * 0.4 5 P(outcome=1) = C(5,1) 0.6 1 * 0.4 4 P(outcome =2) = C(5,2) 0.6 2 * 0.4 3 P(outcome =3) = C(5,3) 0.6 3 * 0.4 2 10

Expected value and variance Definition: The expected value of the random variable X(s) on the sample space is equal to: roll of a dice Outcomes: 1 2 3 4 5 6 Expected value: E(X) =? E ( X ) p( s) X ( s) s S Expected value and variance Definition: The expected value of the random variable X(s) on the sample space is equal to: E ( X ) p( s) X ( s) s S roll of a dice Outcomes: 1 2 3 4 5 6 Expected value: E(X) = 1*1/6 + 2*1/6+3*1/6 + 4*1/6 + 5*1/6 +6* 1/6 = 7/2 11

Expected value Flip a fair coin 3 times. The outcome of the trial X is the number of heads. What is the expected value of the trial? Answer: Possible outcomes: = {HHH HHT HTH THH HTT THT TTH TTT} 3 2 2 2 1 1 1 0 E(X) =? Expected value Flip a fair coin 3 times. The outcome of the trial X is the number of heads. What is the expected value of the trial? Answer: Possible outcomes: = {HHH HHT HTH THH HTT THT TTH TTT} 3 2 2 2 1 1 1 0 E(X) = 1/8 (3 + 3*2 +3*1 +0) = 12/8= 3/2 12

Expected value Theorem: If Xi i=1,2,3, n with n being a positive integer, are random variables on S, and a and b are real numbers then: E(X1+X2+... Xn) = E(X1)+E(X2) +... E(Xn) E(aX+b) = ae(x) +b Expected value Roll a pair of dices. What is the expected value of the sum of outcomes? Approach 1: Outcomes: (1,1) (1,2) (1,3)... (6,1)... (6,6) 2 3 4 7 12 Expected value: 1/36 (2*1 +...) = 7 Approach 2 (theorem): E(X1+X2) = E(X1) +E(X2) E(X1) =7/2 E(X2) = 7/2 E(X1+X2) = 7 13