lecture07 - Great Theoretical Ideas In Computer Science A....

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Counting II: Pigeons, Pirates, and Binomials Great Theoretical Ideas In Computer Science A. Gupta V. Guruswami CS 15-251 Fall 2011 Lecture 7 September 20, 2011 Carnegie Mellon University + + ( ) + ( ) = ? Plan Multinomial coefficients Pirates and Gold Pigeonhole Principle Pascal’s Triangle Combinatorial Proofs Manhattan Walk Permutations vs. Combinations n! (n-r)! n! r!(n-r)! = n r Ordered Unordered Subsets of r out of n distinct objects = P(n,r) How many ways to rearrange the letters in the word “SYSTEMS” ? SYSTEMS 7 places to put the Y, 6 places to put the T, 5 places to put the E, 4 places to put the M, and the S’s are forced 7 X 6 X 5 X 4 = 840 _,_,_,_,_,_,_ SYSTEMS Let’s pretend that the S’s are distinct: S 1 Y S 2 TEM S 3 There are 7! permutations of S 1 Y S 2 TEM S 3 But when we stop pretending we see that we have counted each arrangement of SYSTEMS 3! times, once for each of 3! rearrangements of S 1 S 2 S 3 7! 3! = 840
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Arrange n symbols: r 1 of type 1, r 2 of type 2, …, r k of type k n r 1 n-r 1 r 2 n - r 1 - r 2 - - r k-1 r k n! (n-r 1 )!r 1 ! (n-r 1 )! (n-r 1 -r 2 )!r 2 ! = = n! r 1 !r 2 ! … r k ! How many ways to rearrange the letters in the word “CARNEGIEMELLON” ? 14! 2!3!2! = 3,632,428,800 Multinomial Coefficients ! !...r r ! r n! n r ... r r if 0, r ;...; r ; r n k 2 1 k 2 1 k 2 1 Four ways of choosing We will choose 2-letters word from the alphabet (L,U,C,K,Y} 1) no repetitions, the order is NOT important LU = UL 2 5 Four ways of choosing We will choose 2-letters word from the alphabet (L,U,C,K,Y} 2) P(5,2) no repetitions, the order is important LU != UL P(n,r)=n*(n- 1)*…*(n -r+1) Four ways of choosing We will choose 2-letters word from the alphabet (L,U,C,K,Y} 3) 5 2 =25 with repetitions, the order is important
Background image of page 2
3 Four ways of choosing We will choose 2-letter words from the alphabet {L,U,C,K,Y} 4) ???? repetitions, the order is NOT important + |{LL,UU,CC,KK,YY}| = 15 2 5 5 distinct pirates want to divide 20 identical, indivisible bars of gold. How many different ways can they divide up the loot? Sequences with 20 G’s and 4 /’s 1st pirate gets 2 2 nd pirate gets 1 3 rd gets nothing 4 th gets 16 5 th gets 1 GG / G // GGGGGGGGGGGGGGGG / G represents the following division among the pirates Sequences with 20 G’s and 4 /’s GG / G // GGGGGGGGGGGGGGGG / G In general, the j th pirate gets the number of G’s after the j -1 st / and before the j th / . This gives a correspondence between divisions of the gold and sequences with 20 G’s and 4 / ’s. How many different ways to divide up the loot? 24 4 20 5 -1 How many sequences with 20 G’s and 4 /’s? How many different ways can n distinct pirates divide k identical, indivisible bars of gold? k 1 k n 1 - n 1 - k n
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 How many different ways to put k indistinguishable balls into n distinguishable urns.
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 13

lecture07 - Great Theoretical Ideas In Computer Science A....

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online