lecture06 - 9/15/2011 15-251 15-251 Great Theoretical Ideas...

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

View Full Document Right Arrow Icon
9/15/2011 1 15-251 Great Theoretical Ideas in Computer Science 15-251 Counting for Computer Scientists Lecture 6 (September 14, 2011) Counting I: One-To-One Correspondence and Choice Trees In the next three lectures we will learn some fundamental counting methods. Addition and Product Rules The Principle of Inclusion-Exclusion Choice Trees Permutations and Combinations The Binomial Theorem The Pigeonhole Principle Diophantine Equations Generating Functions If I have 14 teeth on the top and 12 teeth on the bottom, how many teeth do I have in all? A B A B = + Addition Rule Let A and B be two disjoint finite sets
Background image of page 1

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

View Full DocumentRight Arrow Icon
9/15/2011 2 Addition of Multiple Disjoint Sets: Let A 1 , A 2 , A 3 , …, A n be disjoint, finite sets: A A i i i=1 n i n = = 1 Addition Rule (2 Possibly Overlapping Sets) Let A and B be two finite sets: |A| + |B| - |A B| |A B| = Inclusion-Exclusion If A, B, C are three finite sets, what is the size of (A B C) ? |A| + |B| + |C| - |A B| - |A C| - |B C| + |A B C| Inclusion-Exclusion If A 1 , A 2 , …, A n are n finite sets, what is the size of (A 1 A 2 A n ) ? i |A i | - i < j |A i A j | + i < j < k |A i A j A k | + (-1) n-1 |A 1 A 2 A n | Partition Method A A i i i=1 n i n = = 1 To count the elements of a finite set S, partition the elements into non-overlapping subsets A 1 , A 2 , A 3 , …, A n . S = all possible outcomes of one white die and one black die. Partition Method
Background image of page 2
9/15/2011 3 Each of 6 disjoint set have size 6 = 36 outcomes Partition S into 6 sets: S = all possible outcomes of one white die and one black die. Partition Method A 1 = the set of outcomes where the white die is 1. A 2 = the set of outcomes where the white die is 2. A 3 = the set of outcomes where the white die is 3. A 4 = the set of outcomes where the white die is 4. A 5 = the set of outcomes where the white die is 5. A 6 = the set of outcomes where the white die is 6. S = all possible outcomes where the white die and the black die have different values Partition Method A i set of outcomes where black die says i and the white die says something else. S Set of all outcomes where the dice show different values. S = ? | S | = i = 1 6 | A i | = i = 1 6 5 = 30 | S B | = # of outcomes = 36 |S| + |B| = 36 |B| = 6 |S| = 36 – 6 = 30 B set of outcomes where dice agree. S Set of all outcomes where the dice show different values. S = ? Difference Method To count the elements of a finite set S, find two sets A and B such that S and B are disjoint and S B = A then |S| = |A| - |B| S Set of all outcomes where the black die shows a smaller number than the white die. S = ? A
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/03/2011 for the course CS 251 taught by Professor Gupta during the Spring '11 term at Carnegie Mellon.

Page1 / 13

lecture06 - 9/15/2011 15-251 15-251 Great Theoretical Ideas...

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

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