350 likes | 591 Views
Chapter 6 Counting. In this chapter, we will learn several clever techniques to count abstract objects such as combinations and permutations. We won’t count stars, people, or other objects by brute force. 9.2 The Multiplication Rule. Possibility Trees :
E N D
Chapter 6 Counting In this chapter, we will learn several clever techniques to count abstract objects such as combinations and permutations. We won’t count stars, people, or other objects by brute force.
9.2 The Multiplication Rule Possibility Trees: If an operation consists of several steps (such as choosing a meal), then we can use a tree to show all the possibilities that this operation can be performed.
beef Coke chicken Sprite Root Beer fish beef chicken fish 9.2 The Multiplication Rule • Example: • If a diner offers a simple meal that consists of • Either soup or salad • 3 choices of entrée • 3 choices of beverage. How many meals are possible? step 1 step 2 step 3 soup Start salad
9.2 The Multiplication Rule Theorem: If an operation can be broken into k steps and the first step can be performed in n1 ways, the second step can be performed in n2 ways (regardless of the outcome of the 1st step), . . . the kth step can be performed in nk ways (regardless of the outcomes of the previous steps), then the entire operation can be performed in n1× n2 × · · ·× nk ways.
More Examples • How many telephone numbers are possible with the form • 644 - □□ □ □ ? 2. How many license plates are possible with the format 3 letters followed by 3 digits? 3. How many 4-digit numbers are divisible by 5?
4. A club of 25 people is going to elect a chairperson, a secretary, and a treasurer. In how many ways can this be done if every one is eligible and no person can take two positions? 5. Given the set of digits {5, 6, 7, 8, 9}, how many 4-digit numbers can be formed if no digit can be repeated and the number has to be greater than 6000? 6. How many ways different ways can 7 students hold hands together to form a circle to dance, with everyone facing inward?
Special example An example that the Multiplication rule does not apply How many ways can we rearrange the letters in the word “MISSISSIPPI” to form a different string of eleven letters? Why we can’t use the multiplication rule?
9.2 The Multiplication Rule Definition: A permutation of a set of objects is an ordering of the objects in a row. Theorem 6.2.2 For any integer n with n≥ 1, the number of permutations of a set of n objects is n! Definition An r-permutation of a set of n elements is an ordered selection of r elements taken from the set of n elements. The number of such r-permutations is denoted by P(n,r)
9.2 The Multiplication Rule Theorem: If n and r are integers such that 1 ≤ r ≤ n , then
A Simple but Powerful Counting Technique Theorem: Given two finite sets A and B. If there is a one-to-one correspondence between them, then n(A) = n(B). In other words, if set A is inconvenient to count, and we know that there is a set B which is in 1-to-1 correspondence with A, then we can count the elements in B instead. Example: Suppose that we want to find out the number of people in a given concert, and we know that each person has to hand over one ticket (and no one will hand over two or more tickets) at the entrance, then we can count tickets collected instead of counting heads.
9.3 The Addition Rule Theorem: If a finite set A is the union of k mutually disjoint subsets A1, A2, … , Ak, then
Example: The most common type of combination lock is the 1500 padlock (pictured below). It has 40 numbers on it (from 0 to 39) and it can be unlocked only if the correct 3-number code is dialed in. Due to its mechanism, the middle number in the code must be bigger than the other two numbers. In this case, what is the maximum number of such codes are possible? The actual number is 1500 according to the manufacturer, much smaller than our calculations, this may due to other restrictions.
- = - n ( A B ) n ( A ) n ( B ) Theorem (The difference rule) If A is a finite set and B is a subset of A, then Example: If you want to know the number of people absent, we can count the number of people present, and then subtract that number from the total.
Example 1. How many 5-digit numbers are there with repeated digits?
È È = + + n ( A B C ) n ( A ) n ( B ) n ( C ) - Ç - Ç - Ç n ( A B ) n ( A C ) n ( B C ) + Ç Ç n ( A B C ) 9.3 The Addition Rule Inclusion/Exclusion Rule: If A, B, and C are any three finite sets, then and
A B C + n(B) + n(C) n(A)
+ n(A∩B∩C) = n(A ∩ B ∩ C) A B C + n(B) + n(C) − n(A∩B) − n(A∩C) − n(B∩C) n(A)
Example How many integers from 1 through 1000 are either multiples of 3 or multiples of 5?
æ ö n n ! ç ÷ = ç ÷ ´ - r ! ( n r )! r è ø 9.4 Combinations Definition: Let n and r be non-negative integers with r≤ n. An r-combination of a set of n elements is a subset of r elements from that set. The following symbols, all read “n choose r” , are all used the denote the number of size r subsets that can be chosen from a set of n elements. Theorem: Let n and r be non-negative integers with r≤ n, then
Examples 1. If there are 5 ingredients are available for pizza toppings, how many different ways can we can we make a two-topping pizza? (assume that the two toppings are different)
Pick 3 items from: Pepperoni, Sausage, Green pepper, Olive, Mushroom. PSG, PSO, PSM, PGS, PGO, PGM, POS, POG, POM, PMS, PMG, PMO, SPG, SPO, SPM, SGO, SGM, SGP, SOP, SOG, SOM, SMP, SMG, SMO, GPS, GPO, GPM, GSO, GSP, GSM, GOP, GOS, GOM, GMP, GMS, GMO, OPS, OPG, OPM, OSP,OSG, OSM,OGP,OGS,OGM,OMP, OMS, OMG, MPS, MPG, MPO,MSP,MSG, MSO,MGP,MGS,MGO,MOP,MOS,MOG, We can see that every combination repeats 6 times. Hence we need to divide the answer by 6.
2. If a poker hand contains five (different) cards from a standard deck without jokers, how many different poker hands are possible?
9.4 Combinations Permutations of a set with Repeated elements Example: How many ways are there to re-order the letters in the word MISSISSIPPI ?
9.4 Combinations Permutations of a set with Repeated elements Theorem: Suppose a collection consists of n objects of which: n1 are of type 1 and are indistinguishable from each other, n2 are of type 2 and are indistinguishable from each other, . . . nk are of type k and are indistinguishable from each other, and suppose that n1 + n2 + … + nk = n, then the number of permutations of these n objects can be computed by the following formula.
9.4 Combinations Permutations of a set with Repeated elements Challenging Exercise: How many ways are there to re-order the letters in the word MISSISSIPPI such that no two I’s are next to each other?
9.5 r-Combinations with Repetition Allowed Example: Suppose that there are 4 different types of candies, each type is priced at $1 a piece. If you want to spend $10 on these candies, how many different ways can you do it? (You don’t have to include every type) Another equivalent example: Suppose that there are 4 different containers, and 10 identical balls. If the containers are all big enough to hold 10 balls, how many ways can you put these 10 balls into some or all of these containers?
+ - + - æ ö æ ö n r 1 n r 1 ç ÷ ç ÷ or equivalently ç ÷ ç ÷ - r n 1 è ø è ø 9.5 r-Combinations with Repetition Allowed Definition: An r-combination with repetition allowed, chosen from a set X of n elements is an unordered selection of elements taken from X with repetition allowed. (note that r can be ≥n.) If X = {x1, x2 , … , xn} , we write an r-combination with repetition allowed as [y1, y2 , … , yr ] where each yi is equal to a xj for some j. Theorem: The number of r-combinations with repetition allowed , that can be selected from a set of n objects is
Example 2: How many integers are there from 1 through 9,999 are of the form that the sum of its digits equals to 6? (i.e. 24, 150, 2013, 5100, 4011 are all of this form.) Solution: This is equivalent to putting 6 identical balls into 4 different jars. Hence it is equivalent to permuting a collection of 6 identical balls and 3 identical bars. Hence the answer is 9C6 .
6.5 r-Combinations with Repetition Allowed Variations Example 3: Suppose that there are 4 different containers, and 10 identical balls. If the containers are all big enough to hold 10 balls, how many ways can you put these 10 balls into these containers such that each has at least 1 ball? Example 4: Suppose that there are 4 different containers, and 20 identical balls. If the first three containers are all big enough to hold 20 balls but the last one can hold at most 10 balls, how many ways can you put these 20 balls into these containers? -The End -