CS Discrete Mathematical Structures

Slides:



Advertisements
Similar presentations
TWO STEP EQUATIONS 1. SOLVE FOR X 2. DO THE ADDITION STEP FIRST
Advertisements

Opening Objective By the end of this PowerPoint you should be able to:
The Pigeonhole Principle:
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
1. x - 5 = x + 12= – 3x = = -10.
0 - 0.
DIVIDING INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
SUBTRACTING INTEGERS 1. CHANGE THE SUBTRACTION SIGN TO ADDITION
MULT. INTEGERS 1. IF THE SIGNS ARE THE SAME THE ANSWER IS POSITIVE 2. IF THE SIGNS ARE DIFFERENT THE ANSWER IS NEGATIVE.
Addition Facts
The Pigeon hole problem
Multiplication and Division
CSC 2510 Test 3 1. Give the names of the formula or rule that provides the answer for each of the following problems. Do not try to solve the problems!
HAWKES LEARNING SYSTEMS Students Matter. Success Counts. Copyright © 2013 by Hawkes Learning Systems/Quant Systems, Inc. All rights reserved. Section 4.5.
1 Basics of Counting CS/APMA 202 Epp sections 6.2 & 6.3 Aaron Bloomfield.
22C:19 Discrete Math Counting Fall 2011 Sukumar Ghosh.
DIVISIBILITY, FACTORS & MULTIPLES
9.5 Counting Subsets of a Set: Combinations
Counting. Counting in Algorithms How many comparisons are needed to sort n numbers? How many steps to compute the GCD of two numbers ? How many steps.
Copyright © 2002 by Radhika Nagpal and Charles E. Leiserson. All rights reserved. October 30, L9-2.1 Mathematics for Computer Science MIT 6.042J/18.062J.
Basic Permutations and Combinations
Chapter 10 Counting Techniques.
Lecture 4 4.1,4.2 Counting. 4.1 Counting Two Important Principles: Product Rule and Sum Rule. Product Rule: Assume we need to perform procedure 1 AND.
Counting. Counting = Determining the number of elements of a finite set.
Fraction XI Adding Mixed Numbers With Unlike Denominators
The Pigeonhole Principle
CS1022 Computer Programming & Principles
“The factorial of n is denoted by n! and calculated by the product of integer numbers from 1 to n”  For n>0, n! = 1×2×3×4×...×n  For n=0, 0! = 1 Huh?
Addition 1’s to 20.
Graphical Analysis of Motion
Test B, 100 Subtraction Facts
11 = This is the fact family. You say: 8+3=11 and 3+8=11
Week 1.
Lecture 12 Permutations and Combinations CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Bottoms Up Factoring. Start with the X-box 3-9 Product Sum
a*(variable)2 + b*(variable) + c
Chapter 5 Relations and Functions
The Nature of Mathematical Reasoning
COUNTING AND PROBABILITY
Combinations, Permutations, and the Fundamental Counting Principle.
The Pigeonhole Principle
CSE 321 Discrete Structures Winter 2008 Lecture 16 Counting.
1 The Pigeonhole Principle CS/APMA 202 Rosen section 4.2 Aaron Bloomfield.
CS Discrete Mathematical Structures Mehdi Ghayoumi MSB rm 132 Ofc hr: Thur, 9:30-11:30a.
CS100 : Discrete Structures
6.2 Find Probability Using Permutations. Vocabulary n factorial: product of integers from 1 to n, written as n! 0! = 1 Permutation: arrangement of objects.
Counting. Why counting  Determine the complexity of algorithms To sort n numbers, how many instructions are executed ?  Count the number of objects.
Counting. Product Rule Example Sum Rule Pigeonhole principle If there are more pigeons than pigeonholes, then there must be at least one pigeonhole.
A Permutation is an ordered combination. To help you to remember, think "Permutation... Position"
Elements of Combinatorics (Continuation) 1. Pigeonhole Principle Theorem. If pigeons are placed into pigeonholes and there are more pigeons than pigeonholes,
CSNB143 – Discrete Structure Topic 6 – Counting Techniques.
Algebra II 10.1: Apply the Counting Principle and Permutations HW: HW: p (6, 10, 14, 16, 26, 28, 34, all) Quiz : Friday, 12/13.
The Pigeonhole Principle. The pigeonhole principle Suppose a flock of pigeons fly into a set of pigeonholes to roost If there are more pigeons than pigeonholes,
Discrete Structures Counting (Ch. 6)
Counting Techniques. Multiplication Principle (also called the Fundamental Counting Principle) Combinations Permutations Number of subsets of a given.
EXAMPLE 2 Use a permutations formula Your band has written 12 songs and plans to record 9 of them for a CD. In how many ways can you arrange the songs.
1 The Pigeonhole Principle CS 202 Epp section 7.3.
1 The Pigeonhole Principle CS 202 Epp section ??? Aaron Bloomfield.
Pigeonhole Principle. If n pigeons fly into m pigeonholes and n > m, then at least one hole must contain two or more pigeons A function from one finite.
Operations on Sets Union of Sets Intersection of Sets
Algebra II 10.1: Apply the Counting Principle and Permutations.
COUNTING Discrete Math Team KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS ) 1.
Permutations & Combinations
The Pigeonhole Principle
Discrete Structures for Computer Science
CS 2210 Discrete Structures Counting
CS100: Discrete structures
The Pigeonhole Principle
Presentation transcript:

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

Announcements Homework 6 available. Due 07/10, 8a. Today’s lecture covers material from Rosen, sections 6.2-6.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

The Product Rule

Example of Product Rule

How many functions are there from set A to set B? Product Rule How many functions are there from set A to set B? 64 B A To define each function we have to make 3 choices, one for each element of A. How many ways can each choice be made? 4

How many one-to-one functions are there from set A to set B? Product Rule How many one-to-one functions are there from set A to set B? 24 B A To define each function we have to make 3 choices, one for each element of A. How many ways can each choice be made? 4 3 2

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

The Sum Rule

Example of Sum Rule

Pigeonhole Principle If n pigeon 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. Pigeonhole Principle We can use this simple little fact to prove amazingly complex things. If n pigeons fly into k pigeonholes and k < n, then some pigeonhole contains at least two pigeons.

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 = {a1,a2,a3,a4,a5,a6}. 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?

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

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)?

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?

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

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: n × n × ... (r times) = nr

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) = 103 = 1,000 permutations So, the formula is simply: nr where n is the number of things to choose from, and we choose r of them (Repetition allowed, order matters)

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.

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" 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

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

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? 12 11 10 9 8 60 125 12!/7! 512 No clue 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)!

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

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)

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!