Lecture 5 Sum Product Pigeon Principle
Lecture 5 Sum Product Pigeon Principle
1
WHY?
To solve different types of problem
• Counting is used to determine the complexity of
algorithms.
• Counting is also required to determine whether there are
enough telephone numbers or Internet protocol
addresses to meet demand.
• Furthermore, counting techniques are used extensively
when probabilities of events are computed.
2
BASIC COUNTING PRINCIPLES: THE PRODUCT
RULE
The Product Rule
Suppose that a procedure can be broken down into a sequence of
two tasks. If there are n1 ways to do the first task and for each of
these ways of doing the first task, there are n2 ways to do the
second task, then there are n1.n2 ways to do the procedure.
3
THE PRODUCT RULE : EXAMPLE
Problem : How many different license plates can be made if each plate
contains a sequence of three uppercase English letters followed by three
digits (and no sequences of letters are prohibited)?
4
THE PRODUCT RULE : EXAMPLE
Problem : Suppose a college has 3 different history courses, 4 different
literature courses, and 2 different sociology courses. What is the number of
ways a student can choose just one of each kind of courses?
5
THE PRODUCT RULE : EXAMPLE
Problem : There are 32 microcomputers in a computer center. Each
microcomputer has 24 ports. How many different ports to a
microcomputer in the center are there?
6
THE PRODUCT RULE : EXAMPLE
Problem : A new company with just two employees, Anik and Arafat,
rents a floor of a building with 12 offices. How many ways are there to
assign different offices to these two employees?
7
THE PRODUCT RULE : EXAMPLE
Problem : How many different bit strings of length seven are there?
8
BASIC COUNTING PRINCIPLES: THE SUM RULE
The Sum Rule
If a task can be done either in one of n1 ways or in one of n2 ways,
where none of the set of n1 ways is the same as any of the set of n2
ways, then there are n1 + n2 ways to do the task.
9
THE SUM RULE : EXAMPLE
Problem : A student can choose a computer project from one of three lists. The
three lists contain 23, 15, and 19 possible projects, respectively. No project is on
more than one list. How many possible projects are there to choose from?
10
THE SUM RULE : EXAMPLE
Problem : Suppose a college has 3 different history courses, 4 different
literature courses, and 2 different sociology courses. What is the number of
ways a student can choose just one of the courses?
Solution: 3 + 4 + 2 = 9
11
THE SUM RULE VS. PRODUCT RULE
Problem : Fatema wants to go to Chattogram. She can choose from 3 bus
services or 2 train services to head from Rajshahi to downtown Dhaka. From
there, she can choose from 2 bus services or 3 train services to head to
Chattogram. How many ways are there for Fatema to get to Chattogram?
12
The Pigeonhole Principle
Theorem
If k is a positive integer and k+1 or more objects are placed into k boxes, then there
is at least one box containing two or more of the objects.
14
The Pigeonhole Principle
Example
• Suppose a department contains 13 professors, then two of the professors
(pigeons) were born in the same month (pigeonholes)
• Among any group of 367 people, there must be at least two with the same
birthday, because there are only 366 possible birthdays.
15
The Pigeonhole Principle
Example
• Suppose a department contains 13 professors, then two of the professors
(pigeons) were born in the same month (pigeonholes)
• Among any group of 367 people, there must be at least two with the same
birthday, because there are only 366 possible birthdays.
16
The Pigeonhole Principle
Example
• Among any group of 367 people, there must be at least two with the same
birthday, because there are only 366 possible birthdays.
• 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?
• Solution: There are 101 possible scores on the final. The pigeonhole principle
shows that among any 102 students there must be at least 2 students with the
same score.
17
The Generalized Pigeonhole Principle
Theorem
If N objects are placed into k boxes, then there is at least one box containing at least
objects.
18
The Generalized Pigeonhole Principle
Example
• Among 100 people there are at least 100/12=9 who were born in the same month.
• 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: The minimum number of students needed to ensure that at least six students
receive the same grade is the smallest integer N such thatN/5=6. The smallest such
integer is N=5·5+1=26. If you have only 25 students, it is possible for there to be five who
have received each grade so that no six students have received the same grade. Thus, 26
is the minimum number of students needed to ensure that at least six students will
receive the same grade.
19
The Generalized Pigeonhole Principle
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: The minimum number of students needed to ensure that at least six students
receive the same grade is the smallest integer N such that N/5=6. The smallest such
integer is N=5·5+1=26. If you have only 25 students, it is possible for there to be five who
have received each grade so that no six students have received the same grade. Thus, 26
is the minimum number of students needed to ensure that at least six students will
receive the same grade.
20
21
Any Questions?