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 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: 1 Discrete Math CS 280 Prof. Bart Selman [email protected] Module Counting Combinatorics Count the number of ways to put things together into various combinations. e.g. If a password is 6, 7, or 8 characters long; a character is an uppercase letters or a digit, and the password is required to include at least one digit  how many passwords can there be? Or, how many graphs are there on N nodes? How many of those are 3colorable? Many uses in discrete math (because of all the discrete strucures), including e.g. probability theory (next topic). E.g., what is the probability that a randomly generated graph is 3 colorable? First, two most basic rules: Sum rule Product rule How can we figure that out? Sum Rule Let us consider two tasks: m is the number of ways to do task 1 n is the number of ways to do task 2 Tasks are independent of each other, i.e., Performing task 1 does not accomplish task 2 and vice versa. Sum rule : the number of ways that either task 1 or task 2 can be done, but not both , is m + n . Generalizes to multiple tasks ... Task 1 Task 2 4 Example A student can choose a computer project from one of three lists. The three lists contain 23, 15, and 19 possible projects respectively. How many possible projects are there to choose from? 23+15+19 Ok not to worry. things will get more exciting... 5 Sum rule example How many strings of 4 decimal digits, have exactly three digits that are 9s? The string can have: The non9 as the first digit OR the non9 as the second digit OR the non9 as the third digit OR the non9 as the fourth digit Thus, we use the sum rule For each of those cases, there are 9 possibilities for the non9 digit (any number other than 9) Thus, the answer is 9+9+9+9 = 36 6 Set Theoretic Version If A is the set of ways to do task 1, and B the set of ways to do task 2, and if A and B are disjoint , then: the ways to do either task 1 or 2 are A B , and  A B  =  A  +  B  Product Rule Let us consider two tasks: m is the number of ways to do task 1 n is the number of ways to do task 2 Tasks are independent of each other, i.e., Performing task 1does not accomplish task 2 and vice versa. Product rule : the number of ways that both tasks 1 and 2 can be done in mn . Generalizes to multiple tasks ... task 1 task 2 8 Product rule example There are 18 math majors and 325 CS majors How many ways are there to pick one math major and one CS major? Total is 18 * 325 = 5850 Product Rule How many functions are there from set A to set B? A B To define each function we have to make 3 choices, one for each element of A. Each has 4 options (to select an element from B)....
View
Full
Document
This note was uploaded on 10/25/2009 for the course CS 2800 at Cornell.
 '07
 SELMAN

Click to edit the document details