l15_counting3

# l15_counting3 - 6.042/18.062J Mathematics for Computer...

This preview shows pages 1–4. Sign up to view the full content.

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

View Full Document

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 6.042/18.062J Mathematics for Computer Science April 5, 2005 Srini Devadas and Eric Lehman Lecture Notes Counting III Today we’ll brieﬂy review some facts you dervied in recitation on Friday and then turn to some applications of counting. 1 The Bookkeeper Rule In recitation you learned that the number of ways to rearrange the letters in the word BOOKKEEPER is: total letters 10! 1! 2! 2! 3! 1! 1! B’s O’s K’s E’s P’s R’s This is a special case of an exceptionally useful counting principle. Rule 1 (Bookkeeper Rule). The number of sequences with n 1 copies of l 1 , n 2 copies of l 2 , . . . , and n k copies of l k is ( n 1 + n 2 + . . . + n k )! n 1 ! n 2 ! . . . n k ! provided l 1 , . . . , l k are distinct. Let’s review some applications and implications of the Bookkeeper Rule. 1.1 20-Mile Walks I’m planning a 20 miles walk, which should include 5 northward miles, 5 eastward miles, 5 southward miles, and 5 westward miles. How many different walks are possible? There is a bijection between such walks and sequences with 5 N’s, 5 E’s, 5 S’s, and 5 W’s. By the Bookkeeper Rule, the number of such sequences is: 20! 5! 4 2 Counting III 1.2 Bit Sequences How many n-bit sequences contain exactly k ones? Each such sequence also contains n − k zeroes, so there are n ! k ! ( n − k )! by the Bookkeeper Rule. 1.3 k-element Subsets of an n-element Set How many k-elements subsets of an n-element set are there? This question arises all the time in various guises: • In how many ways can I select 5 books from my collection of 100 to bring on vaca- tion? • How many different 13-card Bridge hands can be dealt from a 52-card deck? • In how many ways can I select 5 toppings for my pizza if there are 14 available? There is a natural bijection between k-element subsets of an n-element set and n-bit sequences with exactly k ones. For example, here is a 3-element subset of { x 1 , x 2 , . . . , x 8 } and the associated 8-bit sequence with exactly 3 ones: x 1 , x 4 , x 5 } { ( 1 , , , 1 , 1 , , , 0 ) Therefore, the answer to this problem is the same as the answer to the earlier question about bit sequences. Rule 2 (Subset Rule). The number of k-element subsets of an n-element set is: n ! n = k ! ( n − k )! k The factorial expression in the Subset Rule comes up so often that there is a shorthand, . This is read “ n choose k ” since it denotes the number of ways to choose k items from among n . We can immediately knock off all three questions above using the Sum Rule: • I can select 5 books from 100 in 100 ways. 5 • There are 52 different Bridge hands. 13 n k Counting III 3 • There are 14 different 5-topping pizzas, if 14 toppings are available....
View Full Document

{[ snackBarMessage ]}

### Page1 / 15

l15_counting3 - 6.042/18.062J Mathematics for Computer...

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

View Full Document
Ask a homework question - tutors are online