Bayes Rule for probability

Slides:



Advertisements
Similar presentations
Random Variables & Probability Distributions The probability of someone laughing at you is proportional to the stupidity of your actions.
Advertisements

Bayes Rule for probability. Let A 1, A 2, …, A k denote a set of events such that An generalization of Bayes Rule for all i and j. Then.
7 Probability Experiments, Sample Spaces, and Events
Lecture 10 – Introduction to Probability Topics Events, sample space, random variables Examples Probability distribution function Conditional probabilities.
Chapter 5 Probability Distributions. E.g., X is the number of heads obtained in 3 tosses of a coin. [X=0] = {TTT} [X=1] = {HTT, THT, TTH} [X=2] = {HHT,
22C:19 Discrete Structures Discrete Probability Fall 2014 Sukumar Ghosh.
Lec 18 Nov 12 Probability – definitions and simulation.
Class notes for ISE 201 San Jose State University
Joint Distribution of two or More Random Variables
Lecture 10 – Introduction to Probability Topics Events, sample space, random variables Examples Probability distribution function Conditional probabilities.
Stat 1510: Introducing Probability. Agenda 2  The Idea of Probability  Probability Models  Probability Rules  Finite and Discrete Probability Models.
Section 7.1. Section Summary Finite Probability Probabilities of Complements and Unions of Events Probabilistic Reasoning.
ENGG 2040C: Probability Models and Applications Andrej Bogdanov Spring Conditional probability.
Chapter 7 With Question/Answer Animations. Section 7.1.
Random Variables an important concept in probability.
STA347 - week 51 More on Distribution Function The distribution of a random variable X can be determined directly from its cumulative distribution function.
CHAPTER 10: Introducing Probability ESSENTIAL STATISTICS Second Edition David S. Moore, William I. Notz, and Michael A. Fligner Lecture Presentation.
22C:19 Discrete Structures Discrete Probability Spring 2014 Sukumar Ghosh.
Random Variables an important concept in probability.
3. Conditional probability
Rules of Probability. Recall: Axioms of Probability 1. P[E] ≥ P[S] = 1 3. Property 3 is called the additive rule for probability if E i ∩ E j =
Natural Language Processing Giuseppe Attardi Introduction to Probability IP notice: some slides from: Dan Jurafsky, Jim Martin, Sandiway Fong, Dan Klein.
Probability Distributions
Rules of Probability. The additive rule P[A  B] = P[A] + P[B] – P[A  B] and if P[A  B] =  P[A  B] = P[A] + P[B]
Introduction Lecture 25 Section 6.1 Wed, Mar 22, 2006.
Chapter 4 Random Variables - 1. Outline Random variables Discrete random variables Expected value 2.
MATH 256 Probability and Random Processes Yrd. Doç. Dr. Didem Kivanc Tureli 14/10/2011Lecture 3 OKAN UNIVERSITY.
Great Theoretical Ideas in Computer Science for Some.
Section 7.1. Probability of an Event We first define these key terms: An experiment is a procedure that yields one of a given set of possible outcomes.
Math 145 September 18, Terminologies in Probability  Experiment – Any process that produces an outcome that cannot be predicted with certainty.
No Warm-Up today. You have a Quiz Clear your desk of everything but a calculator and something to write with.
Warm Up 1. Gretchen is making dinner. She has tofu, chicken and beef for an entrée, and French fries, salad and corn for a side. If Ingrid has 6 drinks.
Warm Up 1. Ingrid is making dinner. She has tofu, chicken and beef for an entrée, and French fries, salad and corn for a side. If Ingrid has 6 drinks to.
1 What Is Probability?. 2 To discuss probability, let’s begin by defining some terms. An experiment is a process, such as tossing a coin, that gives definite.
1 COMP2121 Discrete Mathematics Principle of Inclusion and Exclusion Probability Hubert Chan (Chapters 7.4, 7.5, 6) [O1 Abstract Concepts] [O3 Basic Analysis.
Virtual University of Pakistan
Terminologies in Probability
Now it’s time to look at…
Introduction to Discrete Probability
Copyright © 2016, 2013, and 2010, Pearson Education, Inc.
PROBABILITY AND PROBABILITY RULES
Natural Language Processing
Reference: (Material source and pages)
CS104:Discrete Structures
Math 145 September 25, 2006.
Aim – How do we analyze a Discrete Random Variable?
CHAPTER 12: Introducing Probability
Warm Up 1. Gretchen is making dinner. She has tofu, chicken and beef for an entrée, and French fries, salad and corn for a side. If Ingrid has 6 drinks.
Conditional Probability. Expected Value
Basic Probability aft A RAJASEKHAR YADAV.
Natural Language Processing
Introduction to Probability
Warm Up Which of the following are combinations?
Great Theoretical Ideas In Computer Science
Terminologies in Probability
Now it’s time to look at…
Statistical Inference for Managers
Terminologies in Probability
Terminologies in Probability
2. Conditional Probability
Random Variable Two Types:
Combination and Permutations Quiz!
Now it’s time to look at…
Terminologies in Probability
Now it’s time to look at…
Discrete & Continuous Random Variables
Math 145 June 26, 2007.
Terminologies in Probability
Math 145 February 12, 2008.
Terminologies in Probability
Presentation transcript:

Bayes Rule for probability

An generalization of Bayes Rule Let A1, A2 , … , Ak denote a set of events such that for all i and j. Then

Example: We have three urns. Urn 1 contains 14 red balls and 12 black balls. Urn 2 contains 6 red balls and 20 black balls. Urn 3 contains 3 red balls and 23 black balls. An Urn is selected at random and a ball is selected from that urn. Urn 1 Urn 2 Urn 3 If the ball turns out to be red what is the probability that it came from the first urn? second urn? third Urn?

Solution: Let Ai = the event that we select urn i Let B = the event that we select a red ball Note: the desired conditional probability is in the reverse direction of the given conditional probabilities. This is the case when Bayes rule should be used

Bayes rule states

Suppose that an electronic device is manufactured by a company. Example: Suppose that an electronic device is manufactured by a company. During a period of a week 15% of this product is manufactured on Monday, 23% on Tuesday, 26% on Wednesday , 24% on Thursday and 12% on Friday.

Also during a period of a week 5% of the product is manufactured on Monday is defective 3 % of the product is manufactured on Tuesday is defective, 1 % of the product is manufactured on Wednesday is defective , 2 % of the product is manufactured on Thursday is defective and 6 % of the product is manufactured on Friday is defective. If the electronic device manufactured by this plant turns out to be defective, what is the probability that is as manufactured on Monday, Tuesday, Wednesday, Thursday or Friday?

Solution: Let A1 = the event that the product is manufactured on Monday A2 = the event that the product is manufactured on Tuesday A3 = the event that the product is manufactured on Wednesday A4 = the event that the product is manufactured on Thursday A5 = the event that the product is manufactured on Friday Let B = the event that the product is defective

Now P[A1] = 0.15, P[A2] = 0.23, P[A3] = 0.26, P[A4] = 0.24 and P[A5] = 0.12 Also P[B|A1] = 0.05, P[B|A2] = 0.03, P[B|A3] = 0.01, P[B|A4] = 0.02 and P[B|A5] = 0.06 We want to find P[A1|B], P[A2|B], P[A3|B], P[A4|B] and P[A5|B] . We will apply Bayes Rule

i P[Ai] P[B|Ai] P[Ai]P[B|Ai] P[Ai|B] 1 0.15 0.05 0.0075 0.2586 2 0.23 0.03 0.0069 0.2379 3 0.26 0.01 0.0026 0.0897 4 0.24 0.02 0.0048 0.1655 5 0.12 0.06 0.0072 0.2483 Total 1.00 0.0290 1.0000

The sure thing principle and Simpson’s paradox

The sure thing principle Suppose Example – to illustrate Let A = the event that horse A wins the race. B = the event that horse B wins the race. C = the event that the track is dry = the event that the track is muddy

Proof:

Simpson’s Paradox Does Example to illustrate D = death due to lung cancer S = smoker C = lives in city, = lives in country

If we let Then the statement would be true using the Sure Thing Principle This logic is incorrect The events are not defined and do not make sense. The conditional probabilities are defined.

Solution similarly

whether is greater than depends also on the values of

whether than and

The Monty Hall Problem 1 2 3 Behind one of the three doors there is a valuable prize. Behind the other two doors is a worthless prize. You are asked to pick one of the doors. After you have selected, Monty Hall opens one of the doors and reveals a worthless prize. He then asks you do you want to switch your choice.

Should you change your choice? Should you keep your first choice? or It does not matter. Solution Suppose you choice is door #1, and Monty reveals that door #3 has a worthless prize behind it. We can always renumber the doors so that this is the case. Let Ai = the event that the valuable prize is behind door number i. i = 1, 2, 3. P [A1] = P [A2] = P [A3] =1/3 S = A1  A2  A3 and Ai  Aj = f

Another Solution (the correct solution) The probability that you pick the correct door is 1/3 . If you pick the correct door Monty will pick randomly between the two worthless doors. If you did not pick the correct door Monty will choose the worthless door to open with with probability 1. Again P [A1] = P [A2] = P [A3] =1/3 and S = A1  A2  A3 and Ai  Aj = f Let Bi = the event that Monty opens door i. i = 1, 2, 3.

Also and We want to compute P [A1|B3] andP [A2|B3].

and

Another Problem We have three chests each having 2 drawers 1 2 3 We have three chests each having 2 drawers In chest 1 there is a gold coin in each drawer. In chest 2 there is a silver coin in each drawer. In chest 3 there is a gold coin in the top drawer and a silver coin in the bottom drawer..

Ci = the event that we select Chest i. i = 1, 2, 3. One of the chests is selected at random. Then the drawer is selected at random. The coin in that drawer turns out to be gold. What is the probability that the coin in the other drawer is also gold? Is it ½ ? Solution Let Ci = the event that we select Chest i. i = 1, 2, 3. P [C1] = P [C2] = P [C3] =1/3 S = C1  C2  C3 and Ci  Cj = f

Let D1 = the event that we select top drawer in the chest. D2 = the event that we select bottom drawer in the chest. Let G = the event the coin in the drawer is gold = (C1  D1)  (C1  D2)  (C3  D1) We want to compute P[C1|G].

Thus Comment: There are 6 drawers and three of those drawers contain gold coins. Of those three drawers two are in a chest that has a gold coin in the other drawer.

an important concept in probability Random Variables an important concept in probability

A random variable , X, is a numerical quantity whose value is determined be a random experiment Examples Two dice are rolled and X is the sum of the two upward faces. A coin is tossed n = 3 times and X is the number of times that a head occurs. We count the number of earthquakes, X, that occur in the San Francisco region from 2000 A. D, to 2050A. D. Today the TSX composite index is 11,050.00, X is the value of the index in thirty days

Examples – R.V.’s - continued A point is selected at random from a square whose sides are of length 1. X is the distance of the point from the lower left hand corner. point X A chord is selected at random from a circle. X is the length of the chord. chord X

Definition – The probability function, p(x), of a random variable, X. For any random variable, X, and any real number, x, we define where {X = x} = the set of all outcomes (event) with X = x.

Definition – The cumulative distribution function, F(x), of a random variable, X. For any random variable, X, and any real number, x, we define where {X ≤ x} = the set of all outcomes (event) with X ≤ x.

Examples Two dice are rolled and X is the sum of the two upward faces. S , sample space is shown below with the value of X for each outcome (1,1) 2 (1,2) 3 (1,3) 4 (1,4) 5 (1,5) 6 (1,6) 7 (2,1) (2,2) (2,3) (2,4) (2,5) (2,6) 8 (3,1) (3,2) (3,3) (3,4) (3,5) (3,6) 9 (4,1) (4,2) (4,3) (4,4) (4,5) (4,6) 10 (5,1) (5,2) (5,3) (5,4) (5,5) (5,6) 11 (6,1) (6,2) (6,3) (6,4) (6,5) (6,6) 12

Graph p(x) x

The cumulative distribution function, F(x) For any random variable, X, and any real number, x, we define where {X ≤ x} = the set of all outcomes (event) with X ≤ x. Note {X ≤ x} = f if x < 2. Thus F(x) = 0. {X ≤ x} = {(1,1)} if 2 ≤ x < 3. Thus F(x) = 1/36 {X ≤ x} = {(1,1) ,(1,2),(1,2)} if 3 ≤ x < 4. Thus F(x) = 3/36

Continuing we find F(x) is a step function

A coin is tossed n = 3 times and X is the number of times that a head occurs. The sample Space S = {HHH (3), HHT (2), HTH (2), THH (2), HTT (1), THT (1), TTH (1), TTT (0)} for each outcome X is shown in brackets

Graph probability function p(x) x

Graph Cumulative distribution function F(x) x

Examples – R.V.’s - continued A point is selected at random from a square whose sides are of length 1. X is the distance of the point from the lower left hand corner. point X A chord is selected at random from a circle. X is the length of the chord. chord X

Examples – R.V.’s - continued A point is selected at random from a square whose sides are of length 1. X is the distance of the point from the lower left hand corner. point X S An event, E, is any subset of the square, S. P[E] = (area of E)/(Area of S) = area of E E

The probability function S Thus p(x) = 0 for all values of x. The probability function for this example is not very informative

The Cumulative distribution function

S

The probability density function, f(x), of a continuous random variable Suppose that X is a random variable. Let f(x) denote a function define for - < x <  with the following properties: f(x) ≥ 0 Then f(x) is called the probability density function of X. The random, X, is called continuous.

Probability density function, f(x)

Cumulative distribution function, F(x)

Thus if X is a continuous random variable with probability density function, f(x) then the cumulative distribution function of X is given by: Also because of the fundamental theorem of calculus.

Example A point is selected at random from a square whose sides are of length 1. X is the distance of the point from the lower left hand corner. point X

Now

Also

Now and

Finally

Graph of f(x)