mat55-counting

# mat55-counting - Lecture notes on counting used in CS 70...

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

Lecture notes on counting, used in CS 70 Fall 2001 (Paraphrased from Prof. Demmel’s Math 55 Lecture notes #15, #17) Review Counting Principles 1) The Sum Rule: If S1 and S2 are disjoint sets, then the number of members of S1 U S2 is |S1 U S2| = |S1| + |S2| 2) Inclusion-Exclusion Principle: If S1 and S2 are arbitrary sets, then |S1 U S2| = |S1| + |S2| - |S1 inter S2| 3) The Product Rule: If S1 and S2 are sets, and S1 x S2 ={(s1,s2) : s1 in S1 and s2 in S2} is the Cartesian product of S1 and S2, then |S1 x S2| = |S1| x |S2| If S1, S2, . .. , Sk are sets, S1 x S2 x . .. Sk the Cartesian product, then |S1 x . .. x Sk| = |S1| x . .. x |Sk| 4) Tree diagrams EX: How many bit strings of length 4 without two consecutive zeros? Ans: 8; Enumerate all possibilities in a tree: Legal bit strings 0 - 1 0101 / / 0 0110 0 - 1 - 1 - 1 0111 / / 0 1010 / 0 - 1 - 1 1011 / / 0 - 1 1101 / / / / 0 1110 x -----1 - 1 - 1 - 1 1111 Bit # 1 2 3 4 Tree Diagrams (formally) Draw a tree where the children of each node represent all the possible values of the next entry EX: How many 2-out-of-3 game playoffs are there? Ans: 6 Winner sequence Winner b bb b / / b bab b b - a - a baa a / / b abb b / / b - a aba a x -- a - a aa a (5) Pigeonhole Principle: If k+1 or more objects (pigeons) are placed in k boxes (holes), then at least one box contains 2 or more objects. (proof by contradition: if each box had at most one object, there would only be k or fewer objects, a contradiction) EX: In any group of 27 English words, at 2 begin with the same letter, since there are only 26 letters.

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

View Full Document
7) Permuations DEF: a permutation of a set S of n distinct objects is an ordered list of these objects DEF: an r-permutation is an ordered list of r elements of S
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 4

mat55-counting - Lecture notes on counting used in CS 70...

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

View Full Document
Ask a homework question - tutors are online