elie
play

Elie Lecture 13, 7/16/19 1 / 22 Recap I k choices, always the same - PowerPoint PPT Presentation

Counting, Part II CS 70, Summer 2019 Elie Lecture 13, 7/16/19 1 / 22 Recap I k choices, always the same number of options at choice i regardless of previous outcome = First Rule I Order doesnt matter; same number of repetitions for each


  1. Counting, Part II CS 70, Summer 2019 Elie Lecture 13, 7/16/19 1 / 22

  2. Recap I k choices, always the same number of options at choice i regardless of previous outcome = ⇒ First Rule I Order doesn’t matter; same number of repetitions for each desired outcome = ⇒ Second Rule I Indistinguishable items split among a fixed number of di ff erent buckets = ⇒ Stars and Bars Today: more counting strategies, and combinatorial proofs! 2 / 22

  3. Count by (Disjoint) Cases: Restaurant Menu For lunch, there are 2 appetizers, 4 entre´ es, and 3 desserts. The apps are salad and onion rings. If I order salad, I want both an entre´ e and a dessert. If I order onion rings, I only want an additional entre´ e. How many choices do I have for lunch? Entree Dessert salad 1 case : 3=12 4 x Entree =4 case 2 : onion 4 rings ← 16 disjoint 1. are ④ 2 case case = 3 / 22

  4. Count by (Disjoint) Cases: Sum to 12 If x 1 , x 2 , x 3 ≥ 0, how many ways can we satisfy integers x 1 + x 2 + 5 · x 3 = 12 = , 1,23 Xz={ 0 case 2×3--1 3×5-2 1×3=0 case case - - - Xi -142=2 12 Xitxz XtXz=7 - - 8 ways 3 ways to ways 3. \ Xyxz set - ways 24 - 4 / 22

  5. Counting the Complement: Dice Rolls colored ndifferently If we roll 3 die, how many ways are there to get at least one 6? Tis : is :& First (naive, but still correct) attempt: , 6 xx brice 1- I nonce 7×445×3=15 orderings 3 . 6 Dice 6 6 : × a - -36 - 1 way 6 6 6 Dice : - - 91 way 5 / 22

  6. Counting the Complement: Dice Rolls Second attempt: 6 with rolls no= complement : rolls dice overall all space : - I complement space I overall least I 6 / # At = -5×-5×5 -6×-6×-6 - = 125 216 = - 91 ways = = 6 / 22

  7. Counting Using Symmetry: Coin Flips How many sequences of 16 coin flips have more heads than tails? First (naive) attempt: cases 16h HH LOH 94 , - . . = ? 1814181419 )t t " tiff ' . - 16 ! 9TH 7 / 22

  8. Counting Using Symmetry: Coin Flips Second attempt: Split the entire set of coin flips into three types: GID Bijection size same 1. More heads than tails . y TTTH HHHT → 2. More tails than heads SH 87 ( %) 3. Equal numbers of heads and tails + ② ① + ③ # seq = total . 216=2×+186 ) 8 / 22

  9. Counting Using Set Theory: Two Sets × Assume A , B , C finite sets. | A ∪ B | = | A | + | B | − | A ∩ B | ( “ A or B ” / “at least one of A , B ” ) IA ABI IA It IA UBI 1131 - - - 9 / 22

  10. Applying Set Theory: Phone Numbers lead w/ O game . How many 5-digit numbers have a 2 in the first or last position? Set Union # 2 - dig ft 's w/ first A S 2 : -1×10×10*0=10,000 5- dig last ' s 2 B # w/ : 9¥ I - 9,000 w/ first z 5- dig F 2 # s A- NB : x F 10×10×10 and e X - - -2 - last 1000 = 1000=18000 IAU 131=10000-19000 - 10 / 22

  11. Counting Using Set Theory: Three Sets | A ∪ B ∪ C | = | A | + | B | + | C | − | A ∩ B | − | B ∩ C | − | A ∩ C | + | A ∩ B ∩ C | ( “ A or B or C ” / “at least one of A , B , C ”) . . . . . - l B n 4 - IA n BI - I A n c l - I A I t l B l t 14 I A U B U C l - og¥ → middle 11 / 22

  12. Complete Mixups: Warm-Up Alice, Bob, and Charlie each bring a book to class. The books are mixed up and redistributed. How many ways could Alice, Bob, and Charlie each not get their own book ? How many ways can Alice not get her own book, with no restrictions on Bob and Charlie? -2×-2×1=4 ways . B A C How many ways can Alice and Bob both not get their own book, with no restriction on Charlie? cases z : Agetc Ceaser :AgetsB cases : 1×1×1=1 1×2×1=2 - - - - - - A B A c B C 12 / 22

  13. ⇐ Complete Mixups: A Realization How many ways can Alice get her own book, with no restrictions on Bob and Charlie? -1×-2×-1=2 ways A B C How many ways can Alice and Bob both get their own book, with no restrictions on Charlie? E ways i - - A B C . ? 2 The “opposite” problem is easier! 9etsa① I at least # # mix ups rearrangements = complete - He a¥2 13 / 22

  14. Complete Mixups: Finishing Argument Alice gets own where A = rearr . " Bob " B = Charlie " " C = . - IAACI . IBN - IANBI . IAI -1113144 - | A ∪ B ∪ C | = Bncl TIAN 1- It 21-2+2 1- 1 = - → Pg pre . 4 ways = 14 / 22

  15. ( PIE ) The Principle of Inclusion-Exclusion A preview into the discrete probability section... Say we have n subsets of a space, A 1 , . . . , A n . � n � � � [ � = ( size-1 intersections ) − ( size-2 intersections ) A i � � � � � i = 1 + ( size-3 intersections ) − . . . M¥4 . ) - ( IANBHK It IAITIBITKIHDI = . + ( IAhDn4t . ) . . 15 / 22

  16. Intro to Combinatorial Proof: Binomial Coe ffi cients Powers of ( a + b ) : ( a + b ) 0 = I ( a + b ) 1 = at b ( a + b ) 2 = ( a + b )( a + b ) - at b. b a2t2abtb2 btb A At a - - - = . ( a + b ) 3 = ( a + b )( a + b )( a + b ) a. b t beat at a a. a. a - . = - - 3 ab Z b 3 a 2b a 3 3 t t t = ab aba a baa How about ( a + b ) n ? This is the Binomial Theorem . - i bi (7) an t (2) an -ib2+ - ' b ant (7) an - . . . - to ways - ya 's , # I a anagram in 16 / 22

  17. Pascal’s Triangle I " l ° I ( at b) = → ' ' b) ( at I 2 = I 4 = 1 0+0 8 k = I " E →N w I . end " , 5- → LEI Pil is , Pil LEI Ko ) symmetric I Observation #1: O Ot I Observation #2: ' ' o to powers of sum 2 rows I Observation #3: . 17 / 22

  18. Combinatorial Proof I Observation #1: Pascal’s Triangle is symmetric. � n � n � � In other words: = k n − k Algebraic Method: n ! ennui , ✓ Iink - Double-Counting Method ( “Combinatorial Proof” ): of members out LHS n Choosing k : team for my RHS team NOT on my : choosing - k members n . 18 / 22

  19. Combinatorial Proof II Observation #2: Adjacent elements sum to the element below. ① ① � n � n − 1 � n − 1 choose out of - l � � � In other words: = + → n k − 1 k k - I → whole n choosing n → @ team Algebraic Method: Try it yourself! Double-Counting Method ( “Combinatorial Proof” ): for of team k out M my LHS choose : . A member RHS team out single : Don 't A Have A Have - - people # A CNI ) a' ist ( ni E. already C. Moser 19 / 22

  20. Combinatorial Proof III Observation #3: Elements in row n sum to 2 n . In other words: P n � n � = 2 n i = 1 O i Algebraic Method: Don’t try this at home! Double-Counting Method ( “Combinatorial Proof” ): Mg )tkn ) CHI -1 : . . .tl/lg#ofofsYnbpeeotpPe , pick pick n separated pick by 1 pets people nobody size . 2. 2 2 X → × on team RHS or : per¥n pastel Pers # 2 - not on - - - team n . =L 20 / 22

  21. Another Combinatorial Proof IM � n 88¥ � n � n − 1 � n − 2 � k � � � � � From Notes: = + + + . . . + k + 1 k k k k - K choosing : Algebraic Method: Don’t try this at home! fewer I than Htt Double-Counting Method ( “Combinatorial Proof” ): . lktl ) of for team out N LHS people my choosing : . 2 ,N 1 in people Label RHS , : , - frome . . . . - . rest of team Choose " lowest # " I person ' people • chooser f # count " lowest of team rest choose " person 2 : from in . 3 , by . . - fn k people choose ' cases ! : " lowest - Ktl " person #n ( %=1 • th } { n K ktl . ,n n - - - , . . 21 / 22

  22. Summary I Other counting tools: casework, complements, symmetry... I Set theory is your friend! Principle of inclusion / exclusion I Counting problems will ask you to decide what tool to use and often combine strategies I Combinatorial proof: count the same thing in two ways! 22 / 22

Recommend


More recommend