140 likes | 274 Views
Introduction to Combinatorics. CSC 333 Discrete Mathematics. Counting Mechanisms. We in computer science often need to count things . . . Some Techniques: Multiplication Principle Addition Principle Using them together. Multiplication Principle.
E N D
Introduction to Combinatorics CSC 333 Discrete Mathematics
Counting Mechanisms • We in computer science often need to count things . . . • Some Techniques: • Multiplication Principle • Addition Principle • Using them together. CSC 333
Multiplication Principle • If there are n1 possible outcomes for a first event and n2 possible outcomes for a second event, there are n1 x n2 possible outcomes for the sequence of the two events. • Example: How many unique 4-digit numbers are possible? CSC 333
Multiplication Principle • Practice 22? • See Example 28. • Note: |S| denotes the number of elements in the finite set S. CSC 333
Addition Principle • If A and B are disjoint events with n1 and n2 possible outcomes, respectively, then the total number of possible outcomes for event “A or B” is n1 + n2. • See Example 30. • Suppose the customer wants to buy a truck AND a car. CSC 333
Addition Principle • If A and B are disjoint finite sets, then |A U B| = |A| + |B| • Also see Example 32. CSC 333
Using the Addition and Multiplication Principles together • See Example 34. • Practice 23? • Multiple approaches are possible. • See Example 35. • At least 3 approaches to Example 36. CSC 333
Inclusion and Exclusion And The Pigeonhole Principle
Operating Principles: • A and B are subsets of universal set S. • It is true that A - B, B - A, and A ∩ B are disjoint sets (with no common elements). • It is shown that |A U B| = |A| + |B| - |A ∩ B|(common sense) and |A ∩ B| = |A| + |B| - |A U B| CSC 333
Extension to Three Sets • See Equation 3, p. 226, and Figure 3.7 CSC 333
THE Principle of Inclusion and Exclusion: • See p. 228. • Note the mathematical description at bottom of page preceded by an explanatory narrative. CSC 333
The Pigeonhole Principle • If more than k items are placed into k bins, then at least one bin contains more than one item. • See Example 43. • Practice 29? CSC 333
Summary of Counting Mechanisms • Multiplication Principle • Addition Principle • Combination of above • Principle of Inclusion and Exclusion • Pigeonhole Principle CSC 333