Probability – part 1 Prof. Carla Gomes gomes@cs.cornell.edu Rosen 1 1.

Slides:



Advertisements
Similar presentations
Lecture Discrete Probability. 5.2 Recap Sample space: space of all possible outcomes. Event: subset of of S. p(s) : probability of element s of.
Advertisements

Probability: The Study of Randomness Chapter Randomness Think about flipping a coin n times If n = 2, can have 2 heads (100% heads), 1 heads and.
1. Probability of an Outcome 2. Experimental Probability 3. Fundamental Properties of Probabilities 4. Addition Principle 5. Inclusion-Exclusion Principle.
Discrete Probability Chapter 7.
Week 21 Basic Set Theory A set is a collection of elements. Use capital letters, A, B, C to denotes sets and small letters a 1, a 2, … to denote the elements.
Randomness and probability
Probability and inference Randomness; Probability models IPS chapters 4.1 and 4.2 © 2006 W.H. Freeman and Company.
MA-250 Probability and Statistics Nazar Khan PUCIT Lecture 13.
Probability. The probability of an event occurring is between 0 and 1 If an event is certain not to happen, the probability is 0 eg: the probability of.
1 Probability Theory Rosen 5 th ed., Chapter 5. 2 Random Experiment - Terminology A random (or stochastic) experiment is an experiment whose result is.
22C:19 Discrete Structures Discrete Probability Fall 2014 Sukumar Ghosh.
1 Discrete Math CS 280 Prof. Bart Selman Module Probability --- Part a) Introduction.
Basics of probability Notes from:
1 Copyright M.R.K. Krishna Rao 2003 Chapter 5. Discrete Probability Everything you have learned about counting constitutes the basis for computing the.
Probability and combinatorics Notes from Virtual Laboratories in Probability and Statistics.
Special Topics. Definitions Random (not haphazard): A phenomenon or trial is said to be random if individual outcomes are uncertain but the long-term.
Section 7.2. Section Summary Assigning Probabilities Probabilities of Complements and Unions of Events Conditional Probability Independence Bernoulli.
Random Variables. A random variable X is a real valued function defined on the sample space, X : S  R. The set { s  S : X ( s )  [ a, b ] is an event}.
13.1 The Basics of Probability Theory Calculate probabilities by counting outcomes in a sample space. Use counting formulas to compute probabilities. Understand.
22C:19 Discrete Structures Discrete Probability Spring 2014 Sukumar Ghosh.
A phenomenon is random if individual outcomes are uncertain, but there is nonetheless a regular distribution of outcomes in a large number of repetitions.
ICS 253: Discrete Structures I Discrete Probability King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Sixth lecture Concepts of Probabilities. Random Experiment Can be repeated (theoretically) an infinite number of times Has a well-defined set of possible.
Natural Language Processing Giuseppe Attardi Introduction to Probability IP notice: some slides from: Dan Jurafsky, Jim Martin, Sandiway Fong, Dan Klein.
Introducing probability BPS chapter 9 © 2006 W. H. Freeman and Company.
Experiments, Outcomes and Events. Experiment Describes a process that generates a set of data – Tossing of a Coin – Launching of a Missile and observing.
3/7/20161 Now it’s time to look at… Discrete Probability.
Counting and Probability. Imagine tossing two coins and observing whether 0, 1, or 2 heads are obtained. Below are the results after 50 tosses Tossing.
Probability IIntroduction to Probability ASatisfactory outcomes vs. total outcomes BBasic Properties CTerminology IICombinatory Probability AThe Addition.
Chapter 4 Some basic Probability Concepts 1-1. Learning Objectives  To learn the concept of the sample space associated with a random experiment.  To.
Chapter 7. Section 7.1 Finite probability  In a lottery, players win a large prize when they pick four digits that match, in the correct order, four.
1 COMP2121 Discrete Mathematics Principle of Inclusion and Exclusion Probability Hubert Chan (Chapters 7.4, 7.5, 6) [O1 Abstract Concepts] [O3 Basic Analysis.
Section 5.1 and 5.2 Probability
12.3 Probability of Equally Likely Outcomes
Probability and Sample Space…….
Now it’s time to look at…
Introduction to Discrete Probability
ICS 253: Discrete Structures I
Chapter 6: Discrete Probability
Probability.
MATH 2311 Section 3.1.
PROBABILITY AND PROBABILITY RULES
Introduction to Discrete Mathematics
What is Probability? Quantification of uncertainty.
22C:19 Discrete Math Discrete Probability
CS104:Discrete Structures
Introduction to Probability
Conditional Probability
Section 5.1 Basic Ideas.
Natural Language Processing
Discrete Probability Chapter 7 With Question/Answer Animations
Now it’s time to look at…
Introduction to Probability
Lecture 11 Sections 5.1 – 5.2 Objectives: Probability
CSCI 5832 Natural Language Processing
Now it’s time to look at…
Section 6.2 Probability Models
Probability Theory: Counting in Terms of Proportions
Discrete Mathematical Structures CS 23022
Sets A set is simply any collection of objects
Homework: pg. 398 #4, 5 pg. 402 #10, 11 4.) A. A single random digit simulates one shot, 1-7 represents a made shot 8-10 represents a miss. Then 5 consecutive.
Now it’s time to look at…
Mrs.Volynskaya Alg.2 Ch.1.6 PROBABILITY
Now it’s time to look at…
Tree diagrams and tables
Agenda Lecture Content: Discrete Probability
Chapter 4 Probability.
Lecture 2 Basic Concepts on Probability (Section 0.2)
Random Variables Binomial and Hypergeometric Probabilities
Chapter 11 Probability.
Presentation transcript:

Probability – part 1 Prof. Carla Gomes gomes@cs.cornell.edu Rosen 1 1

Probability {(1,1),(1,2),(1,3),…,(2,1),…,(6,6)} Experiment: A repeatable procedure that yields one of a given set of outcomes We roll a single die, what are the possible outcomes? {1,2,3,4,5,6} The set of possible outcomes is called the sample space. We roll a pair of dice, what is the sample space? Depends on what we’re going to ask. Often convenient to choose a sample space of equally likely outcomes. {(1,1),(1,2),(1,3),…,(2,1),…,(6,6)} Alternative: sample outcomes are the sum of the dice, i.e., from 2 through 12. Drawback? Event A subset of the sample experiment 2

Probability definition: Equally Likely Outcomes The probability of an event occurring (assuming equally likely outcomes) is: Where E an event corresponds to a subset of outcomes. Note: E  S. Where S is a finite sample space of equally likely outcomes Note that 0 ≤ |E| ≤ |S| Thus, the probability will always between 0 and 1 An event that will never happen has probability 0 An event that will always happen has probability 1 3 3

Probability Which is more likely: Rolling an 8 when 2 dice are rolled? No clue. 5

Probability What is the probability of a total of 8 when 2 dice are rolled? What is the size of the sample space? 36 How many rolls satisfy our property of interest? 5 So the probability is 5/36 ≈ 0.139. 6

Probability What is the probability of a total of 8 when 3 dice are rolled? What is the size of the sample space? 216 C(7,2) How many rolls satisfy our condition of interest? So the probability is 21/216 ≈ 0.097. 7

Event Probabilities Let E be an event in a sample space S. The probability of the complement of E is: 17 17

Probability of the union of two events Let E1 and E2 be events in sample space S Then p(E1 U E2) = p(E1) + p(E2) – p(E1 ∩ E2) Consider a Venn diagram dart-board 18 18

Probability of the union of two events p(E1 U E2) S E1 E2 19

Probability of the union of two events If you choose a number between 1 and 100, what is the probability that it is divisible by 2 or 5 or both? Let n be the number chosen p(2 div n) = 50/100 (all the even numbers) p(5 div n) = 20/100 p(2 div n) and p(5 div n) = p(10 div n) = 10/100 p(2 div n) or p(5 div n) = p(2 div n) + p(5 div n) - p(10 div n) = 50/100 + 20/100 – 10/100 = 3/5 20 20

Probability: General notion (non necessarily equally likely outcomes) Define a probability measure on a set S to be a real-valued function, Pr, with domain 2S so that: For any subset A in 2S, 0  Pr(A)  1. Pr() = 0, Pr(S) = 1. If subsets A and B are disjoint, then Pr(A U B) = Pr(A) + Pr(B). Pr(A) is “the probability of event A.” A sample space, together with a probability measure, is called a probability space. S = {1,2,3,4,5,6} For A  S, Pr(A) = |A|/|S| (equally likely outcomes) Ex. “Prob of an odd #” A = {1,3,5}, Pr(A) = 3/6 Aside: book first defines Pr per outcome. 22

Definition: Suppose S is a set with n elements. The uniform distribution assigns the probability 1/n to each element of S. The experiment of selecting an element from a sample space with a uniform a distribution is called selecting an element of S at random. When events are equally likely and there a finite number of possible outcomes, the second definition of probability coincides with the first definition of probability. 23

Alternative definition: The probability of the event E is the sum of the probabilities of the outcomes in E. Thus Note that when E is an infinite set, is a convergent infinite series. 24

Probability As before: If A is a subset of S, let ~A be the complement of A wrt S. Then Pr(~A) = 1 - Pr(A) Inclusion-Exclusion If A and B are subsets of S, then Pr(A U B) = Pr(A) + Pr(B) - Pr(A  B) 25

Pr(E|F) = Pr(EF) / Pr(F). Conditional Probability Let E and F be events with Pr(F) > 0. The conditional probability of E given F, denoted by Pr(E|F) is defined to be: Pr(E|F) = Pr(EF) / Pr(F). F E 26 26

Pr(E|F) = Pr(EF) / Pr(F). Example: Conditional Probability A bit string of length 4 is generated at random so that each of the 16 bit strings is equally likely. What is the probability that it contains at least two consecutive 0s, given that its first bit is a 0? So, to calculate: Pr(E|F) = Pr(EF) / Pr(F). where F is the event that “first bit is 0”, and E the event that “string contains at least two consecutive 0s”. What is “the experiment”? The random generation of a 4 bit string. What is the “sample space”? The set of all all possible outcomes, i.e., 16 possible strings. (equally likely) 27

Pr(E|F) = Pr(EF) / Pr(F). A bit string of length 4 is generated at random so that each of the 16 bit strings is equally likely. What is the probability that it contains at least two consecutive 0s, given that its first bit is a 0? So, to calcuate: Pr(E|F) = Pr(EF) / Pr(F). where F is the event that first bit is 0 and E the event that string contains at least two consecutive 0’s. Pr(F) = ? 1/2 Pr(EF)? 0000 0001 0010 0011 0100 (note: 1st bit fixed to 0) Why does it go up? Hmm. Does it? Pr(EF) = 5/16 Pr(E|F) = 5/8 X X So, P(E) = 8/16 = 1/2 1000 1001 1010 1011 1100 28

So, P(F|E) = (5/16) / (1/2) = 5/8 = ((5/8) * (1/2)) / (1/2) A bit string of length 4 is generated at random so that each of the 16 bit strings is equally likely. What is the probability that the first bit is a 0, given that it contains at least two consecutive 0s? So, to calculate: Pr(F|E) = Pr(EF) / Pr(E) = (Pr(E|F) * Pr(F)) / Pr(E) Bayes’ rule where F is the event that first bit is 0 and E the event that string contains at least two consecutive 0’s. We had: Pr(EF) = 5/16 So, P(F|E) = (5/16) / (1/2) = 5/8 = ((5/8) * (1/2)) / (1/2) So, all fits together. Pr(E|F) = 5/8 Pr(F) = 1/2 Pr(E) = 1/2 29

0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 Sample space 0000 0001 0010 0011 0100 0101 0110 0111 F P(F) = 1/2 0000 0001 0010 0011 0100 1000 1001 1100 E P(E) = 1/2 0000 0001 0010 0011 0100 Pr(EF) = 5/16 EF) 0000 0001 0010 0011 0100 0101 0110 0111 P(E|F) = 5/8 0000 0001 0010 0011 0100 1000 1001 1100 P(F|E) = 5/8 30

Independence The events E and F are independent if and only if Pr(EF) = Pr(E) x Pr(F). Note that in general: Pr(EF) = Pr(E) x Pr(F|E) (defn. cond. prob.) So, independent iff Pr(F|E) = Pr(F). (Note: Pr(F|E) = Pr(E  F) / P(E) = (Pr(E)xPr(F)) / P(E) = Pr(F) ) Example: P(“Tails” | “It’s raining outside”) = P(“Tails”). 31

Independence Hmm. Why? n = 2? BB BG GB GG P(E) = 1/2 P(F) = 3/4 The events E and F are independent if and only if Pr(EF) = Pr(E) x Pr(F). Let E be the event that a family of n children has children of both sexes. Let F be the event that a family of n children has at most one boy. Are E and F independent if Hmm. Why? No n = 2? BB BG GB GG P(E) = 1/2 P(F) = 3/4 P(E  F) = 1/2 =/= 1/2 x 3/4 32

Independence The events E and F are independent if and only if Pr(EF) = Pr(E) x Pr(F). Let E be the event that a family of n children has children of both sexes. Let F be the event that a family of n children has at most one boy. Are E and F independent if BBB BBG BGB BGG GBB GBG GGB GGG P(E) = 6/8 P(F) = 4/8 P(E  F) = n = 3? Yes !! 3/8 = 6/8 x 1/2 33

Independence The events E and F are independent if and only if Pr(EF) = Pr(E) x Pr(F). Let E be the event that a family of n children has children of both sexes. Lef F be the event that a family of n children has at most one boy. Are E and F independent if n = 4? So, dependence / independence really depends on detailed structure of the underlying probability space and events in question!! (often the only way is to “calculate” the probabilities to determine dependence / independence.) No n = 5? No 34

Bernoulli Trials A Bernoulli trial is an experiment, like flipping a coin, where there are two possible outcomes. The probabilities of the two outcomes could be different. 35 35

Bernoulli Trials C(n,k)pk(1-p)n-k A coin is tossed 8 times. What is the probability of exactly 3 heads in the 8 tosses? THHTTHTT is a tossing sequence… C(8,3) How many ways of choosing 3 positions for the heads? What is the probability of a particular sequence? .58 So, probability is C(8,3) x .58 = .22 In general: The probability of exactly k successes in n independent Bernoulli trials with probability of success p, is C(n,k)pk(1-p)n-k 36