Discrete Mathematics, 1st Edition Kevin Ferland Chapter 6 Basic Counting 1.

Slides:



Advertisements
Similar presentations
4/16/2015 MATH 224 – Discrete Mathematics Counting Basic counting techniques are important in many aspects of computer science. For example, consider the.
Advertisements

Discrete Probability Chapter 7.
Chapter 2 Probability. 2.1 Sample Spaces and Events.
7 Probability Experiments, Sample Spaces, and Events
COUNTING AND PROBABILITY
Chapter 3 Probability.
Multiplication Rule. A tree structure is a useful tool for keeping systematic track of all possibilities in situations in which events happen in order.
Chapter 2: The Next Step… Conditional Probability.
Discrete Structures Chapter 4 Counting and Probability Nurul Amelina Nasharuddin Multimedia Department.
Discrete Mathematics Lecture 7 More Probability and Counting Harper Langston New York University.
1 Section 5.1 Discrete Probability. 2 LaPlace’s definition of probability Number of successful outcomes divided by the number of possible outcomes This.
Combinations We should use permutation where order matters
Discrete Mathematics Lecture 5
Counting Elements in a List How many integers in the list from 1 to 10? How many integers in the list from m to n? (assuming m
HW2 assignment. 1.A fair coin is tossed 5 times. Find a probability of obtaining (a) exactly 3 heads; (b) at most 3 heads Solution: Binomial distribution.
Logic and Introduction to Sets Chapter 6 Dr.Hayk Melikyan/ Department of Mathematics and CS/ For more complicated problems, we will.
Probability Chapter 3. § 3.1 Basic Concepts of Probability.
Copyright (c) 2004 Brooks/Cole, a division of Thomson Learning, Inc. Chapter 2 Probability.
4. Counting 4.1 The Basic of Counting Basic Counting Principles Example 1 suppose that either a member of the faculty or a student in the department is.
Counting Principles (Permutations and Combinations )
Counting and Probability Sets and Counting Permutations & Combinations Probability.
Chapter 7 Logic, Sets, and Counting Section 4 Permutations and Combinations.
5.1 Basic Probability Ideas
Advanced Math Topics Chapters 4 and 5 Review. 1) A family plans to have 3 children. What is the probability that there will be at least 2 girls? (assume.
6.4 Permutations and combinations For more complicated problems, we will need to develop two important concepts: permutations and combinations. Both of.
Probability Review and Counting Fundamentals Ginger Holmes Rowell, Middle TN State University Tracy Goodson-Espy and M. Leigh Lunsford, University of AL,
Chapter 4 Lecture 4 Section: 4.7. Counting Fundamental Rule of Counting: If an event occurs m ways and if a different event occurs n ways, then the events.
Chapter 11 Data Descriptions and Probability Distributions
Basic Counting. This Lecture We will study some basic rules for counting. Sum rule, product rule, generalized product rule Permutations, combinations.
Topics to be covered: Produce all combinations and permutations of sets. Calculate the number of combinations and permutations of sets of m items taken.
Copyright © Cengage Learning. All rights reserved. CHAPTER 9 COUNTING AND PROBABILITY.
Section 7.1. Section Summary Finite Probability Probabilities of Complements and Unions of Events Probabilistic Reasoning.
Chapter 8: Probability: The Mathematics of Chance Lesson Plan Probability Models and Rules Discrete Probability Models Equally Likely Outcomes Continuous.
Fall 2002CMSC Discrete Structures1 One, two, three, we’re… Counting.
Section 2.6: Probability and Expectation Practice HW (not to hand in) From Barr Text p. 130 # 1, 2, 4-12.
March 10, 2015Applied Discrete Mathematics Week 6: Counting 1 Permutations and Combinations How many different sets of 3 people can we pick from a group.
Permutations, Combinations, and Counting Theory AII.12 The student will compute and distinguish between permutations and combinations and use technology.
3. Counting Permutations Combinations Pigeonhole principle Elements of Probability Recurrence Relations.
1 Lecture 4 (part 1) Combinatorics Reading: Epp Chp 6.
Chapter 6, Counting and Probability
March 10,  Counting  Fundamental Counting principle  Factorials  Permutations and combinations  Probability  Complementary events  Compound.
Chapter 7 Logic, Sets, and Counting Section 4 Permutations and Combinations.
Barnett/Ziegler/Byleen Finite Mathematics 11e1 Learning Objectives for Section 7.4 Permutations and Combinations The student will be able to set up and.
1 CHAPTERS 14 AND 15 (Intro Stats – 3 edition) PROBABILITY, PROBABILITY RULES, AND CONDITIONAL PROBABILITY.
ICS 253: Discrete Structures I Discrete Probability King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Chapter 4 Lecture 4 Section: 4.7. Counting Fundamental Rule of Counting: If an event occurs m ways and if a different event occurs n ways, then the events.
Unit VI Discrete Structures Permutations and Combinations SE (Comp.Engg.)
Copyright © Ed2Net Learning Inc.1. 2 Warm Up Tell whether each event is dependent or independent 1. Selecting a name from a Chicago telephone book and.
Week 21 Rules of Probability for all Corollary: The probability of the union of any two events A and B is Proof: … If then, Proof:
 Counting  Fundamental Counting principle  Factorials  Permutations and combinations  Probability  Complementary events  Compound events  Independent.
Spring 2016 COMP 2300 Discrete Structures for Computation Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University.
Chapter 2: Probability. Section 2.1: Basic Ideas Definition: An experiment is a process that results in an outcome that cannot be predicted in advance.
2/24/20161 One, two, three, we’re… Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: “How many different 8-letter.
COUNTING Permutations and Combinations. 2Barnett/Ziegler/Byleen College Mathematics 12e Learning Objectives for Permutations and Combinations  The student.
Section 7.1. Probability of an Event We first define these key terms: An experiment is a procedure that yields one of a given set of possible outcomes.
Section Basic Counting Principles: The Product Rule The Product Rule: A procedure can be broken down into a sequence of two tasks. There are n 1.
CS 104: Discrete Mathematics
13 Lesson 1 Let Me Count the Ways Fundamental Counting Principle, Permutations & Combinations CP Probability and Statistics FA 2014 S-ID.1S-CP.3S-CP.5.
1 COMP2121 Discrete Mathematics Principle of Inclusion and Exclusion Probability Hubert Chan (Chapters 7.4, 7.5, 6) [O1 Abstract Concepts] [O3 Basic Analysis.
ICS 253: Discrete Structures I
The Pigeonhole Principle
Chapter 7: Counting Principles
Probability Axioms and Formulas
COCS DISCRETE STRUCTURES
What is Probability? Quantification of uncertainty.
Discrete Probability Chapter 7 With Question/Answer Animations
CS100: Discrete structures
Chapter 7 Logic, Sets, and Counting
Chapter 3 Probability.
Counting Discrete Mathematics.
Presentation transcript:

Discrete Mathematics, 1st Edition Kevin Ferland Chapter 6 Basic Counting 1

6.1 The Multiplication Principle (Dinner Choices). A guest at a formal dinner has 4 entrée choices and 2 dessert choices. If a guest’s dinner is entirely determined by these two choices, then how many different dinner choices are there? The total number of dinner choices is given by the product 4 · 2 = 8. 2 Ch6-p303

EXAMPLE 6.1 (Solution) (Cont.) 3 Ch6-p304

THEOREM Ch6-p304

6.2 Permutations and Combinations Permutations A permutation of a set of objects is an ordering of those objects. Permutations reflect selections for which an ordering is important. 5 Ch6-p311

EXAMPLE 6.8 (Lining Up). How many ways are there to put 8 children in a line to get ice cream? 6 Ch6-p311

EXAMPLE 6.8 (Solution) There are 8 children from which to pick the child who is first. Then there are 7 children left from which to pick the second child. Then there are 6 left, and so on. Therefore, there are 8 · 7 · 6 · 5 · 4 · 3 · 2 · 1 = 8! = ways to line up the children. 7 Ch6-p311

THEOREM Ch6-p311

DEFINITION 6.1 A permutation of k objects from a set of size n is an ordered list of k of the n objects. The number of permutations of k objects from n is denoted P(n, k). 9 Ch6-p312

THEOREM Ch6-p313

Combinations DEFINITION 6.2 A combination of k elements from a set of size n is a subset of size k. 11 Ch6-p313

THEOREM Ch6-p313

EXAMPLE 6.18 How many license plates consisting of 6 digits (0 to 9) with exactly 2 of the same digit are possible? 13 Ch6-p314

EXAMPLE 6.18 (Solution) There are 10 digits from which to choose the repeated one. There are ways to choose the two positions to contain the repeated digit. 14 Ch6-p314

EXAMPLE 6.18 (Solution) (Cont.) Then there are P(9, 4) ways to fill in the 4 remaining distinct digits. By the Multiplication Principle, there are 6-digit license plates with exactly 2 digits the same. 15 Ch6-p314

6.3 Addition and Subtraction 16 Ch6-p320

6.3 Addition and Subtraction EXAMPLE 6.20 How many possible license plates consisting of 6 digits (0 to 9) have either all digits distinct or all digits the same? 17 Ch6-p320

EXAMPLE 6.20 (Solution) There are P(10, 6) plates with all digits distinct and 10 with all digits the same. Certainly no one plate can have both of these properties. Hence, the total number of license plates under consideration is P(10, 6) + 10 = Ch6-p

THEOREM Ch6-p322

EXAMPLE 6.26 A byte is a binary number consisting of 8 digits. How many bytes have at least 2 zeros? There are 2 8 binary sequences of length 8. Of them, 1 has no zeros and 8 have one zero. Since the rest have at least 2 zeros, there are 2 8 − (1 + 8) = 247 sequences with at least 2 zeros. 20 Ch6-p323

THEOREM Ch6-p323

EXAMPLE 6.29 A standard (6-sided) die is rolled a sequence of 5 times. In how many ways can the sequence of numbers resulting be all even or all multiples of 3? 22 Ch6-p325

EXAMPLE 6.29 (Solution) Since there are 3 even values (2, 4, and 6), there are 3 5 ways to get all even numbers. Since there are 2 multiples of 3 (3 and 6), there are 2 5 ways to get all multiples of 3. Only the value 6 is both even and a multiple of 3, so there is 1 way to do both. Therefore, the desired number of ways is − 1 = Ch6-p325

6.4 Probability EXAMPLE 6.31 Consider the task of tossing two dice and recording the numbers showing. Compute the probability that the sum is Ch6-p328

EXAMPLE 6.31 (Cont.) The set of possible results of our task is thus S = { (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6), (2, 1), (2, 2), (2, 3), (2, 4), (2, 5), (2, 6), (3, 1), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6), (4, 1), (4, 2), (4, 3), (4, 4), (4, 5), (4, 6), (5, 1), (5, 2), (5, 3), (5, 4), (5, 5), (5, 6), (6, 1), (6, 2), (6, 3), (6, 4), (6, 5), (6, 6) }. 25 Ch6-p328

EXAMPLE 6.31 (Solution) From the possible results listed in S, we are interested in the subset E = {(2, 6), (3, 5), (4, 4), (5, 3), (6, 2)}. The probability of E is given by. 26 Ch6-p328

DEFINITION 6.3 Let S be a finite sample space. The outcomes in S are said to be equally likely if ∀ x, y ∈ S, P(x) = P(y). That is, ∀ x ∈ S, P(x) = 27 Ch6-p329

DEFINITION 6.4 If the outcomes in a finite sample space S are all equally likely, then the probability of an event E is given by 28 Ch6-p329

THEOREM Ch6-p330

EXAMPLE 6.34 The license plates issued by a certain state consist of 3 letters (A to Z) followed by 4 digits (0 to 9). If all possible plates are equally likely to be chosen, then what is the probability that a randomly chosen plate will have some letter or digit repeated? 30 Ch6-p

EXAMPLE 6.34 (Solution) The sample space S is the set of all possible plates consisting of 3 letters followed by 4 digits. Hence, |S| = 26 3 · 10 4 = Ch6-p331

EXAMPLE 6.34 (Solution) (Cont.) Let E be the subset of plates in which some letter or digit is repeated. Clearly, |E c | = P(26, 3) · P(10, 4) = The desired probability is 32 Ch6-p331

THEOREM Ch6-p331

EXAMPLE 6.36 (Home Security). A home security code consists of 4 digits (0 to 9). If all such codes are equally likely to be chosen, then what is the probability that a randomly chosen code will contain exactly 1 three or exactly 2 sixes? 34 Ch6-p331

EXAMPLE 6.36 (Solution) Let S be the sample space of all possible 4- digit codes. Let E be the subset of codes containing exactly 1 three, and let F be the subset of codes containing exactly 2 sixes. So E ∪ F consists of all codes containing exactly 1 three or exactly 2 sixes. We seek P(E ∪ F). 35 Ch6-p331

EXAMPLE 6.36 (Solution) (Cont.) Since 36 Ch6-p332

EXAMPLE 6.36 (Solution) (Cont.) Theorem 6.10 gives that 37 Ch6-p332

Conditional Probability DEFINITION 6.5 Let E and F be events in a sample space S with P(F) > 0. The conditional probability of E given F, denoted P(E | F ), is given by 38 Ch6-p332

EXAMPLE 6.37 At a company picnic, the children played a soccer game, after which one player’s name was randomly drawn to win a prize. The winning team in the soccer game consists of 7 girls and 4 boys, and the losing team consists of 5 girls and 6 boys. Given that the prize winner is a boy, what is the probability that he also comes from the winning soccer team? 39 Ch6-p332

EXAMPLE 6.37 (Solution) Let S be the set of 22 children that played soccer, let E be the event that the prize winner is from the winning team, and let F be the event that the prize winner is a boy. The probability that we seek is P(E|F). 40 Ch6-p333

EXAMPLE 6.37 (Solution) (Cont.) Note that E ∩ F is the event that the prize winner is a boy from the winning team. Clearly, We conclude that 41 Ch6-p333

DEFINITION 6.6 Two events E and F in a sample space S are said to be independent if P(E ∩ F ) = P(E) · P(F ). 42 Ch6-p333

EXAMPLE 6.38 Consider the experiment of tossing two dice in sequence. Let E be the event that the first die shows a value of at most 3, let F 1 be the event that the values on the two dice are the same, and let F 2 be the event that the sum of the values on the two dice is 5. Note that 43 Ch6-p333

EXAMPLE 6.38 (Cont.) (a) Are E and F1 independent? Solution. and. It follows that So yes, E and F 1 are independent. 44 Ch6-p333

EXAMPLE 6.38 (Cont.) (b) Are E and F2 independent? Solution. and. It follows that So no, E and F 2 are not independent. 45 Ch6-p333

THEOREM Ch6-p334

THEOREM Proof E = E ∩ S = E ∩ (F 1 ∪ ·· · ∪ F n ) = (E ∩ F 1 ) ∪ ·· · ∪ (E ∩ F n ) is a disjoint union. It follows that 47 Ch6-p334

COROLLARY Ch6-p334

EXAMPLE 6.39 In a recent election, the majority of female voters preferred a different candidate from the one preferred by the majority of the male voters. Exit polls showed that 75% of female voters chose candidate A, whereas 55% of male voters chose candidate B. 49 Ch6-p334

EXAMPLE 6.39 (Cont.) 50 Ch6-p334 Assume that each voter chose either candidate A or candidate B and that an equal number of men and women voted. (a) Which candidate won the election? Explain. (b) If a randomly chosen voter is known to have voted for candidate A, then what is the probability that the voter is a female?

EXAMPLE 6.39 (Solution) To be simple, let A be the event that a voter chooses candidate A, let B be the event that a voter chooses candidate B, let F be the event that a voter is female, and let M be the event that a voter is male. 51 Ch6-p334

EXAMPLE 6.39 (Solution) (Cont.) Based on the exit polls and the assumption that each voter chose A or B, we know that P(A | F) =.75, P(B | F) =.25, P(A | M) =.45, P(B | M) =.55. We are also assuming that P(F) = P(M) = Ch6-p334

EXAMPLE 6.39 (Solution) (Cont.) (a) To determine who won, we apply Theorem Observe that P(A) = P(A | F)P(F) + P(A | M)P(M) = (.75)(.5) + (.45)(.5) =.6. Since candidate A received 60% of the votes, candidate A won the election. 53 Ch6-p334

EXAMPLE 6.39 (Solution) (Cont.) (b) We seek P(F | A), the probability that a voter is female given that she voted for candidate A. For this, Bayes’ Formula gives that 54 Ch6-p335

6.5 Applications of Combinations ( Choices with Repetition) EXAMPLE 6.42 (Barbecue Orders). A barbecue is attended by 7 people. Each person has the choice of a hamburger, a piece of barbecued chicken, or a hot dog (but only one in each case) for the first food item. If the cook will barbecue all 7 items at the same time and does not care who ordered what, then how many different barbecue orders are possible for the cook? We assume that there are ample supplies of each food type. 55 Ch6-p341

EXAMPLE 6.42 (Solution) This is considered a problem involving choices with repetition, since the cook may receive multiple requests for any of the 3 items: hamburger B, barbecued chicken C, or hot dog D. 56 Ch6-p346

EXAMPLE 6.42 (Solution) (Cont.) A total order would consist of a list of length 7 of B’s, C’s, and D’s, but with no specified number of any particular choice. For example, one order might be CBBDBDB. To help motivate our counting technique, such an order could be recorded in the form of a table. 57 Ch6-p346

EXAMPLE 6.42 (Solution) (Cont.) Imagine that the cook simply places a  in the appropriate column of an order sheet as each order is taken. At the end, the order could more efficiently be recorded as a sequence of length 9 consisting of 7  ’s and 2 |’s.     |  |   58 Ch6-p346

EXAMPLE 6.42 (Solution) (Cont.) Here the headers B, C, D are understood. The point is that this is a binary sequence of length 9 containing 7  ’s (and 2 |’s). Note that the number of |’s is one fewer than the number of item choices. We conclude that the number of possible barbecue orders is 59 Ch6-p346

THEOREM Ch6-p346

6.6 Correcting for Overcounting EXAMPLE 6.44 (Seating Arrangements). How many ways are there to seat 5 girls at a circular table if the particular seat taken by each girl does not matter and what matters to each girl is (a) who is sitting to her left and who is sitting to her right? (b) who is sitting next to her (which side does not matter)? 61 Ch6-p351

EXAMPLE 6.44 (Solution) Temporarily call one seat the head of the table. If we keep track of which girl is seated at the head, then there are 5! ways to seat the girls clockwise around the table. However, 5! is an overcounting of what we want, since we have carried the extra structure of who is seated at the head of the table. Given any such seating, if all of the girls stood up and shifted one position clockwise, then the new seating should be considered the same as the original. 62 Ch6-p351

EXAMPLE 6.44 (Solution) (Cont.) (a) Each girl would still have the same neighbor to her left and the same neighbor to her right. Since there are 5 different rotations of any seating, we need to divide the original 5! count by 5. Therefore, there are different seatings around the table. 63 Ch6-p351

EXAMPLE 6.44 (Solution) (Cont.) (b) When which neighbor is to the left of a girl and which is to the right no longer matters, there are fewer than 24 different seatings. Since only the set of 2 neighbors matters, if we take the mirror reflection of any seating from part (a), then the reflected seating should now be considered the same as the original. 64 Ch6-p351

EXAMPLE 6.44 (Solution) (Cont.) Reflection preserves neighbors (and switches sides). 65 Ch6-p351

EXAMPLE 6.44 (Solution) (Cont.) Since each seating from part (a) should be paired with its reflection, we need to divide the answer from part (a) by 2. Thus, there are different seatings in which only neighbors matter. 66 Ch6-p351