Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events Lesson 3 Chapter 2: Introduction to Probability Michael Akritas Department of Statistics The Pennsylvania State University Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events 1 Sample Spaces, Events and Set Operations 2 Equally Likely Outcomes The Probability Mass Function and Probability Sampling Counting Techniques 3 Axioms and Properties of Probability 4 Conditional Probability The Law of Total Probability and Bayes Theorem 5 Independent Events Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events Overview This chapter presents the basic ideas and tools of classical probability, which is the branch of probability that arose from games of chance. This includes an introduction to combinatorial theory, and an introduction to the concepts of conditional probability and independence. Probability evolved to deal with modeling the randomness of phenomena such as the number of earthquakes, the amount of rainfall, the life time of a given electrical component, or the relation between education level and income, etc. Such probability models will be discussed in Chapters 3 and 4. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events Sample Spaces Definition The set of all possible outcomes of a random experiment is called the sample space of the experiment, and will be denoted by S. Example a) Give the sample space of the experiment which selects two fuses and classifies each as non-defective or defective. b) Give the sample space of the experiment which selects two fuses and records how many are defective. c) Give the sample space of the experiment which records the number of fuses inspected until the second defective is found. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events Example Three undergraduate students from a particular university are selected and their opinions about a proposal to expand the use of solar energy are recorded on a scale from 1 to 10. a) Give the sample space of this experiment. What is the size of this sample space? b) Describe the sample space if only the average of the three responses is recorded. What is the size of this sample space? Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events Solution: a) When the opinions of three students are recorded the set of all possible outcomes consist of the triplets (x1 , x2 , x3 ), where x1 = 1, 2, . . . , 10 denotes the response of the first student, x2 = 1, 2, . . . , 10 denotes the response of the second student, and x3 = 1, 2, . . . , 10 denotes the response of the third student. Thus, the sample space is described as S1 = {(x1 , x2 , x3 ) : x1 = 1, 2, . . . , 10, x2 = 1, 2, . . . , 10, x3 = 1, 2, . . . , 10}. There are 10 · 10 · 10 = 1000 possible outcomes. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events b) The easiest way to describe the sample space, S2 , when the three responses are averaged is to say that it is the collection of distinct averages (x1 + x2 + x3 )/3 formed from the 1000 triplets of S1 . The word ”distinct” is emphasized because the sample space lists each individual outcome only once, whereas several triplets might result in the same average. For example, the triplets (5, 6, 7) and (4, 6, 8) both yield an average of 6. Determining the size of S2 is can be done, most easily, with the following R commands: S1=expand.grid(x1=1:10,x2=1:10,x3=1:10) length(table(rowSums(S1))) Michael Akritas # lists all triplets in S1 # gives the number of different sums Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events Events In experiments with many possible outcomes, investigators often classify individual outcomes into distinct categories. For example, the opinion ratings may be classified into low (L = {0, 1, 2, 3}), medium (M = {4, 5, 6}) and high (H = {7, 8, 9, 10}). Definition Such collections of individual outcomes, i.e. subsets of the sample space, are called events. An event consisting of only one outcome is called a simple event. Events are denoted by letters such as A, B, C, etc. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events Example 1 In selecting one card at random from a deck of cards, the event A = {the card is a spade} consists of 13 outcomes. 2 The event E = {at most 3 heads in five tosses of a coin} consists of the outcomes 0, 1, 2, 3. We say that a particular event A has occurred if the outcome of the experiment is a member of (i.e. contained in) A. The sample space of an experiment is an event which always occurs when the experiment is performed. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events Set Operations The union, A ∪ B, of events A and B, is the event consisting of all outcomes that are in A or in B or in both. The intersection, A ∩ B, of A and B, is the event consisting of all outcomes that are in both A and B. The complement, A0 or Ac , of A is the event consisting of all outcomes that are not in A. The events A and B are said to be mutually exclusive or disjoint if they have no outcomes in common. That is, if A ∩ B = ∅, where ∅ denotes the empty set. The difference A − B is defined as A ∩ B c . A is a subset of B, A ⊂ B, if e ∈ A implies e ∈ B. Two sets are equal, A = B, if A ⊂ B and B ⊂ A. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events Union of A and B A∪B A B Intersection of A and B A∩B A B Figure: Venn diagrams for union and intersection Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The complement of A Ac The difference operation A−B A A B Figure: Venn diagrams for complement and difference Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events A A B B Figure: Venn diagram illustrations of A, B disjoint, and A ⊂ B Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events Commutative Laws: a) A ∪ B = B ∪ A, b) A ∩ B = B ∩ A Associative Laws: a) (A ∩ B) ∩ C = A ∩ (B ∩ C) b) (A ∪ B) ∪ C = A ∪ (B ∪ C) Distributive Laws: a) (A ∪ B) ∩ C = (A ∩ C) ∪ (B ∩ C), b) (A ∩ B) ∪ C = (A ∪ C) ∩ (B ∪ C) De Morgan’s Laws: a) (A ∪ B)c = Ac ∩ B c b) (A ∩ B)c = Ac ∪ B c • Two types of proof: (a) By Venn diagram (informal), and (b) Show formally the equality of the two sides, i.e. show that A ⊂ B and B ⊂ A, where A is the set on the left and B is the set on the right of each equality. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events Example The following table classifies a population of 100 plastic disks in terms of their scratch and shock resistance. shock resistance high low scratch high 70 9 resistance low 16 5 Suppose that one of the 100 disks is randomly selected. What is the sample space? Give the outcomes in the events a) ”the selected disk has low shock resistance”, and b) ”the selected disk has low shock resistance or low scratch resistance”. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Probability Mass Function and Probability Sampling Counting Techniques Definition of Probability The probability of an event E, denoted by P(E), is used to quantify the likelihood of occurrence of E by assigning a number from the interval [0, 1]. Higher numbers indicate that the event is more likely to occur. A probability of 1 indicates that the event will occur with certainty, while a probability of 0 indicates that the event will not occur. Read Section 2.3.1. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Probability Mass Function and Probability Sampling Counting Techniques Assignment of Probabilities It is simplest to introduce probability in experiments with a finite number of equally likely outcomes, such as those used in games of chance, or simple random sampling. Probability for equally likely outcomes If the sample space consists of N outcomes which are equally likely to occur, then the probability of each outcome is 1/N. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Probability Mass Function and Probability Sampling Counting Techniques Population Proportions as Probabilities A unit is selected by s.r. sampling from a finite statistical population of a categorical variable. If category i has Ni units, then the probability the selected unit came from category i is pi = Ni /N. where N is the total number of units (so N = P Ni ). Thus, (a) In rolling a die, the probability of a three is p = 1/6. (b) If 160 out of 500 tin plates have one scratch, and one tin plate is selected at random, the probability that the selected plate has one scratch is p = 160/500. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Probability Mass Function and Probability Sampling Counting Techniques Efron’s Dice Die A: four 4s and two 0s Die B: six 3s Die C: four 2s and two 6s Die D: three 5’s and three 1’s Specify the events A > B, B > C, C > D, D > A. Find the probabilities that A > B, B > C, C > D, D > A. Hint: When two dice are rolled, the 36 possible outcomes are equally likely. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Probability Mass Function and Probability Sampling Counting Techniques Outline 1 Sample Spaces, Events and Set Operations 2 Equally Likely Outcomes The Probability Mass Function and Probability Sampling Counting Techniques 3 Axioms and Properties of Probability 4 Conditional Probability The Law of Total Probability and Bayes Theorem 5 Independent Events Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Probability Mass Function and Probability Sampling Counting Techniques Even when population units are selected with equal probability, the outcomes of the random variable recorded may not be equally likely. For example, when die is rolled twice, each of the 36 possible outcomes are equally likely. But if we record the sum of the two rolls, these outcomes are not equally likely. Definition The probability mass function, or pmf, of a discrete random variable X , is a list of the probabilities p(x) for each value x of the sample space SX of X . Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Probability Mass Function and Probability Sampling Counting Techniques Example Roll a die twice. Find the pmf of X = the sum of the two die rolls. Solution: SX = {2, 3, . . . , 12}. This list of possible values, together with the corresponding probabilities, can be found with the R commands: S=expand.grid(X1=1:6,X2=1:6) ; table(S$X1+S$X2) Try also S[which(S$X1+S$X2==7),]. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Probability Mass Function and Probability Sampling Counting Techniques It is useful to think of a random experiment as a sampling from the sample space. Example 1 Sampling in the tin plate example can be thought of as sampling from S = {0, 1, 2}. But it should not be simple random sampling (why?). 2 One US citizen aged 18 and over is selected by s.r.sampling and his/her opinion regarding solar energy is rated on the scale 0, 1, . . . , 10. This can be thought of as random (but not simple random!) sampling from S = {0, 1, . . . , 10}. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Probability Mass Function and Probability Sampling Counting Techniques Definition When a sample space is thought of as the set from which we sample, we refer to it as sample space population. The random sampling from the sample space population (which is need not be simple random sampling) is called probability sampling, or sampling from a pmf. This idea makes it possible to think of different experiments as sampling from the same population. For example Inspecting 50 products and recording the number of defectives, and Interviewing 50 people and recording if they read New York Times can both be thought as probability sampling from their common sample space S = {0, 1, 2, . . . , 50}. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Probability Mass Function and Probability Sampling Counting Techniques Example (Simulating an Experiment with R) Use the pmf of X = sum of two die rolls to simulate 1000 repetitions of the experiment which records the sum of two die rolls. Take their mean and use it to guess the population mean. The R commands are S=expand.grid(X1=1:6,X2=1:6) ; pmf=table(S$X1+S$X2)/36 mean(sample(2:12, size=1000, replace=T, prob=pmf)) Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Probability Mass Function and Probability Sampling Counting Techniques Outline 1 Sample Spaces, Events and Set Operations 2 Equally Likely Outcomes The Probability Mass Function and Probability Sampling Counting Techniques 3 Axioms and Properties of Probability 4 Conditional Probability The Law of Total Probability and Bayes Theorem 5 Independent Events Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Probability Mass Function and Probability Sampling Counting Techniques Why Count? In classical probability counting is used for calculating probabilities. For the probability of an event A we need to know the number of outcomes in A, N(A), and if the sample space consists of a finite number of equally likely outcomes, also the total number of outcomes, N(S), because P(A) = N(A) N(S) Some counting questions are difficult (e.g. how many different five-card hands are possible from a deck of 52 cards?) and thus we need specialized counting techniques. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Probability Mass Function and Probability Sampling Counting Techniques Some Counting Questions 1 How many samples of size n can be formed from N units? The answer is the number of combinations of n objects selected from N, denoted by Nn , and equals N N! , where k! = 1 × 2 × · · · × k . = n!(N − n)! n 52 52! For example, = 2, 598, 960 is the number of = 5 5!47! hands of n = 5 cards that can be formed from a deck of N = 52 cards. Knowing that N(S) = 2, 598, 960 we can calculate the probability of individual hands such as the hand with 4 aces and the king of hearts. What is it? Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Probability Mass Function and Probability Sampling Counting Techniques 1 What is the probability of A = {the hand has 4 aces}? We need to learn how to determine N(A). 2 When inspecting n items as they come off the assembly line, the probability of the event E = {k of the n inspected items are defective} is calculated using the concept of independence and the answer to the question How many different n-long sequences consisting of k 1s (for defective) and n − k 0s (for non defective) can be formed? The answer is (again) the number of combinations kn . In what follows we will justify the formula for kn . In the process we will learn how to answer question 2. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Probability Mass Function and Probability Sampling Counting Techniques The Product Rules The Simple Product Rule: Suppose a task can be completed in two stages. If stage 1 has n1 outcomes, and if stage 2 has n2 outcomes regardless of the outcome in stage 1, then the task has n1 × n2 outcomes. Example If A = {the hand has 4 aces}, find N(A). Solution. The task is to form a hand with 4 aces. It can be completed in two stages: First select the 4 aces, and then select one additional card. Here n1 = 1 and n2 = 48 (why?). Thus, N(A) = 48. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Probability Mass Function and Probability Sampling Counting Techniques Example (1) 1 In how many ways can we select the 1st and 2nd place winners from the four finalists Niki, George, Sophia and Martha? Answer: 4 × 3 = 12. 2 In how many ways can we select two from Niki, George, Sophia and Martha? 12 4 Answer: (Why?) Note: 6 = # of combinations = . 2 2 Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Probability Mass Function and Probability Sampling Counting Techniques The General Product Rule: If a task can be completed in k stages and stage i has ni outcomes, regardless of the outcomes the previous stages, then the task has n1 × n2 × · · · × nk outcomes Example (2) 1 In how many ways can we select a 1st, 2nd and 3rd place winners from Niki, George, Sophia and Martha? Answer: 4 × 3 × 2 = 24. 2 In how many ways can we select three from Niki, George, Sophia and Martha? 24 Answer: (Why?) Note: 6 4 4 = # of combinations = . 3 Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Probability Mass Function and Probability Sampling Counting Techniques Permutations The answer to Example (1), part 1, i.e. 12, is the number of permutations of 2 items selected from 4. The answer to Example (2), part 1), i.e. 24, is the number of permutations of 3 items selected from 4. Definition The number of ordered selections (i.e. when we keep track of the order of selection) of k items from n is called the number of permutations of k items selected from n, it is denoted by Pk,n , and equals Pk,n = n × (n − 1) × . . . × (n − k + 1) = Michael Akritas n! (n − k)! Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Probability Mass Function and Probability Sampling Counting Techniques Combinations In the answer to Example (1), part 2, i.e. 12 2 , the 2 in the denominator is the number of permutations of 2 items selected from 2 (P2,2 = 2 × 1). In the answer to Example (2), part 2), i.e. 24 6 , the 6 in the denominator is the number of permutations of 3 items selected from 3 (P3,3 = 3 × 2 × 1). Extending the rational used to obtain these answers, we have The number of combinations of k items selected from a group of n is Pk,n n n! = = k k! k!(n − k)! Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Probability Mass Function and Probability Sampling Counting Techniques The numbers kn are called binomial coefficients because of the Binomial Theorem: n X n k n−k n (a + b) = a b . k k=0 Example a) How many n-long sequences consisting of k 1s and n − k zeros can be formed? b) How many paths going from the lower left corner of a 4 × 3 grid to its upper right corner? Assume one is allowed to move either to the right or upwards. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Probability Mass Function and Probability Sampling Counting Techniques Multinomial Coefficients Suppose we want to assign 8 engineers to work on projects A, B, and C, so that 3 work on project A, 2 work on B, and 3 work on C. In how many ways can this be done? The number of ways n units can be divide in r groups of specified sizes is given by n n1 , n2 , . . . , nr = n! n1 !n2 ! · · · nr ! These numbers are called multinomial coefficients because of the Multinomial Theorem. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Probability Mass Function and Probability Sampling Counting Techniques Example An order comes in for 5 palettes of low grade shingles. In the warehouse there are 10 palettes of high grade, 15 of medium grade, and 20 of low grade shingles. An inexperienced shipping clerk is unaware of the distinction in grades of asphalt shingles and he ships 5 randomly selected palettes. 1 How many different groups of 5 palettes are there? 45 5 = 1, 221, 759. 2 What is the probability 45 that all of the shipped palettes are 20 low grade? 5 / 5 = 15, 504/1, 221, 759 = 0.0127. 3 What is the probability that 2 of the shipped palettes are of grade and 3 are from low grade? hmedium i 45 15 20 / 5 = (105 × 2280)/1, 221, 759 = 0.0127 = 2 3 0.1959. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Probability Mass Function and Probability Sampling Counting Techniques Example A communication system consists of 15 indistinguishable antennas arranged in a line. The system functions as long as no two non-functioning antennas are next to each other. Suppose six antennas stop functioning. a) How many different arrangements of the six non-functioning antennas result in the system being functional? (Hint: The 9 functioning antennas, lined up among themselves, define 10 possible locations for the 6 non-functioning antennas so the system functions.) b) If the arrangement of the 15 antennas is random, what is the probability the system is functioning? Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Probability Mass Function and Probability Sampling Counting Techniques Example What is the probability that 5 randomly dealt cards form a full house? Solution: First, the number of all 5-card hands is 52! 52 5 = 5!47! = 2, 598, 960. Next, think of the task of forming a full house as consisting of two stages. In Stage 1 choose two cards of the same kind, and in stage 2 choose three cards of the same kind. Since there are 13 kind of cards, stage 1 can be 13 4 completed in 1 2 = (13)(6) = 78 ways (why?). For each outcome of stage 1, the task of stage 2 becomes that of selecting three of a kind fromone of the remaining 12 kinds. 12 4 This can be completed in 1 3 = 48 ways. Thus there are (78)(48) = 3, 744 possible full houses, and the desired probability is 0.0014. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Probability Mass Function and Probability Sampling Counting Techniques Reading assignment Read Examples 2.3.8 - 2.3.14 Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events Axioms of Probability The axioms governing any assignment of probabilities are: Axiom 1: P(A) ≥ 0, for all events A Axiom 2: P(S) = 1 Axiom 3: If A1 , A2 , . . . are disjoint P(A1 ∪ A2 ∪ . . .) = ∞ X P(Ai ) i=1 Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events Properties of Probability Proposition 1 If A and B are disjoint, P(A ∩ B) = 0. 2 If E1 , . . . , Em are disjoint, then P(E1 ∪ · · · ∪ Em ) = P(E1 ) + · · · + P(Em ) 3 4 5 If A ⊂ B then P(A) ≤ P(B). P(A) = 1 − P(Ac ), for any event A. P P(A) = {all simple events Ei in A} P(Ei ) Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events Proposition 1 If S = {s1 , . . . , sn } and the n outcomes are equally likely, then P(si ) = 1/n, for all i. 2 P(A ∪ B) = P(A) + P(B) − P(A ∩ B) 3 P(A ∪ B ∪ C) = P(A) + P(B) + P(C) − P(A ∩ B) − P(A ∩ C) − P(B ∩ C) + P(A ∩ B ∩ C) Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events Example The probability that a firm will open a branch office in Toronto is 0.7, that it will open one in Mexico City is 0.4, and that it will open an office in at least one of the cities is 0.8. Find the probabilities that the firm will open an office in: 1 neither of the cities 2 both cities 3 exactly one of the cities Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events Example Use the R commands attach(expand.grid(X1=0:1,X2=0:1, X3=0:1,X4=0:1)); table(X1+X2+X3+X4)/length(X1) to find the pmf of the random variable X = number of heads in four flips of a coin. (The answer is x p(x) 0 0.0625 1 0.25 2 0.375 3 0.25 4 .) 0.0625 (a) What can we say about the sum of all probabilities? (b) What is P(X ≥ 2)? Read also Examples 2.4.2, 2.4.3. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Law of Total Probability and Bayes Theorem Updating Probabilities In experiments with multivariate outcome variable, knowledge of the value of one variable may help predict another. For now, the word prediction will mean update the probabilities of events regarding the other variable. The updated probabilities are called conditional probabilities. Knowing a man’s height helps update the probability that he weighs over 170lb. Knowing a person’s education level helps update the probability of that person being in a certain income category. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Law of Total Probability and Bayes Theorem Given partial information regarding the outcome of simple random selection restricts the population. The outcome can be regarded as s.r.s. from the restricted population. Example If the outcome of rolling a die is known to be even, what is the probability it is a 2? If the selected card from a deck is known to be a figure card, what is the probability it is a king? Given event A = {household has a cat}, what is the probability of B = {household has a dog}? http: //stat.psu.edu/˜mga/401/fig/Venn_Square.pdf Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Law of Total Probability and Bayes Theorem The Multiplication Rule The conditional probability of the event A given the information that event B has occurred is denoted by P(A|B) and equals P(A|B) = P(A ∩ B) , provided P(B) > 0 P(B) THE MULTIPLICATION RULE: The definition of P(A|B) yields an alternative formula for P(A ∩ B): P(A ∩ B) = P(A|B)P(B) or P(A ∩ B) = P(B|A)P(A) The rule extends to more than two events. For example, P(A ∩ B ∩ C) = P(A)P(B|A)P(C|A ∩ B) Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Law of Total Probability and Bayes Theorem Example 1 40% of bean seeds come from supplier A and 60% come from supplier B. Seeds from supplier A have 50% germination rate while those from supplier B have a 75% rate. What is the probability that a randomly selected seed came from supplier A and will germinate? ANSWER: P(A ∩ G) = P(G|A)P(A) = 0.5 × 0.4 = 0.2 2 Three players are dealt a card in succession. What is the probability that the 1st gets an ace, the 2nd gets a king, and the 3rd gets a queen? ANSWER: P(A ∩ B ∩ C) = P(A)P(B|A)P(C|A ∩ B) = 4 4 4 52 51 50 = 0.000454 Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Law of Total Probability and Bayes Theorem Example Fifteen percent of all births involve Cesarean (C) section. Ninety-eight percent of all babies survive delivery (S), whereas, when a C section is performed the baby survives with probability 0.96. What is the probability that a baby will survive delivery if a C section is not performed? Solution. P(S ∩ C) = 0.96 × 0.15 = 0.144 (why?) P(S ∩ C c ) = 0.98 − 0.144 = 0.836 (why?) P(S|C c ) = 0.836/0.85 = 0.9835. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Law of Total Probability and Bayes Theorem Example Of the customers entering a department store 30% are men and 70% are women. The probability a male shopper will spend more than $50 is 0.4, and the corresponding probability for a female shopper is 0.6. The probability that at least one of the items purchased is returned is 0.1 for male shoppers and 0.15 for female shoppers. Find the probability that the next customer to enter the department store is a woman who will spend more than $50 on items that will not be returned. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Law of Total Probability and Bayes Theorem Solution. Let W = {customer is a woman}, B = {the customer spends >$50} and R = {at least one of the purchased items is returned}. We want the probability of the intersection of W , B and R c . By the formula for the intersection of three events, this probability is given by P(W ∩ B ∩ R c ) = P(W )P(B|W )P(R c |W ∩ B) = 0.7 × 0.6 × 0.85 = 0.357. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Law of Total Probability and Bayes Theorem The multiplication rule typically applies in situations where the events whose intersection we wish to compute are associated with different stages of an experiment. For example, in the previous example there are three stages: a) record customer’s gender, b) record amount spent by customer, and c) record whether any of the items purchased is subsequently returned. Therefore, by the generalized fundamental principle of counting, this experiment has 2 × 2 × 2 = 8 different outcomes. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Law of Total Probability and Bayes Theorem > 50 0.4 M 0.6 < 50 0.1 R 0.9 Rc 0.1 R 0.9 Rc 0.15 R 0.85 Rc 0.15 R 0.85 Rc 0.3 0.7 W 0.4 < 50 0.6 > 50 Figure: Tree diagram for last example Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Law of Total Probability and Bayes Theorem Outline 1 Sample Spaces, Events and Set Operations 2 Equally Likely Outcomes The Probability Mass Function and Probability Sampling Counting Techniques 3 Axioms and Properties of Probability 4 Conditional Probability The Law of Total Probability and Bayes Theorem 5 Independent Events Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Law of Total Probability and Bayes Theorem The Law of Total Probability Let the events A1 , A2 . . . , Ak be disjoint and make up the entire sample space, and let B denote an event whose probability we want to calculate, as in the figure A1 B A2 A3 A4 If we know P(B|Aj ) and P(Aj ) for all j = 1, 2, . . . , k , the Law of Total Probability gives P(B) = P(A1 )P(B|A1 ) + · · · + P(Ak )P(B|Ak ) Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Law of Total Probability and Bayes Theorem Example 1 40% of bean seeds come from supplier A and 60% come from supplier B. Seeds from supplier A have 50% germination rate while those from supplier B have a 75% rate. What is the probability that a randomly selected seed will germinate? ANSWER: P(G) = P(A)P(G|A) + P(B)P(G|B) = 0.4 × 0.5 + 0.6 × 0.75 = 0.65 2 Three players are dealt a card in succession. What is the probability that the 2nd gets a king? ANSWER: 4 Why? 52 Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Law of Total Probability and Bayes Theorem Example Two dice are rolled and the sum of the two outcomes is recorded. What is the probability that 5 happens before 7? Solution 1: If En = {no 5 or 7 appear on the first n − 1 rolls and a 5 appears on the nth}, then P(∪∞ n=1 En ) = ∞ X P(En ) n=1 = ∞ X n=1 Michael Akritas (1 − 2 10 n−1 4 ) = 36 36 5 Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Law of Total Probability and Bayes Theorem Solution 2: Let B be the desired event, A1 = {first roll results in 5}, A2 = {first roll results in 7}, A3 = {first roll results in neither 5 not 7}. Then P(B) = P(B|A1 )P(A1 ) + P(B|A2 )P(A2 ) + P(B|A3 )P(A3 ) = P(A1 ) + 0 + P(B)P(A3 ). Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Law of Total Probability and Bayes Theorem Example Two consecutive traffic lights have been synchronized to make a run of green lights more likely. In particular, if a driver finds the first light to be red, the second light will be green with probability 0.9, and if the first light is green the second will be green with probability 0.7. The probability of finding the first light green is 0.6. (a) Find the probability that a driver will find the second traffic light green. (b) Recalculate the probability of part (a) through a tree diagram for the experiment which records whether or not a car stops at each of the two traffic lights. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Law of Total Probability and Bayes Theorem Solution. (a) Let A and B denote the events that a driver will find the first, respectively the second, traffic light green. Because the events A and Ac constitute a partition of the sample space, according to the Law of Total Probability P(B) = P(A)P(B|A) + P(Ac )P(B|Ac ) = 0.6 × 0.7 + 0.4 × 0.9 = 0.42 + 0.36 = 0.78. (b) The experiment has two outcomes resulting in the second light being green which are represented by the paths with the pairs of probabilities (0.6,0.7) and (0.4,0.9). The sum of the probabilities of these two outcomes is as above. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Law of Total Probability and Bayes Theorem R R 0.4 0.6 G 0.1 0.9 G 0.3 R 0.7 G Figure: Tree diagram for previous example Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Law of Total Probability and Bayes Theorem Bayes Theorem Consider events B and A1 , . . . , Ak as in the Law of Total Probability. Now, however, we ask a different question: Given that B has occurred, what is the probability that a particular Aj has occurred? The answer is provided by the Bayes theorem: P(Aj |B) = P(Aj ∩ B) P(Aj )P(B|Aj ) = Pk P(B) j=1 P(Ai )P(B|Ai ) Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Law of Total Probability and Bayes Theorem Bayes Theorem Consider events B and A1 , . . . , Ak as in the Law of Total Probability. Now, however, we ask a different question: Given that B has occurred, what is the probability that a particular Aj has occurred? The answer is provided by the Bayes theorem: P(Aj |B) = P(Aj ∩ B) P(Aj )P(B|Aj ) = Pk P(B) j=1 P(Ai )P(B|Ai ) Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Law of Total Probability and Bayes Theorem Example 1 40% of bean seeds come from supplier A and 60% come from supplier B. Seeds from supplier A have 50% germination rate while those from supplier B have a 75% rate. Given that a randomly selected seed germinated, what is the probability that it came from supplier A? ANSWER: P(A|G) = 2 0.2 P(A)P(G|A) = 0.65 P(A)P(G|A) + P(B)P(G|B) Given that the 2nd player got an ace, what is the 3 probability that the 1st got an ace? ANSWER: (Why?) 51 Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events The Law of Total Probability and Bayes Theorem Example Seventy percent of the light aircraft that disappear while in flight in a certain country are subsequently discovered. Of the aircraft that are discovered, 60% have an emergency locator, whereas 10% of the aircraft not discovered have such a locator. Suppose a light aircraft has disappeared. 1 What is the probability that it has an emergency locator and it will not be discovered? 2 What is the probability that it has an emergency locator? 3 If it has an emergency locator, what is the probability that it will not be discovered? Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events Probability of an Intersection The formula for the probability of A ∪ B yields P(A ∩ B) = P(A) + P(B) − P(A ∪ B). A simpler formula is possible if A and B are independent: For independent events, P(A ∩ B) = P(A)P(B). The above also serves as the definition of independent events. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events Independent events arise in connection with independent experiments or independent repetitions of the same experiment. Two experiments are independent if there is no mechanism through which the outcome of one experiment will influence the outcome of the other. A die is rolled twice. Are the two rolls independent? Two cards are drawn without replacement from a deck of cards. Are the two draws independent? In two independent repetitions of an experiment, any event associated with the first repetition will be independent of any event associated with the second repetition. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events Example Toss a coin twice. Find the probability of two heads. Solution. Since the two tosses are independent, P([H in toss 1] ∩ [H in toss 2]) = P([H in toss 1])P([H in toss 2]) = 11 1 = . 22 4 Alternatively, since P([H in toss 1] ∩ [H in toss 2]) = 1 4 (why?), and also P(H in toss 1)P(H in toss 1) = 14 , we can conclude that the two events are independent. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events Example (Fair game with unfair coin) A biased coin results in heads with probability p (e.g. p = 0.3). Flip this coin twice. If the outcome is (H,H) or (T,T) ignore the outcome and flip the coin two more times. Repeat until the outcome of the two flips is either (H,T) or (T,H). In the first case you say you got tails, and in the second case you say you got heads. Prove that now the probability of getting heads equals 0.5. Solution: Ignoring the outcomes (H,H) and (T,T), is equivalent to conditioning on the the event B = {(H, T ), (T , H)}. Thus, P((T , H)|B) = P((T , H)) P((T , H) ∩ B) = P(B) P(B) = (1 − p)p = 0.5. p(1 − p) + (1 − p)p Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events Example Consider again Efron’s dice. That is Die A: four 4s and two 0s; Die B: six 3s; Die C: four 2s and two 6s; Die D: three 5’s and three 1’s. Find the probabilities that A > B, B > C, C > D, and D > A using the properties of probability and the concept of independence. Solution (partial): Note that P(C > D) equals P(C = 2 and D = 1) + P(C = 6 and D = 5 or 1) why? = P(C = 2)P(D = 1) + P(C = 6)P(D = 5 or 1) why? = 21 1 2 + = . 32 3 3 Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events Independence of Multiple Events When there are several independent experiments, events associated with distinct experiments are independent. But the definition is a bit more complicated: Definition The events A1 , . . . , An are mutually independent if P(Ai1 ∩ Ai2 ∩ . . . ∩ Aik ) = P(Ai1 )P(Ai2 ) . . . P(Aik ) for any sub-collection Ai1 , . . . , Aik of k events chosen from A1 , . . . , An All conditions are needed because, for example, P(A ∩ B ∩ C) = P(A)P(B)P(C) does not imply that A, B, C are independent. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events Example Consider rolling a die and define the events A = {1, 2, 3}, B = {3, 4, 5}, C = {1, 2, 3, 4}. Verify that P(A ∩ B ∩ C) = P(A)P(B)P(C), but that A, B are not independent (and thus A, B, C are not mutually independent). Solution: First, since A ∩ B ∩ C = {3}, it follows that P(A ∩ B ∩ C) = 114 1 = P(A)P(B)P(C) = . 6 226 Next, A ∩ B = {3}, so P(A ∩ B) = Michael Akritas 1 6 6= P(A)P(B) = 11 2 2. Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events Example The three components of the series system shown in the figure fail with probabilities p1 = 0.1, p2 = 0.15 and p3 = 0.2, respectively, independently of each other. What is the probability the system will fail? 1 2 3 Figure: Components connected in series Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events Example The three components of the parallel system shown in figure function with probabilities p1 = 0.9, p2 = 0.85 and p3 = 0.8, respectively, independently of each other. What is the probability the system functions? Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events 1 2 3 Figure: Components connected in parallel Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events Read Example 2.6.9. Michael Akritas Lesson 3 Chapter 2: Introduction to Probability Outline Sample Spaces, Events and Set Operations Equally Likely Outcomes Axioms and Properties of Probability Conditional Probability Independent Events Go to previous lesson http://www.stat.psu.edu/ ˜mga/401/course.info/lesson2.pdf Go to next lesson http://www.stat.psu.edu/˜mga/ 401/course.info/lesson4.pdf Go to the Stat 401 home page http: //www.stat.psu.edu/˜mga/401/course.info/ http://www.google.com Michael Akritas Lesson 3 Chapter 2: Introduction to Probability