Module 2
Module 2
Study Material
(Discrete Mathematics (PCC-CSM405)
_____________________________________________________________________________________________
Table of Contents
Module I:
Counting techniques
C ounting techniques, also known as combinatorics, is a branch of mathematics concerned with counting and
organizing the number of possibilities or arrangements of objects. Combinatorics is fundamental to various
areas of mathematics, computer science, and other disciplines.
Combinatorics can be traced back more than 3000 years to India and China. For many centuries, it primarily
comprised the solving of problems relating to the permutations and combinations of objects. The use of the word
“combinatorial” can be traced back to Leibniz in his dissertation on the art of combinatorial in 1666. Over the
centuries, combinatorics evolved in recreational pastimes. In the modern era, the subject has developed both in
depth and variety and has cemented its position as an integral part of modern mathematics. Undoubtedly part of
the reason for this importance has arisen from the growth of computer science and the increasing use of
algorithmic methods for solving real-world practical problems. These have led to combinatorial applications in a
wide range of subject areas, both within and outside mathematics, including network analysis, coding theory,
and probability.
Suppose that a password on a computer system consists of six, seven, or eight characters. Each of these
characters must be a digit or a letter of the alphabet. Each password must contain at least one digit. How many
such passwords are there? The techniques needed to answer this question and a wide variety of other counting
problems will be introduced in this section.
Counting problems arise throughout mathematics and computer science. For example, we must count the
successful outcomes of experiments and all the possible outcomes of these experiments to determine
probabilities of discrete events. We need to count the number of operations used by an algorithm to study its
time complexity. We will introduce the basic techniques of counting in this section. These methods serve as the
foundation for almost all counting techniques.
For instance, assume that a license plate contains two letters followed by three digits. How many different
license plates can be printed?
Answer: Each letter can be printed in 26 ways, and each digit can be printed in 10 ways, so 26 · 26 · 10 · 10 · 10
= 676000 different plates can be printed.
Exercise: Given a set A with m elements and a set B with n elements, find the number of functions from A to B.
Set theoretical version of the rule of sum: If 𝐴 and 𝐵 are disjoint sets (𝐴 ∩ 𝐵 = ∅), then
For instance, if a class has 30 male students and 25 female students, then the class has 30 + 25 = 45 students.
The Inclusion-Exclusion Principle. The inclusion-exclusion principle generalizes the rule of sum to non-disjoint sets.
Example: Assume that in a university with 1000 students, 200 students are taking a course in mathematics, 300 are
taking a course in physics, and 50 students are taking both. How many students are taking at least one of those
courses?
Answer: If 𝑈 = total set of students in the university, 𝑀 = set of students taking Mathematics, 𝑃 = set of students
taking Physics, then:
students are taking Mathematics or Physics. For three sets the following formula applies:
|𝐴1 ∪ 𝐴2 ∪. . .∪ 𝐴𝑛 | = 𝑠1 − 𝑠2 + 𝑠3 − 𝑠4 +. . . ± 𝑠𝑛 ,
where 𝑠𝑘 =sum of the cardinalities of all possible k-fold intersections of the given sets.
Introduction: The Pigeonhole Principle (Schubfachprinzip) was first used by Dirichlet in Number Theory. The
term pigeonhole actually refers to one of those old-fashioned writing desks with thin vertical wooden partitions
in which to file letters.
Statement: The pigeonhole principle is used for proving that a certain situation must actually occur. It says the
following: If n pigeonholes are occupied by m pigeons and m> n, then at least one pigeonhole is occupied by
more than one pigeon.
Example 1: In any given set of 13 people at least two of them have their birthday during the same month.
Example 2: Let S be a set of eleven 2-digit numbers. Prove that S must have two elements whose digits have the
same difference (for instance in S = {10, 14, 19, 22, 26, 28, 49, 53, 70, 90, 93}, the digits of the numbers 28 and
93 have the same difference: 8 − 2 = 6, 9 − 3 = 6.)
Answer: The digits of a two-digit number can have 10 possible differences (from 0 to 9). So, in a list of 11
numbers there must be two with the same difference.
Example 3: Assume that we choose three different digits from 1 to 9 and write all permutations of those digits.
Prove that among the 3-digit numbers written that way there are two whose difference is a multiple of 500.
Answer: There are 9 · 8 · 7 = 504 permutations of three digits. On the other hand if we divide the 504 numbers
by 500, we can get only 500 possible remainders, so at least two numbers give the same remainder, and their
difference must be a multiple of 500.
Exercise: Prove that if we select n+1 numbers from the set S = {1, 2, 3, . . . , 2n}, among the numbers selected
there are two such that one is a multiple of the other one.
Permutations: Assume that we have 𝑛 objects. Any arrangement of any 𝑘 of these objects in a given order is called
a permutation of size 𝑘. If 𝑘 = 𝑛 then we call it just a permutation of the 𝑛 objects. For instance, the permutations
of the letters 𝑎, 𝑏, 𝑐 are the following: 𝑎𝑏𝑐, 𝑎𝑐𝑏, 𝑏𝑎𝑐, 𝑏𝑐𝑎, 𝑐𝑎𝑏, 𝑐𝑏𝑎. The permutations of size 2 of the letters 𝑎, 𝑏, 𝑐, 𝑑
are: 𝑎𝑏, 𝑎𝑐, 𝑎𝑑, 𝑏𝑎, 𝑏𝑐, 𝑏𝑑, 𝑐𝑎, 𝑐𝑏, 𝑐𝑑, 𝑑𝑎, 𝑑𝑏, 𝑑𝑐.
Note that the order is important. Given two permutations, they are considered equal if they have the same elements
arranged in the same order.
We find the number 𝑃(𝑛, 𝑘) of permutations of size 𝑘 of 𝑛 given objects in the following way:
The first object in an arrangement can be chosen in 𝑛 ways, the second one in 𝑛 − 1 ways, the third one in 𝑛 − 2
ways, and so on, hence:
𝑛!
𝑃(𝑛, 𝑘) = 𝑛 × (𝑛 − 1) × . . . (𝑘 𝑓𝑎𝑐𝑡𝑜𝑟𝑠). . .× (𝑛 − 𝑘 + 1) = ,
(𝑛 − 𝑘)!
𝑃(𝑛, 𝑛) = 𝑛!.
By convention 0!=1.
For instance, there are 3! = 6 permutations of the 3 letters 𝑎, 𝑏, 𝑐. The number of permutations of size 2 of the 4
letters 𝑎, 𝑏, 𝑐, d is 𝑃(4, 2) = 4 × 3 = 12.
Exercise: Given a set 𝐴 with 𝑚 elements and a set 𝐵 with 𝑛 elements, find the number of one-to-one functions from
𝐴 to 𝐵.
Combinations. Assume that we have a set 𝐴 with 𝑛 objects. Any subset of 𝐴 of size 𝑟 is called a combination of 𝑛
elements taken 𝑟 at a time. For instance, the combinations of the letters 𝑎, 𝑏, 𝑐, 𝑑, 𝑒 taken 3 at a time are: 𝑎𝑏𝑐, 𝑎𝑏𝑑,
𝑎𝑏𝑒, 𝑎𝑐𝑑, 𝑎𝑐𝑒, 𝑎𝑑𝑒, 𝑏𝑐𝑑, 𝑏𝑐𝑒, 𝑏𝑑𝑒, 𝑐𝑑𝑒, where two combinations are considered identical if they have the same
elements regardless of their order.
𝑛!
𝐶(𝑛, 𝑟) = .
𝑟! (𝑛 − 𝑟)!
The symbol (𝑛 𝑟 ) (read “ 𝑛 choose 𝑟”) is often used instead of 𝐶(𝑛, 𝑟).
One way to derive the formula for 𝐶(𝑛, 𝑟) is the following. Let 𝐴 be a set with 𝑛 objects. In order to generate all
possible permutations of size 𝑟 of the elements of 𝐴 we
𝑃(𝑛, 𝑟) 𝑛!
𝐶(𝑛, 𝑟) = = .
𝑃(𝑟, 𝑟) 𝑟! (𝑛 − 𝑟)!
Assume that we have an alphabet with 𝑘 letters and we want to write all possible words containing 𝑛1 times the
first letter of the alphabet, 𝑛2 times the second letter, ⋯ , 𝑛𝑘 times the 𝑘th letter. How many words can we write?
We call this number 𝑃(𝑛; 𝑛1 , 𝑛2 , 𝑛3 , ⋯ , 𝑛𝑘 ), where 𝑛 = 𝑛1 + 𝑛2 + 𝑛3 + ⋯ + 𝑛𝑘 .
Example: With 3 𝑎’s and 2 𝑏’s, we can write the following 5-letter words: 𝑎𝑎𝑎𝑏𝑏, 𝑎𝑎𝑏𝑎𝑏, 𝑎𝑏𝑎𝑎𝑏, 𝑏𝑎𝑎𝑎𝑏, 𝑎𝑎𝑏𝑏𝑎,
𝑎𝑏𝑎𝑏𝑎, 𝑏𝑎𝑎𝑏𝑎, 𝑎𝑏𝑏𝑎𝑎, 𝑏𝑎𝑏𝑎𝑎, 𝑏𝑏𝑎𝑎𝑎.
We may solve this problem in the following way, as illustrated with the example above. Let us distinguish the
different copies of a letter with subscripts: 𝑎1 𝑎2 𝑎3 𝑏1 𝑏2. Next, generate each permutation of this five elements by
choosing
By the product rule we have 5! = P(5; 3, 2) × 3! × 2!, hence P(5; 3, 2) = 5!/3! 2!.
𝑛!
𝑃(𝑛; 𝑛1 , 𝑛2 , ⋯ , 𝑛𝑘 ) = 𝑛 .
1 2 ! ⋯𝑛𝑘 !
! 𝑛
3. The number of permutations of n things taken all at a time, in which p are alike of one kind, q are alike of second
kind and r are alike of third kind and rest are different is n!/(p!q!r!)
4. The number of permutations of n things of which p1 are alike of one kind p2 are alike of second kind, p3 are alike
of third kind,…, Pr are alike of rth kind such that p1 + p2 + p3 +…+pr = n is n!/P1 !P2 !P3 !….Pr !
5. Number of permutations of n different things taken r at a time, when a particular thing is to be included in each
arrangement is
r.n – 1
P r – 1. when a particular thing is always excluded, then number of arrangements = n – 1 Pr
6. Number of permutations of n different things taken all at a time, when m specified things always come together
is m!(n – m + 1)!.
7. Number of permutations of n different things taken all at a time, when m specified things never come together is
n! – m! x (n – m + 1)!.
Combinations with Repetition: Assume that we have a set 𝐴 with 𝑛 elements. Any selection of 𝑟 objects from 𝐴,
where each object can be selected more than once, is called a combination of 𝑛 objects taken 𝑟 at a time with
repetition. For instance, the combinations of the letters 𝑎, 𝑏, 𝑐, 𝑑 taken 3 at a time with repetition are: 𝑎𝑎𝑎, 𝑎𝑎𝑏,
𝑎𝑎𝑐, 𝑎𝑎𝑑, 𝑎𝑏𝑏, 𝑎𝑏𝑐, 𝑎𝑏𝑑, 𝑎𝑐𝑐, 𝑎𝑐𝑑, 𝑎𝑑𝑑, 𝑏𝑏𝑏, 𝑏𝑏𝑐, 𝑏𝑏𝑑, 𝑏𝑐𝑐, 𝑏𝑐𝑑, 𝑏𝑑𝑑, 𝑐𝑐𝑐, 𝑐𝑐𝑑, 𝑐𝑑𝑑, 𝑑𝑑𝑑. Two
Name of the Faculty: Mr. Sayandeep Dutta
Designation and Department: Assistant Professor, Department of Mathematics
Brainware University, Kolkata 6
Programme Name and Semester: B.Tech CSE (AIML_DS), 4th semester
Course Name (Course Code): Discrete Mathematics (PCC-CSM405)
Academic Session: 2023-24
combinations with repetition are considered identical if they have the same elements repeated the same number
of times, regardless of their order.
2. The number of ways 𝑟 identical objects can be distributed among 𝑛 distinct containers.
𝑥1 + 𝑥2 + ⋯ + 𝑥𝑛 = 𝑟 .
2.The number of ways of dividing n identical things among r persons such that each one gets at least one is n – 1 C r –
1.
4.The total number of ways of dividing n identical items among r persons, each one of whom can receive 0, 1, 2 or
more items (≤ n) is n + r – 1 C r – 1
5.The number of ways in which n identical items can be divided into r groups so that no group contains less than in
items and more than k(m < k) is coefficient of xn in the expansion of (xm + x m + 1 +….+ xk ) r .
6.The total number of ways of selection of some or all of n things at a time is nC1 + nC2 +….+ n n1 = 2n — 1.
Example: Assume that we have 3 different (empty) milk containers and 7 quarts of milk that we can measure with
a one quart measuring cup. In how many ways can we distribute the milk among the three containers?
We solve the problem in the following way. Let 𝑥1 , 𝑥2 , 𝑥3 be the quarts of milk to put in containers number 1, 2 and
3 respectively.
The number of possible distributions of milk equals the number of nonnegative integer solutions for the equation
𝑥1 + 𝑥2 + 𝑥3 = 7. Instead of using numbers for writing the solutions, we will use strokes, so for instance we
represent the solution 𝑥1 = 2, 𝑥2 = 1, 𝑥3 = 4, 𝑜𝑟 2 + 1 + 4, like this: || + | + ||||. Now, each possible solution
9!
is an arrangement of 7 strokes and 2 plus signs, so the number of arrangements is 𝑃(9; 7, 2) = 7! 2!
= (9 7 ) .
(𝑛 + 𝑟 − 1)!
𝑃(𝑛 + 𝑟 − 1; 𝑟, 𝑛 − 1) = 𝑟! (𝑛 − 1)!
= (𝑛+𝑟−1 𝑟 ).
Circular Permutation: In a circular permutation, firstly we fix the position of one of the objects and then arrange
the other objects in all possible ways.
(i) Number of circular permutations at a time is (n -1)!. If clockwise taken as different. of n and different things taken
anti-clockwise orders all are
(ii) Number of circular permutations of n different things taken all at a time, when clockwise or anti-clockwise order
is not different 1/2(n – 1)!.
(iii) Number of circular permutations of n different things taken r at a time, when clockwise or anti-clockwise orders
are take as different is n Pr /r.
(iv) Number of circular permutations of n different things taken r at a time, when clockwise or anti-clockwise orders
are not different is n Pr /2r.
(v) If we mark numbers 1 to n on chairs in a round table, then n persons sitting around table is n!.
1. Function:
(ii) Number of permutations of n different objects taken r at a time in which m particular objects are always
(a) excluded = n – m Pr
(b) included = n – m Pr – m x r!
2. Geometry:
1. Given, n distinct points in the plane, no three of which are collinear, then the number of line segments formed =
n
C2.
2. Given. ii distinct paints in the p)ane. in which m are collinear (m ≥ 3), then the number of line segments is ( nC2 –
m
C2) + 1.
3. Given, n distinct points in the plane, no three of which are collinear, then the number of triangle formed = nC3.
4. Given, n distinct points in a plane, in which m are collinear (m ≥ 3), then the number of triangle formed = nC3 —
m
C2
5. The number of diagonals in a n-sided closed polygon = nC2 — n. 6. Given, n points on the circumference of a circle,
then-
Generating Functions
There is an extremely powerful tool in discrete mathematics used to manipulate sequences called the generating
function. The idea is this: instead of an infinite sequence (for example: 2,3,5,8,12,…) we look at a single function
which encodes the sequence. But not a function which gives the 𝑛 th term as output. Instead, a function whose
power series (like from calculus) “displays” the terms of the sequence. So for example, we would look at the power
series 2 + 3𝑥 + 5𝑥 2 + 8𝑥 3 + 12𝑥 4 + ⋯ which displays the sequence 2,3,5,8,12,… as coefficients.
An infinite power series is simply an infinite sum of terms of the form 𝑐𝑛 𝑥 𝑛 where 𝑐𝑛 is some constant. So we might
write a power series like this:
∑∞
𝑘=0 𝑐𝑘 𝑥 𝑘 .
𝑐0 + 𝑐1 𝑥 + 𝑐2 𝑥 2 + 𝑐3 𝑥 3 + 𝑐4 𝑥 4 + 𝑐5 𝑥 5 + ⋯
When viewed in the context of generating functions, we call such a power series a generating series. The generating
series generates the sequence
𝑐0 , 𝑐1 , 𝑐2 , 𝑐3 , 𝑐4 , 𝑐5 , ⋯
In other words, the sequence generated by a generating series is simply the sequence of coefficients of the infinite
polynomial.
∞
0 1 2 2 𝑟 𝑟
𝑔(𝑥) = 2 + 2 𝑥 + 2 𝑥 + ⋯ + 2 𝑥 + ⋯ = ∑ 2𝑟 𝑥 𝑟
𝑟=0
1
which can be written in closed form as 𝑔(𝑥) = (1 − 2𝑥)−1 = 1−2𝑥.
3. (1 − 𝑥)−1 = ∑∞
𝑟=0 𝑥 𝑟 (−1 < 𝑥 < 1)
4.
(1 + 𝑥)−1 = ∑𝑛𝑟=0 (−1)𝑟 𝑥 𝑟 (−1 < 𝑥 < 1)
5. (1 − 𝑥)−2 = ∑∞
𝑟=0 (𝑟 + 1) 𝑥 𝑟 (−1 < 𝑥 < 1)
Name of the Faculty: Mr. Sayandeep Dutta
Designation and Department: Assistant Professor, Department of Mathematics
Brainware University, Kolkata 10
Programme Name and Semester: B.Tech CSE (AIML_DS), 4th semester
Course Name (Course Code): Discrete Mathematics (PCC-CSM405)
Academic Session: 2023-24
6.
(1 + 𝑥)−2 = ∑𝑛𝑟=0 (−1)𝑟 (𝑟 + 1) 𝑥 𝑟 (−1 < 𝑥 < 1)
7. 𝑛(𝑛+1)(𝑛+2)⋯(𝑛+𝑟−1)
(1 − 𝑥)−𝑛 = 1 + ∑∞
𝑟=1 𝑟!
𝑥 𝑟 , 𝑛 is any real
8. 𝑥𝑟
𝑒 𝑥 = ∑∞
𝑟=0 𝑟!
9. 𝑥𝑟
𝑒 −𝑥 = ∑∞
𝑟=0 (−1)𝑟 𝑟!
10. 𝑥𝑟
𝑙𝑜𝑔 (1 + 𝑥) = ∑∞
𝑟=0 (−1)𝑟 (−1 < 𝑥 < 1)
𝑟
Theorem 1: If 𝒈(𝒙) is the generating function of {𝒂𝒓 } then (𝟏 − 𝒙) 𝒈(𝒙) is the generating function of {𝒂𝒓 − 𝒂𝒓−𝟏 }
assuming 𝒂−𝟏 = 𝟎.
𝑔(𝑥) = 𝑎0 + 𝑎1 𝑥 + 𝑎2 𝑥 2 + ⋯ + 𝑎𝑟 𝑥 𝑟 + ⋯ = ∑∞
𝑟=0 𝑎𝑟 𝑥 𝑟 .
Therefore, (1 − 𝑥) 𝑔(𝑥) = (1 − 𝑥) ∑∞
𝑟=0 𝑎𝑟 𝑥 𝑟 = ∑∞
𝑟=0 𝑎𝑟 𝑥 𝑟 − ∑∞
𝑟=0 𝑎𝑟 𝑥 𝑟+1 = ∑∞
𝑟=0 𝑎𝑟 𝑥 𝑟 −
∑∞
𝑟=1 𝑎𝑟−1 𝑥 𝑟
= ∑∞
𝑟=0 (𝑎𝑟 − 𝑎𝑟−1 )𝑥 𝑟 , assuming 𝑎−1 = 0.
Theorem 2. If 𝑔(𝑥) is the generating function of {𝑎𝑟 }, then 𝑥 𝑔′(𝑥) is the generating function of {𝑟 𝑎𝑟 }.
Therefore, 𝑔′(𝑥) = ∑∞
𝑟=0 𝑟 𝑎𝑟 𝑥 𝑟−1 then 𝑥𝑔′(𝑥) = ∑∞
𝑟=0 𝑟 𝑎𝑟 𝑥 𝑟 .
Exercise: If 𝑔1 (𝑥) and 𝑔2 (𝑥) are the generating functions of {𝑎𝑟 } and {𝑏𝑟 } then
A recurrence relation for a sequence {𝑎0 , 𝑎1 , 𝑎2 , ⋯ , 𝑎𝑟 , ⋯ } is an equation that expresses 𝑎𝑛 for any 𝑛 in
terms of one or more of the 𝑎𝑖 ′𝑠 where 𝑖 < 𝑛 e.g. 𝑎𝑛 = 3 𝑎𝑛−1 + 𝑎𝑛−2 is a recurrence relation.
A sequence is called a solution of a recurrence relation if its terms satisfy the recurrence relation.
For example, the numeric function < 0!, 1!, 2!, ⋯ > satisfies the recurrence relation 𝑎𝑛 = 𝑛 𝑎𝑛−1 , (𝑛 ≥ 1)
…………(1)
Hence the solution of the recurrence relation (1) is < 𝑛! > i.e., (0!, 1!, 2!, 3!, ⋯ )
In this article we solve the recurrence relation by using generating function and we illustrate this by the following
examples.
= 3(3𝑡𝑛−2 + 7) + 7
= 32 𝑡𝑛−2 + 3.7 + 7
= 32 (3𝑡𝑛−3 + 7) + 3.7 + 7
= 33 𝑡𝑛−3 + 32 7 + 3.7 + 7
= 3𝑛 𝑡0 + 3𝑛−1 7 + 3𝑛−2 . 7 + ⋯ + 7
3𝑛 −1
= 5. 3𝑛 + 7 3−1
7
= 5. 3𝑛 + 2
(3𝑛 − 1)
If 𝜆1 𝑎𝑛 + 𝜆2 𝑎𝑛−1 + 𝜆3 𝑎𝑛−2 + ⋯ + 𝜆𝑘+1 𝑎𝑛−𝑘 = 𝑏𝑛 be a recurrence relation then the equation 𝜆1 𝜆𝑘 + 𝜆2 𝜆𝑘−1 +
𝜆3 𝜆𝑘−2 + ⋯ + 𝜆𝑘 𝜆 + 𝜆𝑘+1 = 0 is called its characteristic equation. The roots of the characteristic equations
called its characteristic roots.
Example: Solve the recurrence relation 𝑎𝑛 = 𝑎𝑛−1 + 8𝑎𝑛−2 − 12𝑎𝑛−3 , 𝑛 ≥ 3, subject to the initial conditions 𝑎0 =
0, 𝑎1 = 1, 𝑎2 = 3.
Solution: To determine the characteristic equation, first bring all terms over to the LHS. Thus, the recurrence is 𝑎𝑛 −
𝑎𝑛−1 − 8𝑎𝑛−2 + 12𝑎𝑛−3 = 0, so the characteristic equation is 𝑥 3 − 𝑥 2 − 8𝑥 + 12 = 0. Testing the positive divisors
of 12 and their negatives as possible roots reveals that 2 and -3 are roots, and after factoring the LHS of the
characteristic equation we get (𝑥 − 2)2 (𝑥 + 3) = 0. Thus 2 is a root of multiplicity 2, and 3 is a root of multiplicity
1. Therefore, the general solution is
ℎ(𝑛) = 𝑐1 2𝑛 + 𝑐2 𝑛 2𝑛 + 𝑐3 (−3)𝑛 . Finally, we need to use the initial conditions to determine the constants.
𝑎0 = 0 ⇒ 𝑐1 20 + 𝑐2 0 20 + 𝑐3 (−3)0 = 0
𝑎1 = 1 ⇒ 𝑐1 21 + 𝑐2 1 21 + 𝑐3 (−3)1 = 1
𝑎2 = 2 ⇒ 𝑐1 22 + 𝑐2 2 22 + 𝑐3 (−3)2 = 2
2 3 2
This system of 3 equations in 3 unknowns has the solution 𝑐1 = − 25 , 𝑐2 = ,𝑐
10 3
= 25, so the solution to the
2 𝑛 3 2
𝑎𝑛 = (− )2 + 𝑛 2𝑛 + (−3)𝑛 .
25 10 25
Recall that these are recurrence relations of the form𝑎𝑛 = 𝛼1 𝑎𝑛−1 + 𝛼2 𝑎𝑛−2 + ⋯ + 𝛼𝑘 𝑎𝑛−𝑘 + ℎ(𝑛), where 𝛼1 ,
𝛼2 , ⋯, 𝛼𝑛 are constants, and ℎ(𝑛) is not identically zero. We'll refer to ℎ(𝑛) as the non-homogeneous term. We
will need to use solutions to the recurrence relation obtained by replacing ℎ(𝑛) by zero, which we'll call the
associated non-homogeneous recurrence relation.
1. Write down the associated homogeneous recurrence and nd its general solution.
2. Find a particular solution of the non-homogeneous recurrence. This may involve solving several simpler non-
homogeneous recurrences (using this same procedure).
3. Add all of the above solutions together to obtain the general solution to the non-homogeneous recurrence.
4. Use the initial conditions to get a system of k equations in k unknowns, then solve it to obtain the solution you
want.
Note. You must solve the associated homogeneous recurrence first because you need to know the roots of the
characteristic equation and their multiplicities before you can nd the particular solution you want in the next step.
Solution. The associated homogeneous recurrence is 𝑎𝑛 = 4 𝑎𝑛−1 − 4𝑎𝑛−2 . Its characteristic equation is 𝑥 2 =
4𝑥 − 4, or (𝑥 − 2)2 = 0 . Thus, 2 is the only root and it has multiplicity 2. The general solution to the associated
homogeneous recurrence is 𝑐1 2𝑛 + 𝑐2 𝑛2𝑛 .
To find a particular solution to the non-homogeneous recurrence, we add together particular solutions to the three
\simpler" non-homogeneous recurrences:
• an = 4an-1− 4an-2+ n 2n
• an = 4an-1 − 4an-2 + 4.
Let’s find a particular solution to an = 4an−1 4an−2 + 4 first. The non- homogeneous term is 4 = 4.1n, and since 1
is not a root of the characteristic equation, there is a particular solution of the form c1n.
To determine c, plug c1n = c into the non-homogeneous recurrence and get c = 4c − 4c + 4 = 4. Thus, a particular
solution to the recurrence under consideration is an = 4.
Now let’s do the same for an = 4an−1 4an−2 +3n. The non-homogeneous term is 3n = 1 3n. Since 3 is not a
root of the characteristic equation. There is a particular solution of the form c3n. To determine c, plug c3n into
the non-homogeneous recurrence and get c3n = 4c3n−1 4c3n−2 + 3n. After dividing by the common factor of 3n−2,
we have 9c = 12c − 4c + 9, or c = 9. Thus, a particular solution to the recurrence under consideration is an = 9
· 3 n.
Let’s find a particular solution to an = 4an−1 4an−2 + n2n. The non-homogeneous term is n2n. Since 2 is a root of
the characteristic equation with multiplicity 2, NHLRR 2 says there is a particular solution of the form n2(un + v)2n.
To determine u and v, plug this expression into the non- homogeneous recurrence and get
After dividing both sides by 2n − 2 and doing a bit of algebra this becomes
4un3 + 4vn2 = 8u(n − 1)3 + 8v(n − 1)2 −4u(n − 2)3 − 4v(n − 2)2 + 4n
= (8u − 4u)n3 + (−24u + 8v + 24u − 4v)n2+(24u − 16v − 48u + 16v + 4)n +(−8u + 8v + 32u − 16v)
4u = 4u,
The first two equations tell us nothing. The third equation implies u = 1/6. Substituting this value into the last
equation and solving gives v = 1/2. Thus, a particular solution to the given recurrence is n2(1 n + 1 )2n.
a0 = 0 ⇒ c1 + 4 + 9 = 0
The first equation says c1 = −13. Plugging this into the second equation gives c2 = −8/3.
1 1
𝑎𝑛 =(−13)2n + (−8/3)n2n + 4 + 9 · 3n + 𝑛2 (6 𝑛 + 2)2𝑛 .
1 1
Question: Show that The generating function for 1,1,1,1, . .. is 1−𝑥 and 1, −1,1, −1, .. is 1+𝑥.
Answer:
Answer:
Answer:
1
Question: Show that The generating function for 1,2,3,4,5. .. is (1−𝑥)2 .
Answer: We know
1
Hence, The generating function for 1,2,3,4,5. .. is (1−𝑥)2 .
Question: Find the coefficient of x2005 in the generating function G(x )=(1-2x)5000 and H(x)=1/(1+3x).
Answer:
1 1 1
Question: Find the generating function for the sequence 0,1, − 2 , 3 , − 4 , . ..
a. 24 b. 6
c. 4 d. none of these
2 Determine the number of committees of 2 boys and 3 girls that can be formed out of 7 boys and 6
girls.
a. 21 b. 20
c. 420 d. 504
3 Choose the appropriate option to fill in the blank. If n pigeonholes are occupied by n+1 pigeons, then
at least ______ number of hole is occupied by more than one pigeon.
a. 2 b. 1
c. 3 d. None of these
4 Calculate the number of ways to arrange 7 different beads to form a necklace?
a. 250 b. 300
c. 360 d. 350
5 Choose the correct option. The least number of people 4 of whom will have same birthday of the
week is
a. 18 b. 42
c. 28 d. 22
6
If
2n
C3 :n C2 = 44 : 33 then illustrate the value of n.
a. 6 b. 5
c. 2 d. 7
7 Illustrate the total number of ways of selecting 5 letters from the letters of the word INDEPENDENT.
a. 72 b. 27
c. 462 d. None of these
8 n n n
If C1 , C2 and C3 are in A.P., the illustrate value of n.
a. 6 b. 7
c. 8 d. 4
9 Choose the correct option. The number of ways in which 6 different flowers can be arranged in a
garland is
a. 120 b. 60
c. 240 d. None of these
10 Illustrate the number of words of 5 different letters that can be formed by taking 2 letters from the
word BOX and 3 letters from the word TABLE.
a. 120 b. 30
c. 3600 d. None of these
11 Illustrate the number of distinct permutations that can be formed from all the letters of the word
UNUSUAL.
a. 5040 b. 840
c. 210 d. 35
12 Choose the correct option. How many numbers can be formed by using all of the digits 5, 4, 3, 2, 1, 4,
3, 2, 1 such that odd digits always occupy odd places?
a. 2880 b. 540
a. 16 b. 15
c. 13 d. 11
14
If A, B and C are pairwise mutually disjoint then determine the value of
n( A B C) ?
a. n ( A) + n ( B ) + n ( C ) − n ( A B ) − n ( B C ) − n ( A C ) + n ( A B C )
b. n ( A) + n ( B ) + n ( C ) − n ( A B ) − n ( B C ) − n ( A C )
n ( A) + n ( B ) + n ( C ) n( A + B + C )
c. d.
15 Choose the correct option. The number of numbers from 1 to 7 are chosen so that two of them will
add upto 8 is
a. 3 b. 4
c. 5 d. 9
16
If Pr = 120 Cn−r , illustrate the value of r.
n n
a. 5 b. 4
c. 6 d. 3
x1, x2 , x3 0 .
a. 1320 b. 220
3. Calculate the number of 3 digit numbers can be made from the digits 1, 2, ···, 9, if each can be used once? How
may 7 digit numbers can be made?
4. Write the number of distinct sets of 3 differently coloured scarves can be bought if the shop has scarves in 8
different colours?
5. Write The Pigeonhole Principle.
6. Among 100 people, calculate the minimum number of people that were born in the same month?
7. Assume that we choose three different digits from 1 to 9 and write all permutations of those digits. Justify that
among the 3-digit numbers written that way there are two whose difference is a multiple of 500.
8. Let S be a set of eleven 2-digit numbers. Justify that S must have two elements whose digits
have the same difference (for instance in S = {10, 14, 19, 22, 26, 28, 49, 53, 70, 90, 93}, the
digits of the numbers 28 and 93 have the same difference: 8 − 2 = 6, 9 − 3 = 6.)
2. Deduce the number of non-negative integral solutions of the inequality 𝑥1 + 𝑥2 + 𝑥3+ 𝑥4 < 8? 𝑥𝑖 ≥ 0, 𝑖 =
1 𝑡𝑜 4.
3. Deduce the number of ways in which 4 science students and 17 commerce students can sit together in a queue
such that between any two science students at least two commerce students can sit.
4. There are 12 bulbs in a room each of which is operated independently by 12 different switches. Write the
number of ways the room can be illuminated?
5. Deduce the least number of area codes needed to guarantee that 25 million people will be assigned distinct 10-
digit telephone numbers?
6. Deduce the number of ways are there to select a first-prize winner, a second-prize winner and a third-prize
winner from 100 different competitors?
1 1
7. Justify that the generating function for 1,1,1,1, . .. is and 1, −1,1, −1, .. is .
1−𝑥 1+𝑥
8. 1
Justify that the generating function for 1,2,3,4,5. .. is (1−𝑥)2 .
1 1 1
10. Write the generating function for the sequence 0,1, − , , − , . ..
2 3 4
References:
1. “Discrete Mathematics and Its Applications”, Kenneth H. Rosen, McGraw-Hill.
2. “Discrete Mathematics with Applications”, Susanna S Epp, Wadsworth Publishing Co. Inc, 4th edition
3. “Elements of Discrete Mathematics: a computer oriented approach”, C L Liu and Mohapatra, McGraw
Hill, 3rd edition.
4. “Discrete Mathematical Structures and its Application to Computer Science”, J P Trembley, R
Manohar, TMG Edition, Tata McGraw-Hill.
5. “Discrete Mathematics”, Norman L Biggs, Oxford University Press, 2nd Edition.
6. “Discrete Mathematics”, Schaum’s Outlines Series, Semyour Lipschutz and Marc Lipson
Name of the Faculty: Mr. Sayandeep Dutta
Designation and Department: Assistant Professor, Department of Mathematics
Brainware University, Kolkata 21
Programme Name and Semester: B.Tech CSE (AIML_DS), 4th semester
Course Name (Course Code): Discrete Mathematics (PCC-CSM405)
Academic Session: 2023-24