Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 10

Similar documents
Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Note 14

1. When applied to an affected person, the test comes up positive in 90% of cases, and negative in 10% (these are called false negatives ).

P (A B) P ((B C) A) P (B A) = P (B A) + P (C A) P (A) = P (B A) + P (C A) = Q(A) + Q(B).

Formalizing Probability. Choosing the Sample Space. Probability Measures

Elementary Discrete Probability

Probability, Statistics, and Bayes Theorem Session 3

Discrete Mathematics and Probability Theory Fall 2014 Anant Sahai Note 15. Random Variables: Distributions, Independence, and Expectations

Intermediate Math Circles November 15, 2017 Probability III

Great Theoretical Ideas in Computer Science

the time it takes until a radioactive substance undergoes a decay

HW1 Solutions. October 5, (20 pts.) Random variables, sample space and events Consider the random experiment of ipping a coin 4 times.

First Digit Tally Marks Final Count

Probabilistic models

P (E) = P (A 1 )P (A 2 )... P (A n ).

Probability (Devore Chapter Two)

Problems from Probability and Statistical Inference (9th ed.) by Hogg, Tanis and Zimmerman.

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Note 16. Random Variables: Distribution and Expectation

CS 361: Probability & Statistics

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 12. Random Variables: Distribution and Expectation

Lecture 6 - Random Variables and Parameterized Sample Spaces

CS 124 Math Review Section January 29, 2018

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

Probabilistic models

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

With Question/Answer Animations. Chapter 7

Joint, Conditional, & Marginal Probabilities

CSC Discrete Math I, Spring Discrete Probability

Discrete Mathematics and Probability Theory Fall 2012 Vazirani Note 14. Random Variables: Distribution and Expectation

Probability Theory and Simulation Methods

Conditional Probability, Independence and Bayes Theorem Class 3, Jeremy Orloff and Jonathan Bloom

Introduction to Probability Theory, Algebra, and Set Theory

Discrete Mathematics for CS Spring 2006 Vazirani Lecture 22

MATH2206 Prob Stat/20.Jan Weekly Review 1-2

Discrete Structures for Computer Science

2.4 Conditional Probability

Grades 7 & 8, Math Circles 24/25/26 October, Probability

Final Examination. Adrian Georgi Josh Karen Lee Min Nikos Tina. There are 12 problems totaling 150 points. Total time is 170 minutes.

Mathematical Foundations of Computer Science Lecture Outline October 18, 2018

Uncertainty. Michael Peters December 27, 2013

Lecture 1: Basics of Probability

MAT Mathematics in Today's World

Basic Probability. Introduction

Discrete Probability and State Estimation

Conditional Probability, Independence, Bayes Theorem Spring January 1, / 28

MAE 493G, CpE 493M, Mobile Robotics. 6. Basic Probability

Probability Notes (A) , Fall 2010

Quantitative Understanding in Biology 1.7 Bayesian Methods

Statistics 1 - Lecture Notes Chapter 1

Introduction to Probability, Fall 2013

6.080 / Great Ideas in Theoretical Computer Science Spring 2008

Lecture 8: Conditional probability I: definition, independence, the tree method, sampling, chain rule for independent events

Discrete Random Variables

Lecture 1. ABC of Probability

COS 424: Interacting with Data. Lecturer: Dave Blei Lecture #2 Scribe: Ellen Kim February 7, 2008

Where are we in CS 440?

Lecture 1: Review of Probability

Preliminary Statistics Lecture 2: Probability Theory (Outline) prelimsoas.webs.com

Lecture 2. Conditional Probability

6.042/18.062J Mathematics for Computer Science. Independence

Outline. Introduction. Bayesian Probability Theory Bayes rule Bayes rule applied to learning Bayesian learning and the MDL principle

Lecture 3. January 7, () Lecture 3 January 7, / 35

Probability Space: Formalism Simplest physical model of a uniform probability space:

Probability Theory. Introduction to Probability Theory. Principles of Counting Examples. Principles of Counting. Probability spaces.

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

Probabilities and Expectations

Some Basic Concepts of Probability and Information Theory: Pt. 1

Lecture 1: Probability Fundamentals

6.042/18.062J Mathematics for Computer Science November 28, 2006 Tom Leighton and Ronitt Rubinfeld. Random Variables

P (A) = P (B) = P (C) = P (D) =

MACHINE LEARNING INTRODUCTION: STRING CLASSIFICATION

CS 246 Review of Proof Techniques and Probability 01/14/19

Probability: Part 1 Naima Hammoud

Conditional Probability P( )

Probability Experiments, Trials, Outcomes, Sample Spaces Example 1 Example 2

Chapter 8: An Introduction to Probability and Statistics

Discrete Random Variables

Conditional probability

Lecture 3 Probability Basics

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

lecture notes October 22, Probability Theory

Discrete Mathematics and Probability Theory Fall 2010 Tse/Wagner MT 2 Soln

Probability. Lecture Notes. Adolfo J. Rumbos

CS 361: Probability & Statistics

MATH 10 INTRODUCTORY STATISTICS

Probability Pr(A) 0, for any event A. 2. Pr(S) = 1, for the sample space S. 3. If A and B are mutually exclusive, Pr(A or B) = Pr(A) + Pr(B).

Entropy. Probability and Computing. Presentation 22. Probability and Computing Presentation 22 Entropy 1/39

CIS 2033 Lecture 5, Fall

Conditional Probability, Independence, Bayes Theorem Spring 2018

18.05 Problem Set 5, Spring 2014 Solutions

6.262: Discrete Stochastic Processes 2/2/11. Lecture 1: Introduction and Probability review

Chapter 14. From Randomness to Probability. Copyright 2012, 2008, 2005 Pearson Education, Inc.

STA Module 4 Probability Concepts. Rev.F08 1

Probability Basics Review

Conditional Probability

CS70: Jean Walrand: Lecture 16.

Continuing Probability.

1 INFO 2950, 2 4 Feb 10

Probability Distributions. Conditional Probability.

Computational Cognitive Science

Bayesian Inference. Introduction

Transcription:

EECS 70 Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 10 Introduction to Basic Discrete Probability In the last note we considered the probabilistic experiment where we flipped a fair coin 10,000 times and counted the number of Hs. We asked "what is the chance that we get between 4900 and 5100 Hs". At a more basic level, we asked what was the chance that we got a head? In this note we will begin to formalize these notions for an arbitrary probabilistic experiment. We will start by introducing the space of all possible outcomes of the experiment, called a sample space. Exactly one of these will be realized. In our current model, each element of the sample space is assigned a probability - which tells us how likely it is to occur when we actually perform the experiment. The mathematical formalism we introduce might take you some time to get used to. But you should remember that ultimately it is just a precise way to say what we mean when we describe a probabilistic experiment like flipping a coin n times. Random Experiments The outcome of the random experiment is called a sample point. The sample space, often denoted by Ω, is the set of all possible outcomes. An example of such an experiment is tossing a coin 4 times. HT HT is an example of a sample point and the sample space has 16 elements: How do we determine the chance of each particular outcome, such as HHT T, of our experiment? In order to do this, we need to define the probability for each sample point, as we will do below. Probability Spaces A probability space is a sample space Ω, together with a probability Pr[ω] for each sample point ω, such that EECS 70, Spring 2014, Note 10 1

0 Pr[ω] 1 for all ω Ω. Pr[ω] = 1, i.e., the sum of the probabilities of all outcomes is 1. ω Ω The easiest, and intuitively paradigmatic, case is that of uniform probability. Uniform Probability The easiest way to assign probabilities to sample points is uniformly: if Ω = N, then Pr[x] = 1 N x Ω. For example, if we toss a fair coin 4 times, each of the 16 sample points (as pictured above) is assigned probability 1 16. We will see examples of non-uniform probability distributions soon. After performing an experiment, we are often interested in knowing whether an event occurred. For example, the might be interested in the event that there were exactly 2 H s in four tosses of the coin". How do we formally define the concept of an event in terms of the sample space Ω? Here is a beautiful answer. We will identify the event exactly 2 H s in four tosses of the coin" with the subset consisting of those outcomes in which there are exactly two H s: {HHT T,HT HT,HT T H,T HHT,T HT H,T T HH} Ω. Now we turn this around and say that formally an event A is just a subset of the sample space, A Ω. Another way to think about it is to associate properties with experimental outcomes. An event of interest is about one such property 1. The set A is then just the set of those outcomes that have that property. Following the same example as above, the property is having exactly 2 Hs where the outcomes are strings of length 4. How should we define the probability of an event A? Naturally, we should just add up the probabilities of the sample points in A. For uniform probability, this is the same as asking what is the frequency of the relevant property among possible outcomes. Formally, for any event A Ω, we define the probability of A to be Pr[A] = Pr[ω]. ω A Thus the probability of getting exactly two H s in four coin tosses can be calculated using this definition as follows. A consists of all sequences that have exactly two H s, and so A = 6. For this example, there are 2 4 = 16 possible outcomes for flipping four coins. Thus, each sample point ω A has probability 1 16 ; and, as we saw above, there are six sample points in A, giving us Pr[A] = 6 1 16 = 3 8. For the special case when the probability is uniform, Pr[A] = A Ω So probability is just a kind of generalized proportion and is exactly proportion in the uniform case. Rolling Dice Example The next random experiment we will discuss consists of rolling two dice. In this experiment, Ω = {(i, j) : 1 i, j 6}. The probability space is uniform, i.e. all of the sample points have the same probability, which 1 If you have noticed a connection here between sets and propositions, this is no coincidence. EECS 70, Spring 2014, Note 10 2

must be 1 1 Ω. In this case, Ω = 36, so each sample point has probability 36. In such circumstances, the probability of any event A is clearly just Pr[A] = # of sample points in A # of sample points in Ω = A Ω. So for uniform spaces, computing probabilities reduces to counting sample points! Now consider two events: the event A that the sum of the dice is at least 10 and the event B that there is at least one 6. By writing out the number of sample points in each event, we can determine the number of sample points in each event; A = 6 and B = 11. By the observation above, it follows that Pr[A] = 6 36 = 1 6 and = 11 36. Nonuniform Probability The general formalism above works for any assignment of probability weights on outcomes, not just uniform probability. However, for beginners, it is useful to think about nonuniform probability as being a view of a story that is fundamentally uniform underneath. For example, back to the fair coin toss example, the uniform perspective says that the experimental outcome is the string of tosses. However, someone could also look at the same experiment and instead say that the outcome is the number of heads. In that case, the sample space just has five possibilities {0,1,2,3,4} and the probability is not uniform. We have Pr[0] = Pr[4] = 1 16, Pr[1] = Pr[3] = 4 16 = 1 4, and as we saw above Pr[2] = 6 16 = 3 8. Notice that these numbers sum up to one. When all of the probabilities involved are rational 2 numbers and the set of outcomes is finite, it is always possible to come up with such a uniform back-story for nonuniform probabilities. The Monty Hall Problem In an (in)famous 1970s game show hosted by one Monty Hall, a contestant was shown three doors; behind one of the doors was a prize, and behind the other two were goats. The contestant (who prefers cars to goats) picks a door (but doesn t open it). Then Hall s assistant (Carol), opens one of the other two doors, revealing a goat (since Carol knows where the prize is, and there are two goats, she can always do this). The contestant is then given the option of sticking with his current door, or switching to the other unopened one. He wins the prize if and only if his final chosen door is the correct one. The question, of course, is: Does the contestant have a better chance of winning if he switches doors? Intuitively, it may seem obvious that since there are only two remaining doors after the host opens one, they must have equal probability. So you may be tempted to jump to the conclusion that it should not matter whether or not the contestant stays or switches. Yet there are other people whose intuition cries out that the contestant is better off switching. So who s correct? As a matter of fact, the contestant has a better chance of picking the car if he uses the switching strategy. How can you convince yourself that this is true? One way you can do this is by doing a rigorous analysis. You would start by writing out the sample space, and then assign probabilities to each sample point. Finally you would calculate the probability of the event that the contestant wins under the sticking strategy. This 2 In the irrational case or when the set of outcomes is infinite, it is still possible to come up with a uniform back-story. But that back-story will not be discrete. Instead, we will have to use continuous probability as we will see in a later lecture note. EECS 70, Spring 2014, Note 10 3

is an excellent exercise if you wish to make sure you understand the formalism of probability theory we introduced above. Let us instead give a more intuitive pictorial argument. Initially when the contestant chooses the door, he has a 1 3 chance of picking the car. This must mean that the other doors combined have a 2 3 chance of winning. But after Carol opens a door with a goat behind it, how do the probabilities change? Well, everyone knows that there is a goat behind one of the doors that the contestant did not pick. So no matter whether the contestant is winning or not, Carol is always able to open one of the other doors to reveal a goat. This means that the contestant still has a 1 3 chance of winning. Also the door that Carol opened has no chance of winning. What about the last door? It must have a 2 3 chance of containing the car, and so the contestant has a higher chance of winning if he or she switches doors. This argument can be summed up nicely in the following picture: We will be able to formalize this intuitive argument once we cover conditional probability. In the meantime, to approach this problem formally, first determine the sample space and the probability space. Then formalize the event we have described above (as a subset of the sample space), and compute the probability of the event. Conditional Probability The Basics The intuition behind conditional probability is simple. It is about how to properly update your uncertainty based on pieces of knowledge. In the beginning, you don t know what the outcome is of the random experiment. Anything in Ω is possible. If you want to guess whether or not the outcome will have a certain feature A, you consider it like getting heads in a biased coin toss with probability of heads equal to Pr[A]. Now, somebody (who knows what outcome has happened) tells you that the outcome has a certain feature, which may or may not be related to the feature you are interested in. Equivalently, using the language of events, this person tells you that an event B has ocurred. At this point, how do you update your uncertainty? We would like to say that at this point, the probability is Pr[A B]. How should we compute Pr[A B]? Well, since event B is guaranteed to happen, we need to look not at the whole sample space Ω, but at the smaller sample space consisting only of the sample points in B. In terms of the picture below, we are no longer looking at the large oval, but only the oval labeled B: EECS 70, Spring 2014, Note 10 4

What should the probabilities of these sample points be? If they all simply inherit their probabilities from Ω, then the sum of these probabilities will be ω B Pr[ω] =, which in general is less than 1. So we need to scale the probability of each sample point by 1. I.e., for each sample point ω B, the new probability becomes Pr[ω B] = Pr[ω]. Now it is clear how to compute Pr[A B]: namely, we just sum up these scaled probabilities over all sample points that lie in both A and B: Pr[A B] = ω A B Pr[ω B] = ω A B Pr[ω] Pr[A B] =. Definition (conditional probability): For events A, B in the same probability space, such that > 0, the conditional probability of A given B is Pr[A B] Pr[A B] =. This is particularly intuitive in cases of uniform probability. Then, the division by is just adjusting for the new size of the universe of items. Notice that this definition only makes sense when is nonzero. When we are talking about discrete probability spaces, this turns out not to be a problem in practice. Zero probability events are not interesting. However, when we start talking about continuous probability spaces, figuring out how to condition on a zero probability event will turn out to be both important and a bit subtle (we ll have to take limits). Bayesian Inference Now that we ve introduced the notion of conditional probability, we can see how it is used in real world settings. Conditional probability is at the heart of a subject called Bayesian inference, used extensively in fields such as modern machine learning, and communications and signal processing more generally. In this interpretation, Pr[A] can be thought of as a prior probability: our assessment of the likelihood of an event of interest A before making an observation. It reflects our prior knowledge. Pr[A B] can be interpreted as the posterior probability of A after the observation that B has definitely ocurred. It reflects our new knowledge. Here is an example of where we can apply such a technique. A pharmaceutical company is marketing a new test for a certain medical disorder. According to clinical trials 3, the test has the following properties: 1. When applied to an affected person, the test comes up positive in 90% of cases, and negative in 10% (these are called false negatives ). 3 How such probabilities come to be known or estimated at all is a more subtle problem that we will ignore for now. EECS 70, Spring 2014, Note 10 5

2. When applied to a healthy person, the test comes up negative in 80% of cases, and positive in 20% (these are called false positives ). Suppose that the incidence of the disorder in the US population is 5%; this is our prior knowledge. When a random person is tested and the test comes up positive, how can we update this probability? (Note that this is presumably not the same as the simple probability that a random person has the disorder, which is just 1 20.) The implicit probability space here is the entire US population with uniform probabilities. The sample space here consists of all people in the US denote their number by N (so N 250 million). Let A be the event that a person chosen at random is affected, and B be the event that a person chosen at random tests positive. Now we can rewrite the information above: Pr[A] = 0.05, (5% of the U.S. population is affected) Pr[B A] = 0.9 (90% of the affected people test positive) Pr[B A] = 0.2 (20% of healthy people test positive) We want to calculate Pr[A B]. We can proceed as follows: Pr[A B] = Pr[A B] = Pr[B A]Pr[A] (1) We obtained the second equality above by applying the definition of conditional probability: Pr[B A] = Pr[A B] Pr[A] Now we need to compute. This is the probability that a random person tests positive. To compute this, we can sum two values: the probability that a healthy person tests positive, Pr[Ā B] and the probability that an affected person tests positive, Pr[A B]. We can sum because the events Ā B and A B do not intersect: EECS 70, Spring 2014, Note 10 6

By again applying the definition of conditional probability we have: = Pr[A B] + Pr[A B] = Pr[B A]Pr[A] + Pr[B A](1 Pr[A]) (2) Combining equations (1) and (2), we have expressed Pr[A B] in terms of Pr[A],Pr[B A] and Pr[B A]: Pr[A B] = Pr[B A] Pr[A] Pr[B A] Pr[A] + Pr[B A](1 Pr[A]) (3) By plugging in the values written above, we obtain Pr[A B] = 9 47.19. Equation (3) is useful for many inference problems. We are given Pr[A], which is the (unconditional) probability that the event of interest A happens. We are given Pr[B A] and Pr[B A], which quantify how noisy the observation is. (If Pr[B A] = 1 and Pr[B A] = 0, for example, the observation is completely noiseless.) Now we want to calculate Pr[A B], the probability that the event of interest happens given we made the observation. Equation (3) allows us to do just that. Of course, equations (1), (2) and (3 are derived from the basic axioms of probability and the definition of conditional probability, and are therefore true with or without the above Bayesian inference interpretation. However, this interpretation is very useful when we apply probability theory to study inference problems. Bayes Rule and Total Probability Rule Equations (1) and (2) are very useful in their own right. The first is called Bayes Rule and the second is called the Total Probability Rule. Bayes rule is useful when one wants to calculate Pr[A B] but one is given Pr[B A] instead, i.e. it allows us to "flip" things around. The Total Probability rule is an application of the strategy of "dividing into cases".there are two possibilities: either an event A happens or A does not happen. If A happens the probability that B happens is Pr[B A]. If A does not happen, the probability that B happens is Pr[B A]. If we know or can easily calculate these two probabilities and also Pr[A], then the total probability rule yields the probability of event B. Example: Tennis Match You are about to play a tennis match against a randomly chosen opponent and you wish to calculate your probability of winning. You know your opponent will be one of two people, X or Y. If person X is chosen, you will win with probability.7. If person Y is chosen, you will win with probability.3. Your opponent is chosen by flipping a coin with bias.6 in favor of X. Let s first determine which events we are interested in. Let A be the event that you win. Let B 1 be the event that person X is chosen, and let B 2 be the event that person Y is chosen. We wish to calculate Pr[A]. Here is what we know so far: Pr[A B 1 ] = 0.7, (if person X is chosen, you win with probability.7) Pr[A B 2 ] = 0.3 (if person Y is chosen, you win with probability.3) Pr[B 1 ] = 0.6 (person X is chosen with probability.6) EECS 70, Spring 2014, Note 10 7

Pr[B 2 ] = 0.4 (person Y is chosen with probability.4) By using the Total Probability rule, we have: Pr[A] = Pr[A B 1 ]Pr[B 1 ] + Pr[A B 2 ]Pr[B 2 ]. Now we can simply plug in the known values above to obtain Pr[A]: Pr[A] =.7.6 +.3.4 =.54 EECS 70, Spring 2014, Note 10 8