SlideShare a Scribd company logo
1 of 14
1
The Pigeonhole
Principle
CS/APMA 202
Rosen section 4.2
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
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
In a group of 27 English words, at least
two words must start with the same letter
 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
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
 Thus, we set N/5 = 6
 Lowest possible value for N is 26
6
Rosen, section 4.2, question 4
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
Consider 2 balls of each color
You can’t take another ball without hitting 3
Thus, the answer is 5
 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
Rosen, section 4.2, question 4
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 10 red balls and 2 yellow balls
You can’t take another ball without hitting 3
yellow balls
Thus, the answer is 13
8
Rosen, section 4.2, question 32
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
The number of pigeons, N, is the number of computers
 That’s 6
By the generalized pigeonhole principle, at least one
box must have N/k objects
 6/5 = 2
 In other words, at least two computers must have the same
number of connections
9
Rosen, section 4.2, question 10
Consider 5 distinct points (xi, yi) 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 )
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
There are four parity possibilities
 (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
10
More elegant applications
Not going over…
11
Quick survey
 I felt I understood the material in this slide set…
a) Very well
b) With some review, I’ll be good
c) Not really
d) Not at all
12
Quick survey
 The pace of the lecture for this slide set was…
a) Fast
b) About right
c) A little slow
d) Too slow
13
Quick survey
 How interesting was the material in this slide
set? Be honest!
a) Wow! That was SOOOOOO cool!
b) Somewhat interesting
c) Rather borting
d) Zzzzzzzzzzz
14
Today’s demotivators

More Related Content

Similar to 20-pigeonhole-principle.ppt

Lesson 2.3 Mathematical Reasoning and Logic
Lesson 2.3 Mathematical Reasoning and LogicLesson 2.3 Mathematical Reasoning and Logic
Lesson 2.3 Mathematical Reasoning and LogicLanceAdrianBengalan
 
X12bPigeonHole.ppt
X12bPigeonHole.pptX12bPigeonHole.ppt
X12bPigeonHole.pptVishva4
 
Permutation and combinations
Permutation and combinationsPermutation and combinations
Permutation and combinationsRushabh Vora
 
ISI CMI IMPORTANT AND COMPLICATED QUESTION WITH SOLUTION BY SOURAV SIR'S CLAS...
ISI CMI IMPORTANT AND COMPLICATED QUESTION WITH SOLUTION BY SOURAV SIR'S CLAS...ISI CMI IMPORTANT AND COMPLICATED QUESTION WITH SOLUTION BY SOURAV SIR'S CLAS...
ISI CMI IMPORTANT AND COMPLICATED QUESTION WITH SOLUTION BY SOURAV SIR'S CLAS...SOURAV DAS
 
Aptitude Training - NUMBERS
Aptitude Training - NUMBERSAptitude Training - NUMBERS
Aptitude Training - NUMBERSAjay Chimmani
 
(7) Lesson 9.2
(7) Lesson 9.2(7) Lesson 9.2
(7) Lesson 9.2wzuri
 
Fine Tune Your Quantitative Skills
Fine Tune Your Quantitative SkillsFine Tune Your Quantitative Skills
Fine Tune Your Quantitative Skillsankits11
 
Combined topic 4
Combined topic 4Combined topic 4
Combined topic 4David Ramos
 
Basic Counting Law Discrete Math Power Point Presentaton
Basic Counting Law Discrete Math Power Point PresentatonBasic Counting Law Discrete Math Power Point Presentaton
Basic Counting Law Discrete Math Power Point Presentatonedzhoroevastudy
 
Day 1 - Law of Large Numbers and Probability (1).ppt
Day 1 - Law of Large Numbers and Probability (1).pptDay 1 - Law of Large Numbers and Probability (1).ppt
Day 1 - Law of Large Numbers and Probability (1).pptHayaaKhan8
 
Pigeonhole principle
Pigeonhole principlePigeonhole principle
Pigeonhole principleNivegeetha
 
Mathematical Languages.pptx
Mathematical Languages.pptxMathematical Languages.pptx
Mathematical Languages.pptxallanbabad4
 
Probability trinity college
Probability trinity collegeProbability trinity college
Probability trinity collegeStacy Carter
 
Lecture Week 17 which hleps in study for logic and
Lecture Week 17 which hleps in study for logic andLecture Week 17 which hleps in study for logic and
Lecture Week 17 which hleps in study for logic andmanishhmishra001
 
statiscs and probability math college to help student
statiscs and probability math college  to help studentstatiscs and probability math college  to help student
statiscs and probability math college to help studentcharlezeannprodonram
 
Probability+problems
Probability+problemsProbability+problems
Probability+problemsSeef Marsden
 
Probability+problems
Probability+problemsProbability+problems
Probability+problemsSeef Marsden
 

Similar to 20-pigeonhole-principle.ppt (20)

Lesson 2.3 Mathematical Reasoning and Logic
Lesson 2.3 Mathematical Reasoning and LogicLesson 2.3 Mathematical Reasoning and Logic
Lesson 2.3 Mathematical Reasoning and Logic
 
X12bPigeonHole.ppt
X12bPigeonHole.pptX12bPigeonHole.ppt
X12bPigeonHole.ppt
 
Permutation and combinations
Permutation and combinationsPermutation and combinations
Permutation and combinations
 
Mat cat que
Mat cat queMat cat que
Mat cat que
 
ISI CMI IMPORTANT AND COMPLICATED QUESTION WITH SOLUTION BY SOURAV SIR'S CLAS...
ISI CMI IMPORTANT AND COMPLICATED QUESTION WITH SOLUTION BY SOURAV SIR'S CLAS...ISI CMI IMPORTANT AND COMPLICATED QUESTION WITH SOLUTION BY SOURAV SIR'S CLAS...
ISI CMI IMPORTANT AND COMPLICATED QUESTION WITH SOLUTION BY SOURAV SIR'S CLAS...
 
Cat,mat,gmat, questions
Cat,mat,gmat, questions Cat,mat,gmat, questions
Cat,mat,gmat, questions
 
Aptitude Training - NUMBERS
Aptitude Training - NUMBERSAptitude Training - NUMBERS
Aptitude Training - NUMBERS
 
(7) Lesson 9.2
(7) Lesson 9.2(7) Lesson 9.2
(7) Lesson 9.2
 
Fine Tune Your Quantitative Skills
Fine Tune Your Quantitative SkillsFine Tune Your Quantitative Skills
Fine Tune Your Quantitative Skills
 
Combined topic 4
Combined topic 4Combined topic 4
Combined topic 4
 
Basic Counting Law Discrete Math Power Point Presentaton
Basic Counting Law Discrete Math Power Point PresentatonBasic Counting Law Discrete Math Power Point Presentaton
Basic Counting Law Discrete Math Power Point Presentaton
 
Day 1 - Law of Large Numbers and Probability (1).ppt
Day 1 - Law of Large Numbers and Probability (1).pptDay 1 - Law of Large Numbers and Probability (1).ppt
Day 1 - Law of Large Numbers and Probability (1).ppt
 
Pigeonhole principle
Pigeonhole principlePigeonhole principle
Pigeonhole principle
 
1150 day 1
1150 day 11150 day 1
1150 day 1
 
Mathematical Languages.pptx
Mathematical Languages.pptxMathematical Languages.pptx
Mathematical Languages.pptx
 
Probability trinity college
Probability trinity collegeProbability trinity college
Probability trinity college
 
Lecture Week 17 which hleps in study for logic and
Lecture Week 17 which hleps in study for logic andLecture Week 17 which hleps in study for logic and
Lecture Week 17 which hleps in study for logic and
 
statiscs and probability math college to help student
statiscs and probability math college  to help studentstatiscs and probability math college  to help student
statiscs and probability math college to help student
 
Probability+problems
Probability+problemsProbability+problems
Probability+problems
 
Probability+problems
Probability+problemsProbability+problems
Probability+problems
 

Recently uploaded

TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxAmanpreet Kaur
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 

Recently uploaded (20)

TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 

20-pigeonhole-principle.ppt

  • 1. 1 The Pigeonhole Principle CS/APMA 202 Rosen section 4.2 Aaron Bloomfield
  • 2. 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
  • 3. 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 In a group of 27 English words, at least two words must start with the same letter  As there are only 26 letters
  • 4. 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
  • 5. 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  Thus, we set N/5 = 6  Lowest possible value for N is 26
  • 6. 6 Rosen, section 4.2, question 4 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 Consider 2 balls of each color You can’t take another ball without hitting 3 Thus, the answer is 5  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. 7 Rosen, section 4.2, question 4 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 10 red balls and 2 yellow balls You can’t take another ball without hitting 3 yellow balls Thus, the answer is 13
  • 8. 8 Rosen, section 4.2, question 32 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 The number of pigeons, N, is the number of computers  That’s 6 By the generalized pigeonhole principle, at least one box must have N/k objects  6/5 = 2  In other words, at least two computers must have the same number of connections
  • 9. 9 Rosen, section 4.2, question 10 Consider 5 distinct points (xi, yi) 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 ) 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 There are four parity possibilities  (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
  • 11. 11 Quick survey  I felt I understood the material in this slide set… a) Very well b) With some review, I’ll be good c) Not really d) Not at all
  • 12. 12 Quick survey  The pace of the lecture for this slide set was… a) Fast b) About right c) A little slow d) Too slow
  • 13. 13 Quick survey  How interesting was the material in this slide set? Be honest! a) Wow! That was SOOOOOO cool! b) Somewhat interesting c) Rather borting d) Zzzzzzzzzzz