1 The Pigeonhole Principle CS 202 Epp section ??? Aaron Bloomfield.

Slides:



Advertisements
Similar presentations
The Pigeon hole problem
Advertisements

The Pigeonhole Principle: Selected Exercises
The Pigeonhole Principle College of Information Technology & Design
The Pigeonhole Principle
CS Discrete Mathematical Structures
Epp, section 10.? CS 202 Aaron Bloomfield
COUNTING AND PROBABILITY
The Pigeonhole Principle
Advanced Counting Techniques Prof. Johnnie Baker
Quiz highlights Probability of the song coming up after one press: 1/N. Two times? Gets difficult. The first or second? Or both? USE THE MAIN HEURISTICS:
1 Discrete Math CS 2800 Prof. Bart Selman Module Counting Chapter 5, Rosen.
Discrete Structures Chapter 5 Pigeonhole Principle Nurul Amelina Nasharuddin Multimedia Department.
The Pigeonhole Principle
Copyright © Zeph Grunschlag, Counting Techniques Zeph Grunschlag.
CSE115/ENGR160 Discrete Mathematics 04/10/12
Pigeonhole.
Given three points of a circle: (-1,1), (7,-3), (-2,-6).
Recursive Definitions Rosen, 3.4 Recursive (or inductive) Definitions Sometimes easier to define an object in terms of itself. This process is called.
1 The Pigeonhole Principle CS/APMA 202 Rosen section 4.2 Aaron Bloomfield.
9/2/2015Discrete Structures1 Let us get into… Number Theory.
Fall 2015 COMP 2300 Discrete Structures for Computation
The Pigeonhole (Dirichlet’s box) Principle
Discrete Maths Objective to introduce some of the counting rules (product, sum, subtraction, division, pigeonhole) through examples , Semester 2,
Midpoint and Distance Formulas Section 1.3. Definition O The midpoint of a segment is the point that divides the segment into two congruent segments.
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.
Topics to be covered: Produce all combinations and permutations of sets. Calculate the number of combinations and permutations of sets of m items taken.
1 Lecture 3 (part 2) Functions – Pigeonhole Principle Reading: Epp Chp 7.4.
Fall 2002CMSC Discrete Structures1 One, two, three, we’re… Counting.
September1999 CMSC 203 / 0201 Fall 2002 Week #8 – 14/16 October 2002 Prof. Marie desJardins.
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
Elements of Combinatorics (Continuation) 1. Pigeonhole Principle Theorem. If pigeons are placed into pigeonholes and there are more pigeons than pigeonholes,
Symmetry Problem What is the sum of the values 1 to 100? Hint: Look for the symmetry!
Counting CSC-2259 Discrete Structures Konstantin Busch - LSU1.
CSNB143 – Discrete Structure
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,
CS 103 Discrete Structures Lecture 16
5.2 The Pigeonhole Principle
Discrete Structures Counting (Ch. 6)
Unit II Discrete Structures Relations and Functions SE (Comp.Engg.)
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 7 Functions Instructor: Hayk Melikyan Today we will review sections 7.3, 7.4 and 7.5.
1 Chapter 2 Pigeonhole Principle. 2 Summary Pigeonhole principle –simple form Pigeonhole principle –strong form Ramsey’s theorem.
1 The Pigeonhole Principle CS 202 Epp section 7.3.
2/24/20161 One, two, three, we’re… Counting. 2/24/20162 Basic Counting Principles Counting problems are of the following kind: “How many different 8-letter.
Introduction Suppose that a password on a computer system consists of 6, 7, or 8 characters. Each of these characters must be a digit or a letter of the.
Section 7.1. Probability of an Event We first define these key terms: An experiment is a procedure that yields one of a given set of possible outcomes.
Proof Review CS 202 Aaron Bloomfield Spring 2007.
The Pigeonhole Principle. Pigeonhole principle The pigeonhole principle : If k is a positive integer and k+1 or more objects are placed into k boxes,
Pigeonhole Principle – Page 1CPTR311 – Discrete Structures CPTR311 Discrete Structures Pigeonhole Principle Reading: Kolman, Section 3.3.
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.
Discrete Mathematics. Exercises Exercise 1:  There are 18 Computer Science (CS) majors and 325 Business Administration (BA) majors at a college.
Section The Pigeonhole Principle If a flock of 20 pigeons roosts in a set of 19 pigeonholes, one of the pigeonholes must have more than 1 pigeon.
Main Menu Main Menu (Click on the topics below) Pigeonhole Principle Example Generalized Pigeonhole Principle Example Proof of Pigeonhole Principle Click.
ICS 253: Discrete Structures I Counting and Applications King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Section The Product Rule  Example: How many different license plates can be made if each plate contains a sequence of three uppercase English letters.
COUNTING Discrete Math Team KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS ) 1.
Unit 8: Section 13.5 State and apply the midpoint formula
The Pigeonhole Principle
The Pigeonhole Principle
The Pigeonhole Principle
CS 2210 Discrete Structures Counting
Xuan Guo Lab 9 Xuan Guo
CS100: Discrete structures
The Pigeonhole Principle
CS 220: Discrete Structures and their Applications
The Pigeonhole (Dirichlet’s box) Principle
Counting techniques Basic Counting Principles, Pigeonhole Principle, Permutations and Combinations.
The Pigeonhole Principle
The Pigeon hole problem
Pigeon-Hole Principle ( PHP )
Presentation transcript:

1 The Pigeonhole Principle CS 202 Epp section ??? Aaron Bloomfield

2 The pigeonhole principle Suppose a flock of pigeons fly into a set of pigeonholes to roost If there are more pigeons than pigeonholes, then there must be at least 1 pigeonhole that has more than one pigeon in it If k+1 or more objects are placed into k boxes, then there is at least one box containing two or more of the objects This is Theorem 1 This is Theorem 1

3 Pigeonhole principle examples In a group of 367 people, there must be two people with the same birthday As there are 366 possible birthdays As there are 366 possible birthdays In a group of 27 English words, at least two words must start with the same letter As there are only 26 letters As there are only 26 letters

4 Generalized pigeonhole principle If N objects are placed into k boxes, then there is at least one box containing  N/k  objects This is Theorem 2 This is Theorem 2

5 Generalized pigeonhole principle examples Among 100 people, there are at least  100/12  = 9 born on the same month How many students in a class must there be to ensure that 6 students get the same grade (one of A, B, C, D, or F)? The “boxes” are the grades. Thus, k = 5 The “boxes” are the grades. Thus, k = 5 Thus, we set  N/5  = 6 Thus, we set  N/5  = 6 Lowest possible value for N is 26 Lowest possible value for N is 26

6 Sample questions A bowl contains 10 red and 10 yellow balls a)How many balls must be selected to ensure 3 balls of the same color? One solution: consider the “worst” case One solution: consider the “worst” case Consider 2 balls of each color You can’t take another ball without hitting 3 Thus, the answer is 5 Via generalized pigeonhole principle Via generalized pigeonhole principle How many balls are required if there are 2 colors, and one color must have 3 balls? How many pigeons are required if there are 2 pigeon holes, and one must have 3 pigeons? number of boxes: k = 2 We want  N/k  = 3 What is the minimum N? N = 5

7 Sample questions A bowl contains 10 red and 10 yellow balls b)How many balls must be selected to ensure 3 yellow balls? Consider the “worst” case Consider the “worst” case Consider 10 red balls and 2 yellow balls You can’t take another ball without hitting 3 yellow balls Thus, the answer is 13

8 Sample questions 6 computers on a network are connected to at least 1 other computer Show there are at least two computers that are have the same number of connections The number of boxes, k, is the number of computer connections This can be 1, 2, 3, 4, or 5 This can be 1, 2, 3, 4, or 5 The number of pigeons, N, is the number of computers That’s 6 That’s 6 By the generalized pigeonhole principle, at least one box must have  N/k  objects  6/5  = 2  6/5  = 2 In other words, at least two computers must have the same number of connections In other words, at least two computers must have the same number of connections

9 Sample questions Consider 5 distinct points (x i, y i ) with integer values, where i = 1, 2, 3, 4, 5 Show that the midpoint of at least one pair of these five points also has integer coordinates Thus, we are looking for the midpoint of a segment from (a,b) to (c,d) The midpoint is ( (a+c)/2, (b+d)/2 ) The midpoint is ( (a+c)/2, (b+d)/2 ) Note that the midpoint will be integers if a and c have the same parity: are either both even or both odd Same for b and d Same for b and d There are four parity possibilities (even, even), (even, odd), (odd, even), (odd, odd) (even, even), (even, odd), (odd, even), (odd, odd) Since we have 5 points, by the pigeonhole principle, there must be two points that have the same parity possibility Thus, the midpoint of those two points will have integer coordinates Thus, the midpoint of those two points will have integer coordinates