Professional Documents
Culture Documents
09/04/2020
Outline
1 General information
Evaluation:
Textbook:
K. H. Rosen. Discrete mathematics and its applications, 7th ed.,
McGraw-Hill, 2012.
Examples:
Determining the length of telephone numbers in Vietnam.
1 General information
Example:
Ans: 26 × 50 = 1300.
Example:
Example:
A variable (in a program) is stored using 7 bits. How many different values
can that variable have?
There are two ways to choose a value for each bit (0 or 1). By the product
rule, there are 27 = 128 different values.
(k = 7, n1 = n2 = · · · = n7 = 2)
Example:
Example:
What is the value of k after the execution of the following nested loop?
1 General information
Example:
Example:
Example:
1 General information
Example:
How many binary strings of length 8 either start with a 1 bit or end with
the two bits 00?
There are
27 = 128 binary strings that start with 1;
26 = 64 binary strings that end with 00;
25 = 32 binary strings that start with 1 and end with 00.
Ans: 160
1 General information
Example:
If n people each elbow bump every other person, then how many elbow
bumps are there in total?
Each person elbow bumps the others n − 1 times, hence n people elbow
bump each other n(n − 1) times.
But each elbow bump is counted twice, so the total number of elbow
bumps is n(n − 1)/2.
Note: The pigeon hole principle is also known as the Dirichlet’s principle,
the drawer principle, etc.
Example:
A function f : {1, 2, . . . , n + 1} → {1, 2, . . . , n} cannot be injective.
Among 13 students, there are at least two who were born in the same
month.
Among 27 arbitrary English words, there are at least two that begin
with the same letter.
Example:
Show that every positive integer n has a multiple that is written with only
0’s and 1’s.
Consider n + 1 numbers: 1, 11, 111, . . . , 11. . . 1 (n + 1 digits). By the
pigeon hole principle, at least two among them have the same remainder
when divided by n. The difference of these two number is a multiple of n
that is written with only 0’s and 1’s.
Definition
If n pigeons stay in k pigeon holes, then there is at least one pigeon hole
that accommodates at least dn/ke pigeons.
Note: For any real number x , dx e is the smallest integer that is greater
than or equal to x . For example, d1.2e = 2, d−1e = −1.
Exemple:
Exemple: