This preview shows pages 1–6. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Counting Discrete Math MATH 135 David Oury Counting Discrete Math MATH 135 David Oury December 7, 2011 Chapter 5, Sections 1, 2, 3, 4 (four lectures) of Discrete Mathematics and its Applications, by Rosen (Chapter 6 same sections 7/e) Counting Discrete Math MATH 135 David Oury Sum and product rules I Rule of product A task T is broken up into two subtasks T 1 ,T 2 where subtask T 1 can be completed in n 1 ways and subtask T 2 can be completed in n 2 ways. Then there are n 1 * n 2 ways to complete task T . Use trees to demonstrate this. Counting Discrete Math MATH 135 David Oury Sum and product rules II Product examples How many bit strings are there with 8 digits? 2 8 . How many 8 character passwords starting with a letter? How many functions are there with domain of n elements and codomain of m elements? There are m n functions. Each of the n elements in the domain can be sent to any in the m elements of the codomain. There are m!/n! injective functions from a set of n elements to a set of m elements (as long as n ≤ m .) There are m choices for the first of the n elements, m 1 for the second and n m + 1 for the last. Number of operations performed within nested for loops. Counting Discrete Math MATH 135 David Oury Principle of inclusion/exclusion I Rule of sum If a task can be accomplished in either one of n 1 ways or one of n 2 ways then the task can be accomplished in one of n 1 + n 2 ways. Equivalently, suppose a set is the union of two subsets with n 1 elements and n 2 elements, respectively, with no common elements. Then the original set has n 1 + n 2 elements. Principle of inclusion/exclusion For two finite sets A and B then  A ∪ B  =  A  +  B    A ∩ B  Counting Discrete Math MATH 135 David Oury Principle of inclusion/exclusion II Examples How many bit strings of length n either start with “1” or end with “00”? The number of bit strings which start with “1”is 2 n 1 , the number that end with “00” is 2 n 2 and the number that start with “1” and end with “00” is 2 n 3 . So our answer is 2 n 1 + 2 n 2 2 n 3 . How many numbers from 1 to 100 are divisible by 4 or by 5? There are 25 divisible by 4, are 20 divisible by 5 and are 5 divisible by 20. So there are 40 divisible by either 4 or 5....
View
Full
Document
This note was uploaded on 02/11/2012 for the course MATH 135 taught by Professor Dr.oury during the Spring '12 term at MO St. Louis.
 Spring '12
 Dr.Oury
 Math, Product Rule, Counting

Click to edit the document details