Module 4 - Principles of Counting - II
Module 4 - Principles of Counting - II
Principles of Counting
In this chapter, we continue the studies on Principles of counting. We first consider the Principle
of inclusion-exclusion with appropriate details and illustrations. Then we deal with its
applications to derangements as well as arrangements with forbidden positions. The so-called
rook polynomial are used as a tool in the latter case.
Recall that if S is a finite set, then the number of elements in S is called the order (or the size, or
the cardinality) of S and is denoted by |𝑺|. If A and B are subsets of S, then the order of 𝐴 ∪ 𝐵 is
given by the formula
Thus, for determining the number of elements that are in 𝐴 ∪ 𝐵, we include all elements in A
and B, but exclude all elements common to A and B.
̅̅̅̅̅̅̅̅̅̅
|𝐴̅ ∩ 𝐵̅ | = |(𝐴 ∪ 𝐵)| = |𝑆| − |𝐴 ∪ 𝐵| = |𝑆| − |𝐴| − |𝐵| + |𝐴 ∩ 𝐵| (2)
The formulas (1) and (2) are equivalent to one another, and either of these is referred to as the
Addition Principle or the Principle of inclusion-exclusion, for two sets.
|̅̅̅
𝐴1 ∩ ̅̅̅
𝐴2 ∩ ̅̅̅
𝐴3 ∩ … … . .∩ ̅̅̅̅
𝐴𝑛 | = |𝑆| − ∑|𝐴𝑖 | + ∑|𝐴𝑖 ∩ 𝐴𝑗 | − ∑|𝐴𝑖 ∩ 𝐴𝑗 ∩ 𝐴𝑘 | +
⋯ … . . +(−1)𝑛 |𝐴1 ∩ 𝐴2 ∩ … … . .∩ 𝐴𝑛 | (4)
This expression is an equivalent version of the Principle of inclusion-exclusion, given by (3). Note
that, for n = 2, equations (3) and (4) reduce to expressions (1) and (2), respectively.
Alternative Versions
Suppose A1 represents the set of all those elements of S which satisfy a certain condition c 1, A2
represents the set of all those elements of S which satisfy a certain condition c 2, and so on.
Let us put
…………
…………
̅̅̅1 ∩ ̅̅̅
𝑁(𝑐1 𝑐2 𝑐3 … … . . 𝑐𝑛 ) = |𝐴 𝐴2 ∩ ̅̅̅
𝐴3 ∩ … … … .∩ ̅̅̅̅
𝐴𝑛 |,
……………..
𝑁(𝑐1 𝑜𝑟 𝑐2 𝑜𝑟 𝑐3 𝑜𝑟 … … . . 𝑜𝑟 𝑐𝑛 ) = ∑ 𝑁(𝑐𝑖 ) − ∑ 𝑁(𝑐𝑖 𝑐𝑗 ) + ∑ 𝑁(𝑐𝑖 𝑐𝑗 𝑐𝑘 ) −
⋯ … . +(−1)𝑛−1 𝑁(𝑐1 𝑐2 𝑐3 … … . 𝑐𝑛 ) (5)
𝑆3 = ∑ 𝑁(𝑐𝑖 𝑐𝑗 𝑐𝑘 ) = ∑|𝐴𝑖 ∩ 𝐴𝑗 ∩ 𝐴𝑘 |, … … . .
(8)
and so on, expressions (5) and (6) can be rewritten respectively as follows:
𝑁(𝑐1 𝑜𝑟 𝑐2 𝑜𝑟 𝑐3 𝑜𝑟 … … . . 𝑜𝑟 𝑐𝑛 ) = 𝑆1 − 𝑆2 + 𝑆3 − ⋯ … … + (−1)𝑛−1 𝑆𝑛
(9)
̅ = 𝑺𝟎 − 𝑺𝟏 + 𝑺𝟐 − 𝑺𝟑 + ⋯ … … + (−𝟏)𝒏 𝑺𝒏
𝑵
(10)
Generalization
The principle of inclusion-exclusion as given be expression (10) gives the number of elements in S
that satisfy none of the conditions 𝑐1 , 𝑐2 , 𝑐3 , … … 𝑐𝑛 . The following expression determines the
number of elements in S that satisfy exactly m of the n conditions (0 ≤ 𝑚 ≤ 𝑛):
𝑚+1 𝑚+2 𝑛
𝐸𝑚 = 𝑆𝑚 − ( ) 𝑆𝑚+1 + ( ) 𝑆𝑚+2 − ⋯ … … . . +(−1)𝑛−𝑚 ( )𝑆
1 2 𝑛−𝑚 𝑛
(11)
Example: 1 Among the students in a hostel, 12 students study Mathematics (A), 20 study Physics
(B), 20 study Chemistry (C), and 8 study Biology (D). There are 5 students for A and B, 7 students
for A and C, 4 students for A and D, 16 students for B and C, 4 students for B and D, and 3
students for C and D. There are 3 students for A, B and C, 2 for A, B, and D, 2 for B, C and D, 3 for
A, C and D. Finally, there are 2 who study all of these subjects. Furthermore, there are 71
students who do not study any of these subjects. Find the total number of students in the hostel.
|𝐴 ∩ 𝐵| = 5, |𝐴 ∩ 𝐶| = 7, |𝐴 ∩ 𝐷| = 4,
|𝐵 ∩ 𝐶| = 16, |𝐵 ∩ 𝐷| = 4, |𝐶 ∩ 𝐷| = 3,
|𝐴 ∩ 𝐵 ∩ 𝐶| = 3, |𝐴 ∩ 𝐵 ∩ 𝐷| = 2, |𝐵 ∩ 𝐶 ∩ 𝐷| = 2,
|𝐴 ∩ 𝐶 ∩ 𝐷| = 3, |𝐴 ∩ 𝐵 ∩ 𝐶 ∩ 𝐷| = 2, |𝐴̅ ∩ 𝐵̅ ∩ 𝐶̅ ∩ 𝐷
̅ | = 71,
We are required to find |𝑆| where S is the set of all students in the hostel.
71 = |𝑆| − (12 + 20 + 20 + 8) + (5 + 7 + 4 + 16 + 4 + 3) − (3 + 2 + 2 + 3) + 2
71 = |𝑆| − 29
Example 2: Out of 30 students in a hostel, 15 study History, 8 study Economics, and 6 study
Geography. It is known that 3 students study all these subjects. Show that 7 or more students
study none of these subjects.
Solution: Let S denote the set of all students in the hostel, and 𝐴1 , 𝐴2 , 𝐴3 denote the sets of
students who study History, Economics and Geography, respectively. Then, from what is given,
we have
̅̅̅1 ∩ ̅̅̅
The number of students who do not study any of the three subjects is |𝐴 𝐴2 ∩ ̅̅̅
𝐴3 |.This is
given by (see expression (4))
̅̅̅1 ∩ ̅̅̅
|𝐴 𝐴2 ∩ ̅̅̅
𝐴3 | = |𝑆| − ∑|𝐴𝑖 | + ∑|𝐴𝑖 ∩ 𝐴𝑗 | − ∑|𝐴1 ∩ 𝐴2 ∩ 𝐴3 |
= |𝑆| − 𝑆1 + 𝑆2 − 𝑆3
= 30 − 29 + 𝑆2 − 3 = 𝑆2 − 2 ((i))
where𝑆2 = ∑|𝐴𝑖 ∩ 𝐴𝑗 |.
𝑆2 = ∑|𝐴𝑖 ∩ 𝐴𝑗 | ≥ 3|𝐴1 ∩ 𝐴2 ∩ 𝐴3 | = 9.
Example 3 Determine the number of positive integers n such that 1 ≤ 𝑛 ≤ 100 and n is not
divisible by 2, 3, or 5.
Solution: Let 𝑆 = {1, 2, 3, … … … … . , 100}. Then |𝑆| = 100. Let 𝐴1 , 𝐴2 , 𝐴3 be the subsets of S
whose elements are divisible by 2, 3 and 5 respectively. Then, we have to find |𝐴 ̅̅̅1 ∩ ̅̅̅
𝐴2 ∩ ̅̅̅
𝐴3 |.
We note that* (The following is a standard result in Number theory: For positive integers a and
b, the number of positive integers less than or equal to a and divisible by b is ⌊𝑎/𝑏⌋, the greatest
integer less than or equal to a/b.)
|𝐴1 ∩ 𝐴3 | = 𝑁𝑜. 𝑜𝑓 𝑒𝑙𝑒𝑚𝑒𝑛𝑡𝑠 𝑖𝑛 𝑆 𝑡ℎ𝑎𝑡 𝑎𝑟𝑒 𝑑𝑖𝑣𝑖𝑠𝑖𝑏𝑙𝑒 𝑏𝑦 2 𝑎𝑛𝑑 5 = ⌊100/10⌋ = ⌊10⌋ = 10,
|̅̅̅
𝐴1 ∩ ̅̅̅
𝐴2 ∩ ̅̅̅
𝐴3 |
= |𝑆| − {|𝐴1 | + |𝐴2 | + |𝐴3 |} + {|𝐴1 ∩ 𝐴2 | + |𝐴1 ∩ 𝐴3 | + |𝐴2 ∩ 𝐴3 |}
− |𝐴1 ∩ 𝐴2 ∩ 𝐴3 |
= 100 − (50 + 33 + 20) + (16 + 10 + 6) − 3 = 26.
Solution: Let 𝑆 = {1, 2, … … … . . ,300} so that |𝑆| = 300.Also, let 𝐴1 , 𝐴2 , 𝐴3 be subsets of S whose
elements are divisible by 5, 6, 8 respectively. Then:
We note that
|𝐴1 | = ⌊300/5⌋ = 60, |𝐴2 | = ⌊300/6⌋ = 50, |𝐴3 | = ⌊300/8⌋ = 37,
𝒙𝟏 + 𝒙𝟐 + 𝒙𝟑 + 𝒙𝟒 = 𝟏𝟖
Solution: Let S denote the set of all nonnegative integer solutions of the given equation. The
number of such solutions is*C(n+r-1, r)
|𝑆| = 𝐶(21,18).
Let 𝐴1 be the subset of S that contains the nonnegative integer solutions of the given equation
under the conditions 𝑥1 > 7, 𝑥2 ≥ 0, 𝑥3 ≥ 0, 𝑥4 ≥ 0. That is,
𝐴1 = {(𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ) ∈ 𝑆 | 𝑥1 > 7}
Similarly, let
𝑦1 + 𝑥2 + 𝑥3 + 𝑥4 = 10.
The number of nonnegative integer solutions of this equation is 𝐶(4 + 10 − 1, 10) = 𝐶(13,10).
This is precisely |𝐴1 |.
𝑦1 + 𝑦2 + 𝑥3 + 𝑥4 = 2
Similarly, by symmetry,
In the given equation, more than two 𝑥𝑖 ′𝑠 cannot be greater than 7 simultaneously. Hence
and|𝐴1 ∩ 𝐴2 ∩ 𝐴3 ∩ 𝐴4 | = 0.
Accordingly, we find that (using the Principle of inclusion-exclusion as given by equation (4))
̅̅̅1 ∩ ̅̅̅
|𝐴 𝐴2 ∩ ̅̅̅
𝐴3 ∩ ̅̅̅
𝐴4 | = |𝑆| − ∑|𝐴𝑖 | + ∑|𝐴𝑖 ∩ 𝐴𝑗 | − ∑|𝐴𝑖 ∩ 𝐴𝑗 ∩ 𝐴𝑘 | + |𝐴1 ∩ 𝐴2 ∩ 𝐴3 ∩ 𝐴4 |
4 4
= 𝐶(21,18) − ( ) × 𝐶(13,10) + ( ) × 𝐶(5,2) − 0 + 0
1 2
= 1330 − (4 × 286) + (6 × 10) = 366.
Example 6: Find the number of integer solutions of the equation 𝒙𝟏 + 𝒙𝟐 + 𝒙𝟑 = 𝟐𝟎 such that
𝟐 ≤ 𝒙𝟏 ≤ 𝟓, 𝟒 ≤ 𝒙𝟐 ≤ 𝟕, −𝟐 ≤ 𝒙𝟑 ≤ 𝟗.
𝑦1 + 𝑦2 + 𝑦3 = 16
𝑧1 + 𝑦2 + 𝑦3 = 12.
𝑧1 + 𝑤2 + 𝑦3 = 8.
In any solution of equation (i) we cannot have 𝑦1 > 3, 𝑦2 > 3 𝑎𝑛𝑑 𝑦3 > 11. Therefore,
|𝐴1 ∩ 𝐴2 ∩ 𝐴3 | = 0.
Thus, under the given conditions, the given equation has exactly three integer solutions.
Example 7 : Determine the number of positive integers x where 𝒙 ≤ 𝟗, 𝟗𝟗𝟗, 𝟗𝟗𝟗 and the sum
of the digits in x equals 31.
𝑥 = 𝑥1 𝑥2 𝑥3 𝑥4 𝑥5 𝑥6 𝑥7
𝑥1 + 𝑥2 + 𝑥3 + ⋯ … … . +𝑥7 = 31.
(i)
Thus, we have to find the number of nonnegative integer solutions of equation (i) for which
Where 𝑥𝑖 ≤ 9
𝑖 = 1, 2, 3, … … … 7.
Let S denote the set of all nonnegative integer solutions of equation (i). Then
|𝑆| = 𝐶(7 + 31 − 1, 31) = 𝐶(37,31).
Let 𝐴𝑘 denote the set of those solutions in S for which 𝑥𝑘 > 9 and other x’s are non-negative.
Taking 𝑦𝑘 = 𝑥𝑘 − 10, we find that 𝑦𝑘 ≥ 0. Substituting for 𝑥𝑘 in (i), we get
|𝐴𝑘 | = 𝐶(27,21).
Let 𝐴𝑝 denote the set of those solutions in S for which 𝑥𝑝 > 9 and other x’s are nonnegative.
This holds for k, p = 1, 2, 3, ……..7, 𝑘 ≠ 𝑝. Further, there are C(7,2) number of intersections 𝐴𝑘 ∩
𝐴𝑝 .
This holds for all 𝑘, 𝑝, 𝑞 = 1, 2, … … . .7, 𝑘 ≠ 𝑝, 𝑘 ≠ 𝑞, 𝑝 ≠ 𝑞. Further, there are C (7,3) number
of intersections
𝐴𝑘 ∩ 𝐴𝑝 ∩ 𝐴𝑞 , 𝑘 ≠ 𝑝 ≠ 𝑞.
In equation (i), more than three xi cannot be greater than 9 simultaneously. Hence the order of
the intersection of more than Ai’s is zero.
Accordingly, the number of nonnegative integer solutions of equation (i) for which 𝑥𝑖 ≤ 9, 𝑖 =
1, 2, … … .7, is given by
̅̅̅1 ∩ ̅̅̅
|𝐴 𝐴2 ∩ ̅̅̅
𝐴3 ∩ … … .∩ ̅̅̅
𝐴7 | = |𝑆| − ∑|𝐴𝑘 | + ∑|𝐴𝑘 ∩ 𝐴𝑝 | + ∑|𝐴𝑘 ∩ 𝐴𝑝 ∩ 𝐴𝑞 | + 0
Example 8 :In how many ways 5 number of a’s, 4 number of b’s and 3 number of c’s can be
arranged so that all the identical
Solution: The given letters are 5 + 4 + 3 = 12 in number, of which 5 are a’s 4 are b’s and 3 are
c’s. If S is the set of all permutations (arrangements) of these letters, we have
12!
|𝑆| = .
5! 4! 3!
Let 𝐴1 be the set of arrangements of the letters where the 5 a’s are in a single block. The number
of such arrangements is
8!
|𝐴1 | =
4! 3!
(Because in such an arrangement all the a’s taken together can be regarded as a single letter and
the remaining letters consist of 4 b’s and 3 c’s ).
Similarly, if 𝐴2 is the set of arrangements where the 4 b’s are in a single block, and 𝐴3 is the set
of arrangements where the 3 c’s are in a single block, we have
9! 10!
|𝐴2 | = and|𝐴3 | = 5!4!
5!3!
Likewise,
5! 6! 7!
|𝐴1 ∩ 𝐴2 | = , |𝐴1 ∩ 𝐴3 | = , |𝐴2 ∩ 𝐴3 | = , |𝐴1 ∩ 𝐴2 ∩ 𝐴3 | = 3!.
3! 4! 5!
Accordingly, the required number of arrangements is
̅̅̅1 ∩ ̅̅̅
|𝐴 𝐴2 ∩ ̅̅̅
𝐴3 |
= |𝑆| − {|𝐴1 | + |𝐴2 | + |𝐴3 |} + {|𝐴1 ∩ 𝐴2 | + |𝐴1 ∩ 𝐴3 | + |𝐴2 ∩ 𝐴3 |}
− |𝐴1 ∩ 𝐴2 ∩ 𝐴3 |
12! 8! 9! 10! 5! 6! 7!
= −{ + + } + { + + } − 3!
5! 4! 3! 4! 3! 5! 3! 5! 4! 3! 4! 5!
= 27720 − (280 + 504 + 1260) + (20 + 30 + 42) − 6
= 25762.
Solution: Let S denote the set of all permutations of the digits 1 through 9 (without
repetition). Then |𝑆| = 9!.
(a) Let 𝐴1 be the subset of S which contains the block 23. Thus, 𝐴1 consists of all
permutations which contain the block 23 as a single object and the seven remaining
objects 1, 4, 5, 6, 7, 8, 9. Thus,
|𝐴1 | = (1 + 7)! = 8!
Similarly, if 𝐴2 𝑎𝑛𝑑 𝐴3 are the subsets of S which respectively contain the blocks 57
and 468, we find that
|𝐴2 | = (1 + 7)! = 8! ,
|𝐴3 | = (1 + 6)! = 7!
|𝐴1 ∩ 𝐴2 | = No. of permutations of distinct objects consisting of the two blocks 23 and 57, and
the (five) digits not present in these blocks.
= (2 + 5)! = 7!
= (3 + 2)! = 5!
= 9! − 2 × (8!) + 2 × (6!) − 5!
= 2, 83, 560.
(b) Let 𝐴1 , 𝐴2 , 𝐴3 be the subsets of S which respectively contain the blocks 36, 78, 672. Like
in case (a) above, we find |𝐴1 | = 8!, |𝐴2 | = 8!, |𝐴3 | = 7!
|𝐴1 ∩ 𝐴2 | = No. of permutations of distinct objects consisting of the two blocks 36 and
78 and the (five) digits not present in these blocks.
= (2 + 5)! = 7!
|𝐴1 ∩ 𝐴3 | = No. of permutations of distinct objects consisting of the two blocks 36 and
672 and the digits not present in these blocks.
= No. of permutations of distinct objects consisting of the single block 3672
and the (five) digits not present in this block* (Note that the block 3672
includes in it both of the blocks 36 and 672.
= (1 + 5)! = 6!
Likewise, |𝐴1 ∩ 𝐴2 ∩ 𝐴3 | = 0.
Accordingly, the required number of permutations is
̅̅̅1 ∩ ̅̅̅
|𝐴 𝐴2 ∩ ̅̅̅
𝐴3 |
= |𝑆| − {|𝐴1 | + |𝐴2 | + |𝐴3 |} + {|𝐴1 ∩ 𝐴2 | + |𝐴1 ∩ 𝐴3 | + |𝐴2 ∩ 𝐴3 |}
− |𝐴1 ∩ 𝐴2 ∩ 𝐴3 |
= 9! − 2 × (8!) + 6!
= 2, 82, 960.
Example 11 In how many ways can the 26 letters of the English alphabet be permuted so that
none of the patterns CAR, DOG, PUN or BYTE occurs?
Solution: Let S denote the set of all permutations of the 26 letters. Then |𝑆| = 26!.
Let 𝐴1 be the set of all permutations in which CAR appears. This word, CAR, consists of three
letters which form a single block. The set 𝐴1 therefore consists of all permutations which contain
this single block. The set 𝐴1 therefore consists of all permutations which contain this single block
and the 23 remaining letters. Therefore, |𝐴1 | = 24!.
Similarly, if 𝐴2 , 𝐴3 , 𝐴4 are the sets of all permutations which contain DOG, PUN and BYTE
respectively, we have
Likewise, we find that( * Note that no letter is repeated in the given patterns.)
̅̅̅1 ∩ ̅̅̅
|𝐴 𝐴2 ∩ ̅̅̅
𝐴3 ∩ ̅̅̅
𝐴4 | = |𝑆| − ∑|𝐴𝑖 | + ∑|𝐴𝑖 ∩ 𝐴𝑗 | − ∑|𝐴𝑖 ∩ 𝐴𝑗 ∩ 𝐴𝑘 | + |𝐴1 ∩ 𝐴2 ∩ 𝐴3 ∩ 𝐴4 |
********
Example :Find the number of permutations of the letters a, b, c, ……….x, y, z in which none of
the patterns spin, game, path or net occurs.
Solution: The specified letters are 26 in number. Let S denote the set of all permutations of these
letters without repetition. Then |𝑆| = 26!.
Let 𝐴1 be the subset of S which contains the pattern spin. Thus, 𝐴1 consists of all permutations
(of the above mentioned 26 letters) which contain the 4-letter pattern spin as a single object and
the remaining 22 letters as 22 objects. Therefore,
|𝐴1 | =number of permutations of distinct objects consisting of the single pattern spin and the 22
letters not present in this pattern.
= (1 + 22)! = 23!
Similarly, if 𝐴1 , 𝐴2 , 𝐴3 , 𝐴4 are the subsets of S which respectively contain the patterns game,
path, net, we find that
|𝐴1 ∩ 𝐴2 | =number of permutations of distinct objects consisting of the two patterns spin and
game, and the 18 letters not present in these two patterns
= (2 + 18)! = 20!
|𝐴1 ∩ 𝐴3 | = 0.(Because, no permutation of distinct objects can contain both of the patterns spin
and path). ** ( If there is a permutation containing both of the patterns spin and path, this
permutation contains a repeated letter, p.)
Likewise,
|𝐴2 ∩ 𝐴2 ∩ 𝐴3 | = 0, |𝐴1 ∩ 𝐴2 ∩ 𝐴4 | = 0,
|𝐴2 ∩ 𝐴3 ∩ 𝐴4 | = 0, |𝐴2 ∩ 𝐴3 ∩ 𝐴4 | = 0,
|𝐴1 ∩ 𝐴2 ∩ 𝐴3 ∩ 𝐴4 | = 0.
|𝐴1 ∩ 𝐴4 | = No. of permutations of distinct objects consisting of the patterns spin and net, and
the letters not present in these patterns.
= No. of permutaions of distinct objects consisting of the single pattern spinet, and the (20)
letters not present in this pattern
= (1+20)!=21!.
̅̅̅1 ∩ ̅̅̅
|𝐴 𝐴2 ∩ ̅̅̅
𝐴3 ∩ ̅̅̅
𝐴4 | = |𝑆| − ∑|𝐴𝑖 | + ∑|𝐴𝑖 ∩ 𝐴𝑗 | − ∑|𝐴𝑖 ∩ 𝐴𝑗 ∩ 𝐴𝑘 | + |𝐴1 ∩ 𝐴2 ∩ 𝐴3 ∩ 𝐴4 |
Solution: There are C(5,2) = 10 possible roads between any two of the five villages. Each of
these roads can be either included or excluded from the system. Therefore, the number of ways
of divising the system of roads is 𝑁 = |𝑆| = 210 , where S is the set of all roads.
For each 1 ≤ 𝑖 ≤ 5, let 𝑐𝑖 be the condition that a system of these roads isolates the villages
̅ = 𝑁(𝑐̅̅̅̅̅̅̅̅̅̅̅̅̅̅).
A, B, C, D, E respectively. We have to find 𝑁 1 𝑐2 𝑐3 𝑐4 𝑐5
The possible roads in the system that isolate the village A are BC, BD, BE, CD, CE, DE, which
are 6 in number. Each of these roads can be included or excluded from the system. Therefore,
𝑁(𝑐1 ) = 26 .Similarly, by symmetry, 𝑁(𝑐𝑖 ) = 26 for 𝑖 = 2, 3, 4, 5 also.
The possible roads in the system that isolate the villages A and B are CD, DE, CE, which are
3 in number. Each of these roads can be included or excluded. Therefore, 𝑁(𝑐1 𝑐2 ) = 23 . In view
of this, we note, because of symmetry, that
𝑁(𝑐𝑖 𝑐𝑗 ) = 23 , 𝑖 ≠ 𝑗,
𝑁(𝑐𝑖 𝑐𝑗 𝑐𝑘 ) = 21 , 𝑖 ≠ 𝑗 ≠ 𝑘,
𝑁(𝑐𝑖 𝑐𝑗 𝑐𝑘 𝑐𝑝 ) = 20 , 𝑖 ≠ 𝑗 ≠ 𝑘 ≠ 𝑝, 𝑁(𝑐1 𝑐2 𝑐3 𝑐4 𝑐5 ) = 20 .
Example 13: Six married couple are to be seated at a circular table. Find in how many ways can
they arrange themselves so that no wife sits next to her husband, given that two seating
arrangements are considered the same if one is a rotation of the other.
Solution: First, we note that the total number of arrangements of 6 couples (=12 persons) around
a circular table with no restrictions is 𝑁 = (12 − 1)! = 11!
For 1 ≤ 𝑖 ≤ 6, let 𝑐𝑖 denote the condition where a seating arrangement has the husband and
wife in a couple i seated next to each other.
Similarly,
𝑁(𝑐𝑖 𝑐𝑗 𝑐𝑘 ) = 23 × (8!),
𝑁(𝑐𝑖 𝑐𝑗 𝑐𝑘 𝑐𝑝 ) = 24 × (7!),
𝑁(𝑐𝑖 𝑐𝑗 𝑐𝑘 𝑐𝑝 𝑐𝑞 ) = 25 × (6!)
and𝑁(𝑐1 𝑐2 𝑐3 𝑐4 𝑐5 𝑐6 ) = 26 × (5!).
6
We note that 𝑁(𝑐𝑖 ) are 6 in number, 𝑁(𝑐𝑖 𝑐𝑗 ) are 𝐶(6,2) = ( ) in number, 𝑁(𝑐𝑖 𝑐𝑗 𝑐𝑘 ) are
2
6
𝐶(6,3) = ( ) in number, and so on.
3
Accordingly, the Principle of inclusion-exclusion (as given by expression (6)) gives
̅ = 11! − (6) × {2 × (10!)} + (6) × {2 × (9!)} − (6) × {23 × (8!)} + (6) × {24 × (7!)}
𝑁
1 2 3 4
6 6
− ( ) × {25 × (6!)} + ( ) × {126 × (5!)}
5 6
Example 14: Determine the number of integers between 1 and 300 (inclusive) which are (i)
divisible by exactly two of 5, 6, 8, and (ii) divisible by at least two of 5, 6, 8.
Solution: Let the sets 𝑆, 𝐴1 , 𝐴2 , 𝐴3 be as defined in the Example 4. Using the computations made
in that Example, we find that
Therefore:
(i) The number of integers between 1 and 300 which are divisible by exactly two of 5, 6, 8
is
3 3
𝐸2 = 𝑆2 − ( ) 𝑆3 = 29 − ( ) × 2 = 29 − (3 × 2) = 23,
1 1
(ii) The number of integers between 1 and 300 which are divisible by at least two of 2, 3, 5
is
2
𝐿2 = 𝑆2 − ( ) 𝑆3 = 29 − (2 × 2) = 25.
1
Example 15 :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 patterns CAR, DOG, PUN
and BYTE.
Solution: Let the sets 𝑆, 𝐴1 , 𝐴2 , 𝐴3 , 𝐴4 defined as in Example 11. Then we note that (by using the
computations made in that Example)
𝑆0 = |𝑆| = 26!
𝑆4 = ∑|𝐴1 ∩ 𝐴2 ∩ 𝐴3 ∩ 𝐴4 | = 17!.
Therefore ( on using expressions (11) and (12), page 312) we find that the number of
permutations in the required four cases are as given below:
(𝑖𝑖𝑖)𝐸3 = 𝑆3 − (4) 𝑆4 = 10 − (4 × 2) = 2,
1
1 2 3
(𝑖𝑣)𝐿1 = 𝑆1 − ( ) 𝑆2 + ( ) 𝑆3 − ( ) 𝑆4 = 60 − 39 + 10 − 2 = 29,
0 0 0
1 2 3 4 5
𝐸0 = 𝑆0 − ( ) 𝑆1 + ( ) 𝑆2 − ( ) 𝑆3 + ( ) 𝑆4 − ( ) 𝑆5
1 2 3 4 5
14! 5 13! 5 12! 5 11! 5 10! 5
= 5 − ( ) × 4 + ( ) × 3 − ( ) × 2 + ( ) × − ( ) × 9!.
(2!) 1 (2!) 2 (2!) 3 (2!) 4 2! 5
Next, the number of permutations where there are exactly two pairs of consecutive identical
letters is
3 4 5
𝐸2 = 𝑆2 − ( ) 𝑆3 + ( ) 𝑆4 − ( ) 𝑆5
1 2 3
5 12! 3 5 11! 4 5 10! 5 5
=( )× 3 − ( ) ( ) × 2 + ( ) ( ) × − ( ) ( ) × 9!.⬚
2 (2!) 1 3 (2!) 2 4 2! 3 5
Lastly, the number of permutations where there are at least three pairs of consecutive identical
letters is
3 4
𝐿3 = 𝑆3 − ( ) 𝑆4 + ( ) 𝑆5
2 2
5 11! 3 5 10! 4 5
= ( )× 2
− ( ) ( ) × + ( ) ( ) × 9!
3 (2!) 2 4 2! 2 5
Exercises
1. The sets 𝐴1 , 𝐴2 , 𝐴3 , 𝐴4 are subsets of a set S with |𝑆| = 200. It is known that
|𝐴1 | = 125, |𝐴2 | = 83, |𝐴3 | = 50, |𝐴4 | = 35, |𝐴1 ∩ 𝐴2 | = 41, |𝐴1 ∩ 𝐴3 |
= 25, |𝐴1 ∩ 𝐴4 | = 17,
2. Determine the number of positive integers n such that 1 ≤ 𝑛 ≤ 300 and n is divisible by at
least one of 3, 5, 7.
3. Determine the number of integers between 1 and 1000 (inclusive) which are (i) divisible by
exactly two of 2, 3, 5, and (ii) divisible by at least two of 2, 3, 5.
4. Find the number of integers between 1 and 10,000 (inclusive) that are divisible by none of
5, 6, and 8.
5. Find the number of integers between 1 and 1000 that are not divisible by 2, 3, 5 or 7.
6. Determine the number of positive integers n, 1 ≤ 𝑛 ≤ 2000 that are (i) not divisible by 2,
3, or 5, (ii) not divisible by 2, 3, 5, or 7.
7. Find the number of integer solutions of the equation 𝑥1 + 𝑥2 + 𝑥3 + 𝑥4 = 17, where
1 ≤ 𝑥1 ≤ 3, 2 ≤ 𝑥2 ≤ 4, 3 ≤ 𝑥3 ≤ 5, 𝑎𝑛𝑑 4 ≤ 𝑥4 ≤ 6.
8. Find the number of integer solutions of the equation 𝑥1 + 𝑥2 + 𝑥3 + 𝑥4 = 18 such that
1 ≤ 𝑥1 ≤ 5, −2 ≤ 𝑥2 ≤ 4, 0 ≤ 𝑥3 ≤ 5, 𝑎𝑛𝑑 3 ≤ 𝑥4 ≤ 9.
1 ≤ 𝑥1 ≤ 6, 1 ≤ 𝑥2 ≤ 7, 1 ≤ 𝑥3 ≤ 8, 𝑎𝑛𝑑 1 ≤ 𝑥4 ≤ 9.
10. In how many ways 4 a’s, 2 b’s and 2 c’s be arranged so that all identical letters are not in
a single block?
11. In how many ways can one distribute 10 distinct prizes among 4 students with exactly 2
students getting nothing? How many ways have at least 2 students getting nothing?
12. For the set considered in Exercise 1, evaluate 𝐸1 , 𝐸2 , 𝐸3 𝑎𝑛𝑑 𝐿1 , 𝐿2 , 𝐿3 .
13. For the situation in Worked Example 12, find the number of systems of roads so that (i)
exactly two, and (ii) atleast two of the villages remain isolated.
14. 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?
15. Find the number of permutations of the digits 1 through 9 in which (i) none of the blocks
12, 34 and 567 appears, (ii) none of the blocks 415, 12 and 23 appears.
16. Find the number of permutations of the English letters in which none of the patterns ABC,
EFG, PQRS or XYZ occurs.
17. In how many ways can three x’s, three y’s and three z’s be arranged so that no consecutive
triple of the same letter appears?
18. In how many ways 5 a’s, 4 b’s and 3 c’s can be arranged so that (i) there are exactly two
blocks of identical letters? (ii) there are at least two blocks of identical letters?
19. Fifteen different plants are to be arranged on five schelves. In how many ways the
arrangement can be made so that each shelf has at least one but no more than four
plants?
20. Determine in how many ways can the letters in the word ARRANGEMENTS be arranged so
that (i) there are exactly two pairs of consecutive identical letters. (ii) at least two pairs of
consecutive identical letters.
7.2 Derangements
A permutation of n distinct objects in which none of the objects is in its natural (original )
place is called a derangement. For example, a permutation of the integers 1, 2, 3, 4, ……n,
in which 1 is not in the first place, 2 is not in the second place, 3 is not in the third place,
and so on, and n is not in the nth place is a derangement.
Formula for 𝒅𝒏
The following is the formula for 𝑑𝑛 for 𝑛 ≥ 1:
1 1 1 (−1)𝑛
𝑑𝑛 = 𝑛! {1 − + − + ⋯ … + }
1! 2! 3! 𝑛!
(−1)𝑘
= 𝑛! × ∑𝑛𝑘=0 𝑘!
Proof: Let S be the set of all (possible ) permutations of 1, 2, 3,……n. Then |𝑆| = 𝑛!. Let 𝐴1
be the set of all permutations of 1, 2, 3,…….n where 1 is in its natural place, 𝐴2 be the set of all
permutations where 2 is in its natural place, and so on. Then the set of all derangements of 1, 2,
3, ……n is ̅̅̅
𝐴1 ∩ ̅̅̅
𝐴2 ∩ … … .∩ ̅̅̅̅
𝐴𝑛 . Consequently,
̅̅̅1 ∩ ̅̅̅
𝑑𝑛 = |𝐴 𝐴2 ∩ ̅̅̅
𝐴3 ∩ … … . .∩ ̅̅̅̅
𝐴𝑛 |.
= (𝑛!) − 𝑆1 + 𝑆2 − 𝑆3 + ⋯ … . . +(−1)𝑛 𝑆𝑛
We note that the permutations in 𝐴1 are all of the form 1𝑏2 𝑏3 … … . . 𝑏𝑛 , where 𝑏2 𝑏3 … … . . 𝑏𝑛 is
a permutation of 2, 3, …….n. Thus 𝐴1 consists of all permutations of 2, 3, ……..n. As such |𝐴1 | =
(𝑛 − 1)!. Similarly,
|𝐴1 | = |𝐴2 | = ⋯ … = |𝐴𝑛 | = (𝑛 − 1)!. Consequently,
Accordingly,
Likewise, we find
This completes the proof. (* For another proof, see Example 19, section 7.3.)
Solution: We have
1 1 1 1 1 1 1 1 1
𝑑5 = (5!) {1 − + − + − } = (120) ( − + − ) = 44,
1! 2! 3! 4! 5! 2 6 24 120
1 1 1 1 1 1 1 1 1 1 1
𝑑6 = (6!) {1 − + − + − + } = (720) ( − + − + ) = 265,
1! 2! 3! 4! 5! 6! 2 6 24 120 720
𝑑7 ≈ ⌊(7!) × 𝑒 −1 ⌋ ≈ ⌊5040 × 0.3679⌋ ≈ 1854,
Example 3 :While at the race track, a person bets on each of the nine horses in a race to come
in accordance to how they are favoured. In how many ways can they reach the finish line so
that he loses all his bets?
Solution: Here, we have to find the number of ways of arranging the horses 1, 2, 3, ……9 so that 1
is not in its favoured place, 2 is not in its favoured place, ……, 9 is not in its favoured place. Thus,
the required number of ways is the number of derangements of 9 objects, namely,
𝑑9 = 𝑒 −1 × 9! ≈ 0.3679 × 9! = 133504
Example 4: In how many ways can we arrange the numbers 1, 2, 3, …….,10 so that 1 is not in
the first place, 2 is not in the second place, and so on, and 10 is not in the 10 th place?
Example 5: From the set of all permutations of n distinct objects, one permutation is chosen at
random. What is the probability that it is not a derangement?
𝑑𝑛 1 1 1 (−1)𝑛
𝑝 = 1− = 1 − {1 − + − + ⋯ … . + }
𝑛! 1! 2! 3! 𝑛!
1 1 (−1)𝑛
= 1 − + − +⋯…….− .
2! 3! 𝑛!
Example 6: There are n pairs of children’s gloves in a box. Each pair is of a different colour.
Suppose the right gloves are distributed at random to n children, and therefore the left gloves
are also distributed to them at random. Find the probability that (i) no child gets a matching
pair, (ii) every child gets a matching pair, (iii) exactly one child gets a matching pair, and (iv) at
least 2 children get matching pairs.
Solution: Any one distribution of n right gloves to n children determines a set of n places for the
n pairs of gloves. Let us take these as the natural places for the pairs of gloves. The left gloves
can be distributed to n children in n! ways.
(i) The event of no child getting a matching pair occurs if the distribution of the left gloves
is a derangement. The number of derangement is 𝑑𝑛 . Therefore, the required
probability, in this case, is
𝑑𝑛 1 1 1 1
𝑝1 = = (1 − + − + ⋯ … … + (−1)𝑛 )
𝑛! 1! 2! 3! 𝑛!
(ii) The event of every child getting a matching pair occurs in only one distribution of the
1
left gloves. Therefore, the required probability, in this case, is 𝑝2 = .
𝑛!
(iii) The event of exactly one child getting a matching pair occurs when only one left glove is
in the natural place, and all others are in wrong places. The number of such
distributions is 𝑑𝑛−1 . The required probability, in this case, is
𝑑𝑛−1 1 1 1 1
𝑝3 = = (1 − + − + ⋯ … … + (−1)𝑛−1 ).
𝑛! 1! 2! 3! (𝑛 − 1)!
(iv) The event of at least 2 children getting a matching pair occurs if the event of no child or
one child getting a matching pair does not occur. The probability, in this case, is 𝑝4 =
1 − (𝑝1 + 𝑝3 ).
Example 7 :There are eight letters to eight different people to be placed in eight different
addressed envelopes. Find the number of ways of doing this so that at least one
letter gets to the right person.
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 𝑑8 .
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! − 𝑑8 ≈ (8!) − ⌊(8!) × 𝑒 −1 ⌋
≈ ⌊(8!)(1 − 0.3679)⌋
= ⌊40320 × 0.6321⌋ = 25486.
Example 8 Each of the n students is given a book. The books are to be returned and redistributed
to the same students. In how many ways can the two distributions be made so that no
student will get the same book in both the distributions.
Solution: At the first instance, the books can be distributed in n! ways. Each such distribution
fixed the positions of the n blocks. The redistribution of the books such that no student
will get the same book again is a derangement of these positions. This can be done in
𝑑𝑛 ways. Therefore, by the product rule, the answer is
𝑛
2
(−1)𝑘
(𝑛!)𝑑𝑛 = (𝑛!) × ∑ .
𝑘!
𝑘=0
Example 9: Find the number of derangements of the integers from 1 to n (inclusive) such that,
in each derangement,
(i) The elements in the first k places are 1, 2, 3, …….k in some order.
(ii) The elements in the first n - k places are k + 1, k + 2, ……..,n in some order.
(𝐻𝑒𝑟𝑒 0 < 𝑘 < 𝑛).
Solution: (i) The number of derangements of the integers 1, 2, 3, ……., k in the first k
places is 𝑑𝑘 . Consequently, the number of derangements of the remaining n – k
integers (which are to be in the last n – k places) integers is
Example 10 :For the positive integers 1, 2, 3, ……..,n. there are 11660 derangements
where 1, 2, 3, 4, 5 appear in the first five positions. What is the value of n?
Solution: The integers 1, 2, 3, 4 and 5 can be deranged in the first five places in 𝑑5
ways; the last 𝑛 − 5integers in 𝑑𝑛−5 ways. Hence, the number of derangements (being
considered) is 𝑑5 × 𝑑𝑛−5 = 11660, so that
11660 11660
𝑑𝑛−5 = = = 265.
𝑑5 44
Example 11: In how many ways can the integers 1, 2, 3, ……., 10 be arranged in a line so that no
even integer is in its natural place.
Solution: Let 𝐴1 be the set of all permutations of the given integers where 2 is in its natural
place, 𝐴2 be the set of all permutations in which 4 is in its natural place, and so on. Then, the
number of permutations where no even integer is in its natural place is |𝐴 ̅̅̅1 ∩ ̅̅̅
𝐴2 ∩ ̅̅̅
𝐴3 ∩ ̅̅̅
𝐴4 ∩
̅̅̅
𝐴5 |. This is given by * ( Recall expression (4) of section 7.1.)
̅̅̅1 ∩ ̅̅̅
|𝐴 𝐴2 ∩ ̅̅̅
𝐴3 ∩ ̅̅̅
𝐴4 ∩ ̅̅̅
𝐴5 | = |𝑆| − 𝑆1 + 𝑆2 − 𝑆3 + 𝑆4 − 𝑆5
(i)
Now, the permutations in 𝐴1 are all of the form 𝑏1 𝑏3 𝑏4 … … … 𝑏10 , where 𝑏1 𝑏3 𝑏4 … … … 𝑏10 is a
permutation of 1, 3, 4, 5,….10. As such, |𝐴1 | = 9!.
= 2170680.
𝑛
Example 12 Prove that, for any positive integer n, 𝑛! = ∑𝑛𝑘=0 ( ) 𝑑𝑘
𝑘
Solution: For any positive integer n, the total number of permutations 1, 2, 3, ………,n, is n!. In
each such permutation there exist 𝑘 ( where0 ≤ 𝑘 ≤ 𝑛)elements which are in their natural
(original) positions called fixed elements, and 𝑛 − 𝑘 elements which are not in their original
𝑛
positions. The 𝑘 elements can be chosen in ( ) ways, and the remaining 𝑛 − 𝑘 elements can
𝑘
𝑛
then be chosen in 𝑑𝑛−𝑘 ways. Hence there are ( ) 𝑑𝑛−𝑘 permutations of 1, 2, 3, ……n, with 𝑘
𝑘
fixed elements and 𝑛 − 𝑘 deranged elements. As 𝑘 varies from 0 𝑡𝑜 𝑛, we count all of the n!
permutations 1, 2, 3, ……, n.
Thus,
𝑛
𝑛
𝑛! = ∑ ( ) 𝑑𝑛−𝑘
𝑘
𝑘=0
𝑛 𝑛 𝑛 𝑛
= ( ) 𝑑𝑛 + ( ) 𝑑𝑛−1 + ( ) 𝑑𝑛−2 + ⋯ … … + ( ) 𝑑0
0 1 2 𝑛
𝑛 𝑛
𝑛 𝑛
= ∑( ) 𝑑𝑘 = ∑ ( ) 𝑑𝑘
𝑛−𝑘 𝑘
𝑘=0 𝑘=0
Exercises
Consider a board that resembles a full chess board or a part of a chess board. Let n be the
number of squares present in the board. Pawns are placed in the squares of the board such that
not more than one pawn occupies a square. Then, according to the Pigeonhole Principle* (see:
Section 5.4), not more than n pawns can be used. Two pawns placed on a board having 2 or
more squares are said to capture (or take) each other if they (pawns) are in the same row or in
the same column of the board. For 2 ≤ 𝑘 ≤ 𝑛, let 𝑟𝑘 denote the number of ways in which k
pawns can be placed on a board such that no two pawns capture each other – that is, no two
pawns are in the same row or in the same column of the board. Then the polynomial 1 + 𝑛𝑥 +
𝑟2 𝑥 2 + ⋯ … . . +𝑟𝑛 𝑥 𝑛 is called the rook polynomial *(Rook is the term used for a pawn placed on
a chess board. It is also called castle.) for the board considered. If the board is given the name C,
then the polynomial is denoted by 𝑟(𝐶, 𝑥). Thus, by definition,
𝑟(𝐶, 𝑥) = 1 + 𝑛𝑥 + 𝑟2 𝑥 2 + ⋯ … … + 𝑟𝑛 𝑥 𝑛 .
(1)
While defining this polynomial, it has been assumed that 𝑛 ≥ 2.In the trivial case where 𝑛 = 1
(that is, in the case where a board contains only on square), 𝑟2 , 𝑟3 … … are identically zero and
the rook polynomial 𝑟(𝐶, 𝑥) is defined by
𝑟(𝐶, 𝑥) = 1 + 𝑥.
(2)
The expression (1) and (2) can be put in the following combined form which holds for a board C
with 𝑛 ≥ 1 squares:
𝑟(𝐶, 𝑥) = 1 + 𝑟1 𝑥 + 𝑟2 𝑥 2 + ⋯ … … . +𝑟𝑛 𝑥 𝑛
(3)
1 2
3 4
For this board, 𝑟1 = 4. 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
𝑟2 = 2. Three rooks cannot be placed on the board such that no two pawns capture each other.
Thus, 𝑟3 = 0. Similarly, 𝑟4 = 0.
Example 2. Consider the board containing 5 squares (marked 1 to 5) shown in Figure 7.2
1 2 3
4 5
Solution: For this board, 𝑟1 = 5.We note that 2 non-capturing rooks can be placed on the board
in the following positions:
(1,5), (2,4), (2,5), (3,4). Thus, 𝑟2 = 4.We check that the board has no positions for more than
two mutually non-capturing rooks. That is, 𝑟3 = 0, 𝑟4 = 0, 𝑟5 = 0.Thus, for this board, the rook
polynomial is 𝑟(𝐶, 𝑥) = 1 + 5𝑥 + 4𝑥 2 .
Example 3. Consider the board containing 6 squares, shown in Figure 7.3.
1 2
3
4 5 6
Solution: For this board 𝑟1 = 6. We observe that 2 non-capturing rooks can have the following
positions: (1,3), (1,5), (1,6), (2,3), (2,4), (2,6), (3,4), (3,5). These positions are 8 in number;
therefore 𝑟2 = 8.
Next, 3 mutually non-capturing rooks can be placed only in the following two positions: (1, 3, 5),
(2, 3, 4). Thus, 𝑟3 = 2.We find that four or more mutually noncapturing rooks cannot be placed
on the board. Thus 𝑟4 = 0, 𝑟5 = 0, 𝑟6 = 0. Accordingly, for this board, the rook polynomial is
𝑟(𝐶, 𝑥) = 1 + 6𝑥 + 8𝑥 2 + 2𝑥 3 .
Example 4. Consider the board with squares marked from 1 to 7 shown in Figure 7.4.
1 2
3 4
5 6 7
Solution: For this board we have 𝑟1 = 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). These are 10 in number; therefore 𝑟2 = 10.The
positions of 3 mutually non-capturing rooks are:
𝑟(𝐶, 𝑥) = 1 + 7𝑥 + 10𝑥 2 + 2𝑥 3 .
Example 5. Consider the board containing 8 squares (marked 1 to 8) as shown in Figure 7.5.
1 2 3
4 * 5
6 7 8
C
In this board, the position of 2 non-capturing rooks 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). These are 14 in number; therefore 𝑟2 = 14.The positions
of 3 mutually non-capturing rooks are:
(1, 5, 7), (2, 4, 8), (2, 5, 6), (3, 4, 7). These are 4 in number, therefore 𝑟3 = 4.
We check that the board has no positions for more than 3 mutually non-capturing rooks. Hence
𝑟4 = 𝑟5 = 𝑟6 = 𝑟7 = 0.
Consider an𝑛 × 𝑛 board 𝐶𝑛×𝑛 , where 𝑛 ≥ 2. *(For n = 5, the board is as shown in Figure 7.6). For
this board, 𝑟1 = 𝑛2 .
Solution: In this board, one can choose 𝑘( with2 ≤ 𝑘 ≤ 𝑛 ) rows out of the n rows in 𝐶(𝑛, 𝑘)
ways. After that, k rooks can be placed in these k rows so that there is exactly 1 rook in each row
and no 2 rooks are in the same column, in P(n,k) ways. Thus, there are 𝐶(𝑛, 𝑘) × 𝑃(𝑛, 𝑘) ways of
placing the k rooks such that no two rooks are in the same row or in the same column. This
means that, for 2 ≤ 𝑘 ≤ 𝑛,
𝑟𝑘 = 𝐶(𝑛, 𝑘) × 𝑃(𝑛, 𝑘)
𝑛! 𝑛!
= × = 𝑘! × {𝐶(𝑛, 𝑘)}2
(𝑛 − 𝑘)! 𝑘! (𝑛 − 𝑘)!
Further, 𝑟𝑘 = 0 for 𝑘 > 𝑛.Because it is not possible to place more than n rooks such that no 2
rooks are in the same row or in the same column.
𝑛 2 𝑛 2 𝑛 2 𝑛 2
= 1 + ( ) 𝑥 + (2!) × ( ) 𝑥 2 + (3!) × ( ) 𝑥 3 + ⋯ … . . +(𝑛!) × ( ) 𝑥 𝑛
1 2 3 𝑛
(4)
Taking n = 2, 3, 4,…..in this polynomial, we get the rook polynomial for the boards
𝐶2×2 , 𝐶3×3 , 𝐶4×4 , … … Thus,
2 2 2 2
𝑟(𝐶2×2 , 𝑥) = 1 + ( ) 𝑥 + (2!) × ( ) 𝑥 2 = 1 + 4𝑥 + 2𝑥 2 (This agrees with that obtained in
1 2
Example 1).
3 2 3 2 3 2
𝑟(𝐶3×3 , 𝑥) = 1 + ( ) 𝑥 + (2!) × ( ) 𝑥 2 + (3!) × ( ) 𝑥 3 = 1 + 9𝑥 + 18𝑥 2 + 6𝑥 3 ,
1 2 3
4 2 4 2 4 2 4 2
𝑟(𝐶4×4 , 𝑥) = 1 + ( ) 𝑥 + (2!) × ( ) 𝑥 2 + (3!) × ( ) 𝑥 3 + (4!) × ( ) 𝑥 4
1 2 3 4
2 3 4
= 1 + 16𝑥 + 72𝑥 + 96𝑥 + 24𝑥 ,
5 2 5 2 5 2 5 2 5 2
𝑟(𝐶5×5 , 𝑥) = 1 + ( ) 𝑥 + (2!) × ( ) 𝑥 2 + (3!) × ( ) 𝑥 3 + (4!) × ( ) 𝑥 4 + (5!) × ( ) 𝑥 5
1 2 3 4 5
= 1 + 25𝑥 + 200𝑥 2 + 600𝑥 3 + 600𝑥 4 + 120𝑥 5 ,and so on.
Expansion Formula
The rook polynomials have many interesting properties. Below we indicate two of these. In a
given board C, suppose we choose a particular square and mark it as ⊛. Let D be the board
obtained from C by deleting the row and the column containing the square ⊛.Then, the rook
polynomial 𝑟(𝐶, 𝑥) for the board C has the following property:
Example 6 Find the rook polynomial for the 2 X 2 board by using the expansion formula.
Solution: The 2 X 2 board is shown in Figure 7.1. Let us mark the square numbered 1 as ⊛. Then
the boards D and E appear as shown below.
The board D contains only one square. Therefore, 𝑟(𝐷, 𝑥) = 1 + 𝑥.
Example 7 Find the rook polynomial for the 3 × 3 board by using the expansion formula.
Let us mark the square which is at the centre of the board as ⊛. Then the boards D and E appear
as shown below (the shaded parts are the deleted parts):
The board E is the same as the one considered in Example 5 (see Figure 6.5). As such (for this
board)
𝑟(𝐸, 𝑥) = 1 + 8𝑥 + 14𝑥 2 + 4𝑥 3 .
= 𝑥 (1 + 4𝑥 + 2𝑥 2 ) + (1 + 8𝑥 + 14𝑥 2 + 4𝑥 3 )
= 1 + 9𝑥 + 18𝑥 2 + 6𝑥 3 .
Example 8 By using the expansion formula, obtain the rook polynomial for the board C show
below
Solution: Let us mark the topmost square 1 in the given board as ⊛. Then the boards D and E
appear as shown below.
For the board D, we have 𝑟1 = 5, 𝑟2 = 4( the positions of two non – capturing rooks being (2,4),
(2,7), (4,8), (5,7), and
𝑟3 = 𝑟4 = 𝑟5 = 0. Thus, 𝑟(𝐷, 𝑥) = 1 + 5𝑥 + 4𝑥 2 .
For the board E, we have 𝑟1 = 7, 𝑟2 = 11 ( the positions of two non-capturing rooks being (2,4),
(2,6), (2,7), (3,4), (3,5), (3,7), (3,8), (4,8), (5,7), (6,7), (6,8)), 𝑟3 = 3 ( the positions of three
mutually non – capturing rooks being (2, 6, 7), (3, 4, 8), (3, 5, 7)), and 𝑟𝑘 = 0 for k = 4, 5, 6, 7.
= 1 + 8𝑥 + 16𝑥 2 + 7𝑥 3 .
Example 9 By using the expansion formula find the rook polynomial for the board C shown below
(made up of unshaded parts):
Solution: Marking the square numbered 4 as ⊛, we get the boards D and E shown below
(unshaded parts):
For the board D, we have 𝑟1 = 2, 𝑟2 = 0. Hence
𝑟(𝐷, 𝑥) = 1 + 2𝑥 (i)
In the board E, let us mark the square numbered 6 as ⊛. Then, consider the boards
𝐷 ′ 𝑎𝑛𝑑 𝐸 ′ shown below (unshaded parts):
= 𝑥(1 + 4𝑥 + 2𝑥 2 ) + (1 + 4𝑥 + 2𝑥 2 )
= 1 + 5𝑥 + 6𝑥 2 + 2𝑥 3 (ii)
Now, applying the expansion formula to the given board C, and using (i) and (ii), we get
= 𝑥(1 + 2𝑥) + (1 + 5𝑥 + 6𝑥 2 + 2𝑥 3 )
= 1 + 6𝑥 + 8𝑥 2 + 2𝑥 3 .
Product formula
Suppose a board C is made up of two parts C1 and C2 where C1 and C2 have no squares in the
same row or column of
C –such parts of C are called disjoint sub-boards of C. Then the rook polynomial 𝑟(𝐶, 𝑥) for the
board C has the following property:
Example 10 Find the rook polynomial for the board shown below (shaded part).
Solution: We note that the given board C is made up of two disjoint sub-boards C1 and C2, where
C1 is the 2 × 2 board with squares numbered 1 to 4 and C2 is the board with squares numbered 5
to 11.
We note that C2 is the same as the board considered in Example 4. For this board, we have
𝑟(𝐶2 , 𝑥) = 1 + 7𝑥 + 10𝑥 2 + 2𝑥 3 .
Therefore, the product formula yields the rook polynomial for the given board as
Example 11 A board consists of the shaded part of Figure 7.16. Find its rook polynomial.
Solution: We observe that the given board, C, is made up of two disjoint sub-boards C1 and C2
shown below.
𝑟(𝐶1 , 𝑥) = 1 + 3𝑥 + 𝑥 2 .
Therefore, by the product formula, the rook polynomial for the given board is
Example 12 Find the rook polynomial for the board shown below:
Solution: First, let us mark the square numbered 6 in the given board, C, as ⊛ and obtain the
boards D and E shown below.
𝑟(𝐷, 𝑥) = 1 + 3𝑥 + 𝑥 2 (i)
In the board E, let us mark the square numbered 5 as ⊛ and obtain the boards 𝐷 ′ 𝑎𝑛𝑑 𝐸 ′
shown below.
We observe that for the board 𝐷 ′ , 𝑟1 = 3, 𝑟2 = 2, 𝑟3 = 0. Therefore,
𝑟(𝐷 ′ , 𝑥) = 1 + 3𝑥 + 2𝑥 2 (ii)
The board 𝐸 ′ is made up of two disjoint subboards one of which is a 2 X 2 board and the other is
a 2 X 1 board. The product formula applied to the board 𝐸 ′ yields
= 1 + 6𝑥 + 10𝑥 2 + 4𝑥 3 (iii)
Consequently, the expansion formula applied to the board E yields (using (ii) and (iii))
= 𝑥(1 + 3𝑥 + 2𝑥 2 ) + (1 + 6𝑥 + 10𝑥 2 + 4𝑥 3 )
= 1 + 7𝑥 + 13𝑥 2 + 6𝑥 3 (iv)
Finally, the expansion formula applied to the given board C yields (using (i) and (iv))
= 𝑥 (1 + 3𝑥 + 𝑥 2 ) + (1 + 7𝑥 + 13𝑥 2 + 6𝑥 3 )
= 1 + 8𝑥 + 16𝑥 2 + 7𝑥 3 .
Example 13 Find the rook polynomial for the board made up of the shaded squares in Figure
Solution: First, let us mark the square numbered 6 ingiven board, C, as ⊛ and obtain the boards
D and E shown below.
Figure 7.22
In the board D let us mark the square numbered 2 as ⊛ and obtain the boards 𝐷 ′ and 𝐸 ′
shown below:
= 𝑥(1 + 𝑥) + (1 + 3𝑥 + 2𝑥 2 )
= 1 + 4𝑥 + 3𝑥 2 . (i)
Now, let us look at the board E. This is made up of the disjoint subboards E 1 and E2 shown below:
Then, we have, using the product formula (applied to the board E),
In the board E1, let us mark the square numbered 5 as ⊛ , and obtain the boards 𝐷 ′′ and 𝐸 ′′
shown below.
We observe that 𝐸 ′′ is made up of two disjoint boards (-one board made up of squares
numbered from 1 to 4 and the other board with a single square numbered 7). Using the product
formula, we find that
𝑟(𝐸 ′′ , 𝑥) = (1 + 4𝑥 + 3𝑥 2 ) × (1 + 𝑥) = 1 + 5𝑥 + 7𝑥 2 + 3𝑥 3 (iv)
= 1 + 8𝑥 + 20𝑥 2 + 17𝑥 3 + 4𝑥 4 .
Suppose m objects are to be arranged in n places, where 𝑛 ≥ 𝑚.Suppose there are 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 out this task is given by the
following rule:
̅ = 𝑆0 − 𝑆1 + 𝑆2 − 𝑆3 + ⋯ … … . +(−1)𝑛 𝑆𝑛
𝑁 (8)
Where 𝑆0 = 𝑛! (9)
Here, 𝑟𝑘 is the coefficient of 𝑥 𝑘 in the rook polynomial of the board of m rows and n columns
whose squares represent the forbidden places ( under the specified conditions).
The formula (8) is a consequence of and analogous to the formula (9) of Section 7.1.
Example 14 :An apple, a banana, a mango and an orange are to be distributed to four boys
𝑩𝟏 , 𝑩𝟐 , 𝑩𝟑 , 𝑩𝟒 . The boys 𝑩𝟏 and 𝑩𝟐 do not wish to have apple, the boy 𝑩𝟑 does not want
banana or mango, and 𝑩𝟒 refuses orange. In how many ways the distribution can be made so
that no boy is displeased?
Solution: The situation can be described by the board shown in Figure 7.26 in which the rows
respectively represent apple, banana, mango and orange, and the columns represent the boys
𝐵1 , 𝐵2 , 𝐵3 , 𝐵4 respectively. Also, the shaded squares together represent the forbidden places in
the distribution
Let us consider the board C consisting of the shaded squares in Figure 7.26. We note that C is
formed by the mutually disjoint boards 𝐶1 , 𝐶2 , 𝐶3 shown in Figure 7.27.
C1
C2
C3
𝑟(𝐶, 𝑥) = (1 + 2𝑥)2 (1 + 𝑥) = 1 + 5𝑥 + 8𝑥 2 + 4𝑥 3 .
Thus, for C, 𝑟1 = 5, 𝑟2 = 8, 𝑟3 = 4.
This is the number of ways of distributing the fruits under the given constraints.
Example 15: Five teachers 𝑻𝟏 , 𝑻𝟐 , 𝑻𝟑 , 𝑻𝟒 , 𝑻𝟓 are to be made class teachers for five classes,
𝑪𝟏 , 𝑪𝟐 , 𝑪𝟑 , 𝑪𝟒 , 𝑪𝟓 , one teacher for each class. 𝑻𝟏 and 𝑻𝟐 do not wish to become the class
teachers for 𝑪𝟏 or 𝑪𝟐 , 𝑻𝟑 and 𝑻𝟒 for 𝑪𝟒 or 𝑪𝟓 , and 𝑻𝟓 for 𝑪𝟑 or 𝑪𝟒 or 𝑪𝟓 .In how many ways can
the teachers be assigned the work (without displeasing any teacher)?
Solution: The situation can be represented by the board shown below in which the rows
respectively represent the teachers 𝑇1 , 𝑇2 , 𝑇3 , 𝑇4 , 𝑇5 and the columns respectively represent the
classes 𝐶1 , 𝐶2 , 𝐶3 , 𝐶4 , 𝐶5 , and the shaded squares together represent the forbidden places
involved.
C1 C2 C3 C4 C5
T1
T2
T3
T4
T5
For the board C made up of the shaded squares in the above Figure, the rook polynomial is given
by (see Example 10)
Consequently,
Example 16 Four persons 𝑷𝟏 , 𝑷𝟐 , 𝑷𝟑 , 𝑷𝟒 who arrive late for a dinner party find that only one
chair at each of five tables 𝑻𝟏 , 𝑻𝟐 , 𝑻𝟑 , 𝑻𝟒 𝒂𝒏𝒅 𝑻𝟓 is vacant. 𝑷𝟏 will not sit at 𝑻𝟏 𝒐𝒓 𝑻𝟐 , 𝑷𝟐 will
not sit at 𝑻𝟐 , 𝑷𝟑 will not sit at 𝑻𝟑 𝒐𝒓 𝑻𝟒 , 𝒂𝒏𝒅 𝑷𝟒 will not sit at 𝑻𝟒 𝒐𝒓 𝑻𝟓 . Find the number of
ways they can occupy the vacant chairs.
Solution: Consider the board shown below, representing the situation. The shaded squares in the
first row indicate that tables 𝑇1 𝑎𝑛𝑑 𝑇2 are forbidden for 𝑃1 , and so on.
T1 T2 T3 T4 T5
For the board made up of shaded squares in the above Figure, the rook polynomial is given by
(see Example 11)
Consequently, the number of ways in which the four persons can occupy the chairs is
Example 17 A girl student has sarees of 5 different colours; blue, green, red, white and yellow.
On Mondays she does not wear green; on Tuesdays blue or red; on Wednesdays blue or green;
on Thursdays red or yellow; on Fridays red. In how many ways can she dress without repeating a
colour during a week (from Monday to Friday)?
Solution: The situation here can be represented by the board shown below in which the rows
respectively represent the colours B, G, R, W, Y and the columns respectively represent Mondays
through Fridays, and the shaded squares together represent the constraints on the colours worn.
For the board C made up of the shaded squares in the above Figure, the rook polynomial is (see
Example 13)
𝑟(𝐶, 𝑥) = 1 + 8𝑥 + 20𝑥 2 + 17𝑥 3 + 4𝑥 4 .
Consequently,
Example 18 A pair of dice, one red and the other green is rolled six times. Find the probability
that we obtain all six values on both the red die and the green die under the restriction that the
ordered pairs (1,1), (1,5), (2,4), (3,6), (4,2), (4,4),(5,1) and (5,5) do not occur. [Here an ordered
pair (a,b) indicates a on the red die and b on the green].
Solution: The situation being considered here can be represented by the board shown in Figure
7.31(a) in which the rows represent the values appearing on the red die and the columns
represent the values appearing on the green die. The shaded squares represent the value-pairs
that do not occur.
For the purpose of writing down the rook polynomial, let us redraw the board by relabeling the
rows and columns as shown in Figure 7.31(b).
Solution: For the shaded part of the board in Figure 7.31 (b), the rook polynomial is (using the
Product formula)
This gives
𝑆0 = 6! = 720, 𝑆1 = (5!) × 8 = 960, 𝑆2 = (4!) × 22 = 528, 𝑆3 = (3!) × 25 = 150,
Therefore,
̅ = 𝑆0 − 𝑆1 + 𝑆2 − 𝑆3 + 𝑆4 − 𝑆5
𝑁
Consequently, the number of ordered sequences of the six rolls of the dice for the event we are
interested in is
̅ = 720 × 160.
(6!) × 𝑁
Since the sample space consists of all sequences of six ordered pairs selected with repetitions
720×160
from the 28 unshaded squares of the board, the probability of this event is 𝑃 = .
(28)6
Example 19 Obtain the formula for 𝑑𝑛 , the number of dereangements of n objects, by using rook
polynomials.
is not in the first place 𝑝1 , 𝑎2 is not in the second place 𝑝2 , … … … . , 𝑎𝑛 is not in the nth place 𝑝𝑛 .
Accordingly, a derangement can be represented by the board shown below in which the rows
respectively represent the objects 𝑎1 , 𝑎2 , … . . , 𝑎𝑛 and the columns respectively represent the
places 𝑝1 , 𝑝2 , 𝑝3 , … … . , 𝑝𝑛 and the shaded squares together represent the constraints involved.
The board C make up of the shaded squares consists of n mutually disjoint squares, one square in
each row/column. For a board with single square, the rook polynomial is (1+x).
𝑛 𝑛!
𝑟𝑘 = ( ) = , 𝑓𝑜𝑟 𝑘 = 1, 2, … … . . 𝑛.
𝑘 𝑘! (𝑛 − 𝑘)!
𝑑𝑛 = 𝑆0 − 𝑆1 + 𝑆2 − 𝑆3 + ⋯ … . . +(−1)𝑛 𝑆𝑛
1 1 1 (−1)𝑛
= 𝑛! × {1 − + − + ⋯ … . + }
1! 2! 3! 𝑛!
This is the required formula; this agrees with formula (1) of section 6.2.
Exercises
Where c is a known constant and f(n) is a known function. Such a relation is called a
linear recurrence relation of first-order with constant coefficient. If f(n) = 0, the relation is called
homogeneous; otherwise, it is called non-homogeneous (or in homogeneous).
The relation (1) can be solved in a trivial way. First, we note that this relation may be rewritten as
(by changing n to n+1)
𝑎1 = 𝑐𝑎0 + 𝑓(1),
= 𝑐 2 𝑎0 + 𝑐𝑓(1) + 𝑓(2),
This is the general solution of the recurrence relation (2) which is equivalent to the relation (1).
If f(n)=0, that is if the recurrence relation is homogeneous, the solution (3) becomes
𝑎𝑛 = 𝑐 𝑛 𝑎0 𝑓𝑜𝑟 𝑛 ≥ 1 … … … . . (4)
The solutions (3) and (4) yield particular solutions if 𝑎0 is specified. The specified value of 𝑎0 is
called the initial condition.
Example 1 Solve the recurrence relation 𝒂𝒏+𝟏 = 𝟒𝒂𝒏 𝒇𝒐𝒓 𝒏 ≥ 𝟎, given that 𝒂𝟎 = 𝟑.
𝑎𝑛 = 4𝑛 𝑎0 𝑓𝑜𝑟 𝑛 ≥ 1. (i)
𝑎𝑛 = 3 × 4𝑛 𝑓𝑜𝑟 𝑛 ≥ 1. (ii)
This is the particular solution of the given relation, satisfying the initial condition 𝑎0 = 3.
Example 2 Solve the recurrence relation 𝒂𝒏 = 𝟕𝒂𝒏−𝟏 , 𝒘𝒉𝒆𝒓𝒆 𝒏 ≥ 𝟏, given that 𝒂𝟐 = 𝟗𝟖.
Solution: The given relation may be rewritten as 𝑎𝑛+1 = 7𝑎𝑛 for 𝑛 ≥ 0.The general solution of
this homogeneous relation is
𝑎𝑛 = 7𝑛 𝑎0 𝑓𝑜𝑟 𝑛 ≥ 1. (i)
It is given that 𝑎2 = 98. Using this in (i) we get 98 = 𝑎2 = 72 𝑎0 so that 𝑎0 = 2.Putting this into
the general solution (i) we get the particular solution
𝑎𝑛 = 2 × 7𝑛 , 𝑓𝑜𝑟 𝑛 ≥ 1. (ii)
This is the solution of the given relation under the condition 𝑎2 = 98.
Example 3 Solve the recurrence relation 𝒂𝒏 = 𝒏𝒂𝒏−𝟏 for 𝒏 ≥ 𝟏, given that 𝒂𝟎 = 𝟏.
𝑎1 = 1 × 𝑎0 , 𝑎2 = 2𝑎1 = (2 × 1)𝑎0 ,
𝑎3 = 3 × 𝑎2 = (3 × 2 × 1)𝑎0 ,
𝑎𝑛 = (𝑛!)𝑎0 𝑓𝑜𝑟 𝑛 ≥ 1.
Using the given initial condition 𝑎0 = 1 in this, we get 𝑎𝑛 = 𝑛! as the required solution.
From this, we get 𝑎3 = 𝑘 3 𝑎0 𝑎𝑛𝑑 𝑎5 = 𝑘 5 𝑎0 , 𝑠𝑜 𝑡ℎ𝑎𝑡 𝑎5 ⁄𝑎3 = 𝑘 2 .Using the given values
of 𝑎3 𝑎𝑛𝑑 𝑎5 in this, we get
1377 49 9
𝑘2 = . = .
2401 153 49
3
Therefore, 𝑘 = ±
7
Example 5: Find 𝒂𝟏𝟐 if 𝒂𝒏+𝟏 𝟐 = 𝟓𝒂𝟐 𝒏 , where 𝒂𝒏 > 0 𝑓𝑜𝑟 𝑛 ≥ 0, given that 𝒂𝟎 = 𝟐.
Solution: 𝑏𝑛 = 𝑎2 𝑛 , the given relation reads 𝑏𝑛+1 = 5𝑏𝑛 , whose general solution is 𝑏𝑛 = 5𝑛 𝑏0 .
Using 𝑏0 = 𝑎2 0 = 4 in this, we get 𝑏𝑛 = 4 × 5𝑛 . Thus, we have 𝑎2 𝑛 = 4 × 5𝑛 . Since 𝑎𝑛 > 0 for
𝑛 ≥ 0, this yields 𝑎𝑛 = 2(√5)𝑛 for 𝑛 ≥ 0. Therefore,
𝑎𝑛 = 3𝑛 𝑎0 + ∑ 3𝑛−𝑘 𝑓(𝑘).
𝑘=1
𝑎𝑛 = (2 × 3𝑛 ) + ∑ 3𝑛−𝑘 × (5 × 7𝑘 )
𝑘=1
𝑛
𝑛) 𝑛−1
7 𝑘−1
= (2 × 3 + (5 × 7 × 3 )×∑( )
3
𝑘=1
𝑛) 𝑛−1
3 7𝑛 − 3𝑛
= (2 × 3 + (5 × 7 × 3 )× ×
4 3𝑛
1
= (2 × 3𝑛 ) + (5 × 7)(7𝑛 − 3𝑛 )
4
35 𝑛 5 𝑛+1 27 5
= (2 − )3 + 7 = − 3𝑛 + 7𝑛+1
4 4 4 4
5 1
= 7𝑛+1 − 3𝑛+3 .
4 4
This is the required solution.
Example 7 :Solve the recurrence relation 𝒂𝒏 − 𝟑𝒂𝒏−𝟏 = 𝟓 × 𝟑𝒏 for 𝒏 ≥ 𝟏 given that 𝒂𝟎 = 𝟐.
𝑎𝑛 = 3𝑛 𝑎0 + ∑ 3𝑛−𝑘 𝑓(𝑘)
𝑘=1
= 2 × 3𝑛 + 5 × (𝑛3𝑛 )
= (2 + 5𝑛)3𝑛
Example 8 :Find a recurrence relation and the initial condition for the sequence
Evidently,
From these, we readily note that the recurrence relation for the given sequence is 𝑎𝑛 = 5𝑎𝑛−1
for 𝑛 ≥ 1, 𝑤𝑖𝑡ℎ 𝑎0 = 2 as the initial condition.
The solution of this relation is
𝑎𝑛 = 5𝑛 𝑎0 = 5𝑛 × 2.
Example 9: Find the recurrence relation and the initial condition for the sequence
𝑎0 = 0, 𝑎1 = 2, 𝑎1 − 𝑎0 = 2,
𝑎2 = 6, 𝑎2 − 𝑎1 = 4, 𝑎3 = 12, 𝑎3 − 𝑎2 = 6,
Evidently,
This is the recurrence relation for the given sequence, with 𝑎0 = 0 as the initial condition.
𝑎𝑛 − 𝑎𝑛−1 = 2𝑛
………….
………….
𝑎3 − 𝑎2 = 2 × 3
𝑎2 − 𝑎1 = 2 × 2
𝑎1 − 𝑎0 = 2 × 1
𝑎𝑛 − 𝑎0 = 2{𝑛 + (𝑛 − 1) + (𝑛 − 2) + ⋯ … . . +3 + 2 + 1}
𝑛(𝑛+1)
= 2. = 𝑛(𝑛 + 1).
2
Solution: From the given recurrence relation, we obtain the following (successive) equations (with
𝑛 = 2𝑘 )
𝑎𝑛 − 2𝑎𝑛 = (𝑛 − 1)
2
𝑛
𝑎𝑛/2 − 2𝑎𝑛/4 = ( − 1)
2
𝑛
𝑎𝑛/4 − 2𝑎𝑛/8 = ( − 1)
4
.
.
.
𝑛
𝑎𝑛/(2𝑘−2 ) − 2𝑎𝑛/(2𝑘−1 ) = ( − 1)
2𝑘−2
𝑛
𝑎𝑛/(2𝑘−1 ) − 2𝑎𝑛/(2𝑘 ) = ( 𝑘−1 − 1)
2
These can be rewritten as
𝑎𝑛 − 2𝑎𝑛 = (𝑛 − 1)
2
2𝑎𝑛/2 − 22 𝑎𝑛 = (𝑛 − 2)
4
22 𝑎𝑛/4 − 23 𝑎𝑛 = (𝑛 − 22 )
8
.
.
.
𝑎𝑛 − 2𝑘 𝑎 𝑛 = (𝑛 − 1) + (𝑛 − 2) + (𝑛 − 22 ) + ⋯ … … . +(𝑛 − 2𝑘−1 )
2𝑘
𝑎𝑛 = 𝑘𝑛 − (1 + 2 + 22 + ⋯ … … … + 2𝑘−1 )
(2𝑘 − 1)
= 𝑘𝑛 − = 𝑘𝑛 − (𝑛 − 1) = 1 + (𝑘 − 1)𝑛
2−1
= 1 + (log 2 𝑛 − 1)𝑛
Example 11: The number of virsus affected files in a system is 1000 (to start with) and this
incease 250% every two hours. Use a recurrence relation to determine the number of virus
affected files in the system after one day.
Solution: In the beginning, the number of virus affected files is 1000. Let us denote this by 𝑎0 .
Let 𝑎𝑛 denote the number of virus affected files after 2n hours. Then the number increases by
250
𝑎𝑛 × 100 in the next two hours. Thus, after 2𝑛 + 2 hours, the number is
250
𝑎𝑛+1 = 𝑎𝑛 + 𝑎𝑛 ×
100
= 𝑎𝑛 (1 + 2.5) = 𝑎𝑛 (3.5).
This is the recurrence relation for the number of virus affected files. Solving this relation, we get
This gives the number of virus affected files after 2n hours. From this, we get (for n = 12)
This is the number of virus affected files after one day (24 hours).
Example 12: A person invests Rs. 10,000 at 10.5% interest (per year) compounded monthly.
Find and solve the recurrence relation for the value of the investment at the end of n months.
What is the value of the investment at the end of the first year? How long will it take to double
the investment?
Solution: Since the annual interest is 10.5%, the monthly interest comes to
(10.5%)/12=0.875%=0.00875.
Let 𝑆0 denote the investment made namely Rs. 10,000, and 𝑆1 , 𝑆2 , … … … , 𝑆𝑛 denote the value of
the investment at the end of n months.
Then
𝑆1 = 𝑆0 + (0.00875)𝑆0 = (1.00875)𝑆0
𝑆2 = 𝑆1 + (0.00875)𝑆1 = (1.00875)𝑆1
This is the required recurrence relation. Solving this recurrence relation, we find that
Therefore, the value at the end of the first year is (in Rupees)
𝑆12 = (1.00875)12 × 10,000 ≈ 11,102.
or𝑙𝑜𝑔2 = 𝑛 log(1.00875)
𝑙𝑜𝑔2
or𝑛 = log (1.00875) ≈ 79.6.
Thus, the investment will be doubled in about 80 months ( 6 years and 8 months) time.
Example: 13 A bank pays a certain % of annual interest on deposits, compounding the interest
once in 3 months. If a deposit doubles in 6 years and 6 months, what is the annual % of
interest paid by the bank?
Solution: Let the annual rate of interest be x%. Then, the quarterly rate of interest is
𝑥 𝑥
( )% = ( ).
4 400
Let 𝑝0 denote the deposit made (in Rs.). and𝑝𝑛 denote the value of the deposit at the end of the
𝑛𝑡ℎ quarter. Then
𝑥 𝑥
𝑝𝑛+1 = 𝑝𝑛 + (400) 𝑝𝑛 = (1 + 400) 𝑝𝑛 𝑓𝑜𝑟 𝑛 ≥ 0
(i)
This is the recurrence relation for the problem. The general solution of this homogeneous
relation is
𝑥 𝑛
𝑝𝑛 = (1 + ) 𝑝0 𝑓𝑜𝑟 𝑛≥1
400
From what is given, we have 𝑝𝑛 = 2𝑝0 when n = 26. *(n=26 corresponds to 6 years and 6
months.) Using this in (ii), we get
𝑥 26
(1 + ) =2
400
𝑥 log𝑒 2
Or log 𝑒 (1 + 400) = = 0.02666
26
𝑥
Or 1 + 400 = 𝑒 0.02666 = 1.027
Thus, the annual rate of interest paid by the bank is 10.8% (compounding the interest once in 3
months).
Example 14: A person takes a loan of Rs. S with A as the interest-rate per month. The loan is to
be paid back (with interest) in N months of time. If the person agrees to make a fixed payment
of Rs. P at the end of every month until the loan (with interest) is cleared, what should P be?
Solution: Let 𝑝𝑛 denote the amount still owed at the end of the nth month (following the nth
payment). Then, at the end of the (𝑛 + 1)𝑠𝑡 month, the amount still owed is
Here, P is the payment the person made at the end of the (𝑛 + 1) 𝑠𝑡 month.
Thus, (i) is the recurrence relation for 𝑝𝑛 . The general solution of this nonhomogeneous relation
is
𝑛
At the end of the Nth month, the amount owed is Nil. Thus, 𝑝𝑁 = 0.Using this in (ii), we get
𝑃
0 = 𝑆(1 + 𝐴)𝑁 − {(1 + 𝐴)𝑁 − 1}
𝐴
This yields
𝐴𝑆(1 + 𝐴)𝑁
𝑃= .
(1 + 𝐴)𝑁 − 1
Example 15: Suppose that there are 𝒏 ≥ 𝟐 persons at a party and that each of these persons
shakes hands (exactly once) with all of the other persons present. Using a recurrence relation,
find the number of hand shakes.
Solution: Let 𝑎𝑛−2 denote the number of hand shakes among the 𝑛 ≥ 2 persons present. ( If n =
2, the number of handshakes is 1; that is 𝑎0 = 1). If a new person jumps the party, he will shake
hands with each of the n persons already present. Thus, the number of hand shakes increases by
n when the number of persons changes to n+1 from n. Thus,
The general solution of this nonhomogeneous recurrence relation is (see expression (3))
𝑚 𝑚
𝑎𝑚 = 1 + {2 + 3 + 4 + ⋯ … … + 𝑚 + (𝑚 + 1)}
1
= (𝑚 + 1)(𝑚 + 2) 𝑓𝑜𝑟 𝑚 ≥ 0
2
1
Or 𝑎𝑛−2 = 2 (𝑛 − 1)𝑛 𝑓𝑜𝑟 𝑛 ≥ 2.
This is the number of handshakes in the party when 𝑛 ≥ 2 persons are present. *(This result
agrees with the result got in Example 9, section 4.3.)
Example 16: There are 3 pegs fixed vertically on a table, and n circular disks having holes at
their centres and having increasing diameters are slipped onto one of these pegs, with the
largest disk at the bottom. The disks are to be transferred, one at a time, onto another peg
with the condition that at no time a larger disk is put on a smaller disk. Determine the number
of moves for the transfer of all the n disks, so that at the end the disks are in their original
order. *(This problem is known as The Towers of Hanoi Problem. Figure 8.1 corresponds to the
case of 8 disks.)
Solution: Let 𝑎𝑛 be the number of moves required to transfer n disks. Evidently, 𝑎0 = 0. Let us
denote the peg on which the disks are originally located as 𝑝1 .To effect the transfer, for 𝑛 ≥ 1,
we first transfer the top n – 1 disks to a vacant peg, say 𝑝2, in the presecribed manner. This
involves 𝑎𝑛−1 moves. Then we transfer the nth disk to the other vacant peg, say 𝑝3 . This involves
1 move. Lastly, we transfer the n -1 disks from peg 𝑝2 to the peg 𝑝3 , in the prescribed manner.
This involves
𝑎𝑛−1 moves. Thus, the total number of moves involved in the transfer of n disks is
𝑎𝑛 = 𝑎𝑛−1 + 1 + 𝑎𝑛−1 = 2𝑎𝑛−1 + 1, 𝑓𝑜𝑟 𝑛 ≥ 1,
Or equivalently
𝑛−1 𝑛−2 2
2𝑛 − 1
=2 +2 + ⋯……+ 2 + 2 + 1 = = 2𝑛 − 1.
2−1
This is the required number of moves.
Remark: According to the result proved above 𝑎𝑛 = 3 when 𝑛 = 2. That is, three moves are
required when there are two disks. If the disks are denoted by 𝑑1 𝑎𝑛𝑑 𝑑2 , where 𝑑2 is the bigger
disk, the three moves are: (i) 𝑑1 from 𝑝1 𝑡𝑜 𝑝2 , (ii) 𝑑2 from 𝑝1 𝑡𝑜 𝑝3 , and (iii) 𝑑1 from 𝑝2 𝑡𝑜𝑝3 .
For n = 3 we have 𝑎𝑛 = 7, and for n = 4 we have 𝑎𝑛 = 15.That is, 7 moves are required when
there are 3 disks and 15 moves are required when there are 4 disks. The reader is urged to
identify these moves.
Exercises
(𝑖𝑣)𝑎𝑛+1 − 2𝑎𝑛 = 5, 𝑛 ≥ 0, 𝑎0 = 1.
(𝑣𝑖𝑖)𝑎𝑛+1 − 𝑎𝑛 = 3𝑛2 − 𝑛, 𝑛 ≥ 0, 𝑎0 = 3.
(𝑥𝑖)𝑎𝑛+1 − 2𝑎𝑛 = 2𝑛 , 𝑛 ≥ 0, 𝑎0 = 1.
2. Find the recurrence relation and the initial condition for each of the following sequences:
24 72 216
(𝑖) 3, 7, 11, 15, 19, … … . (𝑖𝑖) 8, , , ,……
7 49 343
14 28 56
(𝑖𝑖𝑖) 6, −18, 54, −162, … … . (𝑖𝑣) 7, , , , … … ..
5 25 125
3. Solve the recurrence relation 𝑎𝑛2 − 2𝑎𝑛−1 = 0, 𝑛 ≥ 1, 𝑎0 = 2. (𝐻𝑖𝑛𝑡: 𝑇𝑎𝑘𝑒 𝑏𝑛 =
log 2 𝑎𝑛 ).
4. A person invests certain amount at 11% interest (per year) compounded annually. How
long will it take to double the investment?
5. If a person invests Rs. 10,000 at 10% annual interest compounded quarterly, in how many
months the money will become Rs. 15000?
6. Fifteen years ago, a person invested some amount at 14% annual interest compounded
half-yearly. Now the amount has become Rs. 91,347. What was the amount he invested?
7. If a person invests Rs. 25,000 at 9% annual interest, find the amount he will get at the end
of 5 years in each of the following situations:
(i) The interest is compounded annually.
(ii) The interest is compounded half-yearly.
(iii) The interest is compounded quarterly.
(iv) The interest is compounded monthly.
8. A person wishes to take a loan at 1% interest per month. He agrees to clear the loan with
interest in 24 monthly instalments of Rs. 5000 (each). What is the loan amount he is
eligible for?
9. On the first day of a new year, a person deposits Rs. S in an account that pays a% annual
interest compounded monthly. At the beginning of each month he adds Rs. R to his
account. If he continues to do this for the next n years(so that he makes (12n-1) additional
deposits of Rs. R) how much will his account be worth exactly n years after he opened it?
10. Use a recurrence relation to derive the formula for ∑𝑛𝑘=0 𝑘 2 .
Second-order Homogeneous Recurrence Relations
Where 𝑐𝑛 , 𝑐𝑛−1 𝑎𝑛𝑑 𝑐𝑛−2 are real constants with 𝑐𝑛 ≠ 0.A relation of this types is called a
second-order linear homogeneous recurrence relation with constant coefficients.
Or 𝑐𝑛 𝑘 2 + 𝑐𝑛−1 𝑘 + 𝑐𝑛−2 = 0
(2)
Thus, 𝑎𝑛 = 𝑐𝑘 𝑛 is a solution of (1) if k satisfies the quadratic equation (2). This quadratic
equation is called the auxiliary equation or the characteristic equation for the relation (1).
Now, the following three cases arise:
Case 1: The two roots 𝑘1 𝑎𝑛𝑑 𝑘2 of equation (2) are real and distinct. Then we take
𝑎𝑛 = 𝐴𝑘1𝑛 + 𝐵𝑘2𝑛 ,
(3)
Where A and B are arbitrary real constants, as the general solution of the relation
(1).
Case 2: The two roots 𝑘1 𝑎𝑛𝑑 𝑘2 of equation (2) are real and equal, with k as the common
value. Then we take
𝑎𝑛 = (𝐴 + 𝐵𝑛)𝑘 𝑛 ,
(4)
Where A and B are arbitrary real constants, as the general solution of the relation (1).
Case 3: The two roots 𝑘1 𝑎𝑛𝑑 𝑘2 of equation (2) are complex. Then 𝑘1 𝑎𝑛𝑑 𝑘2 are
complex conjugates of each other, so that if 𝑘1 = 𝑝 + 𝑖𝑞, then 𝑘2 = 𝑝 − 𝑖𝑞, and we take
𝑎𝑛 = 𝑟 𝑛 (𝐴𝑐𝑜𝑠𝑛𝜃 + 𝐵𝑠𝑖𝑛𝑛𝜃), (5)
Solution: Here, the coefficients of 𝑎𝑛 , 𝑎𝑛−1 𝑎𝑛𝑑 𝑎𝑛−2 are 𝑐𝑛 = 1, 𝑐𝑛−1 = 1 𝑎𝑛𝑑 𝑐𝑛−2 =
−6, respectively.
Therefore, the characteristic equation is*
𝑘2 + 𝑘 − 6 = 0 𝑜𝑟 (𝑘 + 3)(𝑘 − 2) = 0.
Evidently, the roots of this equation are 𝑘1 = −3 𝑎𝑛𝑑 𝑘2 = 2 which are real and distinct.
Therefore, the general solution of the given relation is **(see solution (3) page 338.)
𝑎𝑛 = 𝐴 × (−3)𝑛 + 𝐵 × 2𝑛
(i)
𝑎𝑛 = −2 × (−3)𝑛 + 2𝑛 , (ii)
This is the solution of the given relation, under the given initial conditions 𝑎0 = −1 𝑎𝑛𝑑 𝑎1 = 8.
Solution: Here, the coefficients of 𝑎𝑛 , 𝑎𝑛−1 𝑎𝑛𝑑 𝑎𝑛−2 𝑎𝑟𝑒, respectively, 𝑐𝑛 = 1, 𝑐𝑛−1 =
−3 𝑎𝑛𝑑 𝑐𝑛−2 = 2.
𝑘 2 − 3𝑘 + 2 = 0 𝑜𝑟 (𝑘 − 2)(𝑘 − 1) = 0
𝑎𝑛 = 𝐴 × 2𝑛 + 𝐵 × 1𝑛
(i)
Where A and B are arbitrary constants. Using the given conditions 𝑎1 = 5 𝑎𝑛𝑑 𝑎2 = 3 in this, we
get
5 = 2𝐴 + 𝐵 𝑎𝑛𝑑 3 = 4𝐴 + 𝐵.
Solving these, we get 𝐴 = −1 𝑎𝑛𝑑 𝐵 = 7.Putting these into (i), we get
𝑎𝑛 = −2𝑛 + 7
as the solution for the given relation under the given conditions.
𝑘 2 − 6𝑘 + 9 = 0, 𝑜𝑟 (𝑘 − 3)2 = 0
Whose roots are 𝑘1 = 𝑘2 = 3. Therefore, the general solution for 𝑎𝑛 is *(see solution (4), page
338)
𝑎𝑛 = (𝐴 + 𝐵𝑛)3𝑛 . (i)
Using the given initial conditions 𝑎0 = 5 𝑎𝑛𝑑 𝑎1 = 12 in (i), we get 5 = 𝐴 𝑎𝑛𝑑 12 = 3(𝐴 + 𝐵).
Solving these we get 𝐴 = 5 𝑎𝑛𝑑 𝐵 = −1. Putting these values in (i), we get
𝑎𝑛 = (5 − 𝑛)3𝑛 . (ii)
This is the solution of the given relation, under the given initial conditions.
Solution: For the given relation, the characteristic equation is 𝑘 2 − 2𝑘 + 2 = 0 whose roots are
2 ± √4 − 8
𝑘= = 1±𝑖
2
Therefore, the general solution for 𝑎𝑛 is**(See solution (5) page 338)
𝑎𝑛 = 𝑟 𝑛 [𝐴 𝑐𝑜𝑠𝑛𝜃 + 𝐵𝑠𝑖𝑛𝑛𝜃], (i)
1
Where A and B are arbitrary constants, 𝑟 = |(1 ± 𝑖)| = √2, and 𝑡𝑎𝑛𝜃 = 1 = 1 which yields 𝜃 =
𝜋⁄4. Thus,
𝑛 𝑛𝜋 𝑛𝜋
𝑎𝑛 = (√2) [𝐴 𝑐𝑜𝑠 + 𝐵𝑠𝑖𝑛 ]. (ii)
4 4
This is the solution of the given relation under the given conditions.
Solution: For the given relation, the characteristic equation is 𝑘 2 − 𝑏𝑘 + 𝑏 2 = 0, whose roots are
𝑏 ± √𝑏 2 − 4𝑏 2 𝑏
𝑘= = (1 ± 𝑖√3)
2 2
Therefore, the general solution for 𝐷𝑛 is
𝑏 𝑏 √3
𝑟 = | (1 ± 𝑖√3)| = (√12 + 3) = 𝑏 𝑎𝑛𝑑 tan 𝜃 = = √3,
2 2 1
So that 𝜃 = 𝜋⁄3. Thus, we have
𝑛𝜋 𝑛𝜋
𝐷𝑛 = 𝑏 𝑛 [𝐴 cos + 𝐵𝑠𝑖𝑛 ], (ii)
3 3
1 √3 1 √3
1= 𝐴+ 𝐵 𝑎𝑛𝑑 0 = − 𝐴 + 𝐵.
2 2 2 2
Solving these, we get 𝐴 = 1 𝑎𝑛𝑑 𝐵 = 1⁄√3.Putting these values of A and B into (ii), we get
𝑛𝜋 1 𝑛𝜋
𝐷𝑛 = 𝑏 𝑛 [cos + sin ]. (iii)
3 √3 3
This is the solution of the given relation under the given conditions.
𝑎𝑛+2 + 𝑏𝑎𝑛+1 + 𝑐𝑎𝑛 = 0 𝑓𝑜𝑟 𝑛 ≥ 0,determine the constants b and c and then solve the
relation for 𝑎𝑛 .
4 + 𝑏 + 0 = 0 𝑎𝑛𝑑 37 + 4𝑏 + 𝑐 = 0.
𝑎𝑛 = 𝐴 × 7𝑛 + 𝐵 × (−3)𝑛 (ii)
0 =𝐴+𝐵 𝑎𝑛𝑑 1 = 7𝐴 − 3𝐵
1
Which yield 𝐴 = −𝐵 = 10. Putting these values into (ii), we get
1
𝑎𝑛 = 10 {7𝑛 − (−3)𝑛 }. (iii)
Or equivalently,
𝑏𝑛 − 5𝑏𝑛−1 + 4𝑏𝑛−2 = 0, 𝑛 ≥ 2.
The characteristic equation for this relation is 𝑘 2 − 5𝑘 + 4 = 0 whose roots are 𝑘1 = 4 and 𝑘1 =
1. Therefore, the general solution for 𝑏𝑛 is
𝑏𝑛 = 𝐴 × 4𝑛 + 𝐵 × 1𝑛 (i)
It is given that 𝑎0 = 4 𝑎𝑛𝑑 𝑎1 = 13.These yield 𝑏0 = 𝑎02 = 42 = 16 𝑎𝑛𝑑 𝑏1 = 𝑎12 = 132 = 169.
Using these in (i), we get
16 = 𝐴 + 𝐵 𝑎𝑛𝑑 169 = 4𝐴 + 𝐵.
Solving these, we get 𝐴 = 51 𝑎𝑛𝑑 𝐵 = −35. Putting these into (i), we get
𝑏𝑛 = 51 × 4𝑛 − 35 (ii)
Example 8 Solve the recurrence relation *(The recurrence relation considered here is known as
the Fibonacci relation. The sequence 〈𝐹𝑟 〉 is known as the Fibonacci sequence. The terms
𝐹0 , 𝐹1 , 𝐹2 , 𝐹3 , … … of this sequence are known as Fibonacci numbers. The result (ii) agrees with
that proved in Example 7, section 3.2.
Where A and B are arbitrary constants. Using the given initial conditions 𝐹0 = 0 𝑎𝑛𝑑 𝐹1 = 1 in
this, we get
0 0
1 + √5 1 − √5
0 = 𝐴( ) +𝐵( ) =𝐴+𝐵
2 2
1 + √5 1 − √5
1 = 𝐴( )+𝐵( )
2 2
1
Solving these, we get 𝐴 = −𝐵 = .Putting these values of A and B into (i), we get
√5
𝑛 𝑛
11 + √5 1 − √5
𝐹𝑛 = {( ) −( ) }
√5 2 2
Example 9 Solve the recurrence relation 𝑎𝑛+2 = (𝑎𝑛+1 )(𝑎𝑛 ), 𝑓𝑜𝑟 𝑛 ≥ 0 with 𝑎0 = 1, 𝑎1 =
2.
𝑏𝑛+2 = 𝑏𝑛+1 + 𝑏𝑛 , 𝑛 ≥ 0.
This is identical with the Fibonacci recurrence relation. Therefore, 𝑏𝑛 = 𝐹𝑛 if the initial conditions
of the Fibonacci numbers hold for 𝑏𝑛 also; that is, if
Since it is given that 𝑎0 = 1 𝑎𝑛𝑑 𝑎1 = 2, these read 0 = log 1 𝑎𝑛𝑑 1 = 𝑙𝑜𝑔2.These conditions
hold if the base of the logarithm is 2. Thus, we have
𝑏𝑛 = 𝐹𝑛 𝑖𝑓 𝑏𝑛 = log 2 𝑎𝑛 , 𝑛 ≥ 0.
𝑎𝑛 = 2𝑏𝑛 = 2𝐹𝑛 .
Example 10 Find and solve a recurrence relation for the number of binary sequences of length
𝑛 ≥ 1 that have no consecutive 0’s.
Solution: Let 𝑎𝑛 denote the number of binary sequences of length 𝑛 ≥ 1, of the required type.
For 𝑛 = 1, there exist two such sequences – one sequence consisting of one 0 and the other
consisting of one 1.
For 𝑛 = 2, there exist three such sequences: 01, 11, 10. Thus, 𝑎1 = 2 𝑎𝑛𝑑 𝑎2 = 3.
In a sequence of the desired type of length 𝑛 ≥ 3, the last entry may be 1 or 0. If the last entry is
1, then the preceding
𝑛 − 1entries from a sequence of the desired type of length 𝑛 − 1; their number is 𝑎𝑛−1 . If the
last entry is 0, the preceding entry must be 1. The entries preceding this 1 form a sequence of
length (n-2) of the desired type; their number is 𝑎𝑛−2 .
All binary sequences of a given length must end with 1 or 0. Therefore, their number must be
equal to the number of sequences which end with 1 plus the number of sequences which end
with 0. Applying this result to the sequences that are being considered, we get
𝑎𝑛 = 𝑎𝑛−1 + 𝑎𝑛−2 𝑓𝑜𝑟 𝑛 ≥ 3. (i)
These simplify to
√5 + 3 √5 − 3
𝐴= , 𝐵=
2√5 2√5
Substituting these into (ii), we get
𝑛 𝑛
1 1+√5 1−√5
𝑎𝑛 = 2 {(√5 + 3) ( ) + (√5 − 3) ( ) }. (iii)
√ 5 2 2
Example 11 Consider the set 𝑆𝑛 = {1,2,3, … … 𝑛} for 𝑛 ≥ 1.Let 𝑆0 = ∅ (𝑛𝑢𝑙𝑙 𝑠𝑒𝑡).If 𝑎𝑛 ( for𝑛 ≥ 0)
is the number of subsets of 𝑆𝑛 that do not contain consecutive integers, find a recurrence
relation for 𝑎𝑛 and hence determine 𝑎𝑛 .
Solution: We recall that the set 𝑆0 = ∅ has only one subset, namely ∅ itself. This subset does not
contain consecutive integers. Therefore, 𝑎0 = 1.
We have 𝑆1 = {1} which has two subsets (namely ∅ and {1}). These subsets does not consecutive
integers. Therefore 𝑎1 = 2.
For 𝑛 ≥ 2, we have 𝑆𝑛 = {1,2, … … … , 𝑛 − 1, 𝑛}. Let A be any subset of 𝑆𝑛 . Then there arise only
the following two mutually exclusive possibilities:
1 + √5 1 − √5
1 = 𝐴 + 𝐵, 2 = 𝐴( )+𝐵( )
2 2
1 3 1 3
These give 𝐴 = 2 + 2 ; 𝐵 = 2 − 2 5.
√ 5 √
Thus,
𝑛 𝑛
1 1 + √5 1 − √5
𝑎𝑛 = {(√5 + 3) ( ) + (√5 − 3) ( ) }
2√5 2 2
Example 12 Let𝑎𝑛 denote the number of n-letter sequences that can be formed using the letters
A, B and C such that any nonterminal A has to be immediately followed by a B. Find the
recurrence relation for 𝑎𝑛 and solve it.
Solution: For n = 1, the possible sequences are the singleton sequences. These are 3 in number.
Thus, 𝑎1 = 3.
For n = 2, the possible sequences are: AB, BA, BB, BC, CA, CB, CC. Thus, 𝑎2 = 7.
Let 𝑛 ≥ 3, and consider a sequence of the desired type. The first letter of this sequence can be A
or cannot be A. In the former case, the second letter has to be B; Consequently the first two
positions are fixed, and the letters in the remaining positions correspond to (n-2) letter
sequences of the desired type. Their number is 𝑎𝑛−2 . In the latter case, there are two choices for
the first place, and for each choice the letters in the remaining positions correspond to (n-1)
letter sequences. Their number is 2 × 𝑎𝑛−1 .
Thus,
𝑎𝑛 = 𝑎𝑛−2 + 2𝑎𝑛−1 .
The characteristic equation for the relation (i) is 𝑘 2 − 2𝑘 − 1 = 0 whose roots are
2 ± √4 + 4
𝑘= = 1 ± √2.
2
Therefore, the general solution for 𝑎𝑛 is
1
𝑎𝑛 = [(1 + √2)𝑛+1 + (1 − √2)𝑛+1 ]
2
This is the solution for 𝑎𝑛 , with 𝑎1 = 3 𝑎𝑛𝑑 𝑎2 = 7.
Excercises
4. A particle moves horizontally to the right. The distance the particle travels in the (𝑛 + 1)𝑠𝑡
second is equal to twice the distance it has travelled in the nth second. If 𝑎𝑛 denotes the
position of the particle at the start of the (𝑛 + 1)𝑠𝑡
second, show, by using a recurrence relation, that𝑎𝑛 = (4 × 2𝑛 ) − 3, 𝑛 ≥ 0.
5. For 𝑛 ≥ 0, let 𝑎𝑛 count the number of ways a sequence of 1’s and 2’s will sum to n. By
finding a recurrence relation for 𝑎𝑛 , show that
𝑛+1 𝑛+1
1 1 + √5 1 − √5
𝑎𝑛 = [( ) −( ) ].
√5 2 2
Answers