Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
MTH 243 Chapter 4: Introduction to Probability Suppose that we found that one of our pieces of data was unusual. For example suppose our pack of M&M’s only had 30 and that was 3.1 standard deviations below the mean, what does that mean? Can we associate a probability with that? Developing the ability to associate a probability to certain outcomes is the goal of this chapter. Definitions: A random experiment is an experiment where the outcome cannot be predicted with certainty. A sample space consists of all possible outcomes of a random experiment. We will write our sample space using set notation. A set is a list of objects or elements. We typically denote the set by a capital letter and list the elements between curly braces. Examples: 1. Suppose our experiment is we flip a coin and record whether it lands heads or tails. Then we write our sample space as S = { heads, tails } or we may write S = {h,t}. This is a discrete sample space since it consists of discrete data. 2. Suppose our experiment is to flip a coin 4 times and record the number of times we get heads. Then our sample space is: S = {0,1,2,3,4} This is also a discrete sample space. 3. Suppose our experiment is to flip a coin and record the time it takes until you get two heads in a row. This (theoretically) could be any length of time – the set of outcomes could range from very close to 0 (but not 0) to an infinite amount of time. We denote this mathematically in interval notation: S = { (0, ) }. This is a continuous sample space since it contains continuous type data. 4. Suppose the experiment is to roll two dice and record the sum of the top faces. Write down the sample space: S= MTH 243 A subset, E, of a set S is a set where all of the elements of E are also elements of S. We write An event is a subset of a sample space. Example: 1. Suppose our experiment is to flip a coin 3 times and record the outcomes. Our sample space is: S = {hhh, hht, hth, thh, htt, tht, tth, ttt} Let E be the event of getting exactly two heads. Then E = {hht, hth, thh} and is a subset of S. 2. Suppose our experiment is to roll two dice and record the sum of the top faces. Then our sample space is as in example 4 on the previous page. Let E be the event of getting at least 6, then write down the elements in E: E={ } Probability The probability of an event, E, denoted P(E), is a value between 0 and 1 giving the measure of the likelihood of the occurrence of an outcome in E. Note P(S) = 1 since S lists all possible outcomes. There is a probability associated with each outcome. For example suppose we have a coin and we flip it. There is a probability, let’s call it p, that it will land on heads; P(heads) = p. This probability is a parameter. We don’t know what it is. We can only estimate it. There are two ways of estimating this probability: 1. Empirical probability (or relative frequency approximation)– repeatedly flip the coin and record the number of times it lands on heads out of the total number of flips. This gives us a statistic we can use to estimate the probability: . How well this approximates p depends on how many flips we try. 2. Theoretical probability – we can estimate the probability based on assumptions we make about the coin. If we assume the coin is fair (that is that it is equally likely to land on heads as tails) then we can estimate the probability to be . MTH 243 If our assumptions about the experiment are correct, then the probability we find theoretically will match the empirical probability we get after repeating the experiment a very large number of times. This value will be close to the actual probability. Theoretical Probability: If all outcomes in our sample space are EQUALLY LIKELY then the probability of an event E is Let’s try some examples: Example 1 Experiment: Roll a die. Record the number showing on top. Sample space: S = { Let’s estimate P(4) (probability of getting a 4). Theoretical: P(4) = Empirical Roll your die 10 times and record your results. Then we will tally for the class. Individual Number of Rolls Number of 4’s 10 Individual empirical estimate for P(4) = Class Number of Rolls Number of 4’s Class empirical estimate for P(4) = MTH 243 Example 2 Experiment: Roll 2 die and record the sum of the top faces. Sample Space: Are all outcomes equally likely? Sample Space: Event: Let E be the event of rolling a 6. E = Theoretical: Empirical: Roll two dice 10 times. Record the number of times you get at least 6. Individual Number of Rolls Number of times sum is 6 10 Individual empirical estimate for P(E) = Class Number of Rolls Number of times sum is 6 Class empirical estimate for P(E) = MTH 243 For some experiments it is not possible to repeat the experiment many times to collect lots of data for empirical estimates (example – having a boy or a girl baby). We will focus on theoretical probability. Recall that if all outcomes in our sample space, S, are equally likely, then the probability of an event, E is 1. A family has 2 children. What is the sample space for the gender? What assumptions are you making? Is every outcome in your sample space equally likely? 2. What is the probability that a family with two children has two boys? 3. A family has 3 children. What is the probability that that the family has three boys? Complementary Event: If E is an event, the complementary event S that are not in E. (Note if (P(E) = p, then P( ) is the set of all outcomes in 4. A family has 3 children. What is the probability that the family has at least one boy? MTH 243 Card Examples A Deck of Cards contains 52 cards. Each card has one of 4 symbols (heart, spade, diamond, club) o Diamonds and Hearts are RED o Spades and Clubs are BLACK Each card has one of 13 number/letters (A, 2,3,4,5,6,7,8,9,10, J,Q,K) o A=Ace, J=Jack, Q=Queen, K= king o The Jack, Queen, and King are called FACE CARDS Heart A 2 3 4 5 6 7 8 9 10 J Q K Spade A 2 3 4 5 6 7 8 9 10 J Q K Diamond A 2 3 4 5 6 7 8 9 10 J Q K Club A 2 3 4 5 6 7 8 9 10 J Q K 1. A card is dealt at random. Find the probability that the card is red. P(Red) = 2. A card is dealt at random. Find the probability that the card is a face card. P(Face) = 3. Five cards are dealt at random. Find the probability that you have a pair. P(pair) = Counting 101 Multiplication Principle: Suppose 2 experiments are performed, E1 and E2 . If E1 has n1 possible outcomes and E2 has n2 possible outcomes, then the composite experiment of performing E1 followed by E2 has n1 ∗ n2 possible outcomes. Example: Suppose I have 4 shirts and 3 pairs of pants. How many different outfits can I make? Space for Notes: This idea can be generalized... General Multipliction rule: If experiments E1 , E2 , E3 , ..., Ek has n1 , n2 , ..., nk outcomes respectively, then the composite experiment of performing E1 followed by E2 , ... Ek has n1 · n2 · ... · nk possible outcomes. Example • How many different 7−digit phone numbers are possible if the first number cannot be a 0 or 1? • How many different licences plates of the form LETTER LETTER LETTER NUMBER NUMBER NUMBER are there? Order vs Unorder - When is order important? Permutations: A Permutation is an arrangement of objects in a row where order matters. Examples • How many ways to line up three children in a row for a picture? Amy, Bobby, Cathy • How many ways are there to choose a president and vice president from a class of 20? Suppose that n distinguishable objects are to be ordered. How many permutations of these n objects are there? ··· 1 2 3 n Total number of permutations on n objects: Examples • Lenny has 5 songs on his ipod. How many different ways can the songs be shuffled (no repeats)? • Lenny only has time to hear 3 of his songs. How many different choices? Def: A permutation on n objects taken r at at time, denoted n Pr , is the number of ways to fill r positions given n distinguishable objects. n n-1 1 2 n-2 ··· n-(r-1) 3 r n Pr = n(n − 1)(n − 2) · · · (n − r + 1) Note that this is the same as: n(n − 1) · · · (n − r + 1)(n − r)(n − r − 1) · · · 3 · 2 · 1 (n − r)(n − r − 1) · · · 3 · 2 · 1 SO n Pr = n! (n − r)! Example: 5 P3 = 5! 5·4·3·2·1 5! = = = 60 (5 − 3)! 2! 2·1 Try a few: 1. Find 10 P4 2. Find 15 P10 = = Sampling with or without replacement A permutation is an ordering of objects. Once you’ve put one of your objects someplace, you’ve used it and you can’t also use it somewhere else, hence permutations give an example of sampling without replacement. Def: Sampling without replacement: an object is NOT replaced after it has been selected. Def: Sampling with replacement: an object IS replaced after it has been selected. Examples: • A state lottery selects 3 balls numbered 0 − 9 one at a time. After each ball is selected, it is put back. This is sampling WITH / WITHOUT replacement (circle one). • My kids still have 10 (different) pieces of halloween candy left. I eat three pieces after they go to bed. his is sampling WITH / WITHOUT replacement (circle one). Ordered vs. Unordered In some cases the order in which we place the objects matters (e.g. phone number, lottery balls) and in others, the order does not matter (e.g. choose 3 pieces of candy). We note that given n different objects, the number of ordered samples of size r is: with replacement: nr (multiplication principle) without replacement: n Pr = n! (n−r)! Unordered Objects The number of unordered sets of size r chosen from a set of size n (different) objects is called the number of combinations of n objects taken r at a time and is denoted n ( n “choose” r) n Cr or r Space for notes: Try a few: 1. Find 10 C4 2. Find 15 C10 = = Examples - Permutations and Combinations 1. How many ways can a committee of three be chosen from a group of 5 people? 2. I want to arrange my action figures: Xena (Warrior Princess), Spider Man, Iron Man, Cat Women and the Bionic Women in a row on my shelf. In how many different ways can I do this? 3. I dont have enough room on my shelf and I can only fit three of my five action figures on the shelf at one time. How many different ways can I display the three figures in a row? 4. I’ve decided to sell my entire collection of 42 action figures in sets of three on e-bay, but I am having a hard time choosing the first set to sell. In how many ways can I pick three action figures to offer for sale? 5. How many different 5 card hands can be dealt from a standard 52 card deck? 6. 2 cards are dealt at random from a standard 52 card deck. How many ways can I get two threes? MTH 243 Back to Probability When determining the (theoretical) probability of an event, we know We can use our counting to determine the number of outcomes in our event and sample space without writing them all down. 1. A random 2 card hand is dealt from a standard 52 card deck. Find the probability of getting two fives. Total number of two card hands = Number of ways to get two fives = P(2 fives in your hand) = 2. In a family of 5 children, find the probability of having two boys: Total number of 5 children families: Number of ways to have two boys: P(2 boys) = MTH 243 Summer 2012 1. A family wishes to have 3 children. Assume throughout the problem that boys and girls are equally likely. a. Write down the sample space for the three children in the family. b. What is the probability that the family will have at least one girl? c. Suppose now that the family decides to have 8 children. What is the probability that they will have no girls? (don’t try to write down the sample space) d. What is the probability that they will have at least one girl (Hint: at least one girl means not zero girls). 2. At one point in the 2008 US Presidential Campaign there were 7 candidates from the Republican or Democrat party still in the running: Democrat Party Candidates: Clinton, Obama, Gravel Republican Party Candidates: McCain, Romney, Huckabee, Paul a. How many different ways can the candidates be lined up? MTH 243 Summer 2012 b. Selecting only from the list of Republican candidates, how many ways are there to choose a President and a Vice President? c. Suppose three candidates are selected at random from the seven above. Find the probability that all three are republican. 3. My garden has 5 daisies, 6 roses, and 7 geraniums ready to be picked. How many ways are there to pick 6 flowers for my bouquet so that 4 are roses and 2 are daisies? 4. My garden has 5 daisies, 6 roses, and 7 geraniums ready to be picked. I pick 6 flowers at random. What is the probability that I pick two of each kind? total number of ways to pick 2 of each kind = total number of ways to pick 6 flowers = P(2 of each kind) =