Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
4 views90 pages

Module 4 - Principles of Counting - II

This document discusses the Principle of Inclusion-Exclusion in counting, detailing its application to finite sets and providing formulas for calculating the number of elements in unions and intersections of sets. It includes examples illustrating the principle's use in determining the total number of students studying various subjects in a hostel. Additionally, it presents alternative expressions and generalizations of the principle for different conditions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views90 pages

Module 4 - Principles of Counting - II

This document discusses the Principle of Inclusion-Exclusion in counting, detailing its application to finite sets and providing formulas for calculating the number of elements in unions and intersections of sets. It includes examples illustrating the principle's use in determining the total number of students studying various subjects in a hostel. Additionally, it presents alternative expressions and generalizations of the principle for different conditions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 90

Module 4

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.

7.1 The Principle of Inclusion-Exclusion

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

|𝐴 ∪ 𝐵| = |𝐴| + |𝐵| − |𝐴 ∩ 𝐵| (1)

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.

If 𝐴̅ is the complement of A (in S) and 𝐵̅ is the complement of B, we recall that 𝐴̅ ∩ 𝐵̅ = ̅̅̅̅̅̅̅̅̅̅


(𝐴 ∪ 𝐵)
and
̅̅̅̅̅̅̅̅̅̅
|(𝐴 ∪ 𝐵)| = |𝑆| − |𝐴 ∪ 𝐵|. Accordingly, we find by using formula (1), that

̅̅̅̅̅̅̅̅̅̅
|𝐴̅ ∩ 𝐵̅ | = |(𝐴 ∪ 𝐵)| = |𝑆| − |𝐴 ∪ 𝐵| = |𝑆| − |𝐴| − |𝐵| + |𝐴 ∩ 𝐵| (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.

Below we prove a generalization of this principle to n sets.


Principle of Inclusion-Exclusion for n sets

Let S be a finite set and 𝐴1 , 𝐴2 , … … . . , 𝐴𝑛 be subsets of S. Then the Principle of inclusion-


exclusion for 𝐴1 , 𝐴2 , … … . . , 𝐴𝑛 states that

|𝐴1 ∪ 𝐴2 ∪ 𝐴3 ∪ … … .∪ 𝐴𝑛 | = ∑|𝐴𝑖 | − ∑|𝐴𝑖 ∩ 𝐴𝑗 | + ∑|𝐴𝑖 ∩ 𝐴𝑗 ∩ 𝐴𝑘 | + ⋯ … … ….

+ (−1)𝑛−1 |𝐴1 ∩ 𝐴2 ∩ … … . .∩ 𝐴𝑛 | (3) ∗

Corollary: By virtue of the De’Morgan law in set Theory, we have

|̅̅̅
𝐴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

We may rewrite expressions (3) and (4) in other forms as well.

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 ∩ … … … .∩ ̅̅̅̅
𝐴𝑛 |,

and𝑁(𝑐𝑖 𝑜𝑟 𝑐𝑗 ) = |𝐴𝑖 ∪ 𝐴𝑗 |, 𝑁(𝑐𝑖 𝑜𝑟 𝑐𝑗 𝑜𝑟 𝑐𝑘 ) = |𝐴𝑖 ∪ 𝐴𝑗 ∪ 𝐴𝑘 |, … … … ..

……………..
𝑁(𝑐1 𝑜𝑟 𝑐2 𝑜𝑟 𝑐3 𝑜𝑟 … … . . 𝑜𝑟 𝑐𝑛 ) = ∑ 𝑁(𝑐𝑖 ) − ∑ 𝑁(𝑐𝑖 𝑐𝑗 ) + ∑ 𝑁(𝑐𝑖 𝑐𝑗 𝑐𝑘 ) −
⋯ … . +(−1)𝑛−1 𝑁(𝑐1 𝑐2 𝑐3 … … . 𝑐𝑛 ) (5)

and expression (3) reads

̅ = 𝑁 − ∑ 𝑁(𝑐𝑖 ) + ∑ 𝑁(𝑐𝑖 𝑐𝑗 ) − ∑ 𝑁(𝑐𝑖 𝑐𝑗 𝑐𝑘 ) + ⋯ … … . +(−1)𝑛−1 𝑁(𝑐1 𝑐2 𝑐3 … … . . 𝑐𝑛 )


𝑁
(6)

Using expression (6), expression (5) can be written as


̅
𝑁(𝑐1 𝑜𝑟 𝑐2 𝑜𝑟 𝑐3 𝑜𝑟 … … . . 𝑜𝑟 𝑐𝑛 ) = 𝑁 − 𝑁
(7)

Putting 𝑆0 = 𝑁 = |𝑆|, 𝑆1 = ∑ 𝑁(𝑐𝑖 ) = ∑|𝐴𝑖 |, 𝑆2 = ∑ 𝑁(𝑐𝑖 𝑐𝑗 ) = ∑|𝐴𝑖 ∩ 𝐴𝑗 |,

𝑆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)

For m = 0, this expression reduces to expression (10).


Further, the following expression determines the number of elements in S that satisfy at least m
of the n conditions (1 ≤ 𝑚 ≤ 𝑛):
𝑚 𝑚+1 𝑛−1
𝐿𝑚 = 𝑆𝑚 − ( ) 𝑆𝑚+1 + ( ) 𝑆𝑚+2 − ⋯ … … . . +(−1)𝑛−𝑚 ( )𝑆
𝑚−1 𝑚−1 𝑚−1 𝑛
(12)

For m = 1, this expression reduces to expression (9).

The proofs of expressions (11) and (12) are omitted.

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.

Solution: From, what is given, we have

|𝐴| = 12, |𝐵| = 20, |𝐶| = 20, |𝐷| = 8,

|𝐴 ∩ 𝐵| = 5, |𝐴 ∩ 𝐶| = 7, |𝐴 ∩ 𝐷| = 4,

|𝐵 ∩ 𝐶| = 16, |𝐵 ∩ 𝐷| = 4, |𝐶 ∩ 𝐷| = 3,

|𝐴 ∩ 𝐵 ∩ 𝐶| = 3, |𝐴 ∩ 𝐵 ∩ 𝐷| = 2, |𝐵 ∩ 𝐶 ∩ 𝐷| = 2,

|𝐴 ∩ 𝐶 ∩ 𝐷| = 3, |𝐴 ∩ 𝐵 ∩ 𝐶 ∩ 𝐷| = 2, |𝐴̅ ∩ 𝐵̅ ∩ 𝐶̅ ∩ 𝐷
̅ | = 71,

in the notation which is obvious.

We are required to find |𝑆| where S is the set of all students in the hostel.

The Principle of inclusion-exclusion .


̅̅̅1 ∩ ̅̅̅
|𝐴 𝐴2 ∩ ̅̅̅
𝐴3 ∩ … … . .∩ ̅̅̅̅
𝐴𝑛 |

= |𝑆| − ∑|𝐴𝑖 | + ∑|𝐴𝑖 ∩ 𝐴𝑗 | − ∑|𝐴𝑖 ∩ 𝐴𝑗 ∩ 𝐴𝑘 | + ⋯ … . . +(−1)𝑛 |𝐴1 ∩ 𝐴2 ∩ … … . .∩ 𝐴𝑛 |


The Principle of inclusion-exclusion (as given by equation (4)) applied to the above data gives

71 = |𝑆| − (12 + 20 + 20 + 8) + (5 + 7 + 4 + 16 + 4 + 3) − (3 + 2 + 2 + 3) + 2

71 = |𝑆| − 29

This gives |𝑆| = 71 + 29 = 100.

Thus, the total number of students in the hostel is 100.

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 = ∑|𝐴𝑖 | = 15 + 8 + 6 = 29, 𝑎𝑛𝑑 𝑆3 = |𝐴1 ∩ 𝐴2 ∩ 𝐴3 | = 3.

̅̅̅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 = ∑|𝐴𝑖 ∩ 𝐴𝑗 |.

We note that (𝐴1 ∩ 𝐴2 ∩ 𝐴3 ) is a subset of (𝐴𝑖 ∩ 𝐴𝑗 ) for 𝑖, 𝑗 = 1, 2, 3. Therefore, each of


|𝐴𝑖 ∩ 𝐴𝑗 |, which are 3 in number, is greater than or equal to |𝐴1 ∩ 𝐴2 ∩ 𝐴3 |. Hence

𝑆2 = ∑|𝐴𝑖 ∩ 𝐴𝑗 | ≥ 3|𝐴1 ∩ 𝐴2 ∩ 𝐴3 | = 9.

Using this in (i), we find that


̅̅̅1 ∩ ̅̅̅
|𝐴 𝐴2 ∩ ̅̅̅
𝐴3 | ≥ 9 − 2 = 7.

This proves the required result.

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 | = 𝑁𝑜. 𝑜𝑓 𝑒𝑙𝑒𝑚𝑒𝑛𝑡𝑠 𝑖𝑛 𝑆 𝑡ℎ𝑎𝑡 𝑎𝑟𝑒 𝑑𝑖𝑣𝑖𝑠𝑖𝑏𝑙𝑒 𝑏𝑦 2 = ⌊100/2⌋ = ⌊50⌋ = 50,

|𝐴2 | = 𝑁𝑜. 𝑜𝑓 𝑒𝑙𝑒𝑚𝑒𝑛𝑡𝑠 𝑖𝑛 𝑆 𝑡ℎ𝑎𝑡 𝑎𝑟𝑒 𝑑𝑖𝑣𝑖𝑠𝑖𝑏𝑙𝑒 𝑏𝑦 3 = ⌊100/3⌋ = ⌊33.333⌋ = 33,

|𝐴3 | = 𝑁𝑜. 𝑜𝑓 𝑒𝑙𝑒𝑚𝑒𝑛𝑡𝑠 𝑖𝑛 𝑆 𝑡ℎ𝑎𝑡 𝑎𝑟𝑒 𝑑𝑖𝑣𝑖𝑠𝑖𝑏𝑙𝑒 𝑏𝑦 5 = ⌊100/5⌋ = ⌊20⌋ = 20,

|𝐴1 ∩ 𝐴2 | = 𝑁𝑜. 𝑜𝑓 𝑒𝑙𝑒𝑚𝑒𝑛𝑡𝑠 𝑖𝑛 𝑆 𝑡ℎ𝑎𝑡 𝑎𝑟𝑒 𝑑𝑖𝑣𝑖𝑠𝑖𝑏𝑙𝑒 𝑏𝑦 2 𝑎𝑛𝑑 3 = ⌊100/6⌋ = ⌊16.666⌋


= 16,

|𝐴1 ∩ 𝐴3 | = 𝑁𝑜. 𝑜𝑓 𝑒𝑙𝑒𝑚𝑒𝑛𝑡𝑠 𝑖𝑛 𝑆 𝑡ℎ𝑎𝑡 𝑎𝑟𝑒 𝑑𝑖𝑣𝑖𝑠𝑖𝑏𝑙𝑒 𝑏𝑦 2 𝑎𝑛𝑑 5 = ⌊100/10⌋ = ⌊10⌋ = 10,

|𝐴2 ∩ 𝐴3 | = 𝑁𝑜. 𝑜𝑓 𝑒𝑙𝑒𝑚𝑒𝑛𝑡𝑠 𝑖𝑛 𝑆 𝑡ℎ𝑎𝑡 𝑎𝑟𝑒 𝑑𝑖𝑣𝑖𝑠𝑖𝑏𝑙𝑒 𝑏𝑦 3 𝑎𝑛𝑑 5 = ⌊100/15⌋ = ⌊6.666⌋ = 6,

|𝐴1 ∩ 𝐴2 ∩ 𝐴3 | = 𝑁𝑜. 𝑜𝑓 𝑒𝑙𝑒𝑚𝑒𝑛𝑡𝑠 𝑖𝑛 𝑆 𝑡ℎ𝑎𝑡 𝑎𝑟𝑒 𝑑𝑖𝑣𝑖𝑠𝑖𝑏𝑙𝑒 𝑏𝑦 2, 3 𝑎𝑛𝑑 5 = ⌊100/30⌋


= ⌊3.333⌋ = 3.

Now, the Principle of inclusion-exclusion given (see expression (4))

|̅̅̅
𝐴1 ∩ ̅̅̅
𝐴2 ∩ ̅̅̅
𝐴3 |
= |𝑆| − {|𝐴1 | + |𝐴2 | + |𝐴3 |} + {|𝐴1 ∩ 𝐴2 | + |𝐴1 ∩ 𝐴3 | + |𝐴2 ∩ 𝐴3 |}
− |𝐴1 ∩ 𝐴2 ∩ 𝐴3 |
= 100 − (50 + 33 + 20) + (16 + 10 + 6) − 3 = 26.

Thus, the required number is 26.

Example 4: How many integers between 1 and 300 (inclusive) are

(i) Divisible by at least one of 5, 6, 8?


(ii) Divisible by none of 5, 6, 8?

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:

(i) The number of elements of S that are divisible by at least one of 5, 6, 8 is


|𝐴1 ∪ 𝐴2 ∪ 𝐴3 |. This is given by ( see expression (3) )

|𝐴1 ∪ 𝐴2 ∪ 𝐴3 | = |𝐴1 | + |𝐴2 | + |𝐴3 | − {|𝐴1 ∩ 𝐴2 | + |𝐴1 ∩ 𝐴3 | + |𝐴2 ∩ 𝐴3 |} +


|𝐴1 ∩ 𝐴2 ∩ 𝐴3 | (i)

We note that
|𝐴1 | = ⌊300/5⌋ = 60, |𝐴2 | = ⌊300/6⌋ = 50, |𝐴3 | = ⌊300/8⌋ = 37,

|𝐴1 ∩ 𝐴2 | = ⌊300/30⌋ = 10, |𝐴1 ∩ 𝐴3 | = ⌊300/40⌋ = 7, |𝐴2 ∩ 𝐴3 | = ⌊300/24⌋


= 12

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

|𝐴1 ∩ 𝐴2 ∩ 𝐴3 | = ⌊300/120⌋ = 2 (Note that the l.c.m of 5, 6, 8 is 120).

Using these in (i), we get

|𝐴1 ∪ 𝐴2 ∪ 𝐴3 | = (60 + 50 + 37) − (10 + 7 + 12) + 2 = 120.

Thus, 120 elements of S are divisible by at least one of 5, 6 8.

(ii) The number of elements of S that are divisible by none of 5, 6, 8 is


̅̅̅1 ∩ ̅̅̅
|𝐴 𝐴2 ∩ ̅̅̅
𝐴3 | = |𝑆| − |𝐴1 ∪ 𝐴2 ∪ 𝐴3 | = 300 − 120 = 180.
Example 5: Find the number of nonnegative integer solutions of the equation

𝒙𝟏 + 𝒙𝟐 + 𝒙𝟑 + 𝒙𝟒 = 𝟏𝟖

Under the condition 𝒙𝒊 ≤ 𝟕, 𝒇𝒐𝒓 𝒊 = 𝟏, 𝟐, 𝟑, 𝟒.

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)

𝐶(4 + 18 − 1, 18) = 𝐶(21,18), so that

|𝑆| = 𝐶(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

𝐴2 = {(𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ) ∈ 𝑆|𝑥2 > 7},

𝐴3 = {(𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ) ∈ 𝑆|𝑥3 > 7},

𝐴4 = {(𝑥1 , 𝑥2 , 𝑥3 , 𝑥4 ) ∈ 𝑆|𝑥4 > 7}.


̅̅̅1 ∩ ̅̅̅
Then the required number of solutions would be |𝐴 𝐴2 ∩ ̅̅̅
𝐴3 ∩ ̅̅̅
𝐴4 | .

Let us set 𝑦1 = 𝑥1 − 8.Then𝑥1 > 7(𝑖. 𝑒., 𝑥1 ≥ 8) corresponds to 𝑦1 ≥ 0. When written in


terms of 𝑦1 , the given equation reads

𝑦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 |.

Thus, |𝐴1 | = 𝐶(13,10).


Similarly, by symmetry,

|𝐴2 | = |𝐴3 | = |𝐴4 | = 𝐶(13,10).

Let us take 𝑦1 = 𝑥1 − 8, 𝑦2 = 𝑥2 − 8.Then𝑥1 > 7 𝑎𝑛𝑑 𝑥2 > 7 correspond to 𝑦1 ≥


0 𝑎𝑛𝑑 𝑦2 ≥ 0. When written in terms of 𝑦1 𝑎𝑛𝑑 𝑦2 , the given equation reads

𝑦1 + 𝑦2 + 𝑥3 + 𝑥4 = 2

The number of nonnegative integer solutions of this equation is 𝐶(4 + 2 − 1, 2) = 𝐶(5,2).This is


precisely |𝐴1 ∩ 𝐴2 |.

Thus, |𝐴1 ∩ 𝐴2 | = 𝐶(5,2).

Similarly, by symmetry,

|𝐴1 ∩ 𝐴3 | = |𝐴1 ∩ 𝐴4 | = |𝐴2 ∩ 𝐴3 | = |𝐴3 ∩ 𝐴4 | = 𝐶(5,2).

In the given equation, more than two 𝑥𝑖 ′𝑠 cannot be greater than 7 simultaneously. Hence

|𝐴1 ∩ 𝐴2 ∩ 𝐴3 | = |𝐴1 ∩ 𝐴2 ∩ 𝐴4 | = |𝐴1 ∩ 𝐴3 ∩ 𝐴4 | = |𝐴2 ∩ 𝐴3 ∩ 𝐴4 | = 0,

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.

This is the required number of solutions.

Example 6: Find the number of integer solutions of the equation 𝒙𝟏 + 𝒙𝟐 + 𝒙𝟑 = 𝟐𝟎 such that

𝟐 ≤ 𝒙𝟏 ≤ 𝟓, 𝟒 ≤ 𝒙𝟐 ≤ 𝟕, −𝟐 ≤ 𝒙𝟑 ≤ 𝟗.

Solution: Let 𝑦1 = 𝑥1 − 2, 𝑦2 = 𝑥2 − 4, 𝑦3 = 𝑥3 + 2.Since𝑥1 ≥ 2, 𝑥2 ≥ 4, 𝑥3 ≥ −2, we have


𝑦1 ≥ 0, 𝑦2 ≥ 0, 𝑦3 ≥ 0.
When written in terms of 𝑦𝑖 the given equation reads

𝑦1 + 𝑦2 + 𝑦3 = 16

The number of nonnegative integer solutions of this equation is 𝐶(3 + 16 − 1, 16) =


𝐶(18,16). This is precisely the number of integer solutions of the given equation for which 𝑥1 ≥
2, 𝑥2 ≥ 4, 𝑥3 ≥ −2. If S is this set of solutions, we have |𝑆| = 𝐶(18,16).

When 𝑥1 ≤ 5 we have 𝑦1 ≤ 3, when 𝑥2 ≤ 7 we have 𝑦2 ≤ 3, and when 𝑥3 ≤ 9we have 𝑦3 ≤ 11.


Now, let

𝐴1 = {(𝑦1 , 𝑦2 , 𝑦3 ) ∈ 𝑆 |𝑦1 > 3}

𝐴1 = {(𝑦1 , 𝑦2 , 𝑦3 ) ∈ 𝑆 |𝑦2 > 3}

𝐴1 = {(𝑦1 , 𝑦2 , 𝑦3 ) ∈ 𝑆 |𝑦3 > 11}


̅̅̅1 ∩ ̅̅̅
We have to find |𝐴 𝐴2 ∩ ̅̅̅
𝐴3 |.

Let us set 𝑧1 = 𝑦1 − 4. Then 𝑦1 > 3(𝑖. 𝑒. , 𝑦1 ≥ 4) corresponds to 𝑧1 ≥ 0. When written in terms


of 𝑧1 , equation (i) reads

𝑧1 + 𝑦2 + 𝑦3 = 12.

The number of non-negative integer solutions of this equation is 𝐶(3 + 12 − 1, 12) =


𝐶(14,12).This is the number of solutions for which 𝑦1 > 3. Thus, |𝐴1 | = 𝐶(14,12).

Similarly, we find that |𝐴2 | = 𝐶(3 + 12 − 1, 12) = 𝐶(14,12)

|𝐴3 | = 𝐶(3 + 4 − 1, 4) = 𝐶(6,4).

Next, let us set 𝑧1 = 𝑦1 − 4 𝑎𝑛𝑑 𝑤2 = 𝑦2 − 4.Then, 𝑧1 ≥ 0 𝑎𝑛𝑑 𝑤2 ≥ 0 if 𝑦1 > 3 𝑎𝑛𝑑 𝑦2 > 3.


When written in terms of 𝑧1 𝑎𝑛𝑑 𝑤2 , equation (i) reads

𝑧1 + 𝑤2 + 𝑦3 = 8.

The number of nonnegative integer solutions of this equation is 𝐶(3 + 8 − 1, 8) = 𝐶(10,8).

This means that |𝐴1 ∩ 𝐴2 | = 𝐶(10,8).

Similarly, we find that


|𝐴1 ∩ 𝐴2 | = 𝐶(10,8).

|𝐴1 ∩ 𝐴3 | = 𝐶(3 + 0 − 1, 0) = 𝐶(2,0),

|𝐴2 ∩ 𝐴3 | = 𝐶(3 + 0 − 1, 0) = 𝐶(2,0).

In any solution of equation (i) we cannot have 𝑦1 > 3, 𝑦2 > 3 𝑎𝑛𝑑 𝑦3 > 11. Therefore,
|𝐴1 ∩ 𝐴2 ∩ 𝐴3 | = 0.

Now, we find that (by using the Principle of inclusion-exclusion)


̅̅̅1 ∩ ̅̅̅
|𝐴 𝐴2 ∩ ̅̅̅
𝐴3 |
= |𝑆| − {|𝐴1 | + |𝐴2 | + |𝐴3 |} + {|𝐴1 ∩ 𝐴2 | + |𝐴1 ∩ 𝐴3 | + |𝐴2 ∩ 𝐴3 |}
− |𝐴1 ∩ 𝐴2 ∩ 𝐴3 |

= 𝐶(18,16) − {𝐶(14,12) + 𝐶(14,12) + 𝐶(6,4)} + {𝐶(10,8) + 𝐶(2,0) +


𝐶(2,0)} − 0

= 153 − {(2 × 91) + 15} + (45 + 2) = 3.

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.

Solution: Here, x is of the form

𝑥 = 𝑥1 𝑥2 𝑥3 𝑥4 𝑥5 𝑥6 𝑥7

Where 0 ≤ 𝑥𝑖 ≤ 9 for 𝑖 = 1, 2, 3, … … … 7, and

𝑥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

𝑦𝑘 + 𝑠𝑢𝑚 𝑜𝑓 𝑥𝑖′ 𝑠 𝑒𝑥𝑐𝑙𝑢𝑑𝑖𝑛𝑔 𝑥𝑘 = 21 (ii)

The number of nonnegative integer solutions of this equation is 𝐶(7 + 21 − 1, 21) =


𝐶(27,21).This number is precisely |𝐴𝑘 |; that is

|𝐴𝑘 | = 𝐶(27,21).

This holds for all 𝐴𝑘 , 𝑘 = 1, 2, … … . .7.

Let 𝐴𝑝 denote the set of those solutions in S for which 𝑥𝑝 > 9 and other x’s are nonnegative.

Taking 𝑧𝑝 = 𝑥𝑝 − 10, we find that 𝑧𝑝 ≥ 0.In terms of 𝑧𝑝 , equation (ii) reads

𝑦𝑘 + 𝑧𝑝 + (𝑠𝑢𝑚 𝑜𝑓 𝑥𝑖′ 𝑠 𝑒𝑥𝑐𝑙𝑢𝑑𝑖𝑛𝑔 𝑥𝑘 𝑎𝑛𝑑 𝑥𝑝 ) = 11 (iii)

The number of nonnegative integer solutions of this equation is

|𝐴𝑘 ∩ 𝐴𝑝 | = 𝐶(7 + 11 − 1, 11) = 𝐶(17, 11)

This holds for k, p = 1, 2, 3, ……..7, 𝑘 ≠ 𝑝. Further, there are C(7,2) number of intersections 𝐴𝑘 ∩
𝐴𝑝 .

Similarly, we find that |𝐴𝑘 ∩ 𝐴𝑝 ∩ 𝐴𝑞 | = 𝐶 (7 + 1 − 1, 1) = 𝐶 (7,1).

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

= 𝐶(37,31) − 7 × 𝐶(27,21) + 𝐶(7,2) × 𝐶(17,11) − 𝐶(7,3) × 𝐶(7,1)

This is the required number.

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

letters are not in a single block?

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.

Example 9 Find the number of permutations of the digits 1 through 9 in which

(a) The blocks 23, 57, 468 do not appear.


(b) The blocks 36, 78, 672 do not appear.

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!

Further, we find that:

|𝐴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!

Likewise, |𝐴1 ∩ 𝐴3 | = (2 + 4)! = 6!, |𝐴2 ∩ 𝐴3 | = (2 + 4)! = 6!,


|𝐴1 ∩ 𝐴2 ∩ 𝐴3 | = No. of permutations of distinct objects consisting of the three blocks 23, 57
and 468, and the (two) digits not present in these blocks

= (3 + 2)! = 5!

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! + 8! + 7!) + (7! + 6! + 6!) − 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!

|𝐴1 ∩ 𝐴3 | = 0.(Because, no permutations of distinct objects can contain both of


blocks 78 and 672.)* (If there is a permutation containing the blocks 78 and 672, this
permutation contains a repeated digit, 7.)

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! − (8! + 8! + 7!) + (7! + 6! + 0) − 0

= 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

|𝐴2 | = 24!, |𝐴3 | = 24!, |𝐴4 | = 23!.

Likewise, we find that( * Note that no letter is repeated in the given patterns.)

|𝐴1 ∩ 𝐴2 | = |𝐴1 ∩ 𝐴3 | = |𝐴2 ∩ 𝐴3 | = (26 − 6 + 2)! = 22!,

|𝐴1 ∩ 𝐴4 | = |𝐴2 ∩ 𝐴4 | = |𝐴3 ∩ 𝐴4 | = (26 − 7 + 2)! = 21!,

|𝐴1 ∩ 𝐴2 ∩ 𝐴3 | = (26 − 9 + 3)! = 20!,

|𝐴1 ∩ 𝐴2 ∩ 𝐴4 | = |𝐴1 ∩ 𝐴3 ∩ 𝐴4 | = |𝐴2 ∩ 𝐴3 ∩ 𝐴4 | = (26 − 10 + 3)! = 19!,

|𝐴1 ∩ 𝐴2 ∩ 𝐴3 ∩ 𝐴4 | = (26 − 13 + 4)! = 17!.


Therefore, the required number of permutations is given by

̅̅̅1 ∩ ̅̅̅
|𝐴 𝐴2 ∩ ̅̅̅
𝐴3 ∩ ̅̅̅
𝐴4 | = |𝑆| − ∑|𝐴𝑖 | + ∑|𝐴𝑖 ∩ 𝐴𝑗 | − ∑|𝐴𝑖 ∩ 𝐴𝑗 ∩ 𝐴𝑘 | + |𝐴1 ∩ 𝐴2 ∩ 𝐴3 ∩ 𝐴4 |

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

********

old book problems

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

|𝐴2 | = 23!, |𝐴3 | = 23!, |𝐴4 | = (1 + 23)! = 24!

Likewise, 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 ∩ 𝐴3 | = 0, |𝐴2 ∩ 𝐴4 | = 0, |𝐴3 ∩ 𝐴4 | = 0,

|𝐴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!.

Accordingly, the required number of permutations is given by

̅̅̅1 ∩ ̅̅̅
|𝐴 𝐴2 ∩ ̅̅̅
𝐴3 ∩ ̅̅̅
𝐴4 | = |𝑆| − ∑|𝐴𝑖 | + ∑|𝐴𝑖 ∩ 𝐴𝑗 | − ∑|𝐴𝑖 ∩ 𝐴𝑗 ∩ 𝐴𝑘 | + |𝐴1 ∩ 𝐴2 ∩ 𝐴3 ∩ 𝐴4 |

= 26! − (23! + 23! + 23! + 24!) + (20! + 0 + 0 + 0 + 0 + 21!) − (0 + 0 + 0 + 0) + 0

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


Example 12: In a certain area of the country side, there are five villages A, B, C, D, E. An
Engineer is to device a system of roads so that, after the system is completed, no village will be
isolated. In how many ways can he do this?

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 , 𝑖 ≠ 𝑗,

Likewise, we find that

𝑁(𝑐𝑖 𝑐𝑗 𝑐𝑘 ) = 21 , 𝑖 ≠ 𝑗 ≠ 𝑘,

𝑁(𝑐𝑖 𝑐𝑗 𝑐𝑘 𝑐𝑝 ) = 20 , 𝑖 ≠ 𝑗 ≠ 𝑘 ≠ 𝑝, 𝑁(𝑐1 𝑐2 𝑐3 𝑐4 𝑐5 ) = 20 .

Accordingly, the Principle of inclusion-exclusion ( as given by expression (6)) gives

̅ = 210 − (5) × 26 + (5) × 23 − (5) × 21 + (5) 20 − (5) 20 = 768.


𝑁
1 2 3 4 5
This is the required answer.

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.

To determine 𝑁(𝑐1 ), we consider arranging 11 distinct objects – namely, couple 1 (considered as


one object) and the other 10 people. Eleven distinct objects can be arranged around a circular
table in (11 − 1)! = 10! Ways. Further, the wife in couple 1 can be seated to the left or right of
her husband. Therefore we have 𝑁(𝑐1 ) = 2 × (10!).

Similarly,

𝑁(𝑐2 ) = 𝑁(𝑐3 ) = 𝑁(𝑐4 ) = 𝑁(𝑐5 ) = 𝑁(𝑐6 ) = 2 × (10!).

Next, let us compute 𝑁(𝑐𝑖 𝑐𝑗 ) for 1 ≤ 𝑖 ≤ 6, 1 ≤ 𝑗 ≤ 6, 𝑖 ≠ 𝑗. Here we are arranging 10 distinct


objects (couple i considered as one object and couple j as another object) and the other eight
people. Ten objects can be arranged around a circular table in (10 − 1)! = 9! Ways. Further,
there are two ways for the wife in couple i to be shared next to her husband, and two ways for
the wife in couple j to be shared next to her husband. Therefore, 𝑁(𝑐𝑖 𝑐𝑗 ) = 22 × (9!).

Proceeding like this, we find (𝑓𝑜𝑟 1 ≤ 𝑖, 𝑗, 𝑘, 𝑝, 𝑞 ≤ 6 𝑤𝑖𝑡ℎ 𝑖 ≠ 𝑗 ≠ 𝑘 ≠ 𝑝 ≠ 𝑞)

𝑁(𝑐𝑖 𝑐𝑗 𝑐𝑘 ) = 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

𝑆0 = |𝑆| = 300, 𝑆1 = ∑|𝐴𝑖 | = 60 + 50 + 37 = 147,

𝑆2 = ∑|𝐴𝑖 ∩ 𝐴𝑗 | = 10 + 7 + 12 = 29, 𝑆3 = |𝐴1 ∩ 𝐴2 ∩ 𝐴3 | = 2.

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!

𝑆1 = ∑|𝐴𝑖 | = (3 × 24!) + 23!,

𝑆2 = ∑|𝐴𝑖 ∩ 𝐴𝑗 | = (3 × 22!) + (3 × 21!),

𝑆3 = ∑|𝐴𝑖 ∩ 𝐴𝑗 ∩ 𝐴𝑘 | = 20! + (3 × 19!),

𝑆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:

(𝑖)𝐸2 = 𝑆2 − (3) 𝑆3 + (4) 𝑆4 = 3 × (22! + 21!) − 3 × {20! + (3 × 19!)} + 6 × 17!.


1 2

(𝑖𝑖)𝐿2 = 𝑆2 − (2) 𝑆3 + (3) 𝑆4 = 3 × (22! + 21!) − 2 × {20! + (3 × 19!)} +


1 1
3 × 17!.

(𝑖𝑖𝑖)𝐸3 = 𝑆3 − (4) 𝑆4 = {20! + (3 × 19!) − (4 × 17!).


1

(𝑖𝑣)𝐿3 = 𝑆3 − (3) 𝑆4 = {20! + (3 × 19!) − (3 × 17!).


2
Example 16 :Consider the students referred to in Example 1. Find, among the subjects
indicated, how many study (i) exactly 1 subject, (ii) exactly 2 subjects, (iii) exactly 3 subjects,
(iv) at least 1 subject, (v) at least 2 subjects, (vi) at least 3 subjects.

Solution: From the details available in Example 1, we note the following:


𝑆0 = |𝑆| = 100, 𝑆1 = 60, 𝑆2 = 39, 𝑆3 = 10, 𝑆4 = 2.

The required numbers are, respectively,

(𝑖)𝐸1 = 𝑆1 − (2) 𝑆2 + (3) 𝑆3 − (4) 𝑆4 = 60 − (2 × 39) + (3 × 10) − (4 × 2) = 4,


1 2 3

(𝑖𝑖)𝐸2 = 𝑆2 − (3) 𝑆3 + (4) 𝑆4 = 39 − (3 × 10) + (6 × 2) = 21,


1 2

(𝑖𝑖𝑖)𝐸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

(𝑣)𝐿2 = 𝑆2 − (2) 𝑆3 + (3) 𝑆4 = 39 − (2 × 10) + (3 × 2) = 25,


1 1
3
(𝑣𝑖)𝐿3 = 𝑆3 − ( ) 𝑆4 = 10 − (3 × 2) = 4.
2
Example 17 In how many ways can one arrange the letters in the word CORRESPONDENTS so
that

(i) there is no pair of consecutive identical letters?


(ii) there are exactly two pairs of consecutive identical letters?
(iii) there are at least three pairs of consecutive identical letters?
Solution: In the word CORRESPONDENTS, there occur one each of C, P, D and T, and
two each of O, R, E, S, N. If S is the set of all permutations of these 14 letters, we have
14!
|𝑆| = .
(2!)5

Let 𝐴1 , 𝐴2 , 𝐴3 , 𝐴4 , 𝐴5 be the sets of permutations in which 𝑂′ 𝑠, 𝑅 ′ 𝑠, 𝐸 ′ 𝑠, 𝑆 ′ 𝑠, 𝑁 ′ 𝑠 appear in


pairs, respectively. Then
13!
|𝐴𝑖 | = 𝑓𝑜𝑟 𝑖 = 1, 2, 3, 4, 5.
(2!)4
12! 11! 10!
Also, |𝐴𝑖 ∩ 𝐴𝑗 | = , |𝐴𝑖 ∩ 𝐴𝑗 ∩ 𝐴𝑘 | = , |𝐴𝑖 ∩ 𝐴𝑗 ∩ 𝐴𝑘 ∩ 𝐴𝑝 | = (2!) , |𝐴1 ∩ 𝐴2 ∩
(2!)3 (2!)2
𝐴3 … . .∩ 𝐴5 | = 9!.
From these, we get
14! 13! 12!
𝑆0 = 𝑁 = |𝑆| = , 𝑆1 = 𝐶(5,1) × , 𝑆 2 = 𝐶(5,2) × ,
(2!)5 (2!)4 (2!)3
11! 10!
𝑆3 = 𝐶(5,3) × , 𝑆4 = 𝐶(5,4) × , 𝑆5 = 𝐶(5,5) × 9!.
(2!)2 2!
Accordingly, the number of permutations where there is no pair of consecutive identical
letters is

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 ∩ 𝐴3 | = 16, |𝐴2 ∩ 𝐴4 | = 11, |𝐴3 ∩ 𝐴4 | = 7, |𝐴1 ∩ 𝐴2 ∩ 𝐴3 | = 8, |𝐴1 ∩ 𝐴2 ∩ 𝐴4 | = 5,

|𝐴1 ∩ 𝐴3 ∩ 𝐴4 | = 3, |𝐴2 ∩ 𝐴3 ∩ 𝐴4 | = 2, , |𝐴1 ∩ 𝐴2 ∩ 𝐴3 ∩ 𝐴4 | = 1.


̅̅̅1 ∩ ̅̅̅
Show that |𝐴 𝐴2 ∩ ̅̅̅
𝐴3 ∩ ̅̅̅
𝐴4 | = 7 𝑎𝑛𝑑 |𝐴1 ∪ 𝐴2 ∪ 𝐴3 ∪ 𝐴4 | = 193.

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.

9. Find the number of integer solutions of the equation 𝑥1 + 𝑥2 + 𝑥3 + 𝑥4 = 20 such that

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.

The number of possible derangements of n distinct objects 1, 2, 3, ……,n is denoted by 𝑑𝑛 .


If there is only one object, it continues to be in its original place in every arrangement;
therefore 𝑑1 = 0. If there are two objects, a derangement can be done in only one way –
by interchanging their places; therefore 𝑑2 = 1. For three objects 1, 2, 3, the possible
derangements are 231 and 312; therefore 𝑑3 = 2.

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 ∩ … … . .∩ ̅̅̅̅
𝐴𝑛 |.

Using the Principle of inclusion-exclusion, we may rewrite this as

𝑑𝑛 = |𝑆| − ∑|𝐴𝑖 | + ∑|𝐴𝑖 ∩ 𝐴𝑗 | − ∑|𝐴𝑖 ∩ 𝐴𝑗 ∩ 𝐴𝑘 | + ⋯ … … . +(−1)𝑛 |𝐴1 ∩ 𝐴2 ∩ … … . . 𝐴𝑛 |

= (𝑛!) − 𝑆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,

𝑆1 = ∑|𝐴𝑖 | = 𝑛 × (𝑛 − 1)! = 𝐶(𝑛, 1) × (𝑛 − 1)!.

Next, the permutations in 𝐴1 ∩ 𝐴2 are all of the form 12𝑏3 … … . . 𝑏𝑛 where 𝑏3 𝑏4 … … . . 𝑏𝑛 is a


permutation of 3, 4, ……n.

Thus, 𝐴1 ∩ 𝐴2 consists of all permutations of 3, 4, ……n. As such, |𝐴1 ∩ 𝐴2 | = (𝑛 − 2)!.Similarly,


the order of the intersection of every two of the sets 𝐴1 , 𝐴2 , … … 𝐴𝑛 𝑖𝑠 (𝑛 − 2)!. The number
of such intersections is 𝐶(𝑛, 2).

Accordingly,

𝑆2 = ∑|𝐴𝑖 ∩ 𝐴𝑗 | = 𝐶(𝑛, 2) × (𝑛 − 2)!.

Likewise, we find

𝑆2 = ∑|𝐴𝑖 ∩ 𝐴𝑗 ∩ 𝐴𝑘 | = 𝐶(𝑛, 3) × (𝑛 − 3)!.

𝑆𝑛 = ∑|𝐴1 ∩ 𝐴2 ∩ … … .∩ 𝐴𝑛 | = 𝐶(𝑛, 𝑛) × (𝑛 − 𝑛)! = 𝐶(𝑛, 𝑛).

Using these in expression (2), we get

𝑑𝑛 = (𝑛!) − 𝐶(𝑛, 1) × (𝑛 − 1)! + 𝐶(𝑛, 2) × (𝑛 − 2)! − 𝐶(𝑛, 3) × (𝑛 − 3)!


+ ⋯ … . . +(−1)𝑛 𝐶(𝑛, 𝑛)
𝑛! 𝑛! 𝑛! 𝑛!
= 𝑛! − + − + ⋯ … . . +(−1)𝑛
1! 2! 3! 𝑛!
1 1 1 (−1)𝑛 (−1)𝑘
= 𝑛! {1 − 1! + 2! − 3! + ⋯ … . . + } = 𝑛! × ∑𝑛𝑘=0 .
𝑛! 𝑘!

This completes the proof. (* For another proof, see Example 19, section 7.3.)

Remark: Recall the exponential expansion



𝑥
𝑥2 𝑥3 𝑥𝑘
𝑒 = 1 + 𝑥 + + + ⋯……..= ∑ .
2! 3! 𝑘!
𝑘=0

From this, we get



(−1)𝑘
𝑒 −1 = ∑ .
𝑘!
𝑘=0

To five places of decimals, 𝑒 −1 is known to be equal to 0.36788. Thus,


7
(−1)𝑘 1 1 1 1
∑ = 1 − + − + ⋯ … . . − ≈ 0.36786.
𝑘! 1! 2! 3! 7!
𝑘=0

Thus, for 𝑛 ≥ 7, we may take


(−1)𝑘
∑𝑛𝑘=0 ≈ 𝑒 −1 ≈ 0.3679to four places.
𝑘!

Consequently, for 𝑛 ≥ 7, the formula (1) for 𝑑𝑛 may be rewritten as 𝑑𝑛 ≈ ⌊(𝑛!) × 𝑒 −1 ⌋ ≈


⌊(0.3679) × 𝑛!⌋ (3)

Example 1: Find the number of derangements of 1, 2, 3, 4.

Solution: Here, there are 4 objects. Therefore, the number of derangements is


1 1 1 1
𝑑4 = 4! × {1 − + − + }
1! 2! 3! 4!
1 1 1
= 24 × {1 − 1 + − + }
2 6 24
= 12 − 4 + 1 = 9.

We can check that the nine derangements of 1, 2, 3, 4 are:

2143 2341 2413


3142 3412 3421
4123 4312 4321
Example 2 :Evaluate 𝒅𝟓 , 𝒅𝟔 , 𝒅𝟕 , 𝒅𝟖 .

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,

𝑑8 ≈ ⌊(8!) × 𝑒 −1 ⌋ ≈ ⌊40320 × 0.3679⌋ ≈ 14833.

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?

Solution: The required number of ways is

𝑑10 ≈ (10!)(𝑒 −1 ) ≈ 10! × 0.3679 ≈ 13,35,036.

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?

Solution: The number of permutations of n distinct objects is 𝑛!.The number of derangements of


these objects is 𝑑𝑛 .

Therefore, the probability that a permutation chosen is not a derangement is

𝑑𝑛 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

𝑑𝑛−𝑘 . Hence the answer (in this case) is 𝑑𝑘 × 𝑑𝑛−𝑘 .


(iii) Any arrangement of the n – k integers k+1, k+2, …….,n in the first n – k places is a
dearrangement; the number of such arrangements is (𝑛 − 𝑘)!. Likewise, any
arrangement of the k integers 1, 2, 3, ……,k in the last k places is a dearrangement and
the number of such arrangements is k!. Hence the answer (in this case) 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

But 265 = 𝑑6 . Thus, 𝑛 − 5 = 6 so that n = 11.

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)

We note that |𝑆| = 10!

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!.

Similarly, |𝐴2 | = |𝐴3 | = |𝐴4 | = |𝐴5 | = 9!,

So that 𝑆1 = ∑|𝐴𝑖 | = 5 × 9! = 𝐶(5,1) × 9!.


The permutations in 𝐴1 ∩ 𝐴2 are all of the form 𝑏1 2𝑏3 4𝑏5 𝑏6 … … . . 𝑏10 , where 𝑏1 𝑏3 𝑏5 … … . . 𝑏10
is a permutation of 1, 3, 5, 6,……10. As such, |𝐴1 ∩ 𝐴2 | = 8!.Similarly, each of |𝐴𝑖 ∩ 𝐴𝑗 | = 8!, and
there are 𝐶(10,2) such terms. Hence

𝑆2 = ∑|𝐴𝑖 ∩ 𝐴𝑗 | = 𝐶(5,2) × 8!.

Likewise, we find 𝑆3 = 𝐶(5,3) × 7!, 𝑆4 = 𝐶(5,4) × 6!, 𝑆5 = 𝐶(5,5) × 5!.

Accordingly, expression (i) gives the required number as


̅̅̅1 ∩ ̅̅̅
|𝐴 𝐴2 ∩ … … .∩ ̅̅̅
𝐴5 |
= 10! − 𝐶(5,1) × 9! + 𝐶(5,2) × 8! − 𝐶(5,3) × 7! + 𝐶 × (5,4) × 6! − 𝐶(5,5) × 5!

= 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

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


2. Find the number of derangements of 1, 2, 3, 4, 5, 6 where the first three numbers are 1, 2,
3 in some order.
3. How many derangements of 1, 2, 3, 4, 5, 6, 7, 8 start with 5, 6, 7, or 8 in some order?
4. Thirty students take a quiz. Then for the purpose of grading, the teacher asks the students
to exchange papers so that no one is grading his own paper. In how many ways can this be
done?
5. A simple code is made by permuting the letters of the English alphabet with every letter
being replaced by a different letter. How many distinct codes can be made in this way?
6. 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 gloves.
7. At a restaurant, 10 men hand over their umbrellas to the receptionist. In how many ways
can their umbrellas be returned so that (i) no man receives his own umbrella? (ii) at least
one of the men receives his own umbrellas? (iii) at least two of the men receive their own
umbrellas?
8. Find the number of permutations of the integers 1 to 10 (inclusive)
(i) Such that exactly 4 of the integers are in their natural positions.
(ii) that do not begin with 1 and do not end with 10.
(iii) Such that 6 or more of the integers are deranged.
9. Let 𝐴 = {1, 2, 3, … … . , 𝑛}. How many one-to-one functions 𝑓: 𝐴 → 𝐴 have at least one
fixed point? ( An element 𝑥 ∈ 𝐴 is called a fixed point of 𝑓 if 𝑓(𝑥) = 𝑥).
10. Prove the following:
(𝑖)𝑑𝑛 = (𝑛 − 1)(𝑑𝑛−1 + 𝑑𝑛−2 ) 𝑓𝑜𝑟 𝑛 ≥ 3.

(𝑖𝑖)𝑑𝑛 = 𝑛𝑑𝑛−1 + (−1)𝑛−1 𝑓𝑜𝑟 𝑛 ≥ 2.


7.3 Rook Polynomials

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)

Here, 𝑟1 = 𝑛 =number of squares in the board.


Example 1. Consider the board shown in Figure 7.1, which contains 4 squares.

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.

Accordingly, the rook polynomial for the board is 𝑟(𝐶, 𝑥) = 1 + 𝑟1 𝑥 + 𝑟2 𝑥 2 = 1 + 4𝑥 + 2𝑥 2 .

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, 4, 5), (2,3,5). Thus 𝑟3 = 2.


The board has no positions for four or more mutually non-capturing rooks. Hence, 𝑟4 = 𝑟5 =
𝑟6 = 𝑟7 = 0.

Thus, for this board, the rook polynomial is

𝑟(𝐶, 𝑥) = 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

Solution: For this board, 𝑟1 = 8.

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.

Thus, for this board, the rook polynomial is


𝑟(𝐶, 𝑥) = 1 + 8𝑥 + 14𝑥 2 + 4𝑥 3 .
Rook Polynomial for 𝒏 × 𝒏 board

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.

Hence, for this board, the rook polynomial is

𝑟(𝐶𝑛×𝑛 , 𝑥) = 1 + 𝑛2 𝑥 + ∑𝑛𝑘=2 𝑘! × {𝐶(𝑛, 𝑘)}2 𝑥 𝑘 +

𝑛 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:

𝑟(𝐶, 𝑥) = 𝑥 𝑟(𝐷, 𝑥) + 𝑟(𝐸, 𝑥) (5)

This is known as the expansion formula for r(C,x).

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 + 𝑥.

For the board E, we find that 𝑟1 = 3, 𝑟2 = 1 𝑎𝑛𝑑 𝑟3 = 0. Therefore, 𝑟(𝐸, 𝑥) = 1 + 3𝑥 + 𝑥 2 .

Now, the expansion formula yields

𝑟(𝐶2×2 , 𝑥) = 𝑥 𝑟(𝐷, 𝑥) + 𝑟(𝐸, 𝑥) = 𝑥(1 + 𝑥) + (1 + 3𝑥 + 𝑥 2 ) = 1 + 4𝑥 + 2𝑥 2 .

(This result agrees with the one got in Example 1).

Example 7 Find the rook polynomial for the 3 × 3 board by using the expansion formula.

Solution: The 3 X 3 board is as shown below

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):

For the board D, we find that 𝑟1 = 4, 𝑟2 = 2, 𝑟3 = 𝑟4 = 0. Hence


𝑟(𝐷, 𝑥) = 1 + 4𝑥 + 2𝑥 2 .

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 .

Now, the expansion formula gives

𝑟(𝐶3×3 , 𝑥) = 𝑥 𝑟(𝐷, 𝑥) + 𝑟(𝐸, 𝑥)

= 𝑥 (1 + 4𝑥 + 2𝑥 2 ) + (1 + 8𝑥 + 14𝑥 2 + 4𝑥 3 )

= 1 + 9𝑥 + 18𝑥 2 + 6𝑥 3 .

(This result agrees with that noted earlier).

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.

Thus, 𝑟(𝐸, 𝑥 ) = 1 + 7𝑥 + 11𝑥 2 + 3𝑥 3 .

By using the expansion formula, we find that

𝑟(𝐶, 𝑥) = 𝑥 𝑟(𝐷, 𝑥) + 𝑟(𝐸, 𝑥) = 𝑥 (1 + 5𝑥 + 4𝑥 2 ) + (1 + 7𝑥 + 11𝑥 2 + 3𝑥 3 )

= 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):

We observe that 𝐷 ′ 𝑎𝑛𝑑 𝐸 ′ are identical. For these boards, 𝑟1 = 4, 𝑟2 = 2, 𝑟3 = 𝑟4 = 0.

Hence 𝑟(𝐷 ′ , 𝑥) = 1 + 4𝑥 + 2𝑥 2 , 𝑟(𝐸 ′ , 𝑥) = 1 + 4𝑥 + 2𝑥 2

Accordingly, the expansion formula applied to the board E gives

𝑟(𝐸, 𝑥) = 𝑥 𝑟(𝐷 ′ , 𝑥) + 𝑟(𝐸 ′ , 𝑥)

= 𝑥(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:

𝑟(𝐶, 𝑥) = 𝑟(𝐶1 , 𝑥) × 𝑟(𝐶2 , 𝑥)


(6)

This is known as the product formula for r(C,x).

The following is a natural generalization of this formula:

If a board C is made up of pairwise disjoint sub-boards 𝐶1 , 𝐶2 , 𝐶3 , … … . . , 𝐶𝑛 , then

𝑟(𝐶, 𝑥) = 𝑟(𝐶1 , 𝑥) × 𝑟(𝐶2 , 𝑥) × 𝑟(𝐶3 , 𝑥) … … … .× 𝑟(𝐶𝑛 , 𝑥)


(7)

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.

Since C1 is the 2 × 2 board, we have

𝑟(𝐶1 , 𝑥) = 1 + 4𝑥 + 2𝑥 2 ( see Example 1).

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

𝑟(𝐶, 𝑥) = 𝑟(𝐶1 , 𝑥) × 𝑟(𝐶2 , 𝑥) = (1 + 4𝑥 + 2𝑥 2 )(1 + 7𝑥 + 10𝑥 2 + 2𝑥 3 ).

= 1 + 11𝑥 + 40𝑥 2 + 56𝑥 3 + 28𝑥 4 + 4𝑥 5 .

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.

We note that, for C1, 𝑟1 = 3, 𝑟2 = 1, 𝑟3 = 0, so that

𝑟(𝐶1 , 𝑥) = 1 + 3𝑥 + 𝑥 2 .

For the sub-board 𝐶2 , we find that 𝑟1 = 4, 𝑟2 = 3, 𝑟3 = 𝑟4 = 0 so that


𝑟(𝐶2 , 𝑥) = 1 + 4𝑥 + 3𝑥 2

Therefore, by the product formula, the rook polynomial for the given board is

𝑟(𝐶, 𝑥) = 𝑟(𝐶1 , 𝑥) × 𝑟(𝐶2 , 𝑥)

= (1 + 3𝑥 + 𝑥 2 )(1 + 4𝑥 + 3𝑥 2 ) = 1 + 7𝑥 + 16𝑥 2 + 13𝑥 3 + 3𝑥 4 .

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.

We observe that for the board D, 𝑟1 = 3, 𝑟2 = 1, 𝑟3 = 0. Therefore,

𝑟(𝐷, 𝑥) = 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 + 4𝑥 + 2𝑥 2 )(1 + 2𝑥)

= 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 .

This is the rook polynomial for the given board.

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:

Then, we have ( by the expansion formula applied to the board D)

𝑟(𝐷, 𝑥) = 𝑥 𝑟(𝐷 ′ , 𝑥) + 𝑟(𝐸 ′ , 𝑥)

= 𝑥(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),

𝑟(𝐸, 𝑥) = 𝑟(𝐸1 , 𝑥) × 𝑟(𝐸2 , 𝑥) = 𝑟(𝐸1 , 𝑥) × (1 + 𝑥)


(ii)

In the board E1, let us mark the square numbered 5 as ⊛ , and obtain the boards 𝐷 ′′ and 𝐸 ′′
shown below.

The expansion formula (applied to the board E1 ) gives

𝑟(𝐸1 , 𝑥) = 𝑥 𝑟(𝐷 ′′ , 𝑥) + 𝑟(𝐸 ′′ , 𝑥) = 𝑥(1 + 3𝑥 + 𝑥 2 ) + 𝑟(𝐸 ′′ , 𝑥)


(iii)

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)

Using this in (iii), we get

𝑟(𝐸1 , 𝑥) = 𝑥(1 + 3𝑥 + 𝑥 2 ) + (1 + 5𝑥 + 7𝑥 2 + 3𝑥 3 ) = 1 + 6𝑥 + 10𝑥 2 + 4𝑥 3


(v)

Putting this into (ii), we get

𝑟(𝐸, 𝑥) = (1 + 𝑥)(1 + 6𝑥 + 10𝑥 2 + 4𝑥 3 ) = 1 + 7𝑥 + 16𝑥 2 + 14𝑥 3 + 4𝑥 4 (vi)


Finally, employing the expansion formula to the given board C, we obtain, on using (i) and (vi),

𝑟(𝐶, 𝑥) = 𝑥(1 + 4𝑥 + 3𝑥 2 )(1 + 𝑥)(1 + 6𝑥 + 10𝑥 2 + 4𝑥 3 ) = 1 + 7𝑥 + 16𝑥 2 + 14𝑥 3 + 4𝑥 4

= 1 + 8𝑥 + 20𝑥 2 + 17𝑥 3 + 4𝑥 4 .

This is the rook polynomial for the given board.

Arrangements with forbidden positions

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)

and 𝑆𝑘 = (𝑛 − 𝑘)! × 𝑟𝑘 , for k = 1, 2, 3, ………,n. (10)

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

As such, the rook polynomial for C is (by the product formula)

𝑟(𝐶, 𝑥) = 𝑟(𝐶1 , 𝑥) × 𝑟(𝐶2 , 𝑥) × 𝑟(𝐶3 , 𝑥).

By inspection, we find that

𝑟(𝐶1 , 𝑥) = 1 + 2𝑥, 𝑟(𝐶2 , 𝑥) = 1 + 2𝑥, 𝑟(𝐶3 , 𝑥) = 1 + 𝑥.


Accordingly, we have

𝑟(𝐶, 𝑥) = (1 + 2𝑥)2 (1 + 𝑥) = 1 + 5𝑥 + 8𝑥 2 + 4𝑥 3 .

Thus, for C, 𝑟1 = 5, 𝑟2 = 8, 𝑟3 = 4.

Consequently, (by expressions (9) and (10))

𝑆0 = 4! = 24, 𝑆1 = (4 − 1)! × 𝑟1 = 30,

𝑆2 = (4 − 2)! × 𝑟2 = 16, 𝑆3 = (4 − 3)! × 𝑟3 = 4.

Therefore (by expression (8)),


̅ = 𝑆0 − 𝑆1 + 𝑆2 − 𝑆3 = 24 − 30 + 16 − 4 = 6.
𝑁

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)

𝑟(𝐶, 𝑥) = 1 + 11𝑥 + 40𝑥 2 + 56𝑥 3 + 28𝑥 4 + 4𝑥 5 .

Thus, here, 𝑟1 = 11, 𝑟2 = 40, 𝑟3 = 56, 𝑟4 = 28, 𝑟5 = 4.

Consequently,

𝑆0 = 5! = 120, 𝑆1 = (5 − 1)! × 𝑟1 = 264,

𝑆2 = (5 − 2)! × 𝑟2 = 240, 𝑆1 = (5 − 3)! × 𝑟3 = 112,

𝑆4 = (5 − 4)! × 𝑟4 = 28, 𝑆5 = (5 − 5)! × 𝑟5 = 4.

Accordingly, the number of ways in which the work can be assigned is

𝑆0 − 𝑆1 + 𝑆2 − 𝑆3 + 𝑆4 − 𝑆5 = 120 − 264 + 240 − 112 + 28 − 4 = 8.

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)

𝑟(𝐶, 𝑥) = 1 + 7𝑥 + 16𝑥 2 + 13𝑥 3 + 3𝑥 4 .

Thus, here, 𝑟1 = 7, 𝑟2 = 16, 𝑟3 = 13, 𝑟4 = 3.

Hence, 𝑆0 = 5! = 120, 𝑆1 = (5 − 1)! × 𝑟1 = 168, 𝑆2 = (5 − 2)! × 𝑟2 = 96,

𝑆3 = (5 − 3)! × 𝑟3 = 26, 𝑆4 = (5 − 4)! × 𝑟4 = 3.

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

𝑆0 − 𝑆1 + 𝑆2 − 𝑆3 + 𝑆4 = 120 − 168 + 96 − 26 + 3 = 25.

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 .

Thus, here, 𝑟1 = 8, 𝑟2 = 20, 𝑟3 = 17, 𝑟4 = 4.

Consequently,

𝑆0 = 5! = 120, 𝑆1 = (5 − 1)! × 𝑟1 = 192, 𝑆2 = (5 − 2)! × 𝑟2 = 120

𝑆3 = (5 − 3)! × 𝑟3 = 34, 𝑆4 = (5 − 4)! × 𝑟4 = 4.

Therefore, the number of ways of dressing is

𝑆0 − 𝑆1 + 𝑆2 − 𝑆3 + 𝑆4 = 120 − 192 + 120 − 34 + 4 = 18.

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)

𝑟(𝐶, 𝑥) = (1 + 4𝑥 + 2𝑥 2 )(1 + 3𝑥 + 𝑥 2 )(1 + 𝑥)

= 1 + 8𝑥 + 22𝑥 2 + 25𝑥 3 + 12𝑥 4 + 2𝑥 5

This gives
𝑆0 = 6! = 720, 𝑆1 = (5!) × 8 = 960, 𝑆2 = (4!) × 22 = 528, 𝑆3 = (3!) × 25 = 150,

𝑆4 = (2!) × 12 = 24, 𝑆5 = (1!) × 2 = 2.

Therefore,
̅ = 𝑆0 − 𝑆1 + 𝑆2 − 𝑆3 + 𝑆4 − 𝑆5
𝑁

= 720 − 960 + 528 − 150 + 24 − 2 = 160

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.

Soluiton: A derangement of n objects 𝑎1 , 𝑎2 , 𝑎3 , … … , 𝑎𝑛 is a permutation (arrangement) of


𝑎1 , 𝑎2 , 𝑎3 , … … , 𝑎𝑛 such that 𝑎1

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).

Therefore, by the product formula, the rook polynomial for C is

𝑟(𝐶, 𝑥) = (1 + 𝑥) × (1 + 𝑥) × … … .× (1 + 𝑥)( 𝑛 𝑓𝑎𝑐𝑡𝑜𝑟𝑠)


𝑛
= (1 + 𝑥)𝑛 = ∑𝑛𝑘=0 ( ) 𝑥 𝑘 ,by the binomial theorem.
𝑘
Thus, here,

𝑛 𝑛!
𝑟𝑘 = ( ) = , 𝑓𝑜𝑟 𝑘 = 1, 2, … … . . 𝑛.
𝑘 𝑘! (𝑛 − 𝑘)!

Consequently, 𝑆0 = 𝑛!, 𝑎𝑛𝑑


𝑛!
𝑆𝑘 = (𝑛 − 𝑘)! × 𝑟𝑘 = 𝑘!,for k = 1, 2, 3,……,n.

Therefore, the number of derangements is

𝑑𝑛 = 𝑆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

1. Find the rook polynomials for the boards shown below.


2. Find the rook polynomials for the shaded parts of the boards shown below.

3. Five teachers 𝑇1 , 𝑇2 , 𝑇3 , 𝑇4 , 𝑇5 are required to examine five classes 𝐶1 , 𝐶2 , 𝐶3 , 𝐶4 , 𝐶5 , one for


each class. 𝑇1 𝑎𝑛𝑑 𝑇2
Both dislike 𝐶3 ; 𝑇3 wants to avoid 𝐶2 𝑎𝑛𝑑 𝐶5 ; 𝑇4 rejects 𝐶1 𝑎𝑛𝑑 𝐶2 , and 𝑇5 refuses
𝐶3 𝑎𝑛𝑑 𝐶4 .In how many ways can they do their work without being offended?
4. Students 𝑆1 , 𝑆2 , 𝑆3 , 𝑆4 are to be accommodated in desks 𝐷1 , 𝐷2 , 𝐷3 , 𝐷4 , 𝐷5 , 𝐷6 such that no
two of these students sit in the same desk. 𝑆1does not want 𝐷1 𝑎𝑛𝑑 𝐷2 ; 𝑆2 does not want
𝐷3 ; 𝑆3 does not want 𝐷3 𝑎𝑛𝑑 𝐷4 , and 𝑆4 does not want 𝐷4 , 𝐷5 𝑎𝑛𝑑 𝐷6 . In how many ways
can they be accommodated?
5. In how many ways can each of four women 𝑊1 , 𝑊2 , 𝑊3 , 𝑊4 marry one of the six men
𝑀1 , 𝑀2 , 𝑀3 , 𝑀4 , 𝑀5 , 𝑀6 , under the following constraints: (i) 𝑊1 cannot marry
𝑀1 𝑜𝑟 𝑀3 𝑜𝑟𝑀6 , (ii) 𝑊2 cannot marry 𝑀2 𝑜𝑟𝑀4 , (iii) 𝑊3 cannot marry 𝑀3 𝑜𝑟𝑀6 , (iv) 𝑊4
cannot marry 𝑀4 𝑜𝑟𝑀5 .
6. A pair of dice, one red and one white is rolled six times. What is the probability that we
obtain all six values on both the red die and the white die if we know that the ordered
pairs (1,2), (2,1), (2,5), (3,4), (4,1), (4,5) and (6,6) did not occur? [Here, an ordered pair
(a,b) indicates a on the red die and b on the white]
Recurrence Relations
Sequences are generally defined by specifying their general terms. Alternatively, a
sequence may be defined by indicating a relation connecting its general term with one or
more of the preceding terms. In other words, a sequence 〈𝑎𝑟 〉 may be defined by
indicating a relation connecting its general term 𝑎𝑛 with 𝑎𝑛−1 , 𝑎𝑛−2 , 𝑒𝑡𝑐.
Such a relation is called a recurrence relation for the sequence. The process of determining
𝑎𝑛 from a recurrence relation is called “solving” of the relation. A value 𝑎𝑛 that satisfies a
recurrence relation is called its “general solution”. If the values of some particular terms of
the sequence are specified, then by making use of these values in the general solution we
obtain the “particular solution” that uniquely determines the sequence.
In this chapter, we present some methods of solving some simple recurrence relations.

First-order Recurrence Relations


First, we consider for solution recurrence relations of the form
𝑎𝑛 = 𝑐𝑎𝑛−1 + 𝑓(𝑛), 𝑓𝑜𝑟 𝑛 ≥ 1, (1)

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 = 𝑐𝑎𝑛 + 𝑓(𝑛 + 1), 𝑓𝑜𝑟 𝑛 ≥ 0. (2)

For n = 0, 1, 2, 3, ………, this relation yields, respectively,

𝑎1 = 𝑐𝑎0 + 𝑓(1),

𝑎2 = 𝑐𝑎1 + 𝑓(2) = 𝑐{𝑐𝑎0 + 𝑓(1)} + 𝑓(2),

= 𝑐 2 𝑎0 + 𝑐𝑓(1) + 𝑓(2),

𝑎3 = 𝑐𝑎2 + 𝑓(3) = 𝑐{𝑐 2 𝑎0 + 𝑐𝑓(1) + 𝑓(2)} + 𝑓(3)

= 𝑐 3 𝑎0 + 𝑐 2 𝑓(1) + 𝑐𝑓(2) + 𝑓(3).


and so on. Examining these, we obtain, by induction,

𝑎𝑛 = 𝑐 𝑛 𝑎0 + 𝑐 𝑛−1 𝑓(1) + 𝑐 𝑛−2 𝑓(2) + ⋯ … … . +𝑐 𝑓(𝑛 − 1) + 𝑓(𝑛)


𝑛

= 𝑐 𝑛 𝑎0 + ∑ 𝑐 𝑛−𝑘 𝑓(𝑘), 𝑓𝑜𝑟 𝑛 ≥ 1. … … . (3)


𝑘=1

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 𝒂𝟎 = 𝟑.

Solution: The given relation is homogeneous. Its general solution is

𝑎𝑛 = 4𝑛 𝑎0 𝑓𝑜𝑟 𝑛 ≥ 1. (i)

It is given that 𝑎0 = 3. Putting this into (i), we get

𝑎𝑛 = 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 𝒂𝟎 = 𝟏.

Solution: From the given relation, we find that

𝑎1 = 1 × 𝑎0 , 𝑎2 = 2𝑎1 = (2 × 1)𝑎0 ,

𝑎3 = 3 × 𝑎2 = (3 × 2 × 1)𝑎0 ,

𝑎4 = 4 × 𝑎3 = (4 × 3 × 2 × 1)𝑎0 ,and so on.

Evidently, the general solution is (by induction)

𝑎𝑛 = (𝑛!)𝑎0 𝑓𝑜𝑟 𝑛 ≥ 1.

Using the given initial condition 𝑎0 = 1 in this, we get 𝑎𝑛 = 𝑛! as the required solution.

Example 4 If 𝒂𝒏 is a solution of the recurrence relation 𝒂𝒏+𝟏 = 𝒌𝒂𝒏 𝒇𝒐𝒓 𝒏 ≥ 𝟎, and 𝒂𝟑 =


𝟏𝟓𝟑 𝟏𝟑𝟕𝟕
𝒂𝒏𝒅 𝒂𝟓 = , 𝒘𝒉𝒂𝒕 𝒊𝒔 𝒌?
𝟒𝟗 𝟐𝟒𝟎𝟏

Solution: The general solution of the given relation is 𝑎𝑛 = 𝑘 𝑛 𝑎0 , 𝑓𝑜𝑟 𝑛 ≥ 1.

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,

𝑎12 = 2(√5)12 = 2 × 56 = 31,250.


Example 6 :Solve the recurrence relation 𝒂𝒏 − 𝟑𝒂𝒏−𝟏 = 𝟓 × 𝟕𝒏 , 𝒇𝒐𝒓 𝒏 ≥ 𝟏, given that 𝒂𝟎 =
𝟐.

Solution: The given relation may be rewritten as (by changing n to n+1)

𝑎𝑛+1 = 3𝑎𝑛 + 5 × 7𝑛+1 𝑓𝑜𝑟 𝑛 ≥ 0

= 3𝑎𝑛 + 𝑓(𝑛 + 1), 𝑤ℎ𝑒𝑟𝑒 𝑓(𝑛) = 5 × 7𝑛 .

The general solution of this non-homogeneous relation is (see expression (3))


𝑛

𝑎𝑛 = 3𝑛 𝑎0 + ∑ 3𝑛−𝑘 𝑓(𝑘).
𝑘=1

Substituting for 𝑎0 and f(k) in this we get


𝑛

𝑎𝑛 = (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 𝒂𝟎 = 𝟐.

Solution: The given relation may be rewritten as

𝑎𝑛+1 = 3𝑎𝑛 + 5 × 3𝑛+1 for 𝑛 ≥ 0

= 3𝑎𝑛 + 𝑓(𝑛 + 1), 𝑤ℎ𝑒𝑟𝑒 𝑓(𝑛) = 5 × 3𝑛

The general solution for this relation is


𝑛

𝑎𝑛 = 3𝑛 𝑎0 + ∑ 3𝑛−𝑘 𝑓(𝑘)
𝑘=1

= 3𝑛 𝑎0 + 3𝑛−1 𝑓(1) + 3𝑛−2 𝑓(2) + 3𝑛−3 𝑓(3) + ⋯ … . . +30 𝑓(𝑛)

Substituting for 𝑎0 𝑎𝑛𝑑 𝑓(𝑛), 𝑛 = 1, 2, … … … 𝑛 in this, we get

𝑎𝑛 = 2 × 3𝑛 + 3𝑛−1 × (5 × 31 ) + 3𝑛−2 × (5 × 32 ) + 3𝑛−3 × (5 × 33 ) + ⋯ … . . +30 × (5 × 3𝑛 )

= 2 × 3𝑛 + 5 × (3𝑛 + 3𝑛 + 3𝑛 + ⋯ … . . +3𝑛 ) (𝑛 𝑡𝑒𝑟𝑚𝑠)

= 2 × 3𝑛 + 5 × (𝑛3𝑛 )

= (2 + 5𝑛)3𝑛

This is the required solution.

Example 8 :Find a recurrence relation and the initial condition for the sequence

𝟐, 𝟏𝟎, 𝟓𝟎, 𝟐𝟓𝟎, … ….

Hence find the general term of the sequence.

Solution: The given sequence is 〈𝑎𝑟 〉, where 𝑎0 = 2, 𝑎1 = 10, 𝑎2 = 50, 𝑎3 = 250, … ..

Evidently,

𝑎1 = 5𝑎0 , 𝑎2 = 5𝑎1 , 𝑎3 = 5𝑎2 , 𝑎𝑛𝑑 𝑠𝑜 𝑜𝑛.

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.

This is the general term of the given sequence.

Example 9: Find the recurrence relation and the initial condition for the sequence

𝟎, 𝟐, 𝟔, 𝟏𝟐, 𝟐𝟎, 𝟑𝟎, 𝟒𝟐, … … …

Hence find the general term of the sequence.

Solution: Let the given sequence be 〈𝑎𝑟 〉.Then we note that

𝑎0 = 0, 𝑎1 = 2, 𝑎1 − 𝑎0 = 2,

𝑎2 = 6, 𝑎2 − 𝑎1 = 4, 𝑎3 = 12, 𝑎3 − 𝑎2 = 6,

𝑎4 = 20, 𝑎4 − 𝑎3 = 8, 𝑎5 = 30, 𝑎5 − 𝑎4 = 10,

𝑎6 = 42, 𝑎6 − 𝑎5 = 12, 𝑎𝑛𝑑 𝑠𝑜 𝑜𝑛.

Evidently,

𝑎𝑛 − 𝑎𝑛−1 = 2𝑛, 𝑜𝑟 𝑎𝑛 = 𝑎𝑛−1 + 2𝑛, 𝑓𝑜𝑟 𝑛 ≥ 1.

This is the recurrence relation for the given sequence, with 𝑎0 = 0 as the initial condition.

From this recurrence relation, we note that (working back wards)

𝑎𝑛 − 𝑎𝑛−1 = 2𝑛

𝑎𝑛−1 − 𝑎𝑛−2 = 2(𝑛 − 1)

𝑎𝑛−2 − 𝑎𝑛−3 = 2(𝑛 − 2)

………….

………….

𝑎3 − 𝑎2 = 2 × 3

𝑎2 − 𝑎1 = 2 × 2
𝑎1 − 𝑎0 = 2 × 1

Adding all these, we get

𝑎𝑛 − 𝑎0 = 2{𝑛 + (𝑛 − 1) + (𝑛 − 2) + ⋯ … . . +3 + 2 + 1}
𝑛(𝑛+1)
= 2. = 𝑛(𝑛 + 1).
2

or𝑎𝑛 = 𝑛(𝑛 + 1) + 𝑎0 = 𝑛(𝑛 + 1) + 0 = 𝑛2 + 𝑛.

This is the general term of the given sequence.

Example 10 Solve the recurrence relation

𝑎𝑛 = 2𝑎𝑛/2 + (𝑛 − 1) 𝑓𝑜𝑟 𝑛 = 2𝑘 , 𝑘 ≥ 1. Given 𝑎1 = 0.

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𝑘−2 𝑎𝑛/(2𝑘−2 ) − 2𝑘−1 𝑎 𝑛 = (𝑛 − 2𝑘−2 )


2𝑘−1

2𝑘−2 𝑎𝑛/(2𝑘−1 ) − 2𝑘 𝑎 𝑛 = (𝑛 − 2𝑘−1 )


2𝑘

Adding all these equations, we obtain

𝑎𝑛 − 2𝑘 𝑎 𝑛 = (𝑛 − 1) + (𝑛 − 2) + (𝑛 − 22 ) + ⋯ … … . +(𝑛 − 2𝑘−1 )
2𝑘

Since 2𝑘 = 𝑛, we have 𝑎𝑛/(2𝑘 ) = 𝑎1 = 0 (given), and the above expression becomes

𝑎𝑛 = 𝑘𝑛 − (1 + 2 + 22 + ⋯ … … … + 2𝑘−1 )

(2𝑘 − 1)
= 𝑘𝑛 − = 𝑘𝑛 − (𝑛 − 1) = 1 + (𝑘 − 1)𝑛
2−1
= 1 + (log 2 𝑛 − 1)𝑛

This is the solution of the given recurrence relation.

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

𝑎𝑛 = (3.5)𝑛 𝑎0 = 1000 × (3.5)𝑛 .

This gives the number of virus affected files after 2n hours. From this, we get (for n = 12)

𝑎12 = 1000 × (3.5)12 = 3379220508.

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

and𝑆𝑛 = 𝑆𝑛−1 + (0.00875)𝑆𝑛−1 = (1.00875)𝑆𝑛−1

This is the required recurrence relation. Solving this recurrence relation, we find that

𝑆𝑛 = (1.00875)𝑛 𝑆0 = (1.00875)𝑛 × 10,000.

This gives the value at the end of n months.

Therefore, the value at the end of the first year is (in Rupees)
𝑆12 = (1.00875)12 × 10,000 ≈ 11,102.

Next, we find that 𝑆𝑛 = 2𝑆0 when

2𝑆0 = (1.00875)𝑛 𝑆0 , 𝑜𝑟 2 = (1.00875)𝑛 ,

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

Or 𝑥 = 400 × 0.027 = 10.8

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

𝑝𝑛+1 = (𝑝𝑛 + 𝐴𝑝𝑛 ) − 𝑃 = (1 + 𝐴)𝑝𝑛 − 𝑃 (i)

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
𝑛

𝑝𝑛 = (1 + 𝐴)𝑛 𝑝0 + ∑(1 + 𝐴)𝑛−𝑘 (−𝑃)


𝑘=1

Since 𝑝0 = 𝑆( the loan taken), this gives

𝑝𝑛 = 𝑆(1 + 𝐴)𝑛 − 𝑃{(1 + 𝐴)𝑛−1 + (1 + 𝐴)𝑛−2 + ⋯ … … + (1 + 𝐴) + 1}


(1+𝐴)𝑛 −1
= 𝑆(1 + 𝐴)𝑛 − 𝑃. (1+𝐴)−1
(ii)

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,

𝑎(𝑛+1)−2 = 𝑎𝑛−2 + 𝑛 𝑓𝑜𝑟 𝑛 ≥ 2.

Or 𝑎𝑚+1 = 𝑎𝑚 + (𝑚 + 2) 𝑓𝑜𝑟 𝑚 ≥ 0, where m = n – 2

Setting 𝑓(𝑚) = 𝑚 + 1, this reads

𝑎𝑚+1 = 𝑎𝑚 + 𝑓(𝑚 + 1) 𝑓𝑜𝑟 𝑚 ≥ 0

The general solution of this nonhomogeneous recurrence relation is (see expression (3))
𝑚 𝑚

𝑎𝑚 = (1𝑚 × 𝑎0 ) + ∑ 1𝑚−𝑘 𝑓(𝑘) = 𝑎0 + ∑(𝑘 + 1)


𝑘=1 𝑘=1

Since 𝑎0 = 1, this becomes

𝑎𝑚 = 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𝑎𝑛 + 1, 𝑓𝑜𝑟 𝑛 ≥ 0.

The general solution for this nonhomogeneous recurrence relation is

𝑎𝑛 = 2𝑛 𝑎0 + ∑𝑛𝑘=1 2𝑛−𝑘 . 1 = ∑𝑛𝑘=1 2𝑛−𝑘 ,because𝑎0 = 0.

𝑛−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. Solve the following recurrence relations:


(𝑖) 4𝑎𝑛 − 5𝑎𝑛−1 = 0, 𝑛 ≥ 1, 𝑎0 = 1.

(𝑖𝑖) 3𝑎𝑛+1 − 4𝑎𝑛 = 0, 𝑛 ≥ 0, 𝑎1 = 5.

(𝑖𝑖𝑖) 2𝑎𝑛 − 3𝑎𝑛−1 = 0, 𝑛 ≥ 1, 𝑎4 = 81.

(𝑖𝑣)𝑎𝑛+1 − 2𝑎𝑛 = 5, 𝑛 ≥ 0, 𝑎0 = 1.

(𝑣)𝑎𝑛+1 = 𝑎𝑛 + (2𝑛 + 3), 𝑛 ≥ 0, 𝑎0 = 1.

(𝑣𝑖)𝑎𝑛 = 𝑎𝑛−1 + 3𝑛2 + 3𝑛 + 1, 𝑛 ≥ 1, 𝑎0 = 1.

(𝑣𝑖𝑖)𝑎𝑛+1 − 𝑎𝑛 = 3𝑛2 − 𝑛, 𝑛 ≥ 0, 𝑎0 = 3.

(𝑣𝑖𝑖𝑖)𝑎𝑛 − 𝑎𝑛−1 = 3𝑛2 , 𝑛 ≥ 1, 𝑎0 = 7.


(𝑖𝑥)𝑎𝑛 = 𝑎𝑛−1 + 𝑛3 , 𝑛 ≥ 1, 𝑎0 = 5.
1
(𝑥)𝑎𝑛 − 𝑎𝑛−1 = , 𝑛 ≥ 1, 𝑎0 = 1.
𝑛(𝑛+1)

(𝑥𝑖)𝑎𝑛+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

We now consider a method of solving recurrence relations of the form


𝑐𝑛 𝑎𝑛 + 𝑐𝑛−1 𝑎𝑛−1 + 𝑐𝑛−2 𝑎𝑛−2 = 0 𝑓𝑜𝑟 𝑛 ≥ 2.
(1)

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.

We seek a solution of relation (1) in the form 𝑎𝑛 = 𝑐𝑘 𝑛 where 𝑐 ≠ 0 𝑎𝑛𝑑 𝑘 ≠ 0. Putting


𝑎𝑛 = 𝑐𝑘 𝑛 in (1), we get
𝑐𝑛 𝑐𝑘 𝑛 + 𝑐𝑛−1 𝑐𝑘 𝑛−1 + 𝑐𝑛−2 𝑐𝑘 𝑛−2 = 0

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)

Where A and B are arbitrary complex constants, 𝑟 = |𝑘1 | = |𝑘2 | = √𝑝 2 + 𝑞 2 , 𝑎𝑛𝑑 𝜃 =


𝑞
𝑡𝑎𝑛−1 (𝑝), as the general solution of the relation (1).
It is not hard to verify that 𝑎𝑛 given by expressions (3)-(5) satisfy the relation (1) in the
respective cases. These expressions are called general solutions of the relation (1) in the
sense that they contain two arbitrary constants A and B. These constants may be
evaluated if 𝑎𝑛 is specified for two particular values of n. If 𝑎0 and 𝑎1 are specified, the
specified values are called the initial conditions.

Example 1 Solve the recurrence relation


𝒂𝒏 + 𝒂𝒏−𝟏 − 𝟔𝒂𝒏−𝟐 = 𝟎 𝒇𝒐𝒓 𝒏 ≥ 𝟐, 𝒈𝒊𝒗𝒆𝒏 𝒕𝒉𝒂𝒕 𝒂𝟎 = −𝟏 𝒂𝒏𝒅 𝒂𝟏 = 𝟖.

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)

Where A and B are arbitrary constants. From this solution, we get 𝑎0 = 𝐴 + 𝐵, 𝑎1 =


−3𝐴 + 2𝐵.Using the given values of 𝑎0 𝑎𝑛𝑑 𝑎1 , these become
−1 = 𝐴 + 𝐵, 8 = −3𝐴 + 2𝐵.
Solving these, we get 𝐴 = −2 𝑎𝑛𝑑 𝐵 = 1.Putting these into (i), we get

𝑎𝑛 = −2 × (−3)𝑛 + 2𝑛 , (ii)

This is the solution of the given relation, under the given initial conditions 𝑎0 = −1 𝑎𝑛𝑑 𝑎1 = 8.

Example 2: Solve the recurrence relation

𝒂𝒏 = 𝟑𝒂𝒏−𝟏 − 𝟐𝒂𝒏−𝟐 𝒇𝒐𝒓 𝒏 ≥ 𝟐,

given that 𝒂𝟏 = 𝟓 𝒂𝒏𝒅 𝒂𝟐 = 𝟑.

Solution: Here, the coefficients of 𝑎𝑛 , 𝑎𝑛−1 𝑎𝑛𝑑 𝑎𝑛−2 𝑎𝑟𝑒, respectively, 𝑐𝑛 = 1, 𝑐𝑛−1 =
−3 𝑎𝑛𝑑 𝑐𝑛−2 = 2.

Therefore, the characteristic equation is

𝑘 2 − 3𝑘 + 2 = 0 𝑜𝑟 (𝑘 − 2)(𝑘 − 1) = 0

Whose roots are 𝑘1 = 2 𝑎𝑛𝑑 𝑘2 = 1. Therefore, the general solution for 𝑎𝑛 is

𝑎𝑛 = 𝐴 × 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.

Example 3: Solve the recurrence relation

𝒂𝒏 − 𝟔𝒂𝒏−𝟏 + 𝟗𝒂𝒏−𝟐 = 𝟎 𝒇𝒐𝒓 𝒏 ≥ 𝟐.

given that 𝒂𝟎 = 𝟓, 𝒂𝟏 = 𝟏𝟐.

Solution: The characteristic equation for the given relation is

𝑘 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)

Where A and B are arbitrary constants.

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.

Example 4: Solve the recurrence relation

𝒂𝒏 = 𝟐(𝒂𝒏−𝟏 − 𝒂𝒏−𝟐 ), 𝒇𝒐𝒓 𝒏 ≥ 𝟐,given that 𝒂𝟎 = 𝟏 𝒂𝒏𝒅 𝒂𝟏 = 𝟐.

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

Using the given initial conditions 𝑎0 = 1 𝑎𝑛𝑑 𝑎1 = 2 in this, we get


𝜋 𝜋
1=𝐴 𝑎𝑛𝑑 2 = (√2) [𝐴𝑐𝑜𝑠 + 𝐵𝑠𝑖𝑛 ] = 𝐴 + 𝐵,
4 4
Which yield 𝐴 = 1 𝑎𝑛𝑑 𝐵 = 1.Putting these values of A and B in (ii) we get
𝑛𝜋 𝑛𝜋
𝑎𝑛 = (√2)𝑛 [cos + 𝑠𝑖𝑛 ].
4 4
(iii)

This is the solution of the given relation under the given conditions.

Example 5 Solve the recurrence relation

𝐷𝑛 = 𝑏𝐷𝑛−1 − 𝑏 2 𝐷𝑛−2 𝑓𝑜𝑟 𝑛 ≥ 3,

Given 𝐷1 = 𝑏 > 0 𝑎𝑛𝑑 𝐷2 = 0.

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

𝐷𝑛 = 𝑟 𝑛 [𝐴 cos 𝑛𝜃 + 𝐵𝑠𝑖𝑛 𝑛𝜃], (i)

Where A and B are arbitrary constants, and

𝑏 𝑏 √3
𝑟 = | (1 ± 𝑖√3)| = (√12 + 3) = 𝑏 𝑎𝑛𝑑 tan 𝜃 = = √3,
2 2 1
So that 𝜃 = 𝜋⁄3. Thus, we have
𝑛𝜋 𝑛𝜋
𝐷𝑛 = 𝑏 𝑛 [𝐴 cos + 𝐵𝑠𝑖𝑛 ], (ii)
3 3

Using the given conditions 𝐷1 = 𝑏 > 0, 𝑎𝑛𝑑 𝐷2 = 0 in this, we get


𝜋 𝜋 2𝜋 2𝜋
𝑏 = 𝑏 [𝐴 cos + 𝐵 sin ] 𝑎𝑛𝑑 0 = 𝑏 2 [𝐴 cos + 𝐵 sin ]
3 3 3 3
Which can be rewritten as

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.

Example 6 If 𝑎0 = 0, 𝑎1 = 1, 𝑎2 = 4 𝑎𝑛𝑑 𝑎3 = 37 satisfy the recurrence relation

𝑎𝑛+2 + 𝑏𝑎𝑛+1 + 𝑐𝑎𝑛 = 0 𝑓𝑜𝑟 𝑛 ≥ 0,determine the constants b and c and then solve the
relation for 𝑎𝑛 .

Solution: For n = 0 and n = 1, the given relation reads (respectively)

𝑎2 + 𝑏𝑎1 + 𝑐𝑎0 = 0 𝑎𝑛𝑑 𝑎3 + 𝑏𝑎2 + 𝑐𝑎1 = 0.

Substituting the given values of 𝑎0 , 𝑎1 , 𝑎2 𝑎𝑛𝑑 𝑎3 in this, we get

4 + 𝑏 + 0 = 0 𝑎𝑛𝑑 37 + 4𝑏 + 𝑐 = 0.

These yield𝑏 = −4 𝑎𝑛𝑑 𝑐 = −21.

With these values of b and c, the given recurrence relation reads

𝑎𝑛+2 − 4𝑎𝑛+1 − 21𝑎𝑛 = 0 𝑓𝑜𝑟 𝑛 ≥ 0,

Or equivalently, 𝑎𝑛 − 4𝑎𝑛−1 − 21𝑎𝑛−2 = 0 𝑓𝑜𝑟 𝑛 ≥ 2 (i)


The characteristic equation for this relation is 𝑘 2 − 4𝑘 − 21 = 0 whose roots are 𝑘1 =
7 𝑎𝑛𝑑 𝑘2 = −3.Therefore, the general solutions for 𝑎𝑛 is

𝑎𝑛 = 𝐴 × 7𝑛 + 𝐵 × (−3)𝑛 (ii)

Where A and B are arbitrary constants.

Using the given conditions 𝑎0 = 0 𝑎𝑛𝑑 𝑎1 = 1 in this, we get

0 =𝐴+𝐵 𝑎𝑛𝑑 1 = 7𝐴 − 3𝐵
1
Which yield 𝐴 = −𝐵 = 10. Putting these values into (ii), we get

1
𝑎𝑛 = 10 {7𝑛 − (−3)𝑛 }. (iii)

This is the required solution.

Example 7 Solve the recurrence relation


2 2
𝑎𝑛+2 − 5𝑎𝑛+1 + 4𝑎𝑛2 𝑓𝑜𝑟 𝑛 ≥ 0,given𝑎0 = 4 𝑎𝑛𝑑 𝑎1 = 13.

Solution: Let 𝑏𝑛 = 𝑎𝑛2 . Then the given relation reads

𝑏𝑛+2 − 5𝑏𝑛+1 + 4𝑏𝑛 = 0, 𝑛 ≥ 0,

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)

Where A and B are arbitrary constants.

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)

From this, we get

𝑎𝑛 = ±√(51 × 4𝑛 − 35). (iii)

This is the required solution for 𝑎𝑛 .

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

as the solution for 𝐹𝑛 with 𝐹0 = 0 𝑎𝑛𝑑 𝐹1 = 1.

Example 9 Solve the recurrence relation 𝑎𝑛+2 = (𝑎𝑛+1 )(𝑎𝑛 ), 𝑓𝑜𝑟 𝑛 ≥ 0 with 𝑎0 = 1, 𝑎1 =
2.

Solution: Taking log on both sides, the given relation becomes

log 𝑎𝑛+2 = log 𝑎𝑛+1 + log 𝑎𝑛 , 𝑛 ≥ 0.


Setting 𝑏𝑛 = 𝑙𝑜𝑔𝑎𝑛 , this becomes

𝑏𝑛+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

0 = 𝐹0 = 𝑏0 = log 𝑎0 𝑎𝑛𝑑 1 = 𝐹1 = 𝑏1 = log 𝑎1 .

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.

Consequently, the solution for 𝑎𝑛 is

𝑎𝑛 = 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)

This is the required recurrence relation.

Therefore, (as in Example 8)


𝑛 𝑛
1+√5 1−√5
𝑎𝑛 = 𝐴 ( ) +𝐵( ) . (ii)
2 2

Using the above-made observation that 𝑎1 = 2 𝑎𝑛𝑑 𝑎2 = 3 in this, we get


2 2
1 + √5 1 − √5 1 + √5 1 − √5
2 = 𝐴( )+𝐵( ) 𝑎𝑛𝑑 3 = 𝐴 ( ) +𝐵( ) .
2 2 2 2

These simplify to

4 = (𝐴 + 𝐵) + √5(𝐴 − 𝐵) 𝑎𝑛𝑑 6 = 3(𝐴 + 𝐵) + √5(𝐴 − 𝐵).

Solving these, we get 𝐴 + 𝐵 = 1 𝑎𝑛𝑑 𝐴 − 𝐵 = (3⁄√5) which in turn yield

√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

This gives the number of binary sequences of the desired type.

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) 𝑛 ∈ 𝐴. Then 𝑛 − 1 ∉ 𝐴 and the subset 𝐴 − {𝑛} of 𝑆𝑛 would be counted in 𝑎𝑛−2 .


(2) 𝑛 ∉ 𝐴. Then A would be counted in 𝑎𝑛−1 .

Thus, we should have


𝑎𝑛 = 𝑎𝑛−1 + 𝑎𝑛−2 𝑓𝑜𝑟 𝑛 ≥ 2, 𝑤𝑖𝑡ℎ 𝑎0 = 1 𝑎𝑛𝑑 𝑎1 = 2
This is the recurrence relation for the problem.
Solving this recurrence relation, we obtain (as in Example 8).
𝑛 𝑛
1 + √5 1 − √5
𝑎𝑛 = 𝐴 ( ) +𝐵( )
2 2

Using the initial conditions 𝑎0 = 1 𝑎𝑛𝑑 𝑎1 = 2 in this, we get

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

This is the required 𝑎𝑛 .

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 .

This is the recurrence relation for 𝑎𝑛 .

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 + √2)𝑛 + 𝐵(1 − √2)𝑛

Where A and B are arbitrary constants.

Using the fact that 𝑎1 = 3 𝑎𝑛𝑑 𝑎2 = 7 in this, we get

3 = 𝐴(1 + √2) + 𝐵(1 − √2) 𝑎𝑛𝑑 7 = 𝐴(1 + √2)2 + 𝐵(1 − √2)2 .

These are equivalent to

3 = (𝐴 + 𝐵) + √2(𝐴 − 𝐵) 𝑎𝑛𝑑 7 = 3(𝐴 + 𝐵) + 2√2(𝐴 − 𝐵)

Solving these, we obtain 𝐴 + 𝐵 = 1 𝑎𝑛𝑑 𝐴 − 𝐵 = √2, so that 𝐴 = (1 + √2)⁄2 and 𝐵 =


(1 − √2)⁄2. Putting these into (ii), we get

1
𝑎𝑛 = [(1 + √2)𝑛+1 + (1 − √2)𝑛+1 ]
2
This is the solution for 𝑎𝑛 , with 𝑎1 = 3 𝑎𝑛𝑑 𝑎2 = 7.
Excercises

1. Solve the following recurrence relations:


(i) 𝑎𝑛+2 = 4(𝑎𝑛+1 − 𝑎𝑛 ), 𝑛 ≥ 0, 𝑎0 = 1, 𝑎1 = 3.
5
(ii) 𝑎𝑛 − 4𝑎𝑛−1 + 4𝑎𝑛−2 = 0, 𝑛 ≥ 2, 𝑎0 = 2 , 𝑎1 = 8.
(iii) 𝑎𝑛 = 5𝑎𝑛−1 + 6𝑎𝑛−2 , 𝑛 ≥ 2, 𝑎0 = 1, 𝑎1 = 3.
(iv) 2𝑎𝑛 = 7𝑎𝑛−1 − 3𝑎𝑛−2 , 𝑛 ≥ 2, 𝑎0 = 2, 𝑎1 = 5.
(v) 2𝑎𝑛+2 − 11𝑎𝑛+1 + 5𝑎𝑛 = 0, 𝑛 ≥ 0, 𝑎0 = 2, 𝑎1 = −8.
(vi) 𝑎𝑛+2 + 𝑎𝑛 = 0, 𝑛 ≥ 0, 𝑎0 = 0, 𝑎1 = 3.
(vii) 𝑎𝑛 = 4𝑎𝑛−1 − 4𝑎𝑛−2 , 𝑛 ≥ 3, 𝑎1 = 1, 𝑎2 = 3.
(viii) 𝑎𝑛 = 10𝑎𝑛−1 + 29𝑎𝑛−2 , 𝑛 ≥ 3, 𝑎1 = 10, 𝑎2 = 100.
(ix) 𝑎𝑛 + 7𝑎𝑛−1 + 8𝑎𝑛−2 = 0, 𝑛 ≥ 2, 𝑎0 = 2, 𝑎1 = −7.
(x) 𝑎𝑛 + 5𝑎𝑛−1 + 5𝑎𝑛−2 = 0, 𝑛 ≥ 2, 𝑎0 = 0, 𝑎1 = 2√5.

2. Determine the constants b and c if 𝑎𝑛 = 𝐴 + 𝐵 × 7𝑛 , 𝑛 ≥ 0, is the general solution of


the relation 𝑎𝑛+2 + 𝑏𝑎𝑛+1 + 𝑐𝑎𝑛 = 0, 𝑛 ≥ 0.
3. The Lucas numbers 𝐿0 , 𝐿1 , 𝐿2 , … …. are defined through the recurrence relation 𝐿𝑛 =
𝐿𝑛−1 + 𝐿𝑛−2 for 𝑛 ≥ 2
and𝐿0 = 2, 𝐿1 = 1. Find 𝐿𝑛 for 𝑛 ≥ 0.

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

You might also like