Counting techniques Permutations and Combinations Permutations and Combinations
Counting techniques Permutations and Combinations
Permutations and Combinations Ø apply fundamental counting principle Ø compute permutations Ø compute combinations Ø distinguish between permutations vs combinations
Fundamental Counting Principle can be used determine the number of possible outcomes when there are two or more characteristics. Fundamental Counting Principle states that if an event has m possible outcomes and another independent event has n possible outcomes, then there are m* n possible outcomes for the two events together.
Fundamental Counting Principle Let’s start with a simple example. A student is to roll a die and flip a coin. How many possible outcomes will there be? 1 H 2 H 1 T 2 T 3 H 3 T 4 H 4 T 5 H 5 T 12 outcomes 6 H 6 T 6*2 = 12 outcomes
Fundamental Counting Principle For a college interview, Robert has to choose what to wear from the following: 4 slacks, 3 shirts, 2 shoes and 5 ties. How many possible outfits does he have to choose from? 4*3*2*5 = 120 outfits
Permutations A Permutation is an arrangement of items in a particular order. Notice, ORDER MATTERS! To find the number of Permutations of n items, we can use the Fundamental Counting Principle or factorial notation.
• There are basically two types of permutation: • Repetition is Allowed: such as selecting three digits to form a lock. It could be "333". • No Repetition: for example the first three people in a running race. You can't be first and second.
• Permutations • Permutation • A permutation of a set S is an ordered arrangement of the elements of S. • In other words, it is a sequence containing every element of S exactly once. • Example: Consider the set S = {1; 2; 3}. • The sequence (3; 1; 2) is one permutation of S. • There are 6 different permutations of S. They are: • (1; 2; 3) ; (1; 3; 2) ; (2; 1; 3) ; (2; 3; 1) ; (3; 1; 2) ; (3; 2; 1)
Permutations The number of ways to arrange the letters ABC: ____ 3 ____ Number of choices for second blank? 3 2 ___ Number of choices for third blank? 3 2 1 Number of choices for first blank? 3*2*1 = 6 ABC ACB 3! = 3*2*1 = 6 BAC BCA CAB CBA
Permutations To find the number of Permutations of n items chosen r at a time, you can use the formula
Permutations Practice: A combination lock will open when the right choice of three numbers (from 1 to 30, inclusive) is selected. How many different lock combinations are possible assuming no number is repeated?
Permutations Practice: A combination lock will open when the right choice of three numbers (from 1 to 30, inclusive) is selected. How many different lock combinations are possible assuming no number is repeated?
Permutations Practice: From a club of 24 members, a President, Vice President, Secretary, Treasurer and Historian are to be elected. In how many ways can the offices be filled?
Permutations Practice: From a club of 24 members, a President, Vice President, Secretary, Treasurer and Historian are to be elected. In how many ways can the offices be filled?
Permutation formula proof • 15
Permutations vs. r-permutations • r-permutations: Choosing an ordered 5 card hand is P(52, 5) – When people say “permutations”, they almost always mean r-permutations • But the name can refer to both • Permutations: Choosing an order for all 52 cards is P(52, 52) = 52! – Thus, P(n, n) = n! 16
Sample question • How many permutations of {a, b, c, d, e, f, g} end with a? – Note that the set has 7 elements • The last character must be a – The rest can be in any order • Thus, we want a 6 -permutation on the set {b, c, d, e, f, g} • P(6, 6) = 6! = 720 • Why is it not P(7, 6)? 17
Combinations A Combination is an arrangement of items in which order does not matter. ORDER DOES NOT MATTER! Since the order does not matter in combinations, there are fewer combinations than permutations. The combinations are a "subset" of the permutations.
Combinations To find the number of Combinations of n items chosen r at a time, you can use the formula
• There also two types of combinations (remember the order does not matter now): • Repetition is Allowed: such as coins in your pocket (5, 5, 5, 10) • No Repetition: such as lottery numbers (2, 14, 15, 27, 30, 33)
Combinations Practice: A student must answer 3 out of 5 essay questions on a test. In how many different ways can the student select the questions?
Combinations Practice: A student must answer 3 out of 5 essay questions on a test. In how many different ways can the student select the questions?
Combinations Practice: A basketball team consists of two centers, five forwards, and four guards. In how many ways can the coach select a starting line up of one center, two forwards, and two guards?
Combinations Practice: Center: A basketball team consists of two centers, five forwards, and four guards. In how many ways can the coach select a starting line up of one center, two forwards, and two guards? Forwards: Guards: Thus, the number of ways to select the starting line up is 2*10*6 = 120.
Combinations • What if order doesn’t matter? • In poker, the following two hands are equivalent: – A♦, 5♥, 7♣, 10♠, K♠ – K♠, 10♠, 7♣, 5♥, A♦ • The number of r-combinations of a set with n elements, where n is non-negative and 0≤r≤n is: 25
Combination formula proof • Let C(52, 5) be the number of ways to generate unordered poker hands • The number of ordered poker hands is P(52, 5) = 311, 875, 200 • The number of ways to order a single poker hand is P(5, 5) = 5! = 120 • The total number of unordered poker hands is the total number of ordered hands divided by the number of ways to order each hand • Thus, C(52, 5) = P(52, 5)/P(5, 5) 26
Combination formula proof • Let C(n, r) be the number of ways to generate unordered combinations • The number of ordered combinations (i. e. rpermutations) is P(n, r) • The number of ways to order a single one of those rpermutations P(r, r) • The total number of unordered combinations is the total number of ordered combinations (i. e. rpermutations) divided by the number of ways to order each combination • Thus, C(n, r) = P(n, r)/P(r, r) 27
Combination formula proof 28
Corollary 1 • Let n and r be non-negative integers with r ≤ n. Then C(n, r) = C(n, n-r) • Proof: 29
Corollary example • There are C(52, 5) ways to pick a 5 -card poker hand • There are C(52, 47) ways to pick a 47 -card hand • P(52, 5) = 2, 598, 960 = P(52, 47) • When dealing 47 cards, you are picking 5 cards to not deal – As opposed to picking 5 card to deal – Again, the order the cards are dealt in does matter 30
Permutations vs. Combinations • Both are ways to count the possibilities • The difference between them is whether order matters or not • Consider a poker hand: – A♦, 5♥, 7♣, 10♠, K♠ • Is that the same hand as: – K♠, 10♠, 7♣, 5♥, A♦ • Does the order the cards are handed out matter? – If yes, then we are dealing with permutations – If no, then we are dealing with combinations 31
Permutations with Indistinguishable Objects • Some elements may be indistinguishable in counting problems. When this is the case, care must be taken to avoid counting things more than once. • EXAMPLE 7 How many different strings can be made by reordering the letters of the word SUCCESS?
• Solution: Because some of the letters of SUCCESS are the same, the answer is not given by the number of permutations of seven letters. This word contains three Ss, two Cs, one U, and one E. • To determine the number of different strings that can be made by reordering the letters, first note that the three Ss can be placed among the seven positions in C(7, 3) different ways, leaving four positions free. Then the two Cs can be placed in C(4, 2) ways, leaving two free positions. The U can be placed in C(2, 1) ways, leaving just one position free. Hence E can be placed in C(1, 1) way. Consequently, from the product rule, the number of different strings that can be made is
• Proof: To determine the number of permutations, first note that the n 1 objects of type one can be placed among the n positions in C(n, n 1) ways, leaving n − n 1 positions free. Then the objects of type two can be placed in C(n − n 1, n 2) ways, leaving n − n 1 − n 2 positions free. Continue placing the objects of type three, . . . , type k − 1, until at the last stage, nk objects of type k can be placed in C(n − n 1 − n 2 −· · ·− nk − 1, nk) ways. Hence, by the product rule, the total number of different permutations are:
• More examples: How many different strings can be made by reordering the letters of the word: – evergreen – statistics – mississippi – abracadabra – indiscreetness
- Slides: 38