0% found this document useful (0 votes)
0 views

PHP

The document explains the Pigeonhole Principle, which states that if more objects are placed into fewer containers than there are objects, at least one container must hold more than one object. It provides various examples and problems, such as proving that in a city with a large population, at least two people will have the same number of hairs on their heads. Additionally, it discusses generalized forms of the principle and their applications in different scenarios.

Uploaded by

sanaul.zihad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

PHP

The document explains the Pigeonhole Principle, which states that if more objects are placed into fewer containers than there are objects, at least one container must hold more than one object. It provides various examples and problems, such as proving that in a city with a large population, at least two people will have the same number of hairs on their heads. Additionally, it discusses generalized forms of the principle and their applications in different scenarios.

Uploaded by

sanaul.zihad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

The Pigeonhole Principle

AKR CSE 173


The hair problem
Problem: Prove that there are at least 2 people
in Dhaka city that have the same number of
hairs on their heads.
The Pigeonhole (Dirichlet’s box)
Principle

If you have more pigeons than


pigeonholes, when the pigeons fly
into the holes at night, at least one
hole has more than one pigeon.
The pigeonhole principle
 Assume 13 pigeons fly into 12 pigeonholes to roost.
 A least one of 12 pigeonholes must have at least two
pigeons in it.

  
  
  
1
The pigeonhole principle
Pigeonhole Principle: If n pigeonholes are occupied by n
+ 1 or more pigeons, then at least one pigeonhole is
occupied by more than one pigeon.

Remark: The principle is obvious. No simpler fact or rule to


support or prove it.
The pigeonhole principle
The pigeonhole principle:
 K ∊Z+.
 Assume k+1 or more objects are placed into k
boxes.
 So, there is at least one box containing two or more
of the objects.

Proof by contradiction:
 Suppose none of the k boxes contains more than one object.
 So, the total number of objects would be at most k.
 This is a contradiction, because there are at least k+1 objects.
2
The Pigeonhole Principle

Problem: In a group of 13 people, we


have 2 or more who are born in the
same month.
The Pigeonhole Principle

Problem: Prove that there are at least 2 people


in Dhaka city that have the same number of
hairs on their heads.
Medical fact: people have up to 150,000 hairs.

Census Bureau (2022):


Dhaka city’s population is 1,00,00,000
The Pigeonhole Principle

Problem: Prove that there are at least 2 people


in Dhaka city that have the same number of hairs on their heads.

Holes = heads with N hairs, N from 0 to


150,000. Total: 150,001

Pigeons = Dhakaian = 1,00,00,000


Example
Show that among any group of 367 people, there must
be at least two with the same birthday.
Proof:
 To use pigeonhole principle, first find boxes and objects.
 Suppose that for each day of a year, we have a box
that contains a birthday that occurs on that day.
 The number of boxes is 366 and the number of objects
is 367.
 By the pigeonhole principle, at least one of these boxes
contains two or more birthdays.
 So, there must be at least two people with the same
birthday.

4
Example
Show that in any group of 27 English words, there must
be at least two that begin with the same letter.
Proof:
 To use pigeonhole principle, first find boxes and objects.
 Suppose that for each letter, we have a box that
contains a word that begins with that letter.
 The number of boxes is 26 and the number of objects is
27.
 By the pigeonhole principle, at least one of these boxes
contains two or more words.
 So, there must be at least two words that begin with the
same letter.

5
Example
How many students must be in a class to guarantee
that at least two students receive the same score
on the final exam, if the exam is graded on a scale
from 0 to 100 points.
Proof:
 To use pigeonhole principle, first find boxes and objects.
 Suppose that for each score, we have a box that
contains a student which got that score in the final
exam.
 The number of boxes is 101, so by the pigeonhole
principle, the number of students must be 102 or more.

6
The socks pair matching problem
The Pigeonhole Principle

Problem: In a box there are 10 black socks and


12 blue socks and you need to get one pair of
socks of the same colour. Suppose, you can
take socks out of the box without looking,
what is the minimum number of socks you'd
have to pull out in order to guarantee a pair
of the same color?
The Pigeonhole Principle

Problem: In a box there are 10 black socks and 12 blue socks and you need to get one
pair of socks of the same colour. Supposing you can take socks out of the box without
looking, what is the minimum number of socks you'd have to pull out in order to
guarantee a pair of the same color?

Answer: 3. To have at least one pair of the same colour


(m = 2 holes, one per colour), using one pigeonhole per
colour, you need only three socks (n = 3 pigeons). In this
example, if the first and second sock drawn are not of the
same colour, the very next sock drawn would complete at
least one same colour pair. (m = 2)
More Example

A bowl contains 10 red and 10 yellow balls


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

18
The generalized pigeonhole
principle
 Assume 25 pigeons fly into 12 pigeonholes to roost.
 A least one of 12 pigeonholes must have at least
three pigeons in it.

   
   
   
7
The generalized pigeonhole
principle
The generalized pigeonhole principle:
 Assume N objects are placed into k boxes.
 So, there is at least one box containing at least ⎡N/k]
objects.

Proof by contradiction:
 Assume none of the boxes contains more than ⎡N/k] - 1
objects.
 So, the total number of objects is at most
k(⎡N/k]-1) < k ((N/k+1)-1) = N.
 This is a contradiction because there are a total of N objects.

8
 If 10 objects are placed into 3 boxes, then there is at
least one box containing 4 objects
 Do you agree?
 10/3 = 4
 In general N/k
Example
Show among 100 people there are at least 9 who were born in
the same month.
Solution:
 To use pigeonhole principle, first find boxes and objects.
 Suppose that for each month, we have a box that
contains persons who was born in that month.
 The number of boxes is 12 and the number of objects is
100.
 By the generalized pigeonhole principle, at least one of
these boxes contains at least ⎡100/12] = 9 persons.
 So, there must be at least 9 persons who were born in
the same month.

9
Example
What is the minimum number of students required in a
discrete mathematics class to be sure that at least six
will receive the same grade, if there are five possible
grades, A, B, C, D and F.
Solution:
 To use pigeonhole principle, first find boxes and objects.
 Suppose that for each grade, we have a box that
contains students who got that grade.
 The number of boxes is 5, by the generalized
pigeonhole principle, to have at least 6 (= ⎡N/5])
students at the same box, the total number of the
students must be at least N = 5 . 5 + 1 = 26.

10
Example
Assume there is a standard deck of 52 cards.
a) How many cards must be selected to guarantee that at least
three cards of the same suit are chosen?
b) How many cards must be selected to guarantee that at least
three hearts are selected
Solution:
Part a:
 Suppose that for each suite, we have a box that contains
cards of that suit.
 The number of boxes is 4, by the generalized pigeonhole
principle, to have at least 3 (= ⎡N/4]) cards at the same box,
the total number of the cards must be at least N = 2 . 4 + 1 =
9.

11
Example
Assume there is a standard deck of 52 cards.
a) How many cards must be selected to guarantee that at
least three cards of the same suit are chosen?
b) How many cards must be selected to guarantee that at
least three hearts are selected
Solution:
Part b:
 The worst case, we may selects all the clubs,
diamonds, and spades (39 cards) before any hearts.
 So, to guarantee that at least three hearts are selected,
39+3=42 cards should be selected.

12
Another Problem

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
You pick 2 balls of each color totaling 4 balls
Now you pick one more ball, you get 3 of same color
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
26
Example
Assume that telephone numbers are of the form NXX-NXX-
XXXX where N is a digit from 2 to 9 and X can be any digit.
What is the least number of area codes needed to guarantee
that 25 million phone numbers can be assigned.
Solution:
 The number of different phone numbers of the form
NXX-XXXX is 8 . 10 . 10 . 10 . 10 . 10 . 10 = 8 million.
 Suppose that for each area code, we have a box that
contains telephone numbers with that area code.
 The number of boxes is k and the number of telephone
numbers is 25,000,000.
 No box contains more than 8,000,000 telephone
numbers.
13
Example
Assume that telephone numbers are of the form NXX-NXX-
XXXX where N is a digit from 2 to 9 and X can be any digit.
What is the least number of area codes needed to guarantee
that 25 million phone numbers can be assigned.
Solution:
 By the generalized pigeonhole principle, these boxes
contains no more than ⎡25,000,000/k] = 8,000,000
telephone numbers. (k = ⎡25,000,000/8,000,000])
 So, k must be at least 4 and 4 area codes are enough.

14
Recommended exercises
3,5,9,13,21,25,31

15

You might also like