You are on page 1of 50

AJ Institute of Engineering and Technology

Lecture Notes
T
Discrete Mathematical Structures (18CS36)
IE
Module 4 - The Principle of Inclusion and
Exclusion and Recurrence Relations
AJ

Prepared By

Dr. Shantha Kumari. K.


Department of Mathematics
AJIET, Mangaluru
Email : shanthakk99@gmail.com
AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 1

Module-4: Syllabus

The Principle of Inclusion and Exclusion: The Principle of Inclusion and Exclu-
sion, Generalizations of the Principle, Derangements – Nothing is in its Right Place,
Rook Polynomials.
Recurrence Relations: First Order Linear Recurrence Relation, The Second Order
Linear Homogeneous Recurrence Relation with Constant Coefficients.
Text book : Ralph P. Grimaldi: Discrete and Combinatorial Mathematics, 5th Edi-
tion, Pearson Education. 2004.
Chapter 8 – 8.1 to 8.4, Chapter10 – 10.1, 10.2

3.1 The Principle of Inclusion and Exclusion


T
Recall that if S is a finite set, then the number of elements in S is called the order
IE
(or the cardinality) of S and is denoted by |S|.
If A and B are subsets of S, then the order of A ∪ B is given by the formula
AJ

|A ∪ B| = |A| + |B| − |A ∩ B|

Thus, for determining the number of elements that are in A ∪ B, we include all
elements in A and B, but exclude all elements common to A and B.
If Ā is the complement of A (in S) and B̄ is the complement of B, then
|Ā ∩ B̄| = |(A ∪ B)| = |S| − |A ∪ B| = |S| − |A| − |B| + |A ∩ B|
Similarly for 3 sets A1 , A2 and A3 , we have

|A1 ∪ A2 ∪ A3 | = |A1 | + |A2 | + |A3 |

− |A1 ∩ A2 | − |A2 ∩ A3 |

− |A1 ∩ A3 | + |A1 ∩ A2 ∩ A3 |

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 2

Principle of Inclusion-Exclusion for n sets :


Let S be a finite set and A1 , A2 , . . . , An be subsets of S. Then the Principle of
inclusion- exclusion for A1 , A2 , . . . , An states that

|A1 ∪ A2 ∪ A3 ∪ . . . ∪ An |

= Σ |Ai | − Σ |Ai ∩ Aj | + Σ |Ai ∩ Aj ∩ Ak | + · · ·

+ (−1)n−1 |A1 ∩ A2 ∩ · · · ∩ An |

By using De Morgan’s law



A1 ∩ A 2 ∩ A3 ∩ . . . ∩ An

= A 1 ∪ A2 ∪ A3 ∪ . . . ∪ An

= |S| − |A1 ∪ A2 ∪ A3 ∪ . . . ∪ An |

= |S| − Σ |Ai | + Σ |Ai ∩ Aj | − Σ |Ai ∩ Aj ∩ Ak | + · · ·

+ (−1)n |A1 ∩ A2 ∩ · · · ∩ An |
T
IE
Alternative form :If we denote, S0 = |S| = N S1 = Σ |Ai |, S2 =
Σ |Ai ∩ Aj |,
S3 = Σ |Ai ∩ Aj ∩ Ak | · · · Sn = |A1 ∩ A2 ∩ · · · ∩ An |
AJ

Then the principle of inclusion and Exclusion is given by

|A1 ∪ A2 ∪ . . . ∪ An | = S1 − S2 + S3 − · · · (−1)n−1 Sn

Also ,

A1 ∩ A2 ∩ A3 ∩ . . . ∩ An = S0 − S1 + S2 − S3 · · · + (−1)n Sn

Example 3.1.1. Determine the number of positive integers n such that 1 ≤ n ≤


100 and n is not divisible by 2, 3 or 5
(VTU Sept 2020, Jan 2019, 2017, Jan 2017, June 2014, 2008)

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 3

Solution : Here S = {1, 2, 3, . . . , 100} and N = 100. For n ∈ S


Let A1 = {Integers from 1 to 100 which are divisible by 2}
A2 = {Integers from 1 to 100 which are divisible by 3}
A3 = {Integers from 1 to 100 which are divisible by 5}
|A1 | = 100
   100 
2
= 50 similarly, |A 2 | = 3
= 33
|A3 | = 100
 
5
= 20
∴ S1 = Σ|Ai | = 50 + 33 + 20 = 103
|A1 ∩ A2 | = 100
 
6
= 16 ( Since LCM(2,3)=6)
|A1 ∩ A3 | = 100
 
10
= 10 (since LCM of 2 and 5 = 10)
|A2 ∩ A3 | = 100
 
15
= 6 (Since LCM of 3 and 5 is 15)
∴ S2 = Σ|Ai ∩ Aj | = 16 + 10 + 6 = 32
|A1 ∩ A2 ∩ A3 | = 100
 
30
=3
i.e. S3 = 3 T
pause Applying the Principle of Inclusion and Exclusion, we find that
IE
|A1 ∪ A2 ∪ A3 | = S1 − S2 + S3

= 103 − 32 + 3 = 74
AJ


Required Answer = A1 ∩ A2 ∩ A3

= S0 − S1 + S2 − S3 = 100 − 74 = 26

Example 3.1.2. Find the number of integers between 1 to 10000 (inclusive), which
are divisible by none of 5, 6 or 8 (VTU June 2015, Dec 2014)

Solution : Here S = {1, 2, 3, . . . , 10000} and N = |S| = 100. For n ∈ S


Let A1 = {Integers from 1 to 10000 which are divisible by 5}
A2 = {Integers from 1 to 10000 which are divisible by 6}
A3 = {Integers from 1 to 10000 which are divisible by 8}
Now |A1 | = 10,000
   10,000   10,000 
5
= 2000, |A 2 | = 6
= 1666, |A 3 | = 8
=

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 4

1250.
Integers in the set A1 ∩ A2 are by both 5 and 6.
Note that an integer is divisible by both 5 and 6 if it is divisible by their lcm {5, 6} =
30.
Also lcm{5, 8} = 40, lcm {6, 8} = 24.
Then
 
10000
|A1 ∩ A2 | = = b333.3c = 333,
30
 
10000
|A1 ∩ A3 | = = 250,
40
 
10000
|A2 ∩ A3 | = = 416
24
 10000 
Also |A1 ∩ A2 ∩ A3 | = 120
= 83, since lcm {5, 6, 8} = 120.
Now by Principle of inclusion- Exclusion, the number of integers between 1 and


Ā1 ∩ Ā2 ∩ Ā3
T
10, 000 that are divisible by none of 5,6 and 8 is given by
IE
= |A| − (|A1 | + |A2 | + |A3 |) + (|A1 ∩ A2 |

+ |A2 ∩ A3 | + |A3 ∩ A1 |) − |A1 ∩ A2 ∩ A3 |


AJ

= 10, 000 − (2000 + 1666 + 1250) + (333 + 250 + 416) − 83

= 6000

Example 3.1.3. There are 30 students in a hostel. In that 15 study history, 8 study
economics and 6 study geography it is known that 3 students study all these subjects.
Show that there are 7 or more students studies none of these subjects (VTU Jan
2019, Jan 2018, June 2012, 2011)

Solution : S1 = Σ |Ai | = 15 + 8 + 6 = 29, and


S3 = |A1 ∩ A2 ∩ A3 | = 3

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 5

|A1 ∩ A2 ∩ A3 | = |S| − Σ |Ai | + Σ |Ai ∩ Aj | − Σ |A1 ∩ A2 ∩ A3 |

= |S| − S1 + S2 − S3

= 30 − 29 + S2 − 3 = S2 − 2
where S2 = Σ |Ai ∩ Aj | .
We note that (A1 ∩ A2 ∩ A3 ) is a subset of (Ai ∩ Aj ) for i, j = 1, 2, 3. There-
fore, |A1 ∩ A2 ∩ A3 | is less than or equal to |Ai ∩ Aj | . Hence

S2 = Σ |Ai ∩ Aj | ≥ 3 |A1 ∩ A2 ∩ A3 | = 9

Using this in (i), we find that

|A1 ∩ A2 ∩ A3 | ≥ 9 − 2 = 7

Example 3.1.4. In how many ways one can arrange the integers 1,2,3,4, . . . , 10 in a
line such that no even integer is in its natural place?
T (VTU Jan 2019, June 2013,
2016, Dec 2012, 2010)
IE
Solution : Let S be the set of all arrangements of the given 10 integers.
∴ S0 = |S| = 10!
AJ

For 1 ≤ i ≤ 5, let Ai be the condition that 2i is in position 2i. (i.e. 2 is in 2nd


position, 4 is in 4th position, · · · 10 in 10th position)
Fixing 2 in the second position, remaining 9 integers can be arranged in 9! ways.
This way we can select one even no. out of 5 in 51 ways.


in general |Ai | = 9!, 1 ≤ i ≤ 5 ; Hence S1 = 51 9!




when two even numbers are in their natural position, we have |Ai ∩ Aj | = 8!, 1 ≤
i<j≤5
5
and S2 = 2
8!
when three even numbers are in their natural position, we have |Ai ∩ Aj ∩ Ak | =
7!, 1 ≤ i < j ≤ 5

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 6

5
and S3 = 3
7!
5
and similarly, S4 = 4
6!
Also when all 2, 4 , 6, 8 and 10 are in their natural positions, we have
|A1 ∩ A2 ∩ A3 ∩ A4 ∩ A5 | = 5!
and S5 = 55 5!


∴ Ā1 ∩ Ā2 ∩ Ā3 ∩ Ā4 ∩ Ā5

= S0 − S1 + S2 − S3 + S4 − S5
         
5 5 5 5 5
= 10! −   9! +   8! −   7! +   6! −   5!
1 2 3 4 5

= 2, 170, 680.

Example 3.1.5. In how many ways 5 a’s, 4 b’s and 3 c’s can be arranged so that all
the identical letters are not in a single block?
T
Solution : Here total no. of letters = 5+4+3=12
IE
12!
Let S be the set of all permutations, Then |S| = S0 = (5!4!3!)
= 27, 720
Let A1 be the set of permutations of the letters, where the 5 a’s are in a single block:
AJ

8!
So |A1 | = (4!3!)
= 280
Similarly if A2 is the set of arrangements such that the 4 b’s are together and A3 is
the set of arrangements such that all the 3 c’s are in a single block, we have
9! 10!
|A2 | = (5!3!) = 504, |A3 | = (5!4!) = 1260
P
S1 = |Ai | = 280 + 504 + 1260 = 2044
To find |A1 ∩ A2 | we first remove 5 a’s and 4 b’s from 12 letters and then treat these
as 2 single letters say θ1 = aaaaa, θ2 = bbbb

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 7

(12 − 5 − 4 + 2)! 5!
|A1 ∩ A2 | = = = 20
3! 3!
(12 − 5 − 3 + 2)! 6!
|A1 ∩ A3 | = = = 30
4! 4!
(12 − 4 − 3 + 2)! 7!
|A2 ∩ A3 | = = = 42
5! 5!

P
Hence S2 = |Ai ∩ Aj | = 20 + 30 + 42 = 92
To find |A1 ∩ A2 ∩ A3 |, we first remove 5 a’s and 4 b’s and 3 c’s from 12 letters
and then treat these as 3 single letters say θ1 = aaaaa, θ2 = bbbb, θ3 = ccc
|A1 ∩ A2 ∩ A3 | = (12 − 5 − 4 − 3 + 3)! = 3! = 6

∴ S3 = 6
no. of permutations such that all identical letters are not in a single block
|Ā1 ∩ Ā2 ∩ Ā3 |

= S0 − S1 + S2 + S3

= 27720 − 2044 + 92 − 6
T
IE
= 25762

Example 3.1.6. In how many ways the 26 letters of English alphabet are permuted
AJ

so that none of the patterns CAR, DOG, PUN or BYTE occurs? (VTU Sept 2020,
Jan 2020, July 2019, Jan 2019, Jan 2018, 2017, June 2016, Dec 2013)

Solution :
Let S denote the set of all permutations of the 26 letters. Then |S| = 26!.
For each 1 ≤ i ≤ 4, a permutation in S is said to satisfy condition Ai if the
permutation contains the pattern car, dog, pun, or byte, respectively.
i.e. A1 ={all permutations in which the pattern ‘CAR’ appears}.
A2 ={all permutations in which the pattern ‘DOG’ appears}
A3 ={all permutations in which the pattern ‘PUN’ appears}
A4 ={all permutations in which the pattern ‘BYTE’ appears}

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 8

The word, θ1 = CAR, consists of three letters which form a single block.
The set A1 therefore consists of all permutations which contain this single block θ1
and the 26-3=23 remaining letters.
Therefore, |A1 | = (26 − 3 + 1)! = 24!
Similarly, if θ2 = DOG, θ3 = PUN and θ4 = BYTE respectively, we have

|A2 | = 24!, |A3 | = 24!, |A4 | = 23!

Similarly
|A1 ∩ A2 | = |A1 ∩ A3 | = |A2 ∩ A3 |

= (26 − 6 + 2)! = 22!

|A1 ∩ A4 | = |A2 ∩ A4 | = |A3 ∩ A4 |

= (26 − 7 + 2) = 21!

|A1 ∩ A2 ∩ A3 | = (26 − 9 + 3)! = 20!T


|A1 ∩ A2 ∩ A4 | = |A1 ∩ A3 ∩ A4 |
IE
= |A2 ∩ A3 ∩ A4 | = (26 − 10 + 3)! = 19!
|A1 ∩ A2 ∩ A3 ∩ A4 | = (26 − 13 + 4)! = 17!
AJ

S0 = |S| = 26!

S1 = Σ |Ai | = (3 × 24!) + 23!


Hence
S2 = Σ |Ai ∩ Aj | = (3 × 22!) + (3 × 21!)

S3 = Σ |Ai ∩ Aj ∩ Ak | = 20! + (3 × 19!)

S4 = |A1 ∩ A2 ∩ A3 ∩ A4 | = 17!
Therefore, the required number of permutations is given by

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 9

|A1 ∩ A2 ∩ A3 ∩ A4 |

= |S| − Σ |Ai + Σ| Ai ∩ Aj | − Σ|Ai ∩ Aj ∩ Ak |

+ |A1 ∩ A2 ∩ A3 ∩ A4 |

= S0 − S1 + S2 − S3 + S4

= 26! − (3 × 24! + 23!) + (3 × 22! + 3 × 21!) − (20! + 3 × 17!) + 17!

Example 3.1.7. Find the number of permutations of a, b, c. . . x, y, z in which none


of the patterns spin, game, path or net occurs. (VTU June 2013)

Solution : Let A1 denote that the arrangement contains the pattern spin. Likewise,
let A2 , A3 , A4 denote this for the patterns game, path, and net, respectively.
|A1 | = 23!, |A2 | = 23!, |A3 | = 23!, |A4 | = (1 + 23)! = 24!
|A1 ∩ A2 | = number of permutations of distinct objects consisting of
T
the two patterns spin and game, and the
IE
18 letters not present in these two patterns

=(2 + 18)! = 20!


AJ

|A1 ∩ A3 | = 0
(Because, no permutation of distinct objects can contain both of the patterns spin and path
Similarly A1 ∩ A4 = (26 − 6 + 1)! = 21!
( Since the patterns “spin” and “net” both contain the letter “n”, the only way a per-
mutation can contain both patterns is that it contains the pattern “spinet”. We now
count this as a single block and the remaining 26 − 6 = 20 letters are free)

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 10

Similarly

|A2 ∩ A3 | = 0, |A2 ∩ A4 | = 0, |A3 ∩ A4 | = 0


|A1 ∩ A2 ∩ A3 | = 0, |A1 ∩ A2 ∩ A4 | = 0
|A1 ∩ A3 ∩ A4 | = 0, |A2 ∩ A3 ∩ A4 | = 0
|A1 ∩ A2 ∩ A3 ∩ A4 | = 0

|A1 ∩ A2 ∩ A3 ∩ A4 |

= |S| − Σ |Ai | + Σ |Ai ∩ Aj |

− Σ |Ai ∩ Aj ∩ Ak | + |A1 ∩ A2 ∩ A3 ∩ A4 |

= 26! − (23! + 23! + 23! + 24!)

+ (20! + 0 + 0 + 0 + 0 + 21!) − (0 + 0 + 0 + 0) + 0

= 26! − {3 × (23!) + 24! + (20! + 21!)


T
Ā1 ∩ Ā2 ∩ Ā3 ∩ Ā4 = 26! − [3(23!) +24!] + [(20!+ 21!)] = 4.026 × 1026
IE
AJ

Practice Problems

1. In a survey of 260 college students, the following data were obtained. 64 had
taken mathematics course, 94 had taken CS course, 58 had taken EC course,
28 had taken both Mathematics and EC course, 26 had taken both Mathematics
and CS course, 22 had taken both CS and EC course, and 14 had taken all three
types of course. Determine how many of these students had taken none of the
three subjects. (VTU July 2018) Ans : 106

2. In how many ways can 3 x’s 3y’s and 3 z’s be arranged so that no consecutive
triple of the same letter arrives? (VTU Dec 2012)

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 11

3. In how many ways can 4 a’s, 3 b’s and 2 c’s be arranged so that all identical
letters are not in a single block? (VTU Dec 2011)

3.2 Generalizations of the Principle

Let S be a set with |S| = S0 = N, and let A1 , A2 , . . . , An be n subsets of


S. Let us denote S1 = Σ |Ai |, S2 = Σ |Ai ∩ Aj |, S3 = Σ |Ai ∩ Aj ∩ Ak |
· · · Sn = |A1 ∩ A2 ∩ · · · ∩ An |
Then the principle of inclusion and Exclusion is given by

|A1 ∪ A2 ∪ . . . ∪ An | = S1 − S2 + S3 − · · · (−1)n−1 Sn

If m ∈ Z + and 1 ≤ m ≤ n, Then number of elements in S that satisfy exactly


m of the n conditions is given by T
   
m+1 m+2
IE
Em = Sm −   Sm+1 +   Sm+2 · · · +
1 2
 
n
AJ

· · · + (−1)n−m   Sn
n−m

When m = 0, we get the no. of elements satisfying exactly 0 conditions (i.e none
of the conditions )

E0 = S0 − S1 + S2 + · · · + (−1)n Sn = |A1 ∩ A2 ∩ · · · ∩ An |

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 12

Based on this result, if Lm denotes the number of elements of S that satisfy at least
m of the n conditions, then we have the following formula.
   
m m+1
Lm = Sm − Sm+1 + Sm+2 − · · ·
m−1 m−1
 
n−1
· · · + (−1)n−m   Sn
m−1

When m = 1, the above formula becomes

L1 = S1 − S2 + S3 − · · · + (−1)n−1 Sn = |A1 ∪ A2 ∪ · · · ∪ An |

Example 3.2.1. How many integers between 1 and 300 (inclusive) are divisible by i)
at least one of 5, 6, 8 ii) none of 5, 6, 8? (VTU Jan 2020, Dec 2014, 2013, 2012,
June 2013, 2009)

Solution :
T
Let A1 = {integers between 1 and 300 which are divisible by 5}
IE
A2 = {integers between 1 and 300 which are divisible by 6}
AJ

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 13

A3 = {integers between 1 and 300 which are divisible by 8}

|A1 | = b300/5c = 60,

|A2 | = b300/6c = 50

|A3 | = b300/8c = 37

|A1 ∩ A2 | = b300/30c = 10

|A1 ∩ A3 | = b300/40c = 7

|A2 ∩ A3 | = b300/24c = 12

(Note that the l c.m. of 6 and 8 is 24)

|A1 ∩ A2 ∩ A3 | = b300/120c = 2

( Note that the lcm of 5, 6, 8 is 120).

We note that S1 = Σ|Ai | = 60 + 50 + 37 = 147


S2 = Σ|Ai ∩ Aj | = 10 + 7 + 12 = 29
S3 = |A1 ∩ A2 ∩ A3 |
T (*)
IE
(i) The number of elements of S that are divisible by atleast one of 5,6,8 is given by
L1 = S1 − S2 + S3 = 147 − 29 + 2 = 120
AJ

(ii) The number of elements of S that are divisible by none of 5,6,8 is given by
E0 = S0 − S1 + S2 − S3 = 300 − 147 + 29 − 2 = 180

Example 3.2.2. How many integers between 1 and 300 (inclusive) are (i) divisible
by exactly 2 of of 5, 6, 8 ? (ii) divisible by atleast 2 of of 5, 6, 8 ? (VTU July 2019)

Solution : (Repeat the steps from previous problem till equation (*).
(i)Integers between 1 and 300 that are divisible by exactly 2 of of 5, 6, 8 is given by
E2 = S2 − 31 S3 = 29 − 3(2) = 23


m+1 m+2 n 
(Recall Em = Sm − 1
Sm+1 + 2
Sm+2 · · · + (−1)n−m n−m
Sn )

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 14

(ii) No. of integers between 1 and 300 that are divisible by atleast 2 of of 5, 6, 8 is
given by
2
L2 = S2 − 1
S3 = 29 − 2(2) = 25
 
m  m+1 n−1 
Recall that Lm = Sm − m−1
Sm+1 + m−1
Sm+2 − · · · + (−1)n−m m−1
Sn

Example 3.2.3. In how many ways one can arrange the letters of the word “COR-
RESPONDENTS” so that there are
i) no pair of consecutive identical letters?
ii) exactly 2 pairs of consecutive identical letters?
iii) at least 3 pairs of consecutive identical letters?
(VTU June 2017, Jan 2017, June 2011)

Solution : Here we have 14 letters out of which E occurs twice, N occurs twice, O
T
occurs twice, R occurs twice and S occurs twice.
Hence number of all possible arrangements is given by
IE
(14!)
|S| = S0 = (2!)5

A1 = {arrangements with presence of consecutive E’s}.


AJ

= {arrangements with ‘EE’ together}

A2 = { arrangements with ‘NN’ together}.

A3 = {arrangements with ‘OO’ together}.

A4 = {arrangements with ‘RR’ together}.

A5 = {arrangements with ‘SS’ together.}


(14 − 2 + 1)! (13!)
|A1 | = =
2! 2 2! 2! (2!)4
(13!)
By symmetry,|A1 | = |A2 | = |A3 | = |A4 | = |A5 | =
(2!)4
(13!)
S1 = 5 ×
(2!)4
Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru
AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 15

(14 − 2 − 2 + 2)!
Now, |Ai ∩ Aj | =
2! 2! 2!
(12!)
= ∀1 ≤ i < j ≤ 5
(2!)3
There are 5 C2 = 10 such terms.
(12!)
∴ S2 = 10 × (2!)3

Similarly
|Ai ∩ Aj ∩ Ak | = (14−2−2−2+3)!
2! 2!
= (11!)
(2!)2

There are 53 = 10 such terms.




(11!)
∴ S3 = 10 × (2!)2
(14−2−2−2−2+4)! 10!
Now |Ai ∩ Aj ∩ Ak ∩ Al | = 2!
= 2!
∀1 ≤ i < j < k <
l≤5
5
There are 4
= 5 such terms.
10!
∴ S4 = 5 × 2! T
Finally |A1 ∩ A2 ∩ A3 ∩ A4 ∩ A5 | = 9! = S5
(i)
IE
no. of arrangements with no pair of consecutive identical letters

= Ā1 ∩ Ā2 ∩ Ā3 ∩ Ā4 ∩ Ā5
AJ

E0 = S0 − S1 + S2 − S3 + S4 − S5

= 1, 286, 046, 720 (After substitution and simplification)


(ii)Required Answer = E2 = S2 − 31 S3 + 42 S4 − 53 S5 = 350, 179, 200
  

(After substitution and simplification and calculation)


m+1 m+2 n 
(Recall Em = Sm − 1
Sm+1 + 2
Sm+2 · · · + (−1)n−m n−m
Sn )
3 4
(iii) Required answer = L3 = S3 − 2
S4 + 2
S5 = 74, 753, 280
(After substitution and simplification and calculation)
 
m  m+1 n−1 
Recall that Lm = Sm − m−1
Sm+1 + m−1
Sm+2 − · · · + (−1)n−m m−1
Sn

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 16

Example 3.2.4. Determine in how many ways the letters of the word “ARRANGE-
MENT” can be arranged so that there are
(i) exactly two pairs of consecutive identical letters.
(ii) atleast two pairs of consecutive identical letters.
(iii) exactly three pairs of consecutive identical letters.
(iv)atleast three pairs of consecutive identical letters.
(VTU June 2015, Dec 2014, 2010)

Solution : (a) Let A1 denote the condition that the two A’s are together in an ar-
rangement of “ARRANGEMENT”
Similarly Conditions A2 , A3 , A4 are defined for the two E’s, N ’s, and R’s, respec-
tively.
11!
S0 = |S| = (2!)4
= 2494800
For 1 ≤ i ≤ 4,
|Ai | = 10!
= 453600
T
IE
(2!)3

For 1 ≤ i < j ≤ 4,
9!
|Ai ∩ Aj | = (2!)2
= 90720
AJ

8!
|Ai ∩ Aj ∩ Ak | = (2!)
= 20160, 1 ≤ i < j < k ≤ 4
|A1 ∩ A2 ∩ A3 ∩ A4 | = 7! = 5040
S1 = 41 (453600) = 1814400


S2 = 42 (90720) = 544320


S3 = 43 (20160) = 80640 4

&S4 = 4
(5040) = 5040
m+1 m+2 n 
(i)(Recall Em = Sm − 1
Sm+1 + 2
Sm+2 · · · + (−1)n−m n−m
Sn )

E2 = S2 − (3)S3 + (4)S4
= 544320 − (3)(80640) + (6)(5040) = 332640
 
m  m+1 n−1 
Recall that Lm = Sm − m−1
Sm+1 + m−1
Sm+2 − · · · + (−1)n−m m−1
Sn
2 3
(ii) L2 = S2 − 1
S3 + 3
S4 = 398160

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 17

(iii)E3 = S3 − (1)S4 = 60480


(iv) L3 = S3 − 32 S4 = 65520


3.3 Practice Problems

1. Find the number of permutations of the English letters which contain (i) exactly
two, (ii) at least two, (iii) exactly three, and (iv) at least three, of the pattens
CAR, DOG, PUN and BYTE.

2. In how many ways one can distribute 10 distinct prizes among 4 students with i)
exactly 2 students getting nothing ii) at least 2 students getting nothing? (VTU
Dec 2012)

divisible by 2, 3, or 5
T
3. Determine the number of positive integers n, 1 ≤ n ≤ 2000, that are (a) not
b) not divisible by 2, 3, 5, or 7
IE
4. How many integers between 1 and 300 (inclusive) are divisible by at least one
AJ

of 3,5,7? Ans : 162

5. In how many ways can one arrange all of the letters in the word “INFORMATION”
so that no pair of consecutive letters occurs more than once? [Here we want to
count arrangements such as IINNOOFRMTA and FORTMAIINON but not IN-
FORINMOTA (where “IN” occurs twice) or NORTFNOIAMI (where “NO”
occurs twice).

6. Determine the number of permutations of the letters J, N, U, I, S, G, R, E, A, T


such that none of the words JNUIS and GREAT occur as consecutive letters
(that is, permutations such as JNTUISGREAT, ISJNUGREAT, UNJGREATSI
etc are not allowed).

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 18

3.4 Derangements (Nothing is in its Right Place)

The arrangements of the numbers 1, 2, 3, . . . , n so that 1 is not in first place (its


natural position), 2 is not in second place (its natural position), . . . , and n is not in
nth place (its natural position) are called the derangements of 1, 2, 3, . . . , n and it
is denoted by dn .

 
1 1 1 n 1
dn = n! 1 − + − + · · · + (−1)
1! 2! 3! n!
For example
1 1
 
D2 = 2! 1 − 1!
+ 2!
=1
1 1 1 1 1
  
D3 = 3! 1 − 1!
+ 2!
− 3! =6 1−1+ 2
− 6
=2
Similarly, we get D4 = 9 (Prove this),
D5 = 44(Prove this), T
D6 = 265(Prove this),
IE
and D7 = 1854 (Prove this),

Note :When n ≥ 7 the expression


AJ

 
1 1 1 n 1
1− + − + · · · + (−1) ≈ e−1
1! 2! 3! n!
Hence
dn = n! e−1 where n ≥ 7

Hence d8 = 8! e−1 = 14832.899 = 14833


d9 = 9! e−1 = 133496

Example 3.4.1. Find the number of derangements of the numbers 1, 2, 3 and 4. List
all the derangements. (VTU Sept 2020, July 2019, Dec 2014, 2013, June 2008)

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 19

Solution : The number of derangements of 1, 2, 3, 4 is


 
1 1 1
d4 = 4! 1 − 1 + − +
2! 3! 4!
 
1 1 1
= (24) 1 − 1 + − +
2 6 24
=9

These are
2143 3142 4123
2341 3412 4312
2413 3421 4321

Example 3.4.2. Evaluate d5 , d6 , d7 and d8

Solution :  
1 1 1 1 1
d5 = (5!) 1 − + − + −T
1! 2! 3! 4! 5!
 
1 1 1 1
= (120) − + − = 44
IE
2 6 24 120
 
1 1 1 1 1 1
d6 = (6!) 1 − + − + − +
1! 2! 3! 4! 5! 6!
AJ

 
1 1 1 1 1
= (720) − + − + = 265
2 6 24 120 720
d7 ≈ (7!) × e−1 ≈ b5040 × 0.3679c ≈ 1854
 

d8 ≈ (8!) × e−1 ≈ b40320 × 0.3679c ≈ 14833


 

Example 3.4.3. How many permutations of 1, 2, 3, 4, 5, 6, 7 are not derangements?


(VTU July 2018)

Solution : There are 7! = 5040 permutations of 1, 2, 3, 4, 5, 6, 7.


Among these there are 7! e−1 = 1854 derangements.
Consequently, we have 5040 − 1854 = 3186 permutations of 1, 2, 3, 4, 5, 6, 7

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 20

that are not derangements.

Example 3.4.4. Define derangement. In how many ways one can arrange the num-
bers 1, 2, 3, 4, · · · 10 such that 1 is not in the 1st place, 2 is not in the 2nd place, 3
is not in the 3rd place · · · 10 is not in the 10th place? (VTU June 2011)

Solution : Here, required answer is derangements of n=10 integers.


i.e. d10 = (10!) e−1 ≈ 1334961


(since n ≥ 7, we use the formula dn = n!e−1 )


Note 1: The number of derangements of the integers from 1 to n satisfying the
condition that the elements in first k places are : 1, 2, 3, . . . , k in some order is
given by

T dk × dn−k

Note 2: The number of derangements of the integers from 1 to n satisfying the


IE
condition that the elements in first k places are: k + 1, k + 2, . . . , n in some order
is given by
AJ

k! × (n − k)!

Example 3.4.5. Find the number of derangements of the numbers 1, 2, 3, 4 and 5.


List those derangements where the first 3 numbers are 1, 2, and 3 in some order.
(VTU Jan 2019, Dec 2011)

Solution : The number of derangements ofthe numbers 1, 2, 3, 4 and 5 is given by


1 1 1 1 1
d5 = 5! 1 − + − + −
1! 2! 3! 4! 5!
 
1 1 1 1
= 5! 1 − 1 + − + −
2 6 24 120
= 44
To find the derangements where the first 3 numbers are 1, 2, and 3 in some order, we

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 21

use the formula dk × dn−k where k = 3, n = 5


Hence the no. of such derangements = dk × dn−k = d3 × d2 = 2
The derangements with this property are 23154 and 31254

Example 3.4.6. List all the derangements of the numbers 1, 2, 3, 4, 5, 6 where the
first three numbers are 1, 2, 3 in some order.

Solution : When first three numbers are 1, 2, 3 in some order, we have n = 6 and
k = 3.
There are dk × dn−k = d3 × d3 = 2 × 2 = 4 such derangements.
The list of these derangements is given by
312, 564, 231, 645, 312, 645 and 231, 564

Example 3.4.7. For the positive integers 1, 2, 3, . . . , n there are 11660 derange-
ments where 1, 2, 3, 4, 5 appear in first five positions. What is the value of n? (VTU
T
Dec 2013)
IE
Solution : Here k = 5 and n − k = n − 5
Then 11, 660 = d5 · dn−k = 44 (dn−k ) , and so dn−k = 265 = d6 .
AJ

Consequently, n − k = 6 ⇒ n = 11.

Example 3.4.8. How many derangements of 1, 2, 3, 4, 5, 6, 7, 8 start with (a) 1, 2, 3,


and 4, in some order? (b) 5, 6, 7, and 8, in some order?

Solution : (a) Here k = 4, n = 8, ∴ n − k = 8 − 4 = 4


There are dk × dn−k = (d4 )2 = 92 = 81 derangements of 1, 2, 3, 4, 5, 6, 7, 8
start with 1, 2, 3, and 4, in some order.
(b)If derangement starts with 5, 6, 7, and 8, in some order, then we have k! ×
(n − k)! = 4! × 4! = 576 derangements.

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 22

Example 3.4.9. There are 8 letters to 8 different people to be placed in 8 different


addressed envelopes. Find the number of ways of doing this so that at least one letter
goes to the right person. (VTU Sept 2020, Jan 2020, July 2019, June 2014, 2009)

Solution :The number of ways of placing 8 letters in 8 envelopes is 8!


The number of ways of placing 8 letters in 8 envelopes such that no letter is in the
right envelope is d8 .
Therefore, the number of ways of placing 8 letters in 8 envelopes such that at least
one letter is in the right envelope is
= 8!−d8 = 8!−8! e−1 ≈ b(8!)(1−0.3679)c = b40320×0.6321c = 25486

Example 3.4.10. Seven books distributed to seven students for reading. The books
are collected and redistributed. In how many ways can the two distributions be made
T
such that no student will get the same book in both distributions? (VTU June 2008)
IE
Solution :At the first distribution, we can distribute the books in 7! ways.
This distribution fixes the position of 7 books. Number both the books and the cor-
AJ

responding students (for the first week) as 1, 2, . . . , 7.

The second distribution of the books is such that no student will get the same book
again.
This is equal to the derangements of these numbers so that none of them is in its
natural position.
This can be done in d7 ways.
By the rule of product, she can make the two distributions in (7!)d7 = (7!)2 e−1 =


93, 44, 726 ways.

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 23

Practice Problems

1. For the positive integers 1,2,3,4 there are n derangements. What is the value of
n?

2. Define Derangement. In how many ways can each of 10 people select a left
glove and a right glove out of a total of 10 pairs of gloves so that no person
selects a matching pair of glove? (VTU June 2013)

3. Sheela has seven books to review for ABC Company, so she hires 7 people to
review them. She wants two reviews per book, so the first week she gives each
person one book to read and redistributes the books at the start of the second
week. In how many ways can she make the two distributions so that she gets
two reviews of each book? (VTU Dec 2012)
T
4. How many permutations of 1, 2, 3, 4, 5, 6, 7, 8 are not derangements? (VTU
IE
Sept 2020)
AJ

3.5 Rook Polynomials

In chess a piece called a rook or castle is allowed to move horizontally or vertically


over as many unoccupied spaces as one wishes.

A rook polynomial is a generating polynomial of the number of ways to place non-


attacking rooks on a board that looks like a chess-board; that is, no two rooks may
be in the same row or column.
Here For k ∈ Z + , we want to determine the number of ways in which k rooks can
be placed on the unshaded squares of this chessboard so that no two of them can

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 24

capture each other - that is, no two of them are in the same row or column of the
chessboard. This number is denoted by rk , or by rk (C) if we wish to stress that we
are working on a particular chessboard C.
Then the polynomial 1 + nx + r2 x2 + · · · + rn xn is called the rook polynomial
for the board considered. This is denoted by r(C, x).
Thus
r(C, x) = 1 + r1 x + r2 x2 + · · · + rn xn

Example 3.5.1. Consider the six-square “chessboard” shown in Fig. (Note: The
shaded squares are not part of the chessboard.)

Find the rook polynomial.


T
IE
For any chessboard, r1 is the number of squares on the board. Here r1 = 6. Two
non-capturing rooks can be placed at the following pairs of positions:
AJ

(1, 4), {1, 5}, {2, 4}, {2, 6}, {3, 5}, {3, 6}, {4, 5}, and {4, 6},
so r2 = 8.
Continuing, we find that r3 = 2, using the locations {1, 4, 5} and {2, 4, 6} ;
Also rk = 0, for k ≥ 4.
With r0 = 1, the rook polynomial, r(C, x), for the chessboard in the above figure
is defined as
r(C, x) = 1 + 6x + 8x2 + 2x3 . For each k ≥ 0, the coefficient of xk is the
number of ways we can place k non-capturing rooks on chessboard C.

Example 3.5.2. Find the rook polynomial of

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 25

Solution : For this board, r1 = n = 4. (n= no. of squares in the board)


The number of ways in which two rooks can be placed on this board such that no two
of them capture each other is 2; ( the two possible positions are (1, 4) and (2, 3))
Thus, r2 = 2.
Three rooks cannot be placed on the board such that no two pawns capture each
other.
Thus, r3 = 0. Similarly, r4 = 0.
Accordingly, the rook polynomial for the board is
r(C, x) = 1 + r1 x + r2 x2 = 1 + 4x + 2x2

T
Example 3.5.3. Find the rook polynomial of
IE
AJ

Solution : For this board, r1 = 5.


2 non-capturing rooks can be placed on the board in the following positions:
(1, 5), (2, 4), (2, 5), (3, 4).
Thus, r2 = 4.
Also the board has no positions for more than two mutually non-capturing rooks.
That is, r3 = 0, r4 = 0, r5 = 0.
Thus, for this board, the rook polynomial is

r(C, x) = 1 + r1 x + r2 x2 = 1 + 5x + 4x2

Example 3.5.4. Find the rook polynomial of

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 26

Solution : For this board r1 = n = 6.


Two non-capturing rooks can have the following positions:
(1, 3), (1, 5), (1, 6), (2, 3), (2, 4), (2, 6), (3, 4), (3, 5).
no. of such positions = 8;
Therefore r2 = 8.
The non-capturing positions for 3 rooks are (1,3,5), (2, 3, 4).
Thus, r3 = 2.
We observe that, Four or more mutually non-capturing rooks cannot be placed on the
board. Thus r4 = 0, r5 = 0, r6 = 0.
T
Accordingly, for this board, the rook polynomial is
IE
r(C, x) = 1 + 6x + 8x2 + 2x3

Example 3.5.5. Find the rook polynomial of


AJ

Solution : For this board we have r1 = n = 7


The positions for 2 non-capturing rooks are: (1, 4), (1, 5), (1, 7), (2, 3), (2, 5), (2, 6),
(3, 5), (3, 7), (4, 5), (4, 6). Therefore r2 = 10.
The positions of 3 mutually non-capturing rooks are: (1, 4, 5), (2, 3, 5). Thus
r3 = 2.
We observe that, Four or more mutually non-capturing rooks cannot be placed on the

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 27

board. Thus r4 = 0, r5 = 0, r6 = 0, r7 = 0
Accordingly, for this board, the rook polynomial is

r(C, x) = 1 + r1 x + r2 x2 + r3 x3 + r4 x4 + · · · + r7 x7 = 1 + 7x + 10x2 + 2x3

Example 3.5.6. Find the rook polynomial of

Solution : For this board, r1 = n = 8.


For two rooks, the non-capturing positions are:
(1, 5), (1, 7), (1, 8), (2, 4), (2, 5), (2, 6),(2, 8),(3, 4), (3, 6), (3, 7), (4, 7), (4, 8),
(5, 6), (5, 7).
Hence r2 = 14.
T
The positions of 3 mutually non-capturing rooks are: (1, 5, 7), (2, 4, 8), (2, 5, 6), (3, 4, 7).
IE
Therefore r3 = 4
We observe that, Four or more mutually non-capturing rooks cannot be placed on the
AJ

board.
Thus r4 = 0, r5 = 0, r6 = 0, r7 = 0, r8 = 0
Accordingly, for this board, the rook polynomial is

r(C, x) = 1 + r1 x + r2 x2 + r3 x3 + r4 x4 + · · · + r7 x7 + r8 x8

= 1 + 8x + 14x2 + 4x3

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 28

3.6 Product formula :

If C is a chessboard made up of pairwise disjoint sub boards C1 , C2 , . . . , Cn , then

r(C, x) = r (C1 , x) r (C2 , x) · · · r (Cn , x)

Example 3.6.1. Find the rook polynomial of

The chessboard C in the following figure is made up of 11 unshaded squares.


Here C consists of a 2 × 2 sub board C1 located in the upper left comer and a
T
seven-square sub board C2 located in the lower right corner.
IE
These sub boards are disjoint because they have no squares in the same row or col-
umn of C.
AJ

For C1 we get r (C1 , x) = 1 + 4x + 2x2 (Prove it !)


For C2 we have r (C2 , x) = 1 + 7x + 10x2 + 2x3 (Prove it !)
Hence r(C, x) = r (C1 , x) · r (C2 , x)

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 29

Hence r(C, x) = 1 + 11x + 40x2 + 56x3 + 28x4 + 4x5 (Obtain this!)

Example 3.6.2. Find the rook polynomial of shaded part in the following board.

Solution : We can see that the given board contains two disjoint sub boards C1 and
C2 as shown in the figure.

T
For the board C1 , we have r1 = 3, r2 = 1, r3 = 0,
IE
so that r (C1 , x) = 1 + 3x + x2
For the sub board C2 , we have r1 = 4, r2 = 3 and r4 = 0
Hence (C2 , x) = 1 + 4x + 3x2
AJ

By product formula,
r(C, x) = r (C1 , x) × r (C2 , x)

= 1 + 3x + x2 1 + 4x + 3x2
 

= 1 + 7x + 16x2 + 13x3 + 3x4

3.7 Expansion formula

Suppose that on a given chessboard C, a cell is selected and marked as a special cell.
Let Cs denote the smaller chessboard obtained from C by deleting the row and the
column that contain the special cell;

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 30

Let Ce denote the chessboard obtained from C by eliminating the marked cell.
Then rook polynomial of the board C is given by
r(C, x) = x · r (Cs , x) + r (Ce , x)

Example 3.7.1. Find the rook polynomial for the 3 × 3 board using expansion for-
mula. (VTU Sept 2020, Jan 2019, July 2018, June 2017, 2014, Dec 2013, June
2012, 2009)

Solution : The 3 × 3 board is as shown below.

Let us mark the square which is at the centre of the board as ⊗. Then the boards Cs
T
(obtained from C by deleting the row and the column that contain marked square)
and Ce (obtained from C by eliminating the marked cell.) appear as shown below
IE
(the shaded parts are the deleted parts):
AJ

For the board CS , we find that r1 = 4, r2 = 2, r3 = r4 = 0.


Hence
r(Cs , x) = 1 + 4x + 2x2

For the board Ce , we have r1 = n = 8.


For two rooks, the non-capturing positions are:
(1, 5), (1, 7), (1, 8), (2, 4), (2, 5), (2, 6), (2, 8), (3, 4), (3, 6), (3, 7), (4, 7), (4, 8), (5,
Hence r2 = 14.

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 31

We observe that, Four or more mutually non capturing rooks cannot be placed on the
board. Thus r4 = 0, r5 = 0, r6 = 0, r7 = 0, r8 = 0
Accordingly, for this board, the rook polynomial is

r(Ce , x) = 1 + r1 x + r2 x2 + r3 x3 + r4 x4 + · · · + r7 x7 + r8 x8

= 1 + 8x + 14x2 + 4x3

we find that r(Ce , x) = 1 + 8x + 14x2 + 4x3


Then by expansion formula, rook polynomial of the board C is given by
r(C, x) = x · r (Cs , x) + r (Ce , x)
 
= x 1 + 4x + 2x2 + 1 + 8x + 14x2 + 4x3
= 1 + 9x + 18x2 + 6x3

3.8 Arrangements with forbidden positions


T
Suppose m objects are to be arranged in n places, where n ≥ m. Suppose there are
IE
constraints under which some objects cannot occupy certain places - such places are
called the forbidden positions for the said objects. The number of ways of carrying
AJ

out this task is given by the following rule:


N̄ = S0 − S1 + S2 − S3 + · · · + (−1)n Sn

where S0 = n!

and Sk = (n − k)! × rk , for k = 1, 2, 3, . . . , n


Here, rk is the coefficient of xk in the rook polynomial of the board of m rows all
whose squares represent the forbidden places (under the specified conditions).

Example 3.8.1. An apple, a banana, a mango and an orange are to be distributed


among four boys B1 , B2 , B3 and B4 . The boys B1 and B2 do not wish to have the

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 32

apple. The boy B3 does not want banana or mango and B4 returns the orange. In
how many ways the distribution is made so that no boy is displeased? (VTU Sept
2020, Jan 2020, Jan 2019, July 2018, Jan 2017, June 2016, Dec 2010)

Solution : The situation can be described by the board C shown in the following
figure in which the rows respectively represent apple, banana, mango and orange,
and the columns represent the boys B1 , B2 , B3 , B4 , respectively. Also, the shaded
squares together represent the forbidden places in the distribution.
Let us consider this board C consisting of the shaded squares as shown in the figure.

T
IE
Here m=no. of fruits=4 and n=no.of places=no. of boys=4. Clearly n ≥ m.
We note that C is by the mutually disjoint boards C1 , C2 , C3 shown in the following
AJ

figure.

Hence by product formula, the rook polynomial for C is given by

r(C, x) = r (C1 , x) × r (C2 , x) × r (C3 , x)

By inspection, we find that

r (C1 , x) = 1 + 2x, r (C2 , x) = 1 + 2x, r (C3 , x) = 1 + x

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 33

Accordingly, we have
r(C, x) = (1 + 2x)2 (1 + x) = 1 + 5x + 8x2 + 4x3
Thus, for C, r1 = 5, r2 = 8, r3 = 4
Consequently we have S0 = 4! = 24, (∵ S0 = n!)
Using Sk = (n − k)! × rk , for k = 1, 2, 3, . . . , n, we get
S1 = (4 − 1)! × r1 = 30
S2 = (4 − 2)! × r2 = 16,
S3 = (4 − 3)! × r3 = 4
Therefore N̄ = S0 − S1 + S2 − S3 = 24 − 30 + 16 − 4 = 6
This is the number of ways of distributing the fruits under the given constraints.

Example 3.8.2. Four persons P1 , P2 , P3 , P4 who arrive late for a dinner party find
that only one chair at each of the five tables T1 , T2 , T3 , T4 , T5 is vacant. P1 will not
T
sit at T1 or T2 . P2 will not sit at T2 . P3 will not sit at T3 or T4 and P4 will not sit
IE
at T4 or T5 . Find the number of ways they occupy the vacant chairs. (VTU July
2019, Dec 2013)
AJ

Solution : Consider the board shown below, representing the situation. The shaded
squares in the first indicate that tables T1 and T2 are forbidden for P1 , and so on.

( Here m=no. of persons=4 and n=no.of tables=5. Clearly n ≥ m.


We can see that the given board contains two disjoint sub boards C1 and C2 as shown
in the figure.

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 34

For the board C1 , we have r1 = 3, r2 = 1, r3 = 0,


so that r (C1 , x) = 1 + 3x + x2
For the sub board C2 , we have r1 = 4, r2 = 3 and r4 = 0
Hence (C2 , x) = 1 + 4x + 3x2
By product formula,
r(C, x) = r (C1 , x) × r (C2 , x)

= 1 + 3x + x2 1 + 4x + 3x2
 

= 1 + 7x + 16x2 + 13x3 + 3x4


Thus, here, r1 = 7, r2 = 16, r3 = 13, r4 = 3 Hence.

S0 = 5! = 120, TS1 = (5 − 1)! × r1 = 168,

S2 = (5 − 2)! × r2 = 96
IE
S3 = (5 − 3)! × r3 = 26, S4 = (5 − 4)! × r4 = 3

Consequently, the number of ways in which the four persons can occupy the chairs
AJ

is
S0 − S1 + S2 − S3 + S4 = 120 − 168 + 96 − 26 + 3 = 25

Example 3.8.3. Five teachers T1 , T2 , T3 , T4 , T5 are to be made class teachers for


five classes C1 , C2 , C3 , C4 , C5 one teacher for each class. T1 or T2 do not wish to
become class teachers for C1 or C2 . T3 and T4 for C4 or C5 and T5 for C3 or C4
or C5 . In how many ways can the teachers be assigned to work? (VTU July 2019,
Jan 2018, Dec 2014, June 2013)

Solution : Consider the board shown below, representing the situation. The shaded
squares in the first and second rows indicate that tables T1 and T2 are forbidden for

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 35

C1 , and C2 so on.

( Here m=no. of teachers=5 and n=no.of classes=5. Clearly n ≥ m.


We can see that the given board contains two disjoint sub boards C1 and C2 as shown
in the figure.

T
IE
For C1 we get r (C1 , x) = 1 + 4x + 2x2 (Prove it !)
For C2 we have r (C2 , x) = 1 + 7x + 10x2 + 2x3 (Prove it !)
AJ

r(C, x) = r(C1 , x)×r(C2 , x) = 1+11x+40x2 +56x3 +28x4 +4x5 (Prove


it !)
The coefficients are, r1 = 11, r2 = 40, r3 = 56, r4 = 28, r5 = 4
S0 = 5! = 120, S1 = (5 − 1)! × r1 = 264
S2 = (5 − 2)! × r2 = 240,
S3 = (5 − 3)! × r3 = 112
S4 = (5 − 4)! × r4 = 28, S5 = (5 − 5)! × r5 = 4
Accordingly, the number of ways in which the work can be assigned is

Sp − S1 + S2 − S3 + S4 − S5 = 120 − 264 + 240 − 112 + 28 − 4 = 8

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 36

Practice Problems

1. Find the rook polynomial for the 2 × 2 board using expansion formula.

2. Find the rook polynomial for the chess board as shown in the figure.

Sol :r(C, x) = 1 + 6x + 8x2 + 2x3

3. Find the rook polynomial for the board C using expansion formula.

T
(VTU Jan 2020) Ans : 1 + 8x + 16x2 + 7x3
IE
4. Find the rook polynomial for the shaded portion of chess board as shown in the
AJ

figure.

5. Describe the expansion formula for Rook Polynomials. Find the rook polyno-
mial for the 3 × 3 board using expansion formula. (VTU Jan 2019, July 2018,
June 2017, 2014, Dec 2013, June 2012, 2009)

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 37

6. A girl student has sarees of 5 different colors: blue, green, white, red and yel-
low. On Monday she does not wear green; on Tuesday, blue or red; on Wednes-
day, blue or green; on Thursday, red or yellow; on Friday red. In how many
ways she can dress without repeating a color during a week from Monday to
Friday? (VTU Jan 2017)
Ans : 18

3.9 Recurrence Relations

A recurrence relation for the sequence {an } is an equation, that expresses an in


terms of one or more of the previous terms of the sequence, namely, a0 , a1 , · · · an–1 ,
for all integers n with n ≥ n0 , where n0 is a non-negative integer.

3.10
T
First Order Linear Recurrence Relation
IE
A linear recurrence relation of first-order with constant coefficient is in the form
AJ

an+1 = dan + f (n), for n ≥ 0

where d is a known constant and f (n) is a known function.


If f (n) ≡ 0, the relation is called homogeneous; otherwise, it is called non-
homogeneous (or inhomogeneous).
The unique solution of the homogeneous recurrence relation

an+1 = dan

where n ≥ 0, d is a constant, and a0 = A is given by

an = a0 dn = Adn ,

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 38

where n ≥ 0

Example 3.10.1. Solve the recurrence relation an = 7an−1 , where n ≥ 1 and


a2 = 98.

Solution : This is just an alternative form of the relation,


an+1 = 7an for n ≥ 0 and a2 = 98.
This is a first order linear recurrence relation.
Hence the solution has the form an = a0 (7n ).

Since a2 = 98 = 7a1 = 7(7)a0 = a0 72 , it follows that a0 = 2, and
an = 2 (7n ) , n ≥ 0, is the unique solution.

Example 3.10.2. A bank pays 6% (annual) interest on savings, compounding the


interest monthly. If Anil deposits Rs.1000 on the first day of May, how much will this
T
deposit be worth a year later?
IE
Solution :The annual interest rate is 6%, so the monthly rate is 6%/12 = 0.5% =
0.005.
AJ

For 0 ≤ n ≤ 12, let pn denote the value of Anil’s deposit at the end of n months.
Then pn+1 = pn + 0.005pn , where 0.005pn is the interest earned on pn during
month n + 1, for 0 ≤ n ≤ 11, and p0 = 1000 Rs.
Then the relation is

pn+1 = (1.005)pn , with p0 = Rs. 1000,

This is a first order linear recurrence relation.


Hence its solution is in the form,
pn = p0 (1.005)n = 1000(1.005)n Rs.
Consequently, at the end of one year, Anil’s deposit is worth 1000(1.005)12 =

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 39

1061.68 Rs.

Example 3.10.3. The number of virus affected files in system is 1000 (to start with)
and this increases 250% every two hours. Use a recurrence relation to determine the
number of virus affected files in the system after one day. (VTU Sept 2020,
July 2019, Jan 2019, July 2018, Jan 2017, June 2016, 2015, 2014, 2013, Dec 2014,
2013)

Solution : In the beginning, the number of virus affected files is 1000. Let us
denote this by a0 .
Let an denote the number of virus affected files after 2n hours.
250
Then the number increases by an × 100
in the next two hours.
Thus, after 2n + 2 hours, the number is
T
an+1 = an + an ×
250
100
IE
= an (1 + 2.5) = an (3.5)

This is the recurrence relation for the number of virus affected files.
AJ

This is a first order linear recurrence relation.


Solving this relation, we get
an = (3.5)n a0 = 1000 × (3.5)n
This gives the number of virus affected files after 2n hours.
From this, we get for n = 12,
a12 = 1000 × (3.5)12 = 3379220508
This is the number of virus affected files after one day ( 24 hours).

Example 3.10.4. A bank pays 6% interest compounded quarterly. If Laura invests


Rs. 100, then how many months must she wait for her money to double? (VTU June
2015)

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 40

Solution : Initial investment a0 = 100


since she’s starting with 100 Rs., we have a0 = 100 and given that interest rate is
6% = 0.06
Hence If compounded quarterly, then interest is
0.06
4
= 0.015
12
So for 0 ≤ n ≤ 3 ( ∵ 4
= 3), let an denote the value of Laura’s deposit at the
end of n quarter months.
Hence the recurrence relation is
an = an−1 + 0.015an−1
i.e.an = (1.015)an−1 , ∀n > 0 (1)
Now we need to calculate the value of n such that an ≥ 200.
Here (1) is a first order linear recurrence relation. Hence its general solution is in the
form T
an = (1.015)n a0 = (1.015)n .100
IE
an ≥ 200 ⇒ (1.015)n .100 ≥ 200
200
⇒ (1.015)n ≥ 100
AJ

⇒ (1.015)n ≥ 2
⇒ n log(1.015) ≥ log(2)
log2
⇒ n≥ log(1.015)

⇒ n ≥ 46.55 ≈ 47
Hence Laura must wait (47) × (3) = 141 months for her money to double.

Example 3.10.5. Find the recurrence relation and the initial condition for the se-
quence 2, 10, 50, 250, . . . hence find the general term of the sequence (VTU Dec
2013)

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 41

Solution : This sequence is in the form {an } where a0 = 2, a1 = 10, a2 =


50, a3 = 250
Clearly a1 = 5a0 , a2 = 5a1 , a3 = 5a2 , and so on.
In general, an = 5an−1 for n ≥ 1, with a0 = 2 as the initial condition.
Hence the solution is
an = 5n a0 = 5n × 2

Example 3.10.6. If an , n ≥ 0, is the unique solution of the recurrence relation


153 1377
an+1 − dan = 0, and a3 = 49
, a5 = 2401
, what is d?

Solution : an+1 − dan = 0, n ≥ 0,


so solution is an = dn a0
153
put n = 3, a3 = d3 a0 ⇒ 49
= d3 a0 ,
Similarly put n=5
a5 = d5 a0 ⇒
a5
1377
2401
= d5 a 0
9
T
This ⇒ = d2 =
IE
a3 49

and d = ± 73
AJ

Example 3.10.7. Find the recurrence relation and the initial conditions for the se-
quence 0, 2, 6, 12, 20, 30, 42, . . . Hence find the general term of the sequence.
(VTU July 2019, June 2017)

Solution : Let the given sequence be {an }


Then a0 = 0, a1 = 2, a2 = 6, a3 = 12, a4 = 20, a5 = 30, a6 = 42,
⇒ a1 − a0 = 2
a2 − a1 = 4, a3 − a2 = 6
a4 − a3 = 8, a5 − a4 = 10
a6 − a5 = 12, and so on.
This implies an − an−1 = 2n, or an = an−1 + 2n, for n ≥ 1

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 42

Now working backwards


an − an−1 = 2n

an−1 − an−2 = 2(n − 1)

an−2 − an−3 = 2(n − 2)

······

······

a3 − a2 = 2 × 3

a2 − a1 = 2 × 2

a1 − a0 = 2 × 1
Adding all these
an − a0 = 2(n + (n − 1) + · · · + 2 + 1)
n(n + 1)
=2· = n(n + 1)
2 T
an = n(n + 1) + a0 = n(n + 1) + 0 = n2 + n
IE
Practice Problems
AJ

1. Find the unique solution for each of the following recurrence relations.
a) an+1 − 1.5an = 0, n ≥ 0 Ans : an = (1.5)n a0 , n ≥ 0
b) 4an − 5an−1 = 0, n ≥ 1 Ans : an = (1.25)n a0 , n ≥ 0
n 15
c) 3an+1 − 4an = 0, n ≥ 0, a1 = 5 Ans :an = 43 4

d) 2an − 3an−1 = 0, n ≥ 1, a4 = 81
n
Ans : an = 16 23 , n ≥ 0

2. Solve the recurrence relation: 6an − 7an−1 = 0, n ≥ 1, given a3 = 343


(VTU Dec 2014)

3. Paul invested the stock profits he received 15 years ago in an account that paid

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 43

8% interest compounded quarterly. If his account now has $7218.27 in it,


what was his initial investment?
Hint :Pn = P0 (1.02)n , 7218.27 = P0 (1.02)60 ,
so P0 = (7218.27)(1.02)−60 = $2200.00

4. A person invests some amount at the rate of 11% annual compound interest.
Determine the period for this principal amount to get doubled. (VTU Sept
2020)

3.11 Higher Order Linear Homogeneous Recurrence Relation


with Constant Coefficients

Let a0 , a1 , a2 , . . . , an , . . . be a sequence of numbers. A linear homogeneous re-


T
currence relation of order k with constant coefficients is a recurrence relation of the
form
IE
c0 an + c1 an−1 + c2 an−2 + c3 an−3 + · · · + ck an−k = 0

where ck 6= 0 and c1 , c2 , c3 , . . . , and ck are constants.


AJ

3.12 linear recurrence relation of order two

A homogeneous linear recurrence relation of order 2 is of the form

c0 an + c1 an−1 + c2 an−2 = 0 , n≥2

To find the general solution, we first substitute an = dr n which gives an equation


c0 dr n + c1 dr n−1 + c2 dr n−2 = 0 With d, r 6= 0,

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 44

This gives a quadratic equation in the form

c0 r 2 + c1 r + c2 = 0 ,

which is called the characteristic equation.The roots r1 , r2 of this equation are


called the characteristic roots.
We write the general solution of linear recurrence relation of order two, by using the
following three cases:

• If r1 , r2 are distinct real numbers; General Solution is given by an = c1 r1n +


c2 r2n

• If If r1 , r2 are real, but r1 = r2 . then general Solution is given by an =


(c1 + c2 n) r1n

• If r1 , r2 form a complex conjugate pair in the form r1 = a + ib and r2 =


T
a−ib then general solution is in the form an = r n (c1 cosθ +c2 sinθ) where
IE

r = a2 + b2 and θ = tan−1 ab


After finding the general solution, the constants c1 and c2 may be evaluated if an is
AJ

specified for two particular values of n.


If a0 and a1 are specified, the specified values are called the initial conditions.

Example 3.12.1. Solve the recurrence relation:an + an−1 − 6an−2 = 0, n ≥


2, a0 = −1, a1 = 8. (VTU July 2018, Dec 2013)

Solution : Let an = dr n , for d, r 6= 0, n ≥ 0.


Upon substitution we get dr n + dr n−1 − 6dr n−2 = 0.
Characteristic equation is r 2 + r − 6 = 0 or (r + 3)(r − 2) = 0
Roots are r1 = −3 and r2 = 2

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 45

General solution of the given relation is

an = c1 × (−3)n + c2 × 2n (1)

Putting n=0 and n=1 in (1), we get


a0 = c1 + c2 and a1 = c1 (−3) + c2 (2)
Using the conditions a0 = −1, a1 = 8,
−1 = c1 + c2
8 = −3c1 + 2c2
Solving these , c1 = −2 and c2 = 1
Thus the particular solution is an = −2(−3)n + 2n

Example 3.12.2. Solve the recurrence relation an − 6an−1 + 9an−2 = 0 for


n ≥ 2, a0 = 5, a1 = 12 T (VTU Sept 2020, Jan 2018)

Solution : Let an = dkn , for d, r 6= 0, n ≥ 0.


IE
Upon substitution we get
dkn − 6dkn−1 + 9dkn−2 = 0
AJ

The characteristic equation is k2 − 6k + 9 = 0


so k = 3, 3 are repeated characteristic roots.
Therefore solution to the recurrence relation has the form
an = c1 3n + c2 n3n
Using the conditions a0 = 5, a1 = 12, we get c1 = 5 and c2 = −1
Hence particular solution is an = (5 − n)3n

Example 3.12.3. Solve the recurrence relation: an = 2 (an−1 − an−2 ) , where


n ≥ 2 and a0 = 1, a1 = 2 (VTU July 2019)

Solution : Here characteristic equation is

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 46

r 2 − 2r + 2 = 0
The roots of characteristc equation are r1 = 1 + i and r2 = 1 − i (complex roots)
Hence general solution is
√ 1
an = r n [c1 cos nθ + c2 sin nθ] where r = |(1 ± i)| = 2, and tan θ = 1
=
1 ⇒ θ = π4

an = ( 2)n c1 cos nπ nπ
 
4
+ c 2 sin 4

Using the initial conditions a0 = 1, a1 = 2


√ 
1 = c1 and 2 = ( 2) c1 cos π4 + c2 sin π4 = c1 + c2


which gives c1 = 1 and c2 = 1.


Putting these values of c1 and c2 in the above solution we get

an = ( 2)n cos nπ nπ
 
4
+ sin 4

Example 3.12.4. Solve the recurrence relation Fn+2 = Fn+1 + Fn , given F0 =


T
0, F1 = 1 and n ≥ 0 (VTU Jan 2019, June 2015, 2012, 2011, Dec 2012)
IE
Solution : Let Fn = cr n , for c, r 6= 0, n ≥ 0.
Upon substitution we get cr n+2 = cr n+1 + cr n .
AJ

This gives the characteristic equation r 2 − r − 1 = 0.



1± 5
The characteristic roots are r = 2
,
so the general solution is
√ !n √ !n
1+ 5 1− 5
Fn = c1 + c2
2 2

To find c1 , c2 , we use the given initial values and write 0 = F0 = c1 + c2 ⇒


c2 = −c1 ,
√ √
(1+ 5) (1− 5)
1 = F1 = c1 [ 2 ] + c2 { 2 ].
√ √
since −c1 = c2 , we have 2 = c1 (1 + 5) − c2 (1 − 5) and c1 = √1
5

The general solution is given by

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 47

h √ n  √ n i
Fn = √1 1+ 5
− 1− 5
, n≥0
5 2 2

Example 3.12.5. Solve the recurrence relation: Cn = 3Cn−1 − 2Cn−2 , for n ≥


2, given C1 = 5, C2 = 3 (VTU Jan 2017, June 2014)

Solution : The characteristic equation associated with this recurrence relation is

k2 = 3k − 2

⇒ k2 − 3k + 2 = 0

⇒ (k − 1)(k − 2) = 0

⇒ k = 1, 2

Cn = u(1)n + v(2)n

⇒ Cn = u + v(2)n
T
Put n = 1 we get u + 2v = C1
IE
⇒ u + 2v= 5 · · · (1)

Put n = 2, we get u + 4v = C2
AJ

⇒ u + 4v = 3 · · · (2)

Solving these two equations, we get

v = −1 & u = 7

∴ Cn = 7 − (2)n
∴ Sequence is 5, 3, −1, −9, . . .

Example 3.12.6. If a0 = 0, a1 = 1, a2 = 4 and a3 = 37 satisfy the recurrence


relation an+2 + ban+1 + can = 0 for n ≥ 0, determine the constants b and c
and then solve the relation for an . (VTU Jan 2020, July 2019)

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 48

Solution : For n = 0 and n = 1, we have

a2 + ba1 + ca0 = 0

a3 + ba2 + ca1 = 0

i.e. 4 + b(1) + c(0) = 0 · · · (1)

37 + b(4) + c(1) = 0 · · · (2)

Solving (1) and (2), we get


b = −4 and c = −21
Hence the given recurrence relation becomes an+2 −4an+1 −21an = 0 for n ≥ 2
Characteristic equation is k2 − 4k − 21 = 0
Solving this, we get k = 7, −3
General solution is given by an = c1 (7)n + c2 (−3)n
T
Put n = 0 and n = 1, we have 0 = c1 + c2 and 1 = 7c1 − 3c2
1 −1
IE
Solving, we get c1 = 10
and c2 = 10
1
Hence the solution is an = 10
[7n − (−3)n ]
AJ

Practice Problems

1. Solve the recurrence relation Fn = 5Fn−1 − 6Fn−2 where F0 = 1 and


F1 = 4 Ans:Fn = 2(3)n + (−1)(2)n

2. Solve the recurrence relation an+2 − 3an+1 + 2an = 0, a0 = 1, a1 = 6


(VTU June 2012)

3. Solve the recurrence relation Dn = bDn−1 − b2 Dn−2 , n ≥ 3, given D1 =


b > 0 and D2 = 0. (VTU June 2017)
h i
Ans : b cos nπ √1 sin nπ
n

3
+ 3 3

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru


AJ Institute of Engineering and Technology
Lecture Notes - 18CS36 (Discrete Mathematical Structures) Page 49

4. Solve the recurrence relation an − 3an−1 = 5 × 3n for n ≥ 1 given that


a0 = 2 (VTU Jan 2018)
Ans : an = 3n (2 + 5n)

5. Find the General solution of the equation S(k)+3S(k−1)−4S(k−2) = 0.


(VTU June 2017)

6. Let an denote the number of n-letter sequences that can be formed using the
letters A, B and C such that non terminal A has to be immediately followed
by a B. Find the recurrence relation for an and solve it. (VTU Jan 2018)

7. Solve the recurrence relation an = 3an−1 − 2an−2 for n ≥ 2 given that


a1 = 5 and a2 = 3 (July 2017) Ans : an = − 2n 7

8. Solve an = 7an−1 − 10an−2 , a0 = 1, a1 = 8 an = 2 · 5n − 2n , n≥0


T
9. an+2 = 4an+1 − 4an , n ≥ 0, a0 = 1, a1 = 3 Ans :
IE
an = (n + 2)2n+1 , n≥0

10. Determine the sequence whose recurrence relation is an = 4an−2 + 5an−2


AJ

Ans : an = − 32 (−1)n + 15 4
 
with a1 = 2&a2 = 6. (5)n

11. Solve the recurrence relation an − an−1 = 12(n + 1)3 , n ≥ 1, a0 = 3


(VTU Sept 2020)

13. Solve the recurrence relation : Fn = 10Fn−1 − 25Fn−2 where F0 = 3 and


F1 = 17 Ans: Fn = 3(5)n + 25 n(2)n

14. Solve the recurrence relation Fn = 2Fn−1 − 2Fn−2 where F0 = 1 and



F1 = 3 Ans: Fn = ( 2)n (cos(nπ/4) + 2sin(nπ/4))

Dr. Shantha Kumari.K., Department of Mathematics AJIET, Mangaluru

You might also like