dm-lec19-counting - Generating Combinations[Algorithm 6.4.9...

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

View Full Document Right Arrow Icon
Counting Methods The Pigeonhole Principle & The Pigeonhole Principle Chapter 6 p (6.8 Pigeonhole Principle) ctober 16, 2009 October 16, 2009 Generating Combinations [Algorithm 6.4.9] • Input: r n , • Output: ll all r-combinations f {1,2,…,n} of {1,2,…,n} in increasing lexicographic order. 2 Generating Permutations • In increasing lexicographic order •E x am p l e – What is the string follows 163542 ? 164235 [email protected] CS204 Discrete Math (Fall 2009) 3 enerating the next largest bit string • Generating the next largest bit string Input: b - b - … b b (not equal to 11…11) n 1 n 2 1 0 i=0 while b i =1 { 0 b i = 0; i=i+1 ; } b i =1; • Generating the next r-combination in l xicographic order e cog ap c o de • Generating the next largest permutation in lexicographic order gp [email protected] CS204 Discrete Math (Fall 2009) 4
Background image of page 1

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

View Full Document Right Arrow Icon
A simple fact about functions etween finite sets between finite sets A and B are finite sets with |A| > |B|, no If A and B are finite sets with |A| |B|, no function f: A B can be one-to-one.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 3

dm-lec19-counting - Generating Combinations[Algorithm 6.4.9...

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

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