combinatorics
play

Combinatorics Reading: EC 5.15.4 Peter J. Haas INFO 150 Fall - PowerPoint PPT Presentation

Combinatorics Reading: EC 5.15.4 Peter J. Haas INFO 150 Fall Semester 2019 Lecture 13 1/ 27 Combinatorics Introduction Representing Sets Organization in Counting Combinatorial Equivalence Counting Lists and Permutations Counting With


  1. Combinatorics Reading: EC 5.1–5.4 Peter J. Haas INFO 150 Fall Semester 2019 Lecture 13 1/ 27

  2. Combinatorics Introduction Representing Sets Organization in Counting Combinatorial Equivalence Counting Lists and Permutations Counting With Equivalence Classes: Combinations Counting Ordered and Unordered Lists With Repetitions Lecture 13 2/ 27

  3. Introduction What is combinatorics? Methods for answering questions about “finite structures” I Existence: Is there a flight sequence that will visit 10 given cities exactly once? → I Enumeration: How many such sequences are there? I Optimization: What is the cheapest set of such flights? We will mostly focus on learning methods for enumeration problems Two key skills I Being able to represent objects in terms of simpler objects I Being able to recognize when two problems are actually the same Lecture 13 3/ 27

  4. Finite Structures We’ll focus on the most basic finite structure: sets I Reminder: { a , b , c } is the same as { b , c , a } (order doesn’t matter) I A “set” is usually a subset of a larger universe The canonical enumeration problem I We are given a description of a set (subset of some universe) I We must compute the number of elements in the set Example: How many U.S. states begin with the letter “A”? I I.e., how many elements in the set { Alabama , Alaska , Arizona , Arkansas } ? I The universe is the set of all U.S. states Lecture 13 4/ 27

  5. Are the prizes Representing Sets di ff erent? Yes No 16 10 Can a person Yes 12 6 win both prizes? No Example: Let S = { Andrew , Bob , Carly , Dianne } Lecture 13 5/ 27

  6. Are the prizes Representing Sets di ff erent? Yes No 16 10 Can a person Yes 12 6 win both prizes? No Example: Let S = { Andrew , Bob , Carly , Dianne } 1. How many ways can two prize winners be chosen from S ? {{ A , B } , { A , C } , { A , D } , { B , C } , { B , D } , { C , D }} (unordered lists, no reps: sets) Lecture 13 5/ 27

  7. Are the prizes Representing Sets di ff erent? Yes No 16 10 Can a person Yes 12 6 win both prizes? No Example: Let S = { Andrew , Bob , Carly , Dianne } 1. How many ways can two prize winners be chosen from S ? {{ A , B } , { A , C } , { A , D } , { B , C } , { B , D } , { C , D }} (unordered lists, no reps: sets) 2. How many ways can we award a first prize and second prize to folks in S ? { AB , BA , AC , CA , AD , DA , BC , CB , BD , DB , CD , DC } (ordered lists, no reps: permutations) Lecture 13 5/ 27

  8. Are the prizes Representing Sets di ff erent? Yes No 16 10 Can a person Yes 12 6 win both prizes? No Example: Let S = { Andrew , Bob , Carly , Dianne } 1. How many ways can two prize winners be chosen from S ? {{ A , B } , { A , C } , { A , D } , { B , C } , { B , D } , { C , D }} (unordered lists, no reps: sets) 2. How many ways can we award a first prize and second prize to folks in S ? { AB , BA , AC , CA , AD , DA , BC , CB , BD , DB , CD , DC } (ordered lists, no reps: permutations) 3. What if two di ff erent door prizes and same person can win both? { AB , BA , AC , CA , AD , DA , BC , CB , BD , DB , CD , DC , AA , BB , CC , DD } (ordered lists, reps: ordered lists) Lecture 13 5/ 27

  9. Are the prizes Representing Sets di ff erent? Yes No 16 10 Can a person Yes 12 6 win both prizes? No Example: Let S = { Andrew , Bob , Carly , Dianne } 1. How many ways can two prize winners be chosen from S ? {{ A , B } , { A , C } , { A , D } , { B , C } , { B , D } , { C , D }} (unordered lists, no reps: sets) 2. How many ways can we award a first prize and second prize to folks in S ? { AB , BA , AC , CA , AD , DA , BC , CB , BD , DB , CD , DC } (ordered lists, no reps: permutations) 3. What if two di ff erent door prizes and same person can win both? { AB , BA , AC , CA , AD , DA , BC , CB , BD , DB , CD , DC , AA , BB , CC , DD } (ordered lists, reps: ordered lists) 4. What if the two door prizes are identical and the same person can get both? {{ A , A } , { A , B } , { A , C } , { A , D } , { B , B } , { B , C } , { B , D } , { C , C } , { C , D } , { D , D }} (unordered list, reps: bags) I We care about how many times each type occurs, not the order given I Other examples: hand of cards, bag of groceries Lecture 13 5/ 27

  10. Representing Sets: Continued Definition I The number of r -element subsets (also called r -combinations) of the set � n � { 1 , 2 , . . . , n } is denoted as C ( n , r ), also written as C n r , n C r , and . r Definition I The number of permutations of length r using elements from { 1 , 2 , . . . , n } is denoted as P ( n , r ), also written as P n r and n P r . Does order matter? Yes No Are repetitions Yes Ordered list Unordered list (bag) allowed? No Permutation Set Lecture 13 6/ 27

  11. Example Which of the four structure types best characterizes the objects in each of the following situations? set I Dealing a five-card poker hand I Dealing a two-card blackjack hand (one card face down and one face up) permutation I Creating a game schedule for a sports team in baseball (can play an opponent list ordered more than once) I Creating a game schedule for a single elimination tennis tournament permutation bag I Filling your orange plastic jack-o-lantern with halloween candy Does order matter? Yes No Are repetitions Yes Ordered list Unordered list (bag) allowed? No Permutation Set Lecture 13 7/ 27

  12. Organization in counting MATH AMTH TMAH HMAT MAHT AMHT TMHA HMTA MTAH ATMH TAMH HAMT MTHA ATHM TAHM HATM Example: How many permutations of the 24 MHAT AHMT THMA HTMA letters MATH are there? MHTA AHTM THAM HTAM I MATH, AMTH, AMHT, THAM, AHMT, HAMT, HMAT, MHAT, THMA, MHTA, HMTA, Andrew Bob Carly Diane AA BA CA DA HATM, AHTM, MAHT, TMAH, MTHA, AB BB CB DB HTMA, TMHA, ATMH, TAHM, ATHM, TAMH, AC BC CC DC MTAH, HTAM AD BD CD DD I Versus organizing in a table Andrew Bob Carly Diane { A,A } { B,B } { C,C } { D,D } Example: The number of ways to award { A,B } { B,C } { C,D } prizes to { Andrew , Bob , Carly , Dianne } { A,C } { B,D } 16 I One person can win both prizes, { A,D } prizes are di ff erent 10 Andrew Bob Carly Diane I One person can win both prizes, AB BA CA DA both prizes the same AC BC CB DB AD BD CD DC : I One person cannot win both prizes, prizes are di ff erent Andrew Bob Carly Diane { A , B } { B , C } { C , D } I One person cannot win both prizes, { A , C } { B , D } both prizes are the same down elements written { A , D } for alpha bietical order convenience in Lecture 13 8/ 27

  13. Organization in Counting, Continued Example: Represent all Green 1 Green 2 Green 3 Green 4 Green 5 Green 6 outcomes of rolling a red Red 1 (1,1) (1,2) (1,3) (1,4) (1,5) (1,6) six-sided die and a green Red 2 (2,1) (2,2) (2,3) (2,4) (2,5) (2,6) six-sided die 36 Red 3 (3,1) (3,2) (3,3) (3,4) (3,5) (3,6) Red 4 (4,1) (4,2) (4,3) (4,4) (4,5) (4,6) Red 5 (5,1) (5,2) (5,3) (5,4) (5,5) (5,6) Example: Represent all Red 6 (6,1) (6,2) (6,3) (6,4) (6,5) (6,6) outcomes of tossing a D penny, nickel, and dime if H HHH . together : :÷÷÷÷÷÷:÷÷÷ . H HHT T T H HTH Example: List all H In (di ff erent-looking) / HTT T T THH permutations of the four H nm H letters in the word BOOK as HHT T g As EM ) IE T am H TTH Example: List all iii. , ⑥ s Is TTT T , three-element sets using Ms K mist letters from the work ' 3 miss E GAMES [Hint: list the set , elements in alphabetical A. o 's ) l , order] I O G A , , , Lecture 13 9/ 27

  14. Combinatorial Equivalence What is combinatorial equivalence? I Informally: When two counting problems have the same answer I Formally: When there is a one-to-one correspondence between sets Lecture 13 10/ 27

  15. Combinatorial Equivalence What is combinatorial equivalence? I Informally: When two counting problems have the same answer I Formally: When there is a one-to-one correspondence between sets Example 1: Why do the following questions have the same answer? 1. How many multiples of 3 are there between 100 and 300 inclusive? 100-3441--67 2. How many integers are there between 34 and 100 inclusive? List 1: 102 105 108 · · · 297 300 l l l · · · l l List 2: 34 35 36 · · · 99 100 Lecture 13 10/ 27

  16. Combinatorial Equivalence What is combinatorial equivalence? I Informally: When two counting problems have the same answer I Formally: When there is a one-to-one correspondence between sets Example 1: Why do the following questions have the same answer? 1. How many multiples of 3 are there between 100 and 300 inclusive? 2. How many integers are there between 34 and 100 inclusive? 67 List 1: 102 105 108 · · · 297 300 l l l · · · l l List 2: 34 35 36 · · · 99 100 Example 2: Why do the following questions have the same answer? 1. How ways can we distribute a red, blue, and green ball to 10 people (more than one ball per person is allowed)? 10,000 2. How many integers are there between 0 and 999 inclusive? Person 1 gets red Person 2 gets red Person 3 gets red Distribution: Person 0 gets blue Person 2 gets blue Person 7 gets blue Person 1 gets green Person 9 gets green Person 5 gets green l l l Integer: 101 229 375 Lecture 13 10/ 27

Recommend


More recommend