Presentation 5
Presentation 5
April 9, 2024
Discrete Mathematics 1 / 38
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.
Discrete Mathematics 2 / 38
Question: The chairs of an auditorium are to be labeled with an
uppercase English letter followed by a positive integer not exceeding
100. What is the largest number of chairs that can be labeled
differently?
Discrete Mathematics 3 / 38
Answer: The procedure of labeling a chair consists of two tasks,
namely, assigning to the seat one of the 26 uppercase English let-
ters, and then assigning to it one of the 100 possible integers. The
product rule shows that there are 26 · 100 = 2600 different ways
that a chair can be labeled. Therefore, the largest number of chairs
that can be labeled differently is 2600.
Discrete Mathematics 4 / 38
Question: There are 32 computers in a data center in the cloud.
Each of these computers has 24 ports. How many different computer
ports are there in this data center?
Discrete Mathematics 5 / 38
Answer: The procedure of choosing a port consists of two tasks,
first picking a computer and then picking a port on this computer.
Because there are 32 ways to choose the computer and 24 ways to
choose the port no matter which computer has been selected, the
product rule shows that there are 32 · 24 = 768 ports.
Discrete Mathematics 6 / 38
An extended version of the product rule is often useful. Suppose
that a procedure is carried out by performing the tasks
T1 , T2 , ..., Tm in sequence. If each task Ti , i = 1, 2, ..., n, can be
done in ni ways, regardless of how the previous tasks were done,
then there are n1 × n2 × · · · × nm ways to carry out the procedure.
Discrete Mathematics 7 / 38
Question: How many different bit strings of length seven are there?
Discrete Mathematics 8 / 38
Answer: Each of the seven bits can be chosen in two ways, because
each bit is either 0 or 1. Therefore, the product rule shows there are
a total of
2 × 2 × 2 × 2 × 2 × 2 × 2 = 27 = 128
different bit strings of length seven.
Discrete Mathematics 9 / 38
Question: 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)?
Discrete Mathematics 10 / 38
Answer:
There are 26 choices for each of the three uppercase English letters
and 10 choices for each of the three digits. Hence, by the product
rule there are a total of
Discrete Mathematics 11 / 38
Question: Find the number of 4 letter words, with or without mean-
ing, which can be formed out of the letters of the word ROSE, where
the repetition of the letters is not allowed.
Discrete Mathematics 12 / 38
Answer:There are as many words as there are ways of filling in 4
vacant places
Discrete Mathematics 13 / 38
Discrete Mathematics 14 / 38
The Pigeonhole Principle
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.
Discrete Mathematics 15 / 38
Example: Among any group of 367 people, there must be at least
two with the same birthday, because there are only 366 possible
birthdays.
Example: A function f from a set with k + 1 or more elements to
a set with k elements is not one-to-one.
Discrete Mathematics 16 / 38
The notation n! represents the product of first n natural numbers,
i.e., the product 1 × 2 × 3 × · · · × (n–1) × n is denoted as n!. We
read this symbol as ‘n factorial’. Thus,
1 × 2 × 3 × 4... × (n–1) × n = n!
7! 12!
Example: Evaluate 1) 4! 2) (9!)(3!)
Discrete Mathematics 17 / 38
Permutation
A permutation of a set of distinct objects is an ordered arrangement
of these objects. We also are interested in orderes arrangements of
some of elements of a set. An ordered arrangement of r elements
of a set is called an r -permutation.
Discrete Mathematics 18 / 38
The number of permutations of n different objects taken r at a
time, where 0 < r ≤ n and the objects do not repeat is
n!
n × (n–1) × (n–2) × · · · × (n–r + 1) = (n−r )! , which is denoted by
n P or P(n, r ).
r
Discrete Mathematics 19 / 38
Example: How many ways are there to select a first-prize winner,
a second-prize winner, and a third-prize winner from 100 different
people who have entered a contest?
Discrete Mathematics 20 / 38
Answer:
Discrete Mathematics 21 / 38
The number of permutations of n objects, where p1 objects are of
one kind, p2 are of second kind, ..., pk are of k th kind and the rest,
if any, are of different ind is p1 !p2n!!...pk !
Discrete Mathematics 22 / 38
Example: In how many ways can 4 red, 3 yellow and 2 green discs
be arranged in a row if the discs of the same colour are indistin-
guishable?
Discrete Mathematics 23 / 38
Answer: Total number of discs are 4 + 3 + 2 = 9. Out of 9 discs, 4
are of the first kind (red), 3 are of the second kind (yellow) and 2 are
of the third kind (green). Therefore, the number of arrangements
9!
4!3!2! = 1260.
Discrete Mathematics 24 / 38
Question: Find the number of arrangements of the letters of the
word INDEPENDENCE. In how many of these arrangements, (i) do
the words start with P (ii) do all the vowels always occur together
(iii) do the vowels never occur together (iv) do the words begin with
I and end in P?
Discrete Mathematics 25 / 38
Answer: There are 12 letters, of which N appears 3 times, E appears
4 times and D appears 2 times and the rest are all different.
i)Let us fix P at the extreme left position, we, then, count the
arrangements of the remaining 11 letters. Therefore, the required
number of words starting with P
11!
= 138600.
3!4!2!
Discrete Mathematics 26 / 38
ii) There are 5 vowels in the given word, which are 4 Es and 1 I.
Since, they have to always occur together, we treat them as a single
object EEEEI for the time being. This single object together with
7 remaining objects will account for 8 objects. These 8 objects, in
which there are 3Ns and 2 Ds, can be rearranged in
8!
3!2!
ways. Corresponding to each of these arrangements, the 5 vowels
E, E, E, E and I can be rearranged in
5!
4!
ways. Therefore, by multiplication principle, the required number of
arrangements
8! 5!
× = 16800.
3!2! 4!
Discrete Mathematics 27 / 38
iii) The required number of arrangements = the total number of
arrangements (without any restriction) – the number of arrange-
12!
ments where all the vowels occur together = 3!4!2! − 16800 =
1663200 − 16800 =1646400
iv) Let us fix I and P at the extreme ends (I at the left end and P
at the right end). We are left with 10 letters. Hence, the required
number of arrangements
10!
= 12600.
3!2!4!
Discrete Mathematics 28 / 38
Combinations
An r -combination of elements of a set is an unordered selection of r
elements from the set. In a combination, the order is not important.
Discrete Mathematics 29 / 38
example: Let us now assume that there is a group of 3 lawn tennis
players X , Y , Z . A team consisting of 2 players is to be formed. In
how many ways can we do so? Is the team of X and Y different from
the team of Y and X ? Here, order is not important. In fact, there
are only 3 possible ways in which the team could be constructed.
These are XY, YZ and ZX.
Discrete Mathematics 30 / 38
Example: Twelve persons meet in a room and each shakes hand
with all the others. How do we determine the number of hand
shakes. X shaking hands with Y and Y with X will not be two
different hand shakes. Here, order is not important. There will be
as many hand shakes as there are combinations of 12 different things
taken 2 at a time.
Discrete Mathematics 31 / 38
Theorem 1
n P = n C × r !, 0 < r ≤ n.
r r
n!
Therefore, n Cr = (n−r )!r ! , 0 < r ≤ n.
Discrete Mathematics 32 / 38
Question: A committee of 3 persons is to be constituted from
a group of 2 men and 3 women. In how many ways can this be
done? How many of these committees would consist of 1 man and
2 women?
Discrete Mathematics 33 / 38
Answer: Here, order does not matter. Therefore, we need to
count combinations. There will be as many committees as there are
combinations of 5 different persons taken 3 at a time. Hence, the
5!
required number of ways = 5 C3 = 3!2! = 10
Now, 1 man can be selected from 2 men in 2 C1 ways and 2 women
can be selected from 3 women in 3 C2 ways. Therefore, the required
2! 3!
number of committees = 2 C1 × 3 C2 = 1!1! × 2!1! = 6.
Discrete Mathematics 34 / 38
n!
1) n Cn = (n−n)!n! = 1.
n!
2) n C0 = (n−0)!0! = 1.
3) n−r = (n−(n−rn!))!(n−r )! = r !(n−r
nC n! n
)! = Cr .
4) n Ca = n Cb =⇒ a = b or a = n − b, i.e.n = a + b.
Discrete Mathematics 35 / 38
5) n Cr + n Cr −1 = n+1 C
r.
Proof:
n n! n!
Cr +n Cr −1 = +
(n − r )!r ! (n − r + 1)!(r − 1)!
n! n!
= +
r (r − 1)!(n − r )! (r − 1)!(n − r + 1)(n − r )!
n! 1 1
= +
(r − 1)!(n − r )! r n−r +1
n! n−r +1+r
=
(r − 1)!(n − r )! r (n − r + 1)
n!(n + 1)
=
(r − 1)!r (n − r )!(n − r + 1)
(n + 1)!
=
r !(n − r + 1)!
=n+1 Cr .
Discrete Mathematics 36 / 38
Example:
1)7 C2 + 7 C1 =
2)10 C5 + 10 C4 =
Discrete Mathematics 37 / 38
Answer:
1)8 C2
2)11 C5
Discrete Mathematics 38 / 38