CS2800-Counting_v.6

# CS2800-Counting_v.6 - Discrete Math CS 2800 Prof Bart...

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

1 Discrete Math CS 2800 Prof. Bart Selman [email protected] Module Counting Chapter 5, Rosen

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

View Full Document
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 3-colorable? 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 How can we figure that out?

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

View Full Document
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 non-9 as the first digit OR the non-9 as the second digit OR the non-9 as the third digit OR the non-9 as the fourth digit Thus, we use the sum rule For each of those cases, there are 9 possibilities for the non-9 digit (any number other than 9) Thus, the answer is 9+9+9+9 = 36

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

View Full Document
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

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

View Full Document
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
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). How many ways can each choice

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 01/16/2010 for the course CS 2800 at Cornell.

### Page1 / 61

CS2800-Counting_v.6 - Discrete Math CS 2800 Prof Bart...

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

View Full Document
Ask a homework question - tutors are online