Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 23022 Discrete Mathematical Structures Mehdi Ghayoumi MSB rm 132 Ofc hr: Thur, 9:30-11:30a.

Similar presentations


Presentation on theme: "CS 23022 Discrete Mathematical Structures Mehdi Ghayoumi MSB rm 132 Ofc hr: Thur, 9:30-11:30a."— Presentation transcript:

1 CS 23022 Discrete Mathematical Structures Mehdi Ghayoumi MSB rm 132 mghayoum@cs.kent.edu Ofc hr: Thur, 9:30-11:30a

2 Announcements Homework 6 available. Due 07/10, 8a. Today’s lecture covers material from Rosen, sections 6.2-6.3.

3 Counting Suppose you have 4 shirts, 3 pairs of pants, and 2 pairs of shoes. How many different outfits do you have? Product Rule

4 The Product Rule

5 Example of Product Rule

6 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. How many ways can each choice be made? 44 4 64

7 Product Rule How many one-to-one 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. How many ways can each choice be made? 43 2 24

8 Example of Product Rule How many Strings of 4 decimal digits… a)Do not contain the same digit twice? b)End with an odd digit? c)Start with an even digit? How many Strings of 4 digits… a)Do not contain the same digit twice? b)End with an odd digit? c)Start with an even digit?

9 The Sum Rule

10 Example of Sum Rule

11 Pigeonhole Principle If n pigeon fly into k pigeonholes and k < n, then some pigeonhole contains at least two pigeons.

12 Pigeonhole Principle If n pigeons fly into k pigeonholes and k < n, then some pigeonhole contains at least two pigeons. We can use this simple little fact to prove amazingly complex things.

13 Pigeonhole Principle Let S contain any 6 positive integers. Then, there is a pair of numbers in S whose difference is divisible by 5. Let S = {a 1,a 2,a 3,a 4,a 5,a 6 }. Each of these has a remainder when divided by 5. What can these remainders be? 0, 1, 2, 3, or 4 6 numbers, 5 possible remainders…what do we know?

14 Pigeonhole Principle 6 numbers, 5 possible remainders…what do we know? Some pair has the same remainder, by PHP. Consider that pair, a i and a j, and their remainder r. a i = 5m + r, and a j = 5n + r. Their difference: a i - a j = (5m + r) - (5n + r) = 5m - 5n = 5(m-n), which is divisible by 5.

15 Generalized Pigeonhole Principle If N objects are placed in k boxes, then there is at least one box containing at least N/k =˥ objects. Example 1. In a class of 73 students, there are at least ? who are born in the same month. Example 2. How many student in a class must there be to ensure that 6 student get the same grade(one of A,B,C,D or F)?

16 More applications of pigeonhole principle A bowl contain 10 red and 10 yellow balls How many balls must be selected to ensure 3 yellow balls? Consider the worst case: Consider 10 red balls and 2 yellow balls, Answer?

17 Permutations There are basically two types of permutation: 1.Repetition is Allowed: such as 4 digits above. It could be "3333". 1.No Repetition: such as 4 digits above. It could be "3624".

18 Permutations with Repetition When we have n things to choose from... then we have n choices each time! When choosing r of them, the permutations are: n × n ×... (r times) (In other words, there are n possibilities for the first choice, THEN there are n possibilites for the second choice, and so on, multplying each time.) Which is easier to write down using an exponent of r:exponent n × n ×... (r times) = n r

19 Permutations with Repetition Example: in a lock, there are 10 numbers to choose from (0,1,...9) and we choose 3 of them: 10 × 10 ×... (3 times) = 10 3 = 1,000 permutations nrnr where n is the number of things to choose from, and we choose r of them (Repetition allowed, order matters) So, the formula is simply:

20 Permutations without Repetition In this case, we have to reduce the number of available choices each time. So, our first choice would have 10 possibilites, and our next choice would then have 9 possibilities, then 8, 7, etc. And the total permutations would be: 10 × 9 × 8 × 7 ×... ×2 ×1 = … But maybe we don't want to choose them all, just 3 of them, so that would be only: 10 × 9 × 8 = 720 In other words, there are 720 different ways that 3 digits code could be selected out of 10 digits.

21 Permutations without Repetition For example, what order could 16 pool balls be in? After choosing, say, number "14" we can't choose it again But how do we write that mathematically? Answer: we use the "factorial function"factorial function So, if we wanted to select all of the billiard balls the permutations would be: 16! = 20,922,789,888,000 But if we wanted to select just 3, then we have to stop the multiplying after 14. How do we do that? There is a neat trick... we divide by 13!... Do you see? 16! / 13! = 16 × 15 × 14

22 Permutations without Repetition How many ways can first and second place be awarded to 10 people? Our "order of 3 out of 16 pool balls example" would be:

23 Permutations In a running race of 12 sprinters, each of the top 5 finishers receives a different medal. How many ways are there to award the 5 medals? a)60 b)12 5 c)12!/7! d)5 12 e)No clue 12 111098 A permutation is an ordered arrangement of objects. The number of permutations of r distinct objects chosen from n distinct objects is denoted P(n,r). P(n,r) = n! / (n-r)!

24 Permutations Suppose you have time to listen to 10 songs on your daily jog around campus. There are 6 Cake tunes, 8 Moby tunes, and 3 Eagles tunes to choose from. How many different jog playlists can you make? P(17,10) = 17x16x15x14x13x12x11

25 Permutations Suppose you have time to listen to 10 songs on your daily jog around campus. There are 6 Cake tunes, 8 Moby tunes, and 3 Eagles tunes to choose from. Now suppose you want to listen to 4 Cake, 4 Moby, and 2 Eagles tunes, in that band order. How many playlists can you make? P(6,4) x P(8,4) x P(3,2)

26 Permutations Suppose you have time to listen to 10 songs on your daily jog around campus. There are 6 Cake tunes, 8 Moby tunes, and 3 Eagles tunes to choose from. Finally, suppose you still want 4 Cake, 4 Moby, and 2 Eagles tunes, and the order of the groups doesn’t matter, but you get dizzy and fall down if all the songs by any one group aren’t played together. How many playlists are there now? P(6,4) x P(8,4) x P(3,2) x 3!

27


Download ppt "CS 23022 Discrete Mathematical Structures Mehdi Ghayoumi MSB rm 132 Ofc hr: Thur, 9:30-11:30a."

Similar presentations


Ads by Google