{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Unit 9 Combinatorics

Unit 9 Combinatorics - Combinatorics Introduction...

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

View Full Document Right Arrow Icon
1 Combinatorics Combinatorics is the study of the arrangement of discrete objects Who Cares? Counting is important whenever we have finite resources Examples: Words of memory needed to store … Instructions needed to solve … Number of hits per second supported by … A password must be between six and eight characters long. The characters can be a digit or a letter (case sensitive). Each password must include at least one digit. How many passwords can we support? Introduction Summation Notation Summation Properties Summation Formulas = + + + = n i n i a a a a 1 2 1 L = = * = * n i i n i i a a c c 1 1 ( ) = = = ± = ± n i i n i i n i i i b a b a 1 1 1 = = n i n 1 1 = + + = n i n n n i 1 2 6 ) 1 2 )( 1 ( = + = n i n n i 1 2 ) 1 ( + = = n i n n i 1 2 2 3 4 ) 1 ( Useful Counting Cheat Sheet
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
2 Product Rule If you have two sets, A & B, |A × B| = |A| * |B| Example: How many different bit strings are there of length seven? Answer: 2 7 Extends (by induction) to sequence of n sets Sum Rule If you have two disjoint sets, A & B, |A B| = |A| + |B| Example: How many ways are there to elect an ACM president if the president must be a CS faculty member (from 8) or a CS major (from 250)? Answer: 258 Extends (by induction) to n mutually exclusive sets Basic Counting Principles Inclusion-Exclusion Rule If you have two arbitrary sets, A & B, |A B| = |A| + |B| - |A B| Example: How many bit strings of length eight start with a 1 or end with the two bits 00? Answer: 2 7 + 2 6 – 2 5 = 160 Subsumes the Sum Rule Extends (by induction) to n arbitrary sets (see p. 205 of text) Consider Venn Diagram Basic Counting Principles Extended Example: Internet Address (IPv4) Sample: 137.28.109.33 (data.cs.uwec.edu) Translation: 32-bits 10001001 00011100 01101101 00100001 Interpretation Restrictions – 1111111 not available as netid of Class A network All 0 s or all 1 s are not allowed as any hostid How many possible computer Internet addresses? Note, netid for Class A is 7 bits long, netid for Class B is 14 bits long, and netid for Class C is 21 bits long if you can’t tell from the above picture.
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 ]}