Dms Mod 4 Notes Jan 2021
Dms Mod 4 Notes Jan 2021
Dms Mod 4 Notes Jan 2021
Lecture Notes
T
Discrete Mathematical Structures (18CS36)
IE
Module 4 - The Principle of Inclusion and
Exclusion and Recurrence Relations
AJ
Prepared By
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
|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 | − |A2 ∩ A3 |
− |A1 ∩ A3 | + |A1 ∩ A2 ∩ A3 |
|A1 ∪ A2 ∪ A3 ∪ . . . ∪ An |
+ (−1)n−1 |A1 ∩ A2 ∩ · · · ∩ An |
= |S| − |A1 ∪ A2 ∪ A3 ∪ . . . ∪ An |
+ (−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
|A1 ∪ A2 ∪ . . . ∪ An | = S1 − S2 + S3 − · · · (−1)n−1 Sn
Also ,
A1 ∩ A2 ∩ A3 ∩ . . . ∩ An = S0 − S1 + S2 − S3 · · · + (−1)n Sn
= 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)
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 |
= 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)
= |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
|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
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
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
(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}
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
Similarly
|A1 ∩ A2 | = |A1 ∩ A3 | = |A2 ∩ A3 |
= (26 − 7 + 2) = 21!
S0 = |S| = 26!
S4 = |A1 ∩ A2 ∩ A3 ∩ A4 | = 17!
Therefore, the required number of permutations is given by
|A1 ∩ A2 ∩ A3 ∩ A4 |
+ |A1 ∩ A2 ∩ A3 ∩ A4 |
= S0 − S1 + S2 − S3 + S4
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
|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)
Similarly
|A1 ∩ A2 ∩ A3 ∩ A4 |
− Σ |Ai ∩ Aj ∩ Ak | + |A1 ∩ A2 ∩ A3 ∩ A4 |
+ (20! + 0 + 0 + 0 + 0 + 21!) − (0 + 0 + 0 + 0) + 0
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)
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)
|A1 ∪ A2 ∪ . . . ∪ An | = S1 − S2 + S3 − · · · (−1)n−1 Sn
· · · + (−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 |
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
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
|A2 | = b300/6c = 50
|A3 | = b300/8c = 37
|A1 ∩ A2 | = b300/30c = 10
|A1 ∩ A3 | = b300/40c = 7
|A2 ∩ A3 | = b300/24c = 12
|A1 ∩ A2 ∩ A3 | = b300/120c = 2
(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 )
(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
(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
(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
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
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
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).
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),
1 1 1 n 1
1− + − + · · · + (−1) ≈ e−1
1! 2! 3! n!
Hence
dn = n! e−1 where n ≥ 7
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)
These are
2143 3142 4123
2341 3412 4312
2413 3421 4321
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
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)
T dk × dn−k
k! × (n − k)!
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.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
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 =
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
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.)
(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.
T
Example 3.5.3. Find the rook polynomial of
IE
AJ
r(C, x) = 1 + r1 x + r2 x2 = 1 + 5x + 4x2
board. Thus r4 = 0, r5 = 0, r6 = 0, r7 = 0
Accordingly, for this board, the rook polynomial is
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
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
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;
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)
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
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
where S0 = n!
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.
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.
= 1 + 3x + x2 1 + 4x + 3x2
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
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
C1 , and C2 so on.
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
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.
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)
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.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
an = a0 dn = Adn ,
where n ≥ 0
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
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
⇒ (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)
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)
······
······
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
3. Paul invested the stock profits he received 15 years ago in an account that paid
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)
c0 r 2 + c1 r + c2 = 0 ,
After finding the general solution, the constants c1 and c2 may be evaluated if an is
AJ
an = c1 × (−3)n + c2 × 2n (1)
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
h √ n √ n i
Fn = √1 1+ 5
− 1− 5
, n≥0
5 2 2
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)
v = −1 & u = 7
∴ Cn = 7 − (2)n
∴ Sequence is 5, 3, −1, −9, . . .
a2 + ba1 + ca0 = 0
a3 + ba2 + ca1 = 0
Practice Problems
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)
Ans : an = − 32 (−1)n + 15 4
with a1 = 2&a2 = 6. (5)n