0% found this document useful (0 votes)
679 views111 pages

Discrete Mathematics

This document provides an introduction and overview of elementary counting principles used in combinatorial analysis, including: 1) The addition principle, which states that if two tasks cannot be performed simultaneously, the number of ways to perform either task is the sum of the number of ways to perform each individually. 2) The multiplication principle, which states that if an operation consists of multiple separate steps, the number of ways to complete the operation is the product of the number of ways to complete each individual step. 3) Several examples are given to illustrate the application of these principles to problems involving choosing instructors, routes, menu items, and arranging objects with restrictions. The goal is to establish a foundation for understanding enumeration techniques used

Uploaded by

Suraphel Birhane
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)
679 views111 pages

Discrete Mathematics

This document provides an introduction and overview of elementary counting principles used in combinatorial analysis, including: 1) The addition principle, which states that if two tasks cannot be performed simultaneously, the number of ways to perform either task is the sum of the number of ways to perform each individually. 2) The multiplication principle, which states that if an operation consists of multiple separate steps, the number of ways to complete the operation is the product of the number of ways to complete each individual step. 3) Several examples are given to illustrate the application of these principles to problems involving choosing instructors, routes, menu items, and arranging objects with restrictions. The goal is to establish a foundation for understanding enumeration techniques used

Uploaded by

Suraphel Birhane
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/ 111

1.

PART I: COMBINATORICS

CHAPTER 1
ELEMENTARY COUNTING PRINCIPLES

1.1 Basic Counting Principles

Combinatorial analysis is concerned with methods and principles of determining the


number of logical possibilities of some event without necessarily listing and identifying
every logical case.
 The study of permutations, combinations and partitions
 The study of intrinsic properties of a known configuration
 The investigation of unknown configuration
 Enumeration and listing of configuration
Configuration arises when objects are distributed according to a certain predetermined
constraints.
There are two fundamental counting principles used throughout this section in order
to develop many other enumeration techniques.

1.1.1 Addition principle (AP)

If a first task E can be per formed in n(E)= r ways, while a second task F can be
per formed in n(F)= t ways, and the two tasks (E and F) can not be accomplished
simultaneously, then either task E or F can be performed in:
n(EVF) = n(E)+n (F)= r + t ways.

This principle is sometimes referred to as the sum Rule.

Examples

1. Suppose there are 4 male and 3 female instructors teaching multivariable calculus in
our college. In how many ways can a student choose a calculus instructor in order to
take the course?

Solution: - The student is faced with two tasks. The task of either
(i) choosing a female calculus instructor or
(ii) Choosing a male calculus instructor.

If E= the task of choosing a female instructor.


and F = the task of choosing a male instructor,
then:
n(E) = 3 --- Number of ways of doing task E, i.e., choosing a female instructor.
n(F) = 4 --- Number or ways of doing task F, i.e., choosing a male instructor.

1
Since the tasks E and F cannot be per formed simultaneously, then n(EVF) – the number
of ways of accomplishing either task E or F, by addition principle (AP), is :
n(EVF) = n (E) + n (F)
= 3+4
= 7.
Therefore, the student can choose one instructor teaching multivariable calculus in
7 ways ///

2. If C is the task of choosing a positive composite number less than 10 and O is the task
of choosing a positive odd number less than 10, then C can be performed in
n(C) = 4 ways since C= {4,6,8,9}. The task O can be performed in n(O)= 5 ways,
Since O = {1, 3, 5, 7, 9}. However, C or O cannot be accomplished in
n(C) + n(O) = 4+5 =9 ways
This is because 9 is both a composite and an odd number less than 10. Hence there is a
possibility of performing the two tasks C and O simultaneously, which show that the
addition Principle is not applicable.
In fact, C or O can be performed in only
4 + 5 – 1 = 8 ways ///

Generalization of AP

Suppose a first task E1 can be performed in n(E1) = r1 ways, a second task E2 can be
performed in n(E2) = r2 ways, a third task E3 can be performed in n(E3) = r3 ways, etc,
and an nth task En can be performed in n(En) = rn ways. If no two of the tasks can be
performed at the same time, then the number of ways in which any one of tasks E1 or E2 or
E3 or ---, or En can be performed is:

n(E1VE2 V --- V En) = n (E1) + n (E2)+ --- + n (En)


= r1+ r2+ --- + rn
n
= r
i 1
i

1.1.2 Multiplication principle (MP)

If an operation consists of two separate steps E and F, and if the first step E can
be performed in n (E) = r ways and corresponding to each of these r ways , there
are n (F) = t ways of performing the second step F, then the entire operation can
be performed in:

n(E) x n(F) =rt different ways

2
Examples

1. A room in a building has four doors that may be designated as Door A, B, C and D. If
a person is interested in entering the room and leaving it by a different door, then in
how many possible ways can be fulfill his interest?

Solution: - To handle problems of this nature, it helps to have a TREE DIAGRAM of the
following form.
Entrance Exit
B
A C
D
A
B C
D
A
C B
D
D A
B
C
Figure 1.1.

Note that the tree diagram takes order to account. Thus, AB and BA count as two
different possibilities or arrangements. The first one refers to the possibility that one
enters the room through door A and leaves through door B, while the second describes
the process of entering through door B and leaving through door A. Order is the essence
of such arrangements, and any change in order yields a completely different arrangement.
The diagram shows that there are four branches corresponding to the entrances in
to the room through the four doors A, B, C and D; and that subsequent to (or following)
one’s entry into the room through one of the doors, there are only three doors left and one
can use any of the three doors for exit. For instance, if one enters through door A, then
one is free to leave the room through one of the remaining doors B, C, or D. Thus, we
find that there are in all 12 different paths along the branches of the tree corresponding to
the 12 different ways in which one can enter the room by one door and leave by another.

 There are 12 ways of entering by one door and leaving by another.

On the other hand, the data in the problem implies that there are
 4 Possible entrances into the room.
Corresponding to each of these entrances, there are
 3 possible exits from the room.
Thus, using the following rule called multiplication principle, we find that there are:
4 x 3 = 12 ways of entering the room by a door and leaving by another.
3
2. Suppose a bus line offers 8 routes between New York and Los Angeles. If a visitor
from New York goes to Los Angeles and then return by a different route, how many
possible routes can the visitor assume for the round trip?

Solution: - The round trip between New York and Los Angles is the task (or the
operation); and it is done in two steps
suppose;
E1 = choosing a route from New York to Los Angles
E2 = Choosing a route from Los Angles back to New York
Then;
n (E1)= 8 and n (E2) = 7

Now, by MP, there are


n (E1) x n (E2) = 8x7 = 56
Different ways (or routes) in which a visitor from New York goes to Los Angles and get
back by a different route.

Generalization of MP

If an operation consists of n separate steps, of which a first step E1 can be performed in


n(E1) = r1 ways; following this, a second step E2 can be performed in n(E2)= r2 ways, and,
following the 2nd step E2, a third step E3 can be performed in n(E3)= r3 ways, etc., and
following all the previous steps, an nth step En can be performed in n(En)= rn ways, then
the entire operation can be performed and completed in:
n(E1). n(E2). n(E3)--- n(En) = r1 r2 r3 --- rn different ways.

3. Suppose a restaurant menu offers a choice of three soups, five meat dishes, four
desserts, and a choice of coffee, tea or milk. In how many ways can one order a meal
consisting of a soup, a meat dish, desert and a beverage?

Solution
Here our operation is ORDERING A MEAL. This operation consists of 4 separate steps.
Suppose
The first step E1 = choosing a soup
The second step E2 = choosing a meat dish
The third step E3 = Choosing a desert; and
The fourth step E4 = choosing a beverage
Then;
n(E1) = 3, n(E2) = 5, n(E3) = 4 and n(E4) = 3 and by EMP, one can order a meal
consisting of a soup, a meat dish, a dessert and a beverage in.
n (E1) . n (E2). n(E3). n(E4) = 3 x 5 x 4 x 3 = 180 possible ways ///
In order to establish these ideas clearly and profoundly it will be helpful to under
take a few more illustrative examples.

4
4. How many numerals, each with two digits, can be formed from the five digits, 1,2,3,4
and 5 so that no digits are repeated?

Solution
To form numeral of two digits, we have to fill two places, the ten’s and the unit’s.
Apparently, there are five ways of filling the ten’s place because any one of the digits
1,2,3,4, or 5 can be placed in this position. Since no digit can be repeated, the unit’s place
can be filled with any one of the remaining four digits. From the multiplication rule, it
follows that the two places can be filled in 5 x 4 = 20 ways, as shown beneath.
12 13 14 15
21 23 24 25
31 32 34 35
41 42 43 45
51 52 53 54

5. In how many ways can five books on different subjects be placed on a shelf?

Solution
The problem requires the filling of five places. Any one of the five books may be placed
first on the shelf; four books are left and there are four ways of placing the second book
on the shelf; no matter which of the five books was used to fill the first place. The first
two places can, there fore, be filled in 5x4 =20 ways. Now, there are three books yet to be
arranged and any one of them can occupy the next (or third) place on the shelf. Thus, the
first three books can be placed in 5 x 4 x 3 = 60 different ways. Following this reasoning
and the extension of MP, we see that all the five books can be arranged in:
5x4x3x2x1 = 120 different ways on the shelf ///

6. In a certain version of BASIC programming language, a variable name consists of a


single letter (A,B --- Z) or a single letter followed by a single digit
(0,1,2,---,9). How many different variable names can this programming language
admit?

Solution
Assuming that the computer makes no distinction between the upper case letters (A, B, C
---, Z) and the lower case letters (a, b, c, ---, z), it follows that there are:
26 variable names consisting of a single letter. For the variable names with a
single letter followed by a single digit, we have to fill two places; the first by a letter and
the second by a digit. There are 26 letters for the first place and 10 digits (0,1,2, ---,9) for
the second place. Thus, from MP, we can form:

26 x 10 = 260 variable names consisting of a letter followed by a digit.


Thus, the given version of BASIC programming language, by addition principle
(AP), admits
26 + 260 = 286 variable names ///

5
EXERCISES 1.1

1. A salesman has eight shirts, 4 suits and 10 ties. How many different combinations
of a suit with a shirt and a tie can he wear?
2. There are four different routes connecting city A to city B. In how many ways can
a round trip be made from A to B and back?
3. A businessman is planning to go from New York to Chicago with one stop-over at
Pittsburgh. He has a choice of a plane, a train, or a bus from New York and a
choice of train or bus from Pittsburgh. Draw a tree diagram indicating the
different choices for making a complete trip to Chicago?
4. From the digits 2,3,4,5,6 and 7, a two-digit numeral is formed so that no digit is
repeated. How many such numerals are possible? Of these, how many are even
numbers?
5. The nominations for officers of the mathematics association of Ethiopia consist of
five candidates and three are to be elected. In how many ways can a president,
Secretary, and treasurer be elected?
6. In how many ways can five students be seated in a classroom with 20 disks?
7. How many three-digit numerals can be formed from the digits 4,5,6,7 and 8 if no
digit is repeated?
8. Given five flags of different colors, how many different signals can be made by
hoisting them on a vertical staff if
(a) three flags are used for each signal?
(b) at least two flags must be used for each signal ?
9. How many numerals can be formed by using all the digits 2,4,5,7 and 9 with no
digit being repeated? How many of these numbers are multiples of 5? How many
of these are even? How many of these are greater than 70,000? How many of
these are less than 50,000?
10. In how many ways can a 10 True/False examination question be answered?
11. A state report on crime consists of eight volumes numbered 1 to 8. In how many
ways can these volumes be placed on a shelf?

1.2 The pigeon hole principle

Definition 1: if n pigeonholes are occupied by n+1 pigeons then at least one pigeonhole
is occupied by more than one pigeon.

Examples:

1. If a computer department consists of 13 doctors then two of the doctors (pigeons)


were born in the same month (pigeonholes).
2. Suppose in a dormitory of 8 beds there are 9 students. Then at least two students
share the same bed.
3. If there are 366 people then at least two people must have the same birth day as
there 365 days in a year.
Definition 2: if n pigeonholes are occupied by k*n+1 or more pigeons, where k is a
positive integer, then at least one pigeonhole is occupied by k+1 or more pigeons.

6
Examples:

1. Find the minimum number of students in a class to be sure that three of them are
born in the same month.

Solution:

n = 12, number of months in a year (pigeonholes)


k+1 = 3 → k= 2.
Hence k*n+1 = 2*12+1=25
Therefore the minimum number of students in a class to be sure that three of them
are in the same class is 25.

2. Suppose a laundry bag consists of many red, white, and blue socks. Find the
minimum number of socks that one need to grip in order to get two pairs (four
socks) of the same color.

Solution:

Pigeonhole: number of colors. That is, n = 3


Pigeons: socks.
Then, k+1 = 4.
Hence k = 3
k*n+1 = 10.
Therefore one needs to grip at least 4 socks of the same color

Exercises 1.2:

1. In MILITEC there are 5 departments for degree programs. Find the


minimum number of students to be sure that 30 of them are in the
same department.

2. If a group of people come from five countries, how large must be to


guarantee that three of them come from the same country?

3. How large a group is needed to ensure that at least three have


birthdays in the same month?

4. How large a group is needed to ensure that at least three have


birthdays in the same week of a month?

5. How large a group is needed to ensure that at least three have


birthdays in the same day of a week?

7
1.3 PERMUTATIONS

In this section, we will show that the multiplication rule (multiplication principle)
provides a general method for finding the number of permutations of n different things
taken r at a time. Many types of problems of permutations can be shortened by means of
convenient symbols and formulas we now introduce.

1.3.1. Factorial Notations

Definition 1:- The product of the first n consecutive positive integers is called n-factorial
denoted by n! and defined as:
n!= 1x2x3x4x --- x(n-1)x n = nx(n-1)x ---x3x2x1

Note that:
(i) 6! = 6x5! (ii) 7! = 7x6! (iii) 200! = 200x199!
In general;
n! = n(n-1)!

 If n=0, then we define 0! =1.

In particular, observe that


1! = 1
2! = 2x1=2
3! = 3x2x1 = 6
4! = 4x3x2x1 = 24
5! = 5x4x3x2x1 = 120
6! = 6x5x4x3x2x1 = 720
7! = 7x6x5x4x3x2x1 = 5040, etc.
The factorial notation is very useful for representing large numbers of the type frequently
encountered in the study of permutations and related topics.

Self test exercises


8!
1. Show that 8x7x6 = .
5!
2. Show that:
16 !
(i).(1x3x5x7x---x15)x 28 =
8!
(ii) 21x22x23x24x ---x 40 = 210 x (1x3x5x7x ---x39).

1.3.2. Permutation principles

Definition 2:- Any arrangement of r objects taken from a collection of n objects is


called a permutation of n objects taken r at a time or an r-permutation of n objects.
Notation: The number of permutations (or possible arrangements in any order) of n
objects taken r at a time is denoted by npr or p (n, r) frequently; where 0  r  n.
Other notations are pn,,r and (n)r.
8
Preposition 1 (Permutations without repeating objects)

The number of permutations of n different objects taken r at a time, when none of


the objects is repeated in an arrangement is:
n n!
pr = n(n-1)(n-2)--- (n-r+1) =
(n  r )!

Proof: - The proof follows directly from the multiplication principle. Apparently, objects
are to be chosen from a collection of n objects one at a time. The first objects is selected
at random from a set of n distinct objects, the second from a set of (n-1) remaining
objects, the third from a set of (n-2) remaining objects, and so on, until finally, the rth
object is chosen from the set of [n- (r-1)] = (n-r+1) remaining objects. From the
multiplication principle, it follows that r objects are selected in:
n(n-1) (n-2) --- (n-r+1) ways
But this product is, by definition, the number of permutation of n objects taken r at a
time.
Thus;
n
pr = n(n-1) (n-2) … (n-r+1)
(n  r )(n  r  1) ... 3 x 2 x1
= n(n-1) (n-2) --- (n-r+1).
(n  r )(n  r  1) ... 3 x 2 x1
n(n  1)(n  2) ... (n  r  1)(n  r )(n  r  1) ... x 2 x1
=
(n  r )(n  r  1) ... 3 x 2 x1

Clearly, the numerator is the product of the integers from n down to 1, while the
denominator is the product of the first (n-r) integers, so that

n n!
pr 
(n  r)!
n
pr  n(n 1)(n  2)    (n  r 1) or
 n n!
pr 
(n  r)!

Examples

1. Evaluate: (a) 8p5 (b) 6p4


8! 8!
Solution: - (a) 8p5 =   8 x7 x6 x5 x 4  6720 ///
(8  5)! 3 !
6! 6!
(b) 6p4 =   6 x5 x 4 x3  360 ///
(6  4)! 2 !

9
2. Solve for n in each of the following
(a) np2 = 56 (b) np3 = 20 n(Exercice)

n!
Solution : (a) np2  56   56... by definition
(n  2)!
n(n - 1) (n - 2)!
  56
(n  2)!
 n 2  n  56
 n 2  n  56  0
 (n  7)(n  8)  0
 n  7 v n  8
n = -7 is rejected since n  N u {0}. Thus, the value of n= 8 ///

3. How many “words” of three letters can be formed from the letters a,b,c,d, and e, using
each letter only once?

Solution:- Since the letters a,b,c,d,e in different orders constitute different “words”, the
result is the number of permutations of five objects taken three at a time. Thus, by
principle of permutation without repetition, there are:
5 5 5!
p3    5 x 4 x3  60 words ///
(5  3)! 2!

4. What is the number of ways in which six students be seated in a classroom with 25
desks?
Solution: - There are six students that are going to occupy six desks at a time. Thus, there
are six seats to fill and 25 desks to choose from. The result is the number of permeations
of 25 different objects taken six at a time, i.e., n= 25 r=6 and

25 25! 25!
p6    25 x 24 x 23x 22 x 21x120
(25  6)! 19!
 127,512,000 ways ///

5. In how many ways can six pupils stand in a line or linearly arranged to pay their
college fees at the finance office counter?

Solution: - This corresponds to the case r = n in proposition 1. Thus the number of


permutations of a set of six different objects, taken altogether is:
6 6! 6! 6 x5 x 4 x3 x 2 x1
p6     720 ways ///
(6  6)! 0! 1
 6p 6  6!

10
Remark:- In general, the number of permutations of n objects taken all at time (or taken
altogether) is:

n
pn  n!

6. In how many ways can n married couples stand on a line alternating man-woman-
man- … -woman? If no same sex stands neighborly, find the number of arrangements.

EXERCISE 1.3.1
1. Evaluate each of the following
12 !
(a) 8! (b) 5p5 (c) 9p2 (d) np2 (e)
5!
2. Solve for n in each of the following.
(a) np2 = 56 (b) np3=20n (c) np4=88x n-1 p2
3. Show that:
(a) npr= n x n-1 pr-1
(b) npr =(n-r+1)x npr-1
(c) npr = n-1 pr+ r ( n-1pr-1)
4. How many “words” can be formed from the letters of the words:
(a) Seat? (b) Globe? C) Payment?
5. How many “words” can be formed from the letters of the word SPECTRUM
taken:
(a) three at a time? (b) five at a time? (c) altogether?
6. How many license plates bearing two letters of the alphabet followed by four
digits can be formed if:
(a) repetition of letters and digits are not permitted?
(b) repetition of letters and digits are permitted?
7. (a) In how many ways can the letters of the word SOCIAL be arranged?
(b) How many of the arrangements in (a) begin with S?
(c) How many permutations in (a) begin with S and end in L?
(d) How many of the arrangements in (a) have O and C together?
8. In the Holiday Inn, six rooms in a row are to be assigned at random to six guests,
two of who are from Dire Dawa. What is the number of possible arrangements so
that the guests from Dire Dawa are assigned rooms side by side?
9. There are eight invited guests to be seated in eight seats arranged in a row. How
different linear seating arrangements are possible if:
(a) the invitation is accepted by six guests?
(b) The invitation is accepted by all the eight guests and two particular guests
insist on sitting side by side?
(c) The invitation is accepted by all the guests but two particular guests wish
not to be seated next to each other?

11
10. How many five-digit integers can be formed from the digits 0, 1, 2, 3, 4, and 5, no
digit being repeated?
11. Seven students are to take an examination, two in Mathematics and five in other
subjects. In how many ways can these seven students be seated in one row so that
the two students taking the mathematics exam do not sit together?
12. Four married couples have eight seats in a row for a certain show. In how many
different ways can they be seated? What is the number of seating arrangements if
all the men are to sit together and all the women are to sit together?
13. An inspector visits six different machines during the day. In order to prevent the
operators from knowing when he will inspect, he varies the order of his visits. In
how many ways can this be accomplished?

Proposition 2 (Permutations with objects repeated)

The number of permutations of n different objects taken r at a time, when each


object can be repeated any number of times in an arrangements is:
n x n x …x n = nr, since n is used r-times as a factor.

Examples

1. A multiple-choice test has 100 questions with four possible answers for each question.
How many different sets of 100 answers are possible?

Solution: - Here, n= 4 and r= 100. Thus, the required permutation is 4100.

2. In how many ways can five prizes be given away to four boys
(a) When each boy is eligible for all the prizes?
(b) When any boy may win all but one of the prizes?

Solution: - (a) There are 4 ways of giving away the first prize (to either boy1, boy2,
boy3, or boy 4). There are again four ways of disposing the second prize since it can be
given to any one of the four students; and so on. Finally, the 5th prize can be disposed in 4
ways. Thus, the required number of permutations is 45= 1024 ///
(b) Since there are only four possibilities in which a student may have all the
prizes, the number of permutations in this case is four less than that for case (a), that is:
45- 4 = 1024 – 4 = 1020 ///

3. How many positive numerals less than 1000 can be formed from the digits 0, 1, 2, 3,
and 4 when digits may be repeated?
Solution: - There are three places to be filled and there are five choices for filling each
place. In other words, n=5 r=3, and the number of possibilities is 53. Excluding the
number 0, we have 53-1=124 numerals less than 1000.
4. A combination lock consists of four rings each marked with the five digits 1,2,3,4 and
5. What is the largest possible number of unsuccessful attempts in opening the lock if
one tries to guess the combination?

Solution: - Each of the four rings can be set in a position in five ways. Here, n=5 and
r=4, so that the number of all positions in which rings can be set is:
12
54=625 ways.
Since one of these is the correct combination, then the largest possible number of
unsuccessful attempts in opening the lock is; then:
54-1=625-1=624 ways ///

EXERCISE 1.3.2

1. For the five objects denoted by a, b, c, d, and f, list all permutations of these
objects taken two at a time without repetition.
2. There are three plumbers listed in a town telephone directory. On a certain
Saturday evening, six residents of the town need a plumber. If each resident is
free to call any plumber and all of the plumbers are available, what is the
maximum number of possible telephone calls that can be made by these six
residents?
3. Grades A, B, C, D, and F are assigned to a class of five students in Mathematics.
In how many ways can these students be graded if no two students receive the
same grade? How many ways are there to grade the students if only A or B is
assigned to each?
4. Consider an Urn containing four balls, numbered 1 to 4. What is the possible
number of ways of drawing three balls at random:
(a) without replacement?
(b) with replacement?
5. How many four-letter words can be made from a set of 10 different letters if:
(a) any letter may be repeated any number of times?
(b) a letter may not be repeated?
6. How many three-digit numbers can be formed from the digits 2, 3, 4, 5, and 6 if
(a) a digit may be repeated any number of times?
(b) a digit may not be repeated?
7. How many five-digit numerals can be formed from the digit 0, 1, 2, 3, and 4 when
a digit may be repeated any number of times and 0 is not allowed as a first digit?
8. A multiple- choice test has 20 questions with three possible answers for each
question.
(a) How many different sets of 20 answers are possible?
(b) In how many ways will all the answers be correct?
(c) In how many ways will all the answers be wrong?
(d) In how many ways will at least one answer be correct?
9. How many subsets (including the empty set and the set itself) can be formed from
a set of:
(a) eight different objects?
(b) 12 different objects?
(c) n different objects?

Preposition 3 (Permutations with alike objects)

The number of permutation of n objects taken all together and where p of the n
objects are alike and of one kind; q others are alike and of another kind, and so on, up to t
others alike and of still another kind such that p+q+---+t = n, is given by:

13
n!
p(n; p, q,..., t ) 
p!q!...t!
Proof: - Suppose that m is the total number of the required permutations. In any of these
arrangements, replace the p like objects by unlike letters, say a1 a2, … , ap different from
any of the remaining objects. These p new letters can be arranged among themselves in p!
new permutations, and if the corresponding changes are made in each of the q like objects
and replaced by unlike letters b1, b2, … bq, then these letters can be permuted in q! ways.
Thus, the total number of permutations would be:

m x p! x q!
Proceeding along these lines (with all like objects in the collection), the total number of
arrangements would be given by:

m x p!x q! x … x t!
But the letters now are all different and n in number, and thus they may be arranged in n!
permutations. Hence,

m x p! x q! …x t! = n!
The required number of permutations X is thus given by
n!
m ///
p!q!...t!
n!
Therefore, p (n; p, q, …, t) =
p!q!...t!
Examples

1. In how many ways can 10 cars be placed in a stock car race if three of them are
Chevrolet, four are Fords, two are Plymouths, and one is a Buick?

Solution:- Here, n = 10, p = 3, q=4, r = 2, and t =1. The number of distinct arrangements
or permutations is given by:

10 !
P (10 ;3 , 4 , 2 , 1)   1260 ///
3 ! 4! 2!1!

2. How many signals can be given using 10 flags of which two are red, five are blue, and
three are yellow?
Solution: - Clearly, n=10, p =2, q= 5 and r=3. Hence, the number of signals is:
10!
P (10;2,5,3)   2520 ///
2! 5! 3!

EXERCISE 1.3.3

1. Twelve students are traveling to Boston in three cars such that three students are
in car1, four in car 2, and five in car 3. How many possible ways are there to do
this?

14
2. In how many ways can 15 accounts be assigned to three accountants so that four
accounts go to one accountant, five to the second accountant and six to the third
accountant?
3. How many arrangements (or permutations) can be formed from the letters of the
words:
(a) Massachusetts? (b) Mississippi? (c) Boston? (d) Conference?
4. (a) How many arrangements can be formed form the letters of the word
MUHAMMADAN?
(b) How many of these permutations have all A’s together?
(c) How many of the permutations of 4 (a) have none of the M’s together?

CIRCULAR PERMUTATIONS

From linear arrangements discussed so far, we know that five persons invited for dinner
may set themselves in a row in any of 5!= 120 different ways. The answer would be
different if the guests were to be seated around a circular table. Denoting the guests by
the letters A, B, C,D, and E, we assume that one of the possible ways in which the guests
can be seated around the circular table is as shown in fig. 1.2 below- which is the
arrangement ABCDE.
A
B

B E C A

C D E
D
Figure 1.2
Figure 1.3

Starting with the letter B and reading in a counterclockwise direction, we get the
arrangement BCDEA, shown in fig 1.3. But the arrangement in fig 1.3. can be obtained
by a simple clockwise rotation from the arrangement in fig.1.2. These two arrangements
are identical when regarded as a circular permutation, although, they are different linear
arrangements, In similar manner starting with the different letters and reading them in a
counter clockwise direction, the various possible seating arrangements so obtained may
be expressed as:
ABCDE BCDEA CDEAB DEABC and EABCD
Although these are different linear permutations, note that they are the same when
regarded as a circular arrangement. Thus, a single circular permutation of the five letters
results from five different linear permutations. If the required number of circular
permutations of the 5 letters is C, then the total number of linear arrangements of these
persons, represented by the five letters, is 5C. We have established earlier that five
persons can be seated in a linear arrangement, taken altogether, in 5p5 =5! different ways.
Hence,

5 C=5!

15
5! 5 x 4!
C 
5 5
 C  4!
Thus, the number of ways in which five persons can be seated around a circular table is
4!. Similarly, the number of circular arrangements (or permutations) of n persons is given
by:

C= (n-1)!

This seems natural, for the seats are not numbered, there is no first or last seat at a round
table, and the only essential feature to be considered is the neighbors, i.e., the position of
one person relative to the others sitting at the same table.
If one person, among the n, is fixed at random it follows that the remaining
(n-1) – persons can be arranged among the selves in (n-1)! different ways. This approach
also gives:
C= (n-1)!
as the number of circular permutations of n-persons . Thus the following proposition.

Proposition 4 (Circular permutations)

The number of permutations of n objects around a circle, taken altogether, is given by:
C= (n-1)!

Examples

1. In how many ways can eight gents (gentlemen) and eight ladies be seated for a round-
table conference so that no two ladies sit together?

Solution: - The number of ways in which the eight gents can be seated at a round table
occupying alternate seats is given by:
C= (n-1)! = (8-1)!= 7! Ways
Then the ladies have a choice of eight remaining seats and this arrangement can be
completed in 8! different ways. Now, using the fundamental principle of multiplication,
we conclude that the required number is:
7!x 8! = 5040 x 40320
= 203,212,800 ways .
2. In how many ways can eight gents and seven ladies be seated for a dinner around a
circular table so that no two ladies sit together?

Solution: - As it was in example 1.22, the number of ways in which the eight gents can
be seated around the circular table is 7! Ways. Now, the ladies have a choice of eight
places so that no two ladies are together. Thus the sitting- arrangement of the seven ladies
on eight seats is, apparently, the permutations of 8 objects taken 7 at a time. The
arrangement of the ladies can, there fore, be completed in 8p7 = 8! Ways. From the
fundamental principle of multiplication, we conclude that the required number of circular
permutation is
C= 7! x 8p7 = 203,212,800, ways .
16
3. (i) In how many ways can 10 children sit in a merry-go-round relative to
one another?
(ii) In how many of this arrangement shall some children have different children in
front of them? (Hint: - The merry-go-round can revolve in either direction)

Solution: - (i) We have 10 children and hence n= 10. Thus the number of ways that these
children sit in a merry-go-round is the number of circular permutations given by:

C= (n-1)!
 C= (10-1)! = 9! =362,880 ways.
(ii) Some children will have different children in front of them in half the
above arrangements. That is, the required number of circular permutations
for this case is:

c (10  1)! 9! 362,880


    181,440 ways ///
2 2 2! 2

Since the merry-go-round can be revolved in two different directions-clockwise or


counter clockwise.

EXERCISE 1.3.4
1. In how many different ways can six ladies be seated at a round table?
2. In how many ways can four persons be seated at a round table so that all persons
do not have the same neighbors in any two arrangements?
3. In how many ways can six keys be placed on a key ring?
4. In how many ways can 12 persons form a “ring” if three of them must be
adjacent?
5. In how many ways can eight beads of different colors be arranged (a) in a
necklace? (b) in a row?
6. In how many ways can eight children at a birthday party be seated at a round table
if two of the children ask to be seated next to each other?
7. (i) In how many ways can nine different television sets be arranged in a row so
that no two particular sets are together?
(ii) If there are five black-and-white and four color sets, in how many ways can
they be arranged in a circle so that no two color sets are together?
8. In how many ways can 12 children at a birthday party be seated:
a) Around a circular table?
b) Around a circular table such that some children have different neighbors?
c) On the same side of a rectangular table?
9. There are five gentlemen and five ladies to dine at a round table. In how many
ways can they be seated so that no two ladies are together?
10. In how many ways can five gents and four ladies be arranged for a round-table
conference if no two ladies are in adjacent seats?

17
1.4. COMBINATIONS
In previous sections, we obtained formulas which enabled us to count the number of
ways in which r objects can be arranged in a row or a circle from a set of n different
objects. There are many problems that require us to make a selection of r objects from the
set of n objects without any regard to the “order”.
 In a permutation, order is taken into consideration, while in combination
problems; the order is of no significance.

Definition: - Any subset of r objects selected with complete disregard to their order from
a collection of n different objects is called an r-combination of the n objects or a
combination of n objects taken r at a time.
The number of r- combination of n objects is frequently denoted by either

n n n
r or cr. The symbols, C(n,r), Cn,r and Cr also appear in various texts.

Examples

1. Find the number of combinations of the four objects a, b, c, & d taken three at a time.

Solution: - Each combination consisting of the three objects determines 3!=6


permutations of the objects in the combination as shown in table 1.1. Thus the number of
combinations multiplied by 3! equals the number of permutations, that is,

 . 3!  p(4,3)
4
3

p(4,3)
  
4
3
3!
4! 4!
But p (4,3)    4x3x2  24 and 3! 1x2x3  6
(4 - 3)! 1!

There fore,
p(4, 3) 24
(43 )    4 as noted in table 1.1 beneath.
3! 6

Combination Permutations
abc abc, acb, bac, bca, cab, cba
abd abd, adb, bad, bda, dab, dba
acd acd, adc, cad, cda, dac, dca
bcd bcd, bdc, cbd, cdb, dbc, dcb

Table 1.1

18
Proposition 1 (number of r-combinations)

The number of combinations of n different objects taken r at a time (i.e., the


number of r- combinations of n objects) is given by.
n
pr n!

n
r 
r!

r!(n  r )!
; where 0  r  n.


Proof: - Note that nr represents the number of combinations of n objects taken r at a
time. Each such combination of r objects can be arranged in r! different ways. There fore,
r!( nr ) yields the total number of permutations of n objects taken r a time, or
r ! ( nr )  n p r
By proposition 1.1 and dividing throughout by r!, we obtain:
n
pr n!
 n
r 
r!

r!(n  r )!

2. In how many ways can a committee of five be chosen from a group of 10 members of
an association?

Solution:- From proposition 1, the number of possibilities of selecting five-person


committee from a group of 10 association members is given by the formula (Where n= 10
and r = 5):
10! 10 x9 x8 x7 x 6
 
10
5  
5!(10  5)! 5 x 4 x3x 2 x1
 252 ///

3. In how many ways can 11 players be chosen from a group of 13 players if


(a) the players are selected at random?
(b) a particular player must be included?
(c) a certain player must be excluded?

Solution: - (a) The number of combinations of 13 players, taken 11 at a time, is given by:
1311   13!  13x12  78 ways ///
11! 2! 2 x1
(b) If one particular player is always to be included, we need to select 10 more out
of the remaining 12. This can be accomplished in:
1210   12!  12 x11  66 ways ///
10! 2! 2 x1
(c) If one player should be excluded from the team, we need a selection of 11
players from the remaining group of 12. Thus, the required number of such
combinations is:
1211   12!  12  12 ways ///
11! 1! 1

4. There are 16 points in a plane, no three collinear. Determine the number of straight
lines that can be formed by joining them.

19
Solution: - Any two distinct points determine one straight line, uniquely. Hence, the
required number of straight lines is given by:
162   16!  16 x15  120 ///
2! 14! 2 x1

5. A committee of two Republicans and two Democrats is to be selected from seven


Republicans and nine Democrats. In how many ways can the committee be formed?


Solution: - The Republicans can be chosen in 72 ways, while Democrats can be

selected in any of the 92 ways. An application of the multiplication rule yields:
7! 9! 7 x6 9 x8
  
7 9
2 2  x  x
2! 5! 2! 7! 2 x1 2 x1
 21x36  756 ///

6. In how many ways can p + q objects be divided into two groups containing p and q
objects, respectively?

Solution: - Each selection of p objects for the first group leaves the remaining q objects
to be placed in the second group. Hence, the required number of combinations is given
by:
    p  q ! q!  p  q ! ///
 p  q q  x 
 p  q  p! q! q! 0! p! q!

7. A gentleman invites a party of m + n friends to dinner and places m of them at one


circular table and the remaining n at another circular table. In how many ways can he
complete their seating arrangements?

 
Solution: - Evidently, there are m  n ways of selecting m friends for the first table.
m
These m people can be seated at the first round table in (m-1)! ways. These leave n
persons for the second table, where there are  nn  ways of selecting n friends and (n-1)!
ways of arranging them around the 2nd circular table. Thus, the seating arrangements at
the first and second circular table can, respectively, be completed in:
  
m  n (m  1)! ways and nn (n  1)! (n  1)! ways ///
m
Thus, the number of ways in which the invited m+ n friends can be arranged around two
tables such that m friends are placed at one circular table and the remaining n at another
is given by:

m  nx (m  1)! x (n  1)!  (mm!n!n)! x (m  1)! x (n  1)!


m

(m  n)! (m - 1)! (n - 1)!



m (m - 1)! n(n - 1)!
(m  n)!
 ways ///
mn

20
8. How many binary strings of length 5 have at least 2 1’s?

Solution: - Method I (permutation with repetition)


The bit string is of length 5
 n=5 of which n1=2 are alike and n2=3 are alike.
5!
 p(n,n1,n2) = p(5,2,3) =  10 ways
2!3!
9. How many binary strings of length 5 have:
a. At least 2 1’s?
b. Exactly 3 1’s that begin with 1 and end with 0?
Solution (self test exercise)

Complementary Combinations

n n
Two combinations   and   are said to be complementary combinations if n  r  s .
r  s 

Remarks

 Two complementary combinations are equal. That is


n n 
  =   , r  n.
r  n  r
e.g.     ;     ;     ;     .
7
0
7
7
7
1
7
6
7
2
7
5
7
3
7
4

n
 A finite set with n-elements has   subsets each with r-elements.
r 
Exercise 1.4

1. Evaluate:
(a) 83  (b)  
12
10 (c)  
100
99

2. Solve for n:
(a)  n2   15 (b) 3n   35
3. Show that:
(a)  nr    nn  r  (b)  nr    nr1    nr 1 
4. How many committees of five representatives can be formed from a group of 10
persons?
5. An electric circuit may possibly fail at 10 stages. If it is found that it has now failed at
exactly four stages, in how many ways could this happen?
6. Nine people are to travel in two cars, five in one and four in the other. How many ways
are there to do this?
7. A salesman’s wife plans to accompany her husband on a sales trip to Cleveland. She
has four coats and six dresses in her cardboard, find the number of ways in which she
can choose three coats and three dresses for the trip.
8. A college freshman finds that he must take 12 hours of mathematics. If there are 12
21
three-hour courses offered, then in how many ways can the student satisfy the college’s
requirements?
9. In how many ways can four persons be selected from five married couples if
(a) the selection must consist of two women and two men?
(b) A husband and wife cannot both be selected?
10. In how many ways can a 10 question True/False examination be answered if you
make the same number of answers true as you do false?
11. A poker hand is a set of five cards selected from a standard deck of 52 cards. What is
the number of possible poker hands that contain:
(a) exactly one ace?
(b) a pair of kings?
(c) three cards of the same denomination?
(d) three cards of the same denomination and a pair of kings?
12. In how many ways can a committee of three be chosen from four Republicans and
four Democrats if
(a) all are equally eligible?
(b) the committee must consist of two democrats and one Republican?
(c) there must be at least one member from each party?
13. A bag contains five white and seven black marbles. If five marbles are drawn
together, how many different drawings are possible if
(a) the marbles may be of any color?
(b) there must be exactly three white marbles?
(c) the marbles must be of the same color?
14. Ten persons are going on a field trip for a history course in three cars that will hold
2, 3, and 5 persons, respectively. In how many ways could they go on the trip?
16. In how many ways can four red balls be drawn from an urn if
(a) the urn contains six red balls?
(b) the urn contains only four red balls?
(c) the urn contains four red, three white and two black balls?
17. There are three offices available for a staff of 12. The first office can accommodate
three persons, and the second and third offices can take four and five persons,
respectively. How many different assignments of the staff are possible?
18. In how many ways can a bridge deck be dealt to four players A, B, C, and D, giving
13 cards each? How is your answer affected if instead of distributing the cards to the
players, you arrange them in four heaps of 13 cards each and the players can
choose the set of 13 cards in any order they like?
19. In how many ways can nine accounts be assigned to three different salesmen so that
each one gets three accounts? What is the number of possibilities if the same
salesman can not be assigned to one particular pair of accounts?
20. In how many ways can 15 parcels be placed in three bags, each bag containing five
parcels? What is the number of possibilities if there are two heavy parcels that can
not be placed in the same bag?
21. In how many ways can one partition a set of size n into r ordered subsets so that the
first subset has size k1, the second subset has k2, and so on, and the rth subset has
size kr, given that k1+ k2+… + kr = n? How is the partition affected if k1 = k2= …=kr ?
22. A businessman has invited 21 of his customers for dinner on a Friday evening. He has
decided to place six guests at one round table, eight at another round table, and the
remaining seven are to be seated at a third circular table. In how many ways can he
22
complete the seating arrangement?

1.5. THE BINOMIAL THEOREM


The quantities nr are called binomial coefficients because of the fundamental role these
quantities play in the formulation of the binomial theorem. Expansions of positive
integral powers of (a+b)n, where n=0,1,2, …, are of frequent occurrence in algebra and
are beginning to appear in all phases of mathematics. Moreover, expansions of this nature
are important because of their close relationship with the binomial distribution studied in
statistics and related fields. We shall, therefore, under take a systematic development of
the formula that produces such expansions.
Of course, the following identities, for example, could be established by direct
multiplication:
(a+ b)0 =1
(a+ b)1 = a+b
(a+ b)2 = a2 + 2ab + b2
(a+ b)3 = a3+3a2 b+ 3ab2+ b3.
(a+ b)4 = a4 + 4a3 b + 6a2 b2 + 4ab3 + b4
(a+ b)5 = a5 + 5a4 b+ 10a3 b2 +10a2b3+ 5ab4+ b5
(a+ b)6 = a6+6a5 b+ 15a4 b2 + 20a3 b3 + 15a2 b4+ 6ab5+ b5.
Note that as we continue expanding larger and larger powers of (a+b), several
patterns emerge, leading to a part of the solution. The following patterns may be evident
from the above process of multiplication:
(a) The coefficients of the first and last terms are both 1.
(b) There are n+1 terms in the expansion of (a+b)n.
(c) The exponent of a starts with n and then decrease by 1 until the exponent of a
has decreased to 0 in the last term, and exponent of b is 0 in the first term and
then continues to increase by 1 with the exponent of b is n in the last term.
(d) The sum of the exponents of a and b in a given term is n.

Remark: - The binomial theorem gives the coefficient of terms in the expansion of
powers of binomial expressions. Binomial expression is an expression which contains
two terms.
Proposition (The Binomial Theorem)
If n, r are non-negative integers, where 0  r  n, then
   
(a  b) n  n0 a n  1n a n 1b  n2 a n - 2b 2  ...  nr a n - rb r  ...   b
n
n
4

n
  (nr ) a n - rb r
r 0
Note that the (n+1) terms in the expansion of (a+b)n, without their coefficients, are
an ; an-1b, an-2 b2 ; … an-r br, …, a2 bn-2 ; abn-1 ; bn
In other words, each term in the expansion is of the form:
an-r br, where r= 0,1,2,…, n.

23

The coefficient of this general term is nr , since this corresponds to the number of ways in
which r b’s and (n-r) a’s can be selected, and thus the complete general term is;

n
r a
n-r r
b
A summation of this general term for r= 0, 1,2, …, n yields the above assertion.

Corollary 1: From proposition above, with a=1, it follows that:

(1  b) n      b   b   b
n
0
n
1
n
2
2 n
3
3
 ...   b
n
r
r
 ...   b .
n
n
n

Corollary 2: With a=b=1 in proposition above, it follows that:

2n  (1  1) n              ...   .
n
0
n
1
n
2
n
3
n
n

Corollary 3: With a=1 and b=-1 in proposition above, we have:

              ...  (1)  .
0  [1  (1)]n  no  1n  n2  3n  n
4
n
5
n n
n
For even values of n, corollary 3 yields:

         ...              ...     2
n
0
n
2
n
4
n
n
n
1
n
3
n
5
n
n 1
n 1
.

24
Examples

1. Expand (x+2y) 7.

Solution:-
x  2 y 7   x   x (2 y )   x (2 y)   x (2 y)
7
0
7 7
1
6 7
2
5 2 7
3
4 3

  x 2 y    x (2 y )   x(2 y )   (2 y )
7 3 4 7 2 5 7 6 7 7
4 5 6 7

 x 7  14 x 6 y  84 x 5 y 2  280 x 4 y 3  560 x 3 y 4  672 x 2 y 5  448 xy 6  128 y 7 . ///


Remark:

The calculation of the coefficients is simplified by making use of the complementary


n 
combinations nr     .
n  r
In the preceding example, we needed to calculate only up to   and then recognize that
7
3

    ;     ;     ;     .
7
0
7
7
7
1
7
6
7
2
7
5
7
3
7
4

2. Expand (1+2x) 6.

Solution: - Letting n=6, a=1 and b=2x in corollary 1, we have:

(1  2 x )6      (2 x)   (2 x)   (2 x)   (2 x)   (2 x)   (2 x) .


6
0
6
1
6
2
2 6
3
3 6
4
4 6
5
5 6
6
6

 1  12 x  60 x 2  160 x 3  240 x 4  192 x 5  64 x 6 ///

3. Expand (1-3x) 4.

Solution: With n = 4, a =1 and b=-3x in corollary 1, we get


(1-3x)4= [1+(-3x)]4.
 
 04  14 (-3x)  42 (3x )2  34 (3 x)3      3x 
4
4
4

 1  12 x  54 x 2  108 x3  81x 4 ///

3. Expand (2x+3y) 5

Solution: - Letting n = 5, a = 2x and b=3y in proposition above, we have:

( 2 x  3 y )5   (2 x)   (2 x) (3 y )   (2 x) (2 y)


5
0
5 5
1
4 5
2
3 2
 (53 )(2 x )2 2 y 
3

  (2 x)(2 y )   (3 y )


5
4
4 5
5
5

 32 x 5  240 x 4 y  720 x 3 y 2  108 x 2 y 3  810 xy 4  243 y 5 ///

25
4. Using the proposition, find the numerical value of (1.04)10.

Solution: - Let n =10, a=1 and b= 0.04 in corollary 1, then

(1  0.04)10      (0.04)   (0.04)


10
0
10
1
10
2
3
 ...    0.04
10
10
10

10
 1  10 (0.04)  45(0.04)  45(0.04) 2  120(0.04)3  ...  0.04
 1  0.4  0.072  0.00768  ...
 1.47968 ///

This example (Example 4) may serve as a practical illustration of the Binomial


Theorem.

Remark:

The (r+1)st term in the binomial expansion of (a+b)n is given by:

Tr 1   a
n
r
n r
br .

5. Without an actual expansion, find the 10th term of (2x-y) 11.


Solution:
Using the above remark, we have:
T10  11  
9 (2x)
11- 9
- y 9
   (-1)
11
9
9
22 x 2 y 9
11!
 .4 x 2 y 9
9! 2!
 220 x 2 y 9 ///
10
 1
6. Find the middle term in the expansion of  x   without expanding it.
 x
Solution:
10
 1
Since n=10, it follows that there are 11 terms in the binomial expansion of  x   .
 x
th
Accordingly, the 6 term represents the middle term. Thus,
5
 1
T6   x
10
5
10  5 5 1 5
 -   252 x ( x )  252 ///
 x
9
 1 
7. Find the two middle terms in the expansion of  2a  a 2  .
 4 

Solution: - With n= 9, there are 10 terms in this expansion. The two middle terms are
then the 5th and 6th, given by T5 and T6.

26
4
 1   a 8  63 13
T5  
9
4 (2a)   a 2   126 (32a 5 ) 
5
  a ///
 4   256  4
5
 1   - a10  63
T6   9
5 (2a)  - a 2   126 (16a 4 ) 
4
   a14 ///
 4   1024  32

8. Find the term independent of x (i.e., the constant term) in the expansion of
12
 2 1
 2x   .
 x

Solution: - Let the (r+1)st term be the term independent of x. Thus, we have
r
2 12  r  1 
12
 
Tr 1  r (2x ) - 
 x
   (2) x
12
r
12 - r 24  2 r
 1r x  r
   (-1) .2
12
r
r 12  r
x 24  3r

It is evident that Tr+1 will be independent of x if 24-3r = 0 , that is, r = 8. Thus, T9


is this term which is given by:
T9  12
8  (-1) 2  8  16   7920 ///
8 4 12

EXERCISE 1.5

1. Expand the following:


(a) (3a+2b)4 (b) (3ax-4by)5 (c) (1-x)7
11
8 6  1
(d) (1+2x) (e) (x-2y) (f)  x  
 x

2. Without the actual computations, evaluate the following:


    
(a) 04  14  42  34  44
(b)                 
5
0
5
1
5
2
5
3
5
4
5
5

(c)                         ...   .
n
0
n
1
n
2
n
3
n
4
n
5
n
6
n
7
n
n

3. Using the binomial Theorem (or formula), find approximations for the following.

(a) (1.006)4 (b) (1.05)5 (c) (0.998)4 (d) (0.98)6.

4. Find in Simplified forms:


(a) the 5th term in the expansion of (x-y)12
24
 1 
(b) the 13th term in the expansion of  2 x   .
 2x 
(c) the two middle terms in the expansion of (1+2x)13
(d) the middle term in the expansion of (4-5x)50
27
5. Find the coefficient of:
(a) x5 in the expansion of (x+x-3)17
(b) x4 in the expansion of ( x-x2) 10
(c) xn in the expansion of (1+x)2n
6.
Without expanding, find the term involving x2 y4 in the expansion of (2x+3y)6.

7. Mr. Smith plans to deposit $ 1000 in a saving account that pays 6 percent interest
compounded annually. How much will he have in his account five years hence?

8. A commercial bank A pays 6 percent interest for savings and compounds it quarterly,
while another commercial bank B pays 7 percent interest on savings but compounds
it annually. If a customer wants a maximum return on his savings, in which bank
should he deposit $ 10,000 he has recently inherited?

9. Three successive coefficients in the expansion of (1+x)n are 462,330, and 165.
Determine the value of n.
10. Find the term independent of x (i.e., the constant term) in the expansion of
12
 3 1
x   .
 x

1.6. THE INCLUSION-EXCLUSION PRINCIPLE AND DERANGEMENTS

1.6.1. THE PRINCIPLE OF INCLUSION AND EXCLUSION


In this section we develop and state a new counting technique called the
Inclusion-exclusion Principle. Examples will be used to develop the technique and as
well as to further demonstrate how the principle is applied.

Proposition 1: Let A,B and C be any finite sets. then:

1. n(A  B) = n(A)+n(B)-n(A  B)
2. n(A  B  C ) =n(A)+n(B)+n(C)-n(A  B)-n(A  C)-
n(B  C)+n(A  B  C)

Proposition 2: Let A,B and C be any finite sets and U a universal set. If n(U) = N, then:

 
1. n A B  N  [n( A)  n( B )]  n( AB ) = N - n(A  B)
2. n A B C   N  [n( A)  n( B )  n(C )]  [n( AB )  n( AC )  n( BC )]  n( ABC )
= N – n(A  B  C)
C C

Note: A B  A  B and AB  A  B where A or Ac denotes the complement of set
A

28
Examples

1. Suppose that in a group of 100 students; 50 taking mathematics, 40 taking


computer science, 35 taking information science, 12 taking maths and computer
science, 10 taking maths and information, 11 taking computer science and
information science and 5 taking all.
a. How many students are taking at least one subject
b. How many of them taking none of the subjects
Solution:
a. Let M = students taking mathematics
C = students taking computer science
I = students taking information
Then by proposition 1
n(M  C  I ) = n(M)+n(C)+n(I)-n(M  C)-n(M  I)- n(C  I)+n(M  C  I)
= 50+40+35-12-11-10+5
= 97
b. using proposition 2
 
n M C I = N – n(M  C  I)
= 100-97
=3

2. Determine the number of integers n such that 1  n 100 that are neither divisible
by 3 nor by 5.

Solution: - Here U= {1,2,3,…,100} and n (U) = N= 100. For n  U, let


C1 be the condition that n is divisible by 3.
C2 be the condition that n is divisible by 5.
 
Then the answer to this problem is N C 1C2 , which is the number of integers n  U that
are not divisible by 3 or 5. Thus:
N (C 1 C 2 )  N  [ N (C1 )  N (C 2 )]  N (C1C 2 ) … (*)
Now;
N (C1)= Number of integers divisible by three  100  33.3
3
 N (C1) =33
N (C2)= Number of integers divisible by five  100  20
5
 N (C2) =20 and
100
N (C1C2)= Number of integers divisible by both 3 and 5   6.7 (Note that
15
an integer is divisible by both 3 and 5 if it is divisible by LCM (3,5) =15)
 N (C1C2 ) = 6.

Inserting these values in the relation (*) above, we get

29
N (C 1 C 2 )  100  [33  20]  6.
 100  53  6
 53 /// ... There are 53 integers that are not
divisble by 3 or 5 in U  {1,2,3, ..., 100}.
Definition: For r  R, the greatest integer function in r (or simply the greatest
integer in r) is denoted by  r  and defined as:

r if r  z
r=
the largest integer smaller than r, if r is not an integer.

For instance, (i)  5  =5 (ii)  8 1  =8


3
1
(iii)   8  = -9. (iv)    =3
3

3. Determine the number of positive integers n where 1  n  100 and n is NOT divisible
by 2, 3, or 5.

Solution: Our universal set U= {1,2,3…,100} and n (U)= N = 100. For n U, let
C1 be the set of integers n divisible 2.
C2 be the set of integers n divisible by 3
C3 be the set of integers n divisible 5.
Here, we want to find N (C1 C 2 C3 )  the number of integers nU which are not divisible
by 2, 3, or 5.
100
N (C1 )   100  = 50 N(C1C2) =   = 16
2 6
100 1 100
N (C2 )    =  33  =33 N(C1C3)=   = 10
3 3 10
100
N (C3 )   100 =  20 = 20 N (C2C3) = =  =6
5 15
100
and N (C1 C2 C3) =   = 3.
30
Then by proposition 2:
N (C1 C 2 C 3 )  N  [ N (C1 )  N (C2 )  N (C3 )]  [ N (C1C2 )  N (C1C3 )  N (C2C3 )]  N (C1C2C3 )
we have;
N (C1 C 2 C3 )  100  [50  33  20]  [16  10  6]  3  26 ///
(These 26 integers are 1,7,11,13,17,19,23,29,31,37,41,43,47,49,53,59,61,67,71,73,77,79,
83,89,91,97.)

 The following proposition generalizes Principle of Inclusion and Exclusion for


any finite number of conditions
Proposition: (The Principle of Inclusion and Exclusion)

30
Given a finite set U with n (U)= |U|=N, and conditions Ci , 1  i  n, satisfied by
some of the elements of U. The number of elements of U that satisfy NONE of the
conditions Ci , 1 i  n, is denoted as N  N (C1 C 2 C3 ...Cn ) and is given by:

N  N- [(N(C1)+ N(C2)+N(C3)+ …+ N (Cn)]


+ [N (C1C2)+ N (C1C3)+ … N(C1Cn)+ N(C2C3) + …+N (Cn-1Cn)]
- [N (C1C2C3)+ N (C1C2C4)+ … + N (C1C2Cn)+ N(C1C3C4)+ … +
N(C1C3Cn) + …+ N (Cn-2 Cn-1Cn)]
+ … + (-1)n N(C1C2C3… Cn)- - - -[1]

or in summation notation:

n
N N  N (Ci)   N (C iC
1 i n 1 i  j  n
j)   N (Ci Cj Ck)  ... (1)
1  i  j k  n
N (C1C2C3...Cn )....[2]

1.6.2. DERANGEMENTS: NOTHING IS IN ITS RIGHT PLACE


The Principle of inclusion and exclusion may be used to provide the key towards
the number of a “special type” of permutation called DERANGEMENT.
A derangement of n objects taken all at a time is a permutation (or arrangements)
of these n elements such that none of the n elements appears in its natural position or
right place.
If, for instance, we consider the numbers 1,2,3, …, n then the derangement of
these numbers is the arrangement of the n numbers taken altogether in which 1 is not in
the first position; 2 is not in the second position; 3 is not in the third position; etc., and n
is not in the nth place.

Notation: The number of derangements of n objects taken altogether is denoted by either


of the symbols D(n) or dn.

Examples

1. Find (a) D (1) (b) D (2) (c) D (3) (d) D (4)

(a) Here, there is only one position to fill and one object to arrange. Hence there is no
position other than this where 1 can be moved. In other words, the number of
arrangements in which 1 is not in the first place is 0. The number of derangements
of the number 1 is then;
D (1) = 0
(b) The derangement of 12 is 21. Thus the number of derangements of the numbers
1,2 taken two at a time is given by:
D (2) =1

31
(c) D (3) = 2. Refer to Example 1.49 (b).
(d) The distinct arrangements of the numbers 1,2,3, 4 so that 1 is not in the first place,
2 is not in the second place, 3 is not in the third place and 4 is not in the fourth
place are:
2143 3142 4123
2341 3412 4312
2413 3421 4321
The number of derangements of the numbers 1,2,3,4 taken altogether is then:
D (4) = 9 ///

At this point of our discussion, given any positive integer n let us look for a
relation (or formula) that can be used to find the number of derangements, D(n), of these
n objects take altogether.

2. In how many ways can we arrange the numbers 1,2,3, …, 7 so that none of the
numbers are in their natural positions?
Solution:
Clearly, n = 7 and the number of permutations of the numbers 1,2,3,4,5,6 and 7
taken all at a time is 7p7= 7!
Let Ci, where i = 1,2,3,,4,5 6 or 7, be the condition that the number i is in its natural
position. For instance, C1 is the condition that 1 is in the first place in a permutation; C2 is
the condition that 2 is in the 2 nd place in a permutation. The permutation 7261534
satisfies the conditions C2 and C5.
By definition, a derangement of 1,2,3, …, 7 is a permutation that satisfies none of
the conditions Ci, 1 i  7. Thus, the number of derangements of these seven numbers is
evidentially;
D (7)  N (C1 C 2 ... C7 )
 N - [N(C1 )  N (C2 )  ...  N (C7 )]
 [ N (C1C2 )  N (C1C3 )  ...  N (C6C7 )]
 [ N (C1C2C3 )  N (C1C2C4 )  ...  N (C5C6C7 )]
 ....
 (1)7 N (C1C2 ...C7 ) .... By PIE.

Since the number of permutation of 1,2,3, …, ,7 taken altogether is N=7!, we need to


compute:
N(C1)= the number of permutations of 1,2,…, 7 such that 1 is in the first place
regardless of the positions of the other numbers. That is, the
numbers 2,3,4,…, 7 may or may not be in their natural place.
Thus, we put 1 in the first place of the arrangements and permute the remaining six
numbers to obtain:
N (C1) = 1x6x5x4x3x2x1=6!
Similarly;
N (C2) =N (C3)= … N (C7) = 6!
To compute N (C1C 2), we hold 1 and 2 in the first and second places, respectively, and
permute the remaining five numbers and get:

32
N (C1C2) = 5!
Proceeding along these lines, the number of permutation satisfying the specified
condition would be given by:
N (C1C3) = N (C1C4)= … = N (C1 C7)+ …= N (C6C7)= 5!
N (C1C2C3)= N (C1C2C4)= … = N (C1C2C7)= … = N(C5C6C7)=4!
------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------

Finally;
N (C1C2C3 … C7) =0! =1

Thus, by the principle of inclusion and exclusion, the number of derangements of the
numbers 1, 2, 3, …, 7 taken altogether is given by:

D (7 )  7 ! -   6 !  5 !-  4 !  3 !-  2 ! 1!-  0 !


7
1
7
2
7
3
7
4
7
5
7
6
7
7

7! 7 ! 7 ! 7 ! 7 ! 7 ! 7 !
 7!-       .
1! 2 ! 3 ! 4 ! 5 ! 6 ! 7 !
 1 1 1 1 1 1
 7 ! 1 - 1       
 2 ! 3! 4 ! 5 ! 6 ! 7 !

Observe that;
  6 !  17! 6! ! 6 !  71!!,   5 !  27!5!!  5 !  72 !!
7
1
7
2 and so on.
   
From elementary calculus we find that the Maclaurin series for the exponential
function is given by:
x 2 x3 
x2
ex  1  x    ...   .
2 ! 3! n 0 n !
Thus

1

(-1)n 1 1 1 1
e   1  1      ...
n 0 n ! 2 ! 3! 4 ! 5 !
-1
To five places, e = 0.36788 and
1 1 1 1
1  1     ....   0.36786,
2 ! 3! 4 ! 7!
+ -1 (1) n k
Consequently, for k  z , k  7, e is a very good approximation to  .
n0 n !
We can, therefore, use this value in example 2 and write:
 1 1 1 1 1 1
D (7)  7 ! 1 - 1       
 2 ! 3! 4 ! 5 ! 6 ! 7 !
 (7 !) (e-1 ) ///

Proposition:

The number of derangements of n objects taken all at a time is given by:


33
D (n)  n ! -   (n - 1) !    (n - 2) ! -  (n  3) ! ...  (-1)   0 ! or equivalently;
n
1
n
2
n
3
n n
n

1 1 1 1 1
D (n)  n !      ...  (-1)n 
 2 ! 3! 4 ! 5 ! n !
If n  7, then the number of derangements of the n objects, can be approximated by:
D (n) = (n !) e-1 … From Maclaurin series for e-1

Examples

1. While at a racetrack, Ralph bets on each of the ten horses in a race to come in
according to how they are favored. In how many ways can they reach the finish line
so that he loses all of his bets?

Solution:

Removing the words “horses” and racetrack” from the problem, we really want to
know in how many ways we can arrange the numbers 1,2,3 …, 10 so that 1 is not in the
first place (its natural position), 2 is not in the second place (its natural position), …, and
10 is not in the tenth place (its natural position). We already know that this is the
derangements of the numbers 1,2,3 …, 10. That is:

 9 !    8 ! -  7 !  ...    0 !
D (10)  N (C1 C2 C3 ...C10 )  10 !  10
1
10
2
10
3
10
10

   9 !  8 !   7 !
10
1
10
2
10
3   0 ! 10
10
 10 ! 1 
    ... 
 10 ! 10 ! 10 ! 10 ! 
 1 1 1 
 10!  1 - 1    ... 
 2! 3! 10 !
 (10!) e-1. ///

2. At the C-H company Peggy has seven books to be reviewed, so she hires seven people
to review them. She wants two reviews per book, so the first week she gives each
person one book to read and then redistributes the books at the start of the second
week. In how many ways can she make these two distributions so that she gets two
reviews (by different people) of each book?

34
Solution:

She can distribute the books in 7! ways the first weak. Numbering both the books and the
reviewers (for the first weak) as 1,2,3, …, 7 for the second distribution she must arrange
these numbers so that none of them is in its natural position. She can do this in
D (7) ways. By the rule of product, i.e., the principle of multiplication, she can make the
two distributions in:

 7 6!
(7 ! ) D(7)  7 ! x7 ! 1 - 1
 7
 2

5! 73 4 !

 7
0 !
 ...  7 
 7! 7! 7! 7! 
 1 1 1 1
 (7 !) 2 1 - 1     ...  
 2 ! 3! 4 ! 7 !
2 1
 (7 !) (e ) ways ////
EXERCIS 1.6

1. There are 50 members in a club. Of these 50 members, if 10 play tennis, 15 play chess,
12 play badminton, 5 play both tennis and chess, 4 play both tennis and badminton, 3
play chess and badminton, and 2 play all the three sports-badminton, chess and tennis.
Then
(a) How many members of the club play none of the sports?
(b) How many play at least one of the three sports?
2. Determine the number of positive integers n, where 1 n  2000, that are:
(a) not divisible by 2,3,or 5.
(b) not divisible by 2,3,5,or 7; and
(c) not divisible by 2,3, or 5, but are divisible by 7.
3. Find all real numbers x such that
(a) 7  x  =  7x  (b) 7x  = 7 (c)  x+7 = x+7 (d)  x+7  =  x  +7.
4. Find the number of arrangements of a, b, c, …, x,y,z, in which none of the patterns
spin, game, path, or net occurs.
5. Determine the number of positive integers n, where 1  n  1000, that are:
(a) not divisible by 7 or 11.
(b) divisible by at least one of the integers 7 or 11.

6. In how many ways can we devise a secret code by assigning to each letter of the
alphabet a different letter to represent it?
7. When n balls, numbered 1,2,3 …, n, are taken in succession from a container, a
rencontre occurs if the mth ball withdrawn is numbered m, 1  m  n. Find the
number of ways of getting no rencontres of these n balls.

8. In how ways can the integers 0,1,2,3, …, 9 be arranged in a line so that no even integer
is in its natural position?

35
CHAPTER 2

RECURRENCE RELATIONS

2.1. Introduction
Recursion involves recursive definition of an algorithm, a set or a sequence in terms of
itself. When a recursive definition is used as a tool for solving combinatorial problems,
an equation called recurrence relation is applied to represent present and future values on
the basis of earlier or prior terms. It is clear that in counting problems we analyze a given
situation and then express the result in terms of the results for certain smaller non-
negative integers. Once the recurrence relation is determined, one can solve the equation
at any nW- non negative integer n. With access to a computer, such relation is highly
valuable, especially if it cannot be solved explicitly.
Recurrence relations are the discrete counterparts to the continuous ideas of the ordinary
differential equations. Recurrence relations are also called difference equations or
recurrence equations.
Thus, this chapter is devoted to the study of recursively defined discrete functions and the
solutions of recurrence relations associated to these recursively defined functions.

2.2 THE NOTION OF SEQUENCES

Counting, enumeration and discrete problems are some typical areas where sequences are
exploited most. In realty, they are ranges of special kinds of functions. The distinguishing
feature of sequences is their domain. In most cases, they assume the set of natural
numbers as a domain. Under our study of recursive definitions and specifically
recurrences relations, the set of whole numbers will be regarded as the domain of
sequences.

Definition: If f is a function that maps the set of whole numbers W or any non-empty
finite subset of W in to a certain number set, then the range of f is called a
sequence. By convention, the elements of the range of the function f, i.e. the
elements of the sequence are known as terms.
Note: A sequence is often called a discrete function or a numeric function

Notations:

(1) Subscripted symbols of the form an, bn, fn, etc are used to denote the image of a
whole number n under the sequence f. If we select, say a n to denote the image of
nW under f, then an = f(n), n= 0,1,2, …

36
(2) We use the notation {fn} n 0 or simply {fn} to denote a sequence f.
In other words,
{an} n 0 = {f0, f1, f2, ---} = the range of f (which is the sequence f).
If nW begins at some non negative integer k 1, then the notation {an} n k is applied for
the sequence.
Note: (1) If the domain of a sequence {an} is the set of all non negative integers W, then
{an} is called an infinite sequence and if the domain is any finite non-empty
subset of w, it is called a finite sequence.
(2) If the sequence {an} = {a0, a1, a2, …} is:
a. the set of integers, then {an} is called a sequence of integers.
b. the set of real numbers, then {an) is termed as a real sequence.
c. the set of complex numbers, then {an) is known as a complex sequence.

2.2.1 METHODS OF DESCRIBING SEQUENCES

There are several methods of representing a sequence and the most commonly
used techniques are the following.
a. Enumerating the first few terms of the sequence. Note that we list terms of
the sequence till a rule for telling the present and future values is observed.
b. Supplying a rule that defines a sequence f as an explicit function a(n),
preferably written as an = f(n), n  0. It should be noted that an= f(n) depends
upon n and only n.
c. A technique called recursive definition stated in terms of recurrence relations
and initial conditions may be used to describe the terms of a sequence.

Examples

1. The numbers: 0,1,1,2,3,5,8,13, … form a sequence that begins with the two terms
0 and 1. Each new term, there after, is a sum of the previous two terms. As we
shall see later, the numbers in this sequence are called the Fibonacci number.
This description is called enumeration method.

2. The sequence {an} n 0 where an= 5(3n) or simply {5(3n)} n 0 represents the
geometric sequence 5,15,45,135,…
This description is called explicit method.

3. If we denote the (n+1)th Fibonacci number by fn we have:


fn = fn-1+ fn-2, n  2, with f0 = 0 and f1=1.
This is called a recursive definition for the sequence of Fibonacci numbers given
in example1

The recursive definition for the Fibonacci sequence is composed of two parts, namely,
the equation: fn = fn-1 + fn-2, n  0 and the values f0=0 and f1=1. These properties are
enjoyed by all other recursively defined sequences.

37
2.3 RECURSIVE DEFINITION AND RECURRENCE RELATIONS

2.3.1 Recursive Definition

A technique of defining an algorithm, a set or a function in terms of itself by:


(i) Giving a rule for finding present and future values from earlier or prior values.
(ii) Specifying one or more starting values to activate the rule mentioned in (i)
An algorithm, a set or a function stated in terms of these two conditions is called a
recursively defined algorithm, set or function, respectively.

Note that a recursive definition is well defined if and only if it satisfies conditions (i) and
(ii) above. If any one of these two properties is lacking, the recursive definition may not
describe the required phenomenon in a unique manner.

Example:
Let us use a geometric sequence to illustrate that both the rule and the starting values are
really essential in recursive definitions.
Recall that a geometric sequence is an infinite array of numbers, such as
5,15,45,135, …, where the division of any term ,other than the first, by its immediate
predecessor is a constant, called the common ratio r. For our sequence this common ratio
15 45 135
r is 3 since        3. If ao,a1,a2, ---,are in a geometric sequence, then
5 15 45
a1 a2 a3 a
   ...  n 1 =…= r, the common ratio. In this particular geometric sequence
a0 a1 a2 an
an+1= 3an, n  0 is the rule for finding present and future values from earlier or prior
terms.

The equation an+1= 3an, n  0, does not, however, define a unique geometric
sequence. The sequence 7, 21, 63, 189, … also satisfies the relation. To pinpoint the
particular sequence described by an+1= 3an, we need to know one of the terms of that
sequence as a starting value. Hence,
an+1= 3an, n  0 and a0=5
uniquely defines the sequence 5,15,45,135,…, whereas
an+1 = 3an n  0 and a1=21 identifies 7,21,63,189, … as the geometric sequence
under study.

2.3.2 RECURRENCE RELATIONS AND INITIAL CONDITIONS

The expressions for permutations and combinations are one of the most
fundamental tools for counting the elements of finite sets. They often prove to be
inadequate and many problems of computer science require a different approach. Hence,
recurrence relation emerges in this section as another tool for solving combinatorial
problems.
Recurrence relations are often called difference equations or recurrence equations.
The salient characteristic of a recurrence relation is the specification of the term fn
as a function of the prior terms f0, f1 , f2 , … , fn-1. However, a recurrence relation by itself
is not sufficient to define a unique sequence; we must also specify the values of some
38
initial terms. This is why in our definition of the Fibonacci sequence, we set f0= 0 and
f1 =1 as initial conditions.
Recall that a recursive definition of a discrete function specifies one or more
initial values and a rule for determining subsequent terms from those that precede them.
When recursive definitions are applied to solve combinatorial problems, the equation
involved in these definitions, which is employed for finding present terms from the
preceding once is called a recurrence relation.

Recurrence relation:
A recurrence relation for a sequence {a n} and a non negative integer no, is a formula that
expresses an in terms of one or more of the previous values a0, a1, … , an-1 of the sequence
for all integers n  n0.

Initial conditions: Initial conditions, which are also called boundary conditions of the
recurrence relation, are the values of one or more starting terms of the sequence specified
in the form
ao= k , a1= r, etc.
for some constants k, r  R. Note that the computation of terms of a sequence from the
recurrence relation is initiated by the boundary conditions.

Explicit sequence: A function an = f(n) that defines the term an of a sequence {an} on the
basis of a non-negative integer n alone is called an explicit sequence of n.

Examples

1 The expression.
n! = n (n-1) !, for n  1 and
O! = 1 [i.e., if n=0, then n! = 1]
refers to itself when it uses (n-1) ! to describe n!. Moreover it contains:
(i) an initial condition (or base value) specified as: 0! =1 or if n=0, then n! =1.
(ii) a recurrence relation stated as: n!=n(n-1)!. Note that this is a recurrence
relation because the present value n! is defined in terms of (n-1)!.Thus the above
expression is the recursive definition of the factorial function
f(n) = n! , n  0.
.
2. Find a recursive definition of the binomial coefficients.

Solution: Denote the n-k binomial coefficient by  nk  . Then from the Pascal’s formula, we
have the recurrence relation:
nk   nk 11   nk 1  , for n >k>0.
If the initial conditions specified as: 0n   1 and  nn  =1 are included to the recurrence
relation, we get the recursive definition for the binomial coefficients   ///
n
k

39
3. Define the number of permutations without repetition of n objects taken altogether
recursively.

Solution: Denote the number of permutations without repetition of n objects taken


altogether by an. Then an-1 will represent the number of permutations of (n-1) objects by
notation analogy. By the principle of permutations, we have
an= n pn  n ! and a n -1  n -1p n -1  (n  1) !... [1]
The definition of the factorial function:
n! = n (n-1) !
together with eq n [1] gives the recurrence relation:
an= n an-1 , for n 1
Thus, the recurrence relation: an= nan-1 for n 1 with the initial condition a0= 0! =1 is the
required recursive definition ///

Solution of a Relation:
If each term of an explicit sequence a n = f(n),  n w satisfies a given recurrence
relation, then the explicit sequence (i.e., the explicitly defined sequence) {an} is called the
solution of the difference equation. The procedure followed to find the explicit sequence
{an} that solves a recurrence relation is called solving.

Examples

1. Show that the explicit sequence {an} where an= 2n+1-1 for n 1 is a solution of the
recurrence relation:
an= 3an-1 – 2an-2 , n 3.

Solution:
To show that an= 2n+1-1 n N is a solution of the recurrence relation:
an= 3an-1 – 2an-2,
first observe that the terms of the explicit sequence {an} at n, n-1, and n-2,
respectively, are:
an= 2n+1 – 1 … [ i ]
an—1 = 2n-1+1 –1 = 2n-1 … [ ii ]
an-2 = 2n-2+1- 1 = 2n-1 - 1 --- [ iii ]

Substituting these formulas into the right-hand side of the recurrence relation, we get:
3an-1 – 2an-2 = 3 [2n -1] –2 [2n-1-1] … by [ii] and [iii]
= 3 (2n) –3 - 2 (2n-1) +2
= 3 (2n) –2n-1
= 2 (2n) –1.
= 2n+1 –1
= an …… by [ i ].
Thus, we conclude that: an= 3an-2 – 2an-2 whenever an= 2n+1-1. Consequently the explicit
sequence {an} n 1 where an= 2n+1-1 n  1 is a solution of the given recurrence relation.

40
2. Show that the sequence {f n} defined explicitly by f n= 2(-4)n +3 is a solution of the
recurrence relation fn = -3 fn-1+4 fn-2.

Solution: Given the explicitly defined sequence fn =2(-4)n +3, to show that it is a solution
of the relation: : fn = -3fn-1+4 fn-2 , we begin with RHS.
-3 fn-1+ 4fn-2 = -3 [2(-4)n-1+3] +4 [2(-4)n-2+3]
= -6 (-4)n-1-9 +8 (-4)n-2+ 12
= -6 (-4)n-1 + (-2) (-4) (-4) n-2+3
= -6 (-4)n-1 –2 (-4)n-1 +3
= -8 (-4)n-1 +3
= 2 (-4) (-4)n-1+ 3
= 2 (-4)n + 3.
= fn
Therefore, the sequence {fn} where fn= 2(-4)n+3 is a solution of the recurrence relation.

3. Suppose that the discrete function f is defined recursively by:


f(0) =2 and
f(n+1) = 2f(n) +3
Then find f(1), f(2), f(3), f(4) and f(5)

Solution: From the recursive definition, it follows that:


f(1) = 2f (0) + 3
= 2(2)+3 = 7 ///
f(2) = 2f(1) +3 = 2 (7) +3 = 17 ///
f(3) = 2f(2) + 3 = 2(17) +3 = 37 ///
f(4) = 2f(3) +3 = = 2(37)+3 = 77 ///
f(5) = 2f(4) +3 = 2(77) + 3 = 157 ///

4. Let a and b be positive integers, and suppose Q is defined recursively as follows.

0, if a < b
Q (a, b) =
Q (a-b,b) +1, if b  a.

(a) find (i) Q (2,5) (ii) Q(12 ,5)


(b) What does this function Q do?
(c) Find Q (5861, 7).

Solution: (a) (i) Q (2,5) = 0 since 2 < 5. ///


(ii) Q (12,5) = Q (7,5) +1
= [ Q(2,5)+1] +1.
= Q (2,5) +2
= 0+2
=2
(b) Each time b is subtracted from a, the value of the function Q is increased by 1. Hence
Q (a,b) finds the quotient when a is divided by b.
(c) When we divide 5861 by 7, the quotient will be 837. Thus, according to the
conclusion drawn in part (b) above, we have:
41
Q (5861,7) = 837.

EXERCISE 2.1

(1) Given a number sequence {an} n 1 = {2,4,8,16,32, …}, find a recursive definition
for {an} n 1 .
(2) Define the number sequence {5n} n 1 = {3,6,9,12,15, … ) recursively.
(3) For a non negative integer n and a non zero real number r, give a recursive
definition of f(n) = rn .
(4) Give a recursive definition of the sequence {fn} n 1 , if
(a) fn =5n (b) fn = 2n+1
(c ) fn+1 = 10n (d) fn = 5.
(5) Let g be the function such that g(n) is the sum of the first n positive integers. Give
a recursive definition for g (n).
(6) Find f1 , f2, f3 and f4 if fn is defined recursively by f0 = 1 and for n  N ,
(a) fn+1 = fn+ 2. (b) fn+1= 3fn.
r
(c ) fn+1 = 2 , where r = fn . (d) fn+1 = fn2 + fn + 1.
(7) Show that the explicit sequence {an} n 0 where an= 3(5n) is a solution of the
recurrence relation: fn-5fn-1= 0, n  1.
(8) Given a recurrence relation: yn =yn-1 + 6yn-2 for n >1, then verify that the explicit
sequence {yn} n 0 such that yn= A (3)n + B(-2)n for any non zero constants A and
B solves the recurrence relation.
(9) Show that the explicit sequence {gn} n 0 such that gn = (A+Bn) (4n) for all non
zero constants A and B solves the recurrence relation: gn+2 – 8gn+1-16gn= 0, n  0.
(10) (a) Find F2 , F3 , F4 , F5 , and F6 if Fn is defined recursively by F0= 0 ,
F1= 1 and for n  o:
Fn+2 – Fn+1 – Fn= 0.
n n
1  1  5  1  1  5 
(b) If : Fn =    is the explicit value of the sequence
5 2  5  2 
{Fn} n 0 , then find F0, F1, F2 and F3.
(c) Identify a relation, if there is any, that can exist between the recursively
defined sequence of part (b).

2.4 LINEAR RCCURRENCE RELATION WITHCONSTANT COEFICIENT

A recurrence relation of the form:


cofn + c1 fn-1+ c2 fn-2+ … + ck fn-k = f(n) … [1].
Where c0, c1, c2, … , ck are constants, is called a linear recurrence relation with constant
coefficients (LRRWCC).
Note: The relation in [1] is linear since each term fn fn-1, fn-2, …, fn-k. appear only in a
power of degree one.

ORDER OF RECURRENCE RELATION


42
If the constants c0 and ck in [1] are none zero, then relation [1] is known as the kth- order
linear recurrence relation with constant coefficients.
Note: The phrase “ kth – order “ mean that the present term fn of the relation depends on
k previous terms, fn-1, fn-2, …, fn-k.

Examples

1. The Fibonacci sequence defined by the recurrence relation: Fn= Fn-1+ Fn-2 , n  2 with
the initial conditions F0= 0 and F1= 1 is linear second-order.
2. yn-4yn-1= 0, n > 1 with the boundary condition y1= 3 is a first-order linear
recurrence relation with constant coefficients (LRRWCC of order-one).
3. aK+1 –5ak + 4ak-1- 6ak-2 = Ak+10 defined for k  3, together with the initial conditions
7
a0 = and a1= a2=5 is a third-order linear recurrence relation with constant
3
coefficients (LRRWCC of order-three).

HOMOGENEOUS RELATION
The recurrence relation [1] is called a k th – order linear homogeneous recurrence relation
with constant coefficients if and only if f(n)= 0 for all n  W.

NONHOMOGENEOUS RELATION
The recurrence relation [1] is called a kth – order linear nonhomogeneous recurrence
relation with constant coefficients if and only if f(n)  0 for some n W. That is, the
relation:
cofn + c1 fn-1+ c2 fn-2+ … ck fn-k= f(n)  0 for some n W is termed as nonhomogeneous
recurrence relation with constant coefficients (LNRRWCC).
Note: Non homogeneous recurrence relation is also called Inhomogeneous RR.
Examples

1. The relation: ak = 5ak-1, - 8ak-2 ,k  2 with a0 =5 and a1= 2 is a 2nd –order LHRRWCC,
7
while ak= 5ak-1 –ak-2 +6ak-3+ 4k+10, k  3 with a0 = and a1= a2 =5 is a 3rd –order
3
LNHRRWCC.
2. Classify the following recurrence relations
(a) fn =nfn-1 (b) an = an-1+ an-3
(c) bn = bn-1+2 (d) Sn = Sn-2 + Sn-4.

Solution:
(a) fn = nfn-1 is a first-order linear homogeneous recurrence relation with variable
coefficients.
(b) an = an-1 + an-3 is a third-order linear homogeneous recurrence relation with constant
coefficients.
(c) bn = bn-1+ 2 is a first-order linear non homogeneous recurrence relation with constant
coefficients.
(d) Sn = Sn-2 + Sn-4 is a fourth-order linear homogeneous recurrence relation
with constant coefficients.
43
2.5 SOLVING LINER HOMOGENEOUS RECURRENCE RELATIONS

It is a common place to apply inductive and deductive reasoning in solving both


homogeneous and non homogeneous linear recurrence relations. Note that inductive
reasoning is used for the purpose of suggesting a sound and reasonable solution to the
given recurrence relation, while deductive reasoning is employed in proving that the
suggested solution is correct. In addition to this, the following two properties regarding
solutions of linear recurrence relations play a vital roll.

PROPERTIES OF SOLUTIONS
The solutions of a linear recurrence relation have two important properties which may be
stated as follows.
(1) Multiplication Property: Multiplying any solution of a linear recurrence relation
by a non-zero constant gives another solution
(2) Addition Property: Adding two or more solutions of a linear recurrence relation
gives another solution.
In the following, we shall study a method of solving 1st -order linear homogeneous
recurrence relations with constant coefficients and then use their solutions as springboard
towards the solutions of higher order linear homogenous relations.

SOLVING FIRST ORDER LINEAR HOMOGENEOS RELATIONS


One method of solving a first-order linear homogeneous recurrence relation is an
application of a repetitive procedure called RECURSION METHOD. The following
example may illustrate the recursion method, i.e., the procedure of reducing the terms
successively to the initial values and then compute the value of the function at any non
negative integer n from these base (or initial) values.
Examples
1. Solve the general first-order linear homogeneous RR with constant coefficients:
an = r an-1 , n  1 with an initial condition: a0 = c.
Note that the coefficient r and the initial value c are constants.
Solution: We solve this general LHRRWCC of order one by recursion. To this end,
observe that:
an = r an-1
an-1 = r an-2
an-2 = r an-3 and so on.
Thus, substituting these and similarly obtained formulas successively in the difference
equation, we get:
an = an-1
= r (r an-2)
= r2 an-2
44
= r2 (r an-3)
= r3 an-3
= …….
= ……
= rk an-k … (for each k  n).
= ……
= rn-1 an- (n-1)
n-1
=r a1
= rn-1 (r a0)
= rn a0
= crn … (since a0 = c is given).
So the solution of the given recurrence relation: an= ran-1, n  1 and a0 = c is the
explicit function of n given by
an = crn for all n  0 ///
Note that this solution: an =crn is called a general solution because it contains the
arbitrary constant c. Moreover the sequence: an= rn also solves the given RR and it is
called the basic solution.
GENERAL SOLUTION
A solution an of a recurrence relation that involves arbitrary constants is called a
general solution.
A solution of the form: an = rn, without the constant c, is called a basic solution.
UNIQUE SOLUTION
A solution in which all the arbitrary constants in the general solution are replaced by
specific numbers is called a unique solution of the recurrence relation:
Note: A unique solution should satisfy both the recurrence relation (RR) and the
initial conditions (IC). Thus, to determine the unique solution, we use the initial
conditions to evaluate the specific values of the arbitrary constants, other than the
value of r, in the general solution.

45
2. Let n be the number of memory locations referenced by a certain computer
program. Suppose that the algorithm implemented by the program requires f n bytes
of memory, where fn depends on n. If fn is defined recursively by:
fn = 4fn-1, n  2 and f1 =3.
Then find the amount of bytes of memory required to implement the algorithm by
the program for all n  2.
Solution: The problem is indeed a problem of solving the given recurrence relation
and its initial condition.
Method 1 (Recursion Method)
Starting from the given RR, we proceed by recursion or a repetitive procedure as
follows.
fn = 4fn-1
=4 (4fn-2) … Since fn-1 = 4fn-2
= 42 fn-2
= 42 (4fn-3) …. Since fn-2 = 4fn-3
= 43 fn-3
= …..
= 4n-k fn-k (for each k W and k  n)
= ……
= 4n-1 fn-(n-1) (where k =n-1)
= 4n-1 f1
= 4n-1(3) ….. Since f1=3 is the given initial condition.
= 3(4)n-1
Thus, the unique solution to the recurrence relation is:
fn= 3(4)n-1, n 1.
Method 2
The general solution obtained in example1 may be applied in solving the recurrence
relation at hand. In other words, suppose that the difference equation has a general
solution of the form:
fn= crn , n1.
Substituting this formula in: fn= 4fn-1, we have
Crn= 4crn-1
cr n 4cr n 1
 
cr n 1 cr n 1
 r=4

46
 fn = c(4)n.
Using the initial condition: f1= 3, where n=1, yields
C(4)1 = f1=3
 4c =3
3
 c= .
4
3 n
 fn= (4) = 3(4)n-1
4
Therefore, the unique solution is:
fn =3(4)n-1 n  1 ///
This agrees with the above solution obtained by recursion.
3. A bank pays 6% annual interest on savings, compounding the interest monthly. If Ato
Gallo deposits $ 1000 on the first day of May, how much will this deposit worth a year
later?
Solution:
6%
Since the annual interest rate is 6%, the monthly rate is  0.5% , which means that
12
0. 5
the monthly interest is  0.005.
100
For 0  n,  12, let pn denote the amount of Gallo’s deposit at the end of n months. Then,
clearly we have the relation: 0.005 pn-1= The interest earned on the amount pn-1 during the
month, Thus;
Pn = pn-1+ 0.005 pn-1 for a 1  n  12 and p0 = $ 1000 …. (*)
represents the problem recursively. What remains is, therefore, to solve this recurrence
relation with its initial condition.
Hence, the relation in (*):
Pn = pn-1 + 0.005pn-1
Pn = (1+0.005)pn-1
Pn = (1.005) pn-1 , p0= $ 1000
has the general solution: pn = (1.005)n p0 ; which gives rise to the unique solution:
Pn = 1000 (1.005)n. …. (why ?)
Consequently, from the unique solution, it is evident that Gallo’s deposite will worth:
P12 = 1000 (1.005)12
= 1061.68 ///
a year or 12 months later.
EXERCISE 2.2

47
1. Find a recurrence relation which will be is satisfied by the sequence {an) n 0
formed from each of the following functions.
n!
(a) an = (b) an = n2-6n+8.
15 !
2. Which of the following recurrence relations are homogenous and which are non-
homogeneous? Which are linear and non linear? Tell the order and describe the
coefficients (as constant or variable) in each case.
(i) fn = nfn-1 (ii) an= an-1+ an-3 (iii) bn =bn-1+ 2
(iv) sn = sn-2 + sn-4 (v) yn  yn 1  6 yn  2  0 (vi) an = an-2
(vii) 5nan + 2nan-1 = 2an-2 (viii) an = an-1 + 2n-7.
3 3
(ix) a n = 7a n-1 (x) an =an-1 + an-2 + (n-1)2.

3. For each of the following, determine the number of initial conditions that must be
assigned so that a unique sequence is generated.
(a) an = 2an-1 – an-2 (b) an-an-2 + an-3 = 0
(c ) an = an-1 + 2n (d) 5nan + 2nan-1 = 2an-1
4. Give an example of:
(a) a linear homogeneous recurrence relation with constant coefficients.
(b) a linear homogeneous recurrence relation with variable coefficients.
(c) a linear inhomogeneous recurrence relation with constant coefficients.
(d) a non-linear homogeneous recurrence relation with constant coefficients.
5. Find the general solution of the recurrence relations:
(a) 2 an+1- 3 an = 0, n  0 (b) 4an – 5an-1 = 0, 0  1.
(c) an+1 – 4an = 0, n  0 (d) an- 1.5 an-1= 0, n 1.
6. Solve each of the following recurrence relations.
(a) an = 3an-1, n  1 and a0 =5.
1
(b) an 1 = an-2, n  2 and a2=98.
7
(c) 3an+1- 4an = 0, n  0 and a1= 5.
(d) 2an – 3an-1= 0, n  1 and a4 = 81.
7. If the explicitly defined sequence {an} n 0 is a solution of the recurrence:
153 1377
an+1- can = 0, with a3 = and a5 = , then what is the value of the constant
49 2401
c?
8. Suppose that bn > 0, for all nW, and solve the relation:
(i) b2n+1 = 5b2n , n  0 and b0 = 2
(ii) find b12.

48
9. The number of bacteria in a culture is 1000 and this number increase 250% every
2 hours. Use a recurrence relation to determine the number of bacteria present
after one day (24 hours).
10. If Addie chaltu invests $ 100 at 6% interest compounded quarterly, how many
months must she wait for her money to double?
11. Find a10 if a3 n = 7a3n-1, n  1 and a0=3.

2.6. THE SECOND-ORDER RECURRENCE RELATION

A typical second-order linear homogeneous recurrence relation with constant coefficients


(LHRRWCC of order-two) has the form:
c0an + c1an-1+ c2an-2 = 0, n  2
with accompanying boundary conditions expressed usually as:
a0 = k0 and a1 = k1
where k0, k1, c0, c1, c2 are constants with c0, c2  0.

2.6.1. SOLVING HOMOGENEOUS RELATION OF ORDER TWO

Recall, from section 2.5, that a first order linear homogeneous relation with
constant coefficients had a general solution: an = crn, where c and r are non-zero
constants.
Based on this work (regarding the first order case), we shall seek a solution for the
second-order homogeneous recurrence relation with constant coefficients, that assumes
the same form: an = crn. Note that we are using inductive procedure to suggest a solution.
Now, consider the second-order LHRRWCC:
A0an +A1an-1+ A2 an-2 = 0, n  2 …. (*)
Assume that this relation has a solution of the form:
an= crn with c  0 and r  0.
Then, observe that the two subsequent terms are expressed as:
an-1 = crn-1 and an-2 = crn-2
substituting these formulas into the equation (*), we get:
A0 crn + A1crn-1+ A2crn-2 = 0
 crn-2 [A0r2+ A1r + A2] = 0.
Dividing throughout this last equation by crn-2  0, we get a second-degree (or quadratic)
equation in r, which will be given by:
A0r2 + A1r + A2 = 0.
Consequently, the discrete function {an} with an = crn is a solution of the 2nd – order
recurrence relation:
A0an + A1an-1 + A2an-2 = 0
if and only if the number r is a solution of the 2nd-degree equation:
A0 r2+ A1r + A2 = 0.

2.6.2. CHARCTERISTIC EQUATION AND ROOTS


Definition:
The characteristic equation of a homogeneous 2 nd- order linear recurrence relation
with constant coefficients:
A0an + A1an-1 + A2an-2 = 0.
49
is the 2nd-degree equation in r, which may be written as:
A0r2 + A1r + A2 = 0.
The solutions r1 and r2 of the characteristic equation are called the characteristic
roots of the recurrence relation.
Note: (1) the characteristic equation and characteristic roots are also called auxiliary
equation and auxiliary roots, respectively.

Example: find the characteristic equation of each of the following recurrence relations
1. fn = 3fn-1 -2fn-2, n > 2 with initial conditions: f 1=3 and f2 = 7
2. yn= 6yn-1- 9yn-2, n>1, y0= 5 and y1= 3

.Solutions:
1. Given the difference equation: fn= 3fn-1- 2fn-2, n>2, suppose that the solution is of the
form: fn = rn. Now, substituting the assumed solution into the given recurrence relation
gives the equation:
rn = 3rn-1- 2rn-2
This equation, upon division by rn-1 0 throughout, yields the characteristic equation:
r2 = 3r-2
 r2-3r + 2= 0
 (r-1) (r-2) = 0
 r1= 1 and r2= 2, which are the characteristic roots.

Remark: The associated characteristic equation may be written directly by identifying


the order of the recurrence relation at hand. For instance, the characteristic equation of:
(a) the first order linear homogeneous relation with constant coefficients: C0an +
c1an-1= 0 is the first degree equation: c0r+ c1= 0.
(b) that of the 2nd order homogeneous relation: c0an+ c1an-1+ c2an-2= 0 is the
second degree equation: c0r2+ c1r + c2= 0.
.
2. By the remark above, the auxiliary equation of the given recurrence relation is the
second degree equation:
r2= 6r – 9.
 r2- 6r + 9 = 0
 (r-3)2 = 0
 r =3 is a repeated or a double characteristic root.

Remark: since r =3 is a characteristic root repeated twice, we say that it is a root of


multiplicity 2.
Definition: A solution r is called a root of multiplicity m, m  2, if it is repeated m-times
as a root of the characteristic equation associated to the given recurrence relation.

2.7 ALOGORITHM FOR SOLVING LINEAR HOMOGENEOUS RELATION OF


ORDER k  1

Recall that the characteristic equation of the homogeneous kth order linear relation:
fn+ a1 fn-1+ a2 fn-2 + a3fn-3+ … + akfn-k = 0, n  k

50
is the kth degree polynomial equation:
rk+ a1rk-1+ a2rk-2a3rk-3 + … + ak-1r + ak = 0.
The solutions of this equation are called the characteristic roots of the recurrence relation.
Example: Find the characteristic equation for each of the following recurrence
relations.
(1) 4un+1 – 7un = 0.
(2) 4 un+1 – 7un + un-1= 0.
(3) 4un+1 + 6un-1= 0.
(4) yk + 2yk-1- 3yk-2- 6yk-4 =0
(5) sn = sn-1 + 4 sn-4.

Solution: Table 2.1 beneath gives the corresponding characteristic equation of each of
the difference equation above.
No. Recurrence Relation Characteristic equation
1 4un+1 - 7un = 0 4r – 7 = 0
2 4un+1 – 7un+ 6un-1 = 0 4r2 –7r + 6 = 0
3 4un+1 + 6un-1 = 0 4r2 + 6 = 0
4 yk +2yk-1 – 3yk-2 – 6yk-4 = 0 r + 2r3-3r2-6 =0
4

5 sn = sn-1 + 4 sn-4 r4 = r3 + 4

At this point of our discussion, we need to realize that the idea of characteristic equations
and roots can be used to solve linear homogenous relations with any given order. To this
end, one may follow the algorithm below as a guide.

Algorithm for Solving Homogenous Recurrence Relations


The essential steps for solving a linear homogeneous recurrence relation with
constant coefficients of any order are the following.
Suppose that the given kth order LHRRWCC is:
fn + a1 fn-1+ a2 fn-2+ a3 fn-3 + … akfn-k = 0, n  k.
Then:
Step1: Write the characteristic equation of the difference equation which is the k th degree
polynomial equation:
rk + a1rk-1 + a2rk-2 + a3rk-3 + … + ak-1r + ak = 0.
Step2: Solve the auxiliary equation found in step 1 and determine all the characteristic
roots of this equation.
Step3: Write the general solution of the difference equation based on any one of the
following two cases.
Case (i): If there are k distinct characteristic roots, say r1, r2, r3, … , rk to the
equation obtained in step 1, then the general solution is of the form:
fn = A1r1n + A2r2n + A3r3n + … Ak rkn.
Case (ii): If there is a root r of multiplicity m, 2  m  k, for the auxiliary equation
obtained in step 1, then the part of the general solution that involves the root r has
the form:
A0 rn + A1 nrn + A2 n2rn + ….+ Am-1 nm-1rn
= (A0+ A1 n+ A2 n2 + Am-1 nm-1) rn.
In addition to the repeated root r, if r1,r2, …., rk-m are the k-m remaining distinct roots,
then the general solution is:
fn = (A0 + A1 n + A2 n2 + … + Am-1 nm-1) rn+ c1r1n + … + ck-mrnk-m.
51
Step4: Use the boundary conditions to determine the constants A0, A1, --- , Am-1, … c1,
c2,… , ck-m in the general solutions found in step 3 (i) or 3 (ii).
Step5: Replace the specific values of the arbitrary constants obtained in step 4 and write
the unique solution.

Examples
1. Solve the recurrence relation
un+1 = 4un, n > 0 with the initial condition u0 = 5.
Solution:
 The characteristic equation of the recurrence relation is:
r =4 … since the auxiliary equation of a first order recurrence relation is a
linear (1st degree) equation.
 The characteristic root is then r = 4.
 The general solution, for some constant A, is: un = A(r )n = A(4)n.
 To determine the arbitrary constant A, use the initial condition u0 =5. That is, for
n =0, write: u0 = A(4)0 =5  A=5
 Replacing the specific number 5 for the arbitrary constant A, the unique solution
of the given recurrence relation will be:
Un = 5(4)n, n  0 ///

2. Solve the recurrence relation:


an= 2an-1+ an-2 – 2an-3 for n  3 with a0 = 0 and a1 = a2 =1.
Solution:

Step1: Writing characteristic equation.


Since an = 2an-1 + an-2 -2an-3 is a 3rd- order difference equation, its auxiliary equation is the
3rd – degree (or cubic) equation of the form:
r3 = 2r2+ r-2
 r3 – 2r2- r +2 = 0.

Step2: Determine characteristic roots.


One of the factors of the characteristic equation is (r-1) by inspection. Thus, the
application of ordinary division gives:
(r-1) ( r2-r-2) = 0
 (r-1) (r+1) (r-2) = 0
 r1= 1, r2= -1 and r3 = 2 are the characteristic roots. So, the basic solutions are:
r1 = (1)n, r2n= (-1)n and r3n = 2n.
n

Step3: Write a general solution.


The linear combinations of the basic solutions yield the general solution:
an= c1(1)n+ c2 (-1)n+ c3 (2)n
 an = c1 + c2 (-1)n+ c3 (2)n.

Step4: Use the initial conditions to determine constants in the general solution.
Now, substituting the initial conditions a0= 0 and a1= a2= 1 in the general solution result
in the system of equations:

c1 + c2+ c3 = 0

52
c1 – c2 + 2c3 = 1
c1 + c2 + 4c3 = 1.

Upon solving this system, we get:


1 1
c1 = 0, c2 =  and c3  .
3 3

Step5: Write the unique solution.


Thus, the unique solution of the given recurrence relation is:
1
 
an = (1)n 1  2 n , n  0 ///
3

Note: The roots of a characteristic equation associated to a recurrence relation could be


complex numbers. Even then, our methods are still valid, but the way the solutions of the
recurrence relations are written is different. Since an understanding of these
representations requires some background in complex numbers, we suggest that an
interested reader refer to a more advanced treatment of recurrence relations.

3. Solve recurrence relation


yn= 6yn-1- 9yn-2, n>1, with its initial conditions y0= 5 and y1= 3.
Solution:

Step1: Writing characteristic equation.


The auxiliary equation of the given recurrence relation is the second degree equation:
r2= 6r – 9.
 r2- 6r + 9 = 0

Step2: Determine characteristic roots.


(r-3)2 = 0
 r =3 is a repeated or a double characteristic root.
Step3: Write a general solution.
Thus, by case (ii) of step3, the general solution of the recurrence relation at hand is:
yn= c (3)n + dn (3)n.

Step4: Use the initial conditions to determine constants in the general solution.
Now, using the initial conditions, we get
y0 = c(3)0+ d(0) (3)0 = 5
y1 = c(3)1+ d(1) (3)1 = 3
 c=5  c=5
3c +3d = 3 d= -4.

Step5: Write the unique solution.


Thus, the explicit function of n that solves the given relation is:
yn = 5(3)n - 4n (3)n = (5-4n) (3)n for n  0 ///

Exercise 2.3
(1)Write the characteristic equations and find the characteristic roots for each of the

53
following recurrence relations.
(a) an = an-1 (b) an+1 - 2an = 0 (c) fn+2 + 3fn+1+ 2fn= 0
(d) yn+2 + 4yn+1+ 4yn =0 (e) fn+2 –7fn+ 12fn-2 = 0
(f) gn+2 – 8gn+1 + 16gn = 0.
(2) Solve the following recurrence relations.
(a) an =5an-1 +6an-2, n  2 with a0 =1, a1= 3.
(b) 2an+2 –11an+1+ 5an = 0, n  0 with a0= 2, a1= -8.
(c) 3an+1= 2an+ an-1, n  1, a0 =7, a1 = 3
(d) an – 6an-1+ 9an-2 = 0, n  2, a0 =5, a1 =12.
(e) an = 7an-1- 10an-2, n  2, a0 =3, a1= 15.
(f) 9an+2 + 12an+1+ 4an = 0, n  0, a0 =1, a1 = 4
(g) an = 3an-2+ 2an-3, n  3, a0= 1, a1= 3, a2=7.
(3) If a0 = 0, a1= 1, a2= 4 and a3 = 37 satisfy the recurrence relation: an+2+ ban+1 + can = 0,
n  0 , where b and c are constants, then
(a) find the constants b and c.
(b) solve the recurrence relation.
(4) Solve the recurrence relation: a2n+2 – 5a2n+1 + 4a2n = 0, n  0, a0 = 4, a1= 13.
(5) If an = c1+ c2(7)n for n  0 is the general solution of the recurrence relation:
an+2 + ban+1+ can = 0, n  0, then determine the constants b and c.
(6) Find a recurrence relation whose solution is:
(a) yn = A (3)n + B (-2)n for some constants A and B.
(b) fn = 3(5)n
(c) an = (A+Bn) (4)n for some constants A and B.
(7) If the recurrence relation: an+ c1an-1+ c2an-2 = 0 is satisfied by a0= 0, a1=1, a2= 4 and
a3= 12, then solve for an.
(8) (a) Find a quadratic polynomial equation in r whose characteristic roots are -1and 5.
(b) Find a linear homogenous recurrence relation with constant coefficients whose
characteristic polynomial is the equation obtained in part (a).
(9) Find the general solution of the following recurrence relations.
(a) fn- 3fn-1- 10fn-2 =0 (b) fn+2 + 6fn+1 + 9fn = 0.
(c) 2fn + 2fn-1 – fn-2 = 0. (d) fn+2 –3fn-1 - 4fn-2 = 0.
(10) For n  0, let an count the number of ways a sequence of 1’S and 2’S will sum to n.
For example, a3= 3 since
(a) 1+1+1 (b) 1+2 (c) 2+1 sum to 3.
(1) Find a recurrence relation for an.
(2) Solve this recurrence relation.
(11) Solve the following recurrence relations.
(a) an + an-1 = 0, n  1, a0 = 4
(b) an = 3an-1 , n  1, a0 = 1.
(c) 2an+3 = an+2 + 2an+1 – an, n  0, a0 = 0, a1= 1 and a2= 2.
(d) an+ 6an-1+ 12an-2+ 8an-3 = 0, n 3, a0 =0, a1 =1and a2 =2.
(e) an+3 = an+2 + 8an+1- 12an, n  0, a0 = 3, a1= -3 and a2= 26.
(f) fn =fn-2 –6fn-3, n 4 , f0 = 1, f1 = -2 and f2 =4 and f3 =-8.
(g) an =3an-1- 3an-2 + an-3, n 3 a0 = a1 =1 and a2 =2.
(h) an = 6an-1 + an-2 – 30an-3, n  3 with initial conditions (a0, a1, a2) = (-1,0,1).
(12) (a) Find a cubic polynomial equation whose roots are 5, -1 and 3.
(b) find a linear homogeneous recurrence relation with constant coefficients whose
54
characteristic equation is the cubic equation found in part(a).
(c) Find the initial conditions that can accompany the recurrence relation
of part (b) if its solution is:
(a) an = 5n (b) an = 5n + (-1)n (c) an = 5n+ 2 (-1)n –3n.
(13) If each of the discrete functions fn, gn and hn are solutions of rth-order linear
homogenous recurrence relation with constant coefficients:
an = k1an-1 + k2 an-2 + k3an-3+ … + kran-r
then prove that the function:
sn = cfn + dgn + ehn
for any constants c, d, and e is also a solution of this recurrence relation.
(14) (a) Which of the following equations have multiple roots?
In case there is a multiple root, find its multiplicity.
(i) x2-1 = 0 (ii) x2 + 2x + 1 = 0 (iii) x2 +x- 12 = 0
(iv) x2 –6x+9 =0 (v) x4 – 2x2+ 1 = 0 (vi) x4+2x3–3x2-4x+4 = 0
3 2 3 2
(vii) x = x + 8x-12. (viii) x + 6x +12x+8= 0
(b) Write a linear homogeneous recurrence relation with constant coefficients whose
corresponding characteristic equation is each equation in part (a).

2.8 LINER NONHOMOGENEOUS RECURRENCE RELATIONS

A recurrence relation of the form:


c0an +c1an-1 + c2an-2+ … + ck an-k = f(n), n  k.
Where c0, c1, c2, … , ck are constants with c0, ck  0 and f(n)  0 for some n  W is called
a kth -order linear nonhomogeneous recurrence relation with constant coefficients
(LNRRWCC of order k).

METHODS OF SOLVING NONHOMOGENEOUS RELATIONS

(1) The Substitution or Intervention Method.

The method of intervention or substitution in solving linear nonhomogeneous


recurrence relation uses the difference equation on the term an to write the base value.
Then the expression of the base value is repeatedly substituted in the recurrence relation
to find the values of the sequence at larger and larger integers successively until an
explicit formula for an in terms of n W is obtained. The explicit sequence of n found in
this manner such that it describes the term an will then be regarded as a solution of the
nonhomogeneous recurrence relation at hand. Some textbooks call this technique as an
Iteration method of solving recurrence relations. We now illustrate the method by the
help of the following examples.

Examples

1. Use the substitution method to formulate the solution of the general recurrence
relation:
an = an-1 + f(n)
Where f(n) is a non-zero function of n.

Solution
55
Successively substitute the base value in the given recurrence relation. In most cases the
substitution begins at a1. Thus:
an = an-1+ f(n)
 a1 = a0 + f(1)
a2 = a1 + f(2) = a0 + f(1) +f(2)
a3 = a2 + f(3) = a0 + f(1) + f(2) + f(3).
a4= a3 + f(4) = a0 + f(1)+f(2) +f(3) + f(4)
--------------------------------------------------------
--------------------------------------------------------
an-1= an-2+ f(n-1) = a0 +f(1) + f(2) + f(3) +f(4)+ … + f(n-2)
an = an-1 + f(n) = a0 + f(1) + f(2) + f(3) + f(4) + … + f(n-1) + f(n).

In Summation Notation:
n
an = a0   f(i).
i 1
This result may be stated as follows.
Theorem (1)
The solution of a nonhomogeneous recurrence relation of the form:
an = an-1+ f(n) , with f(n)  0 for some n W.
is given by:
n
an = a0   f (i).
i 1
2. Solve the recurrence relation:
an- an-1 = 3n2, for n 1 with an initial condition a0 = 7.

Solution
Repeated substitution may solve the relation at hand as follows.
an – an-1= 3n2  an = an-1+ 3n2, from which we get:
a1 = a0 + 3 (1)2
a2 = a1+3(2)2 = a0 + 3 (1)2 + 3 (2)2
a3 = a2 + 3 (3)2 = a0 + 3(1)2 + 3 (2)2+ 3(3)2.
------------------------------------------------------------------
------------------------------------------------------------------
an = an-1 + 3(n)2 = a0 +3(1)2 + 3 (2)2 + 3 (3)2 + … + 3 (n)2
= a0 + 3 (12+ 22+ 32+ … + n2)
n
2
= a0 + 3 i .
i 1
Thus, from some of our earlier work, if we can find a summation formula for the sum:
n
2
i
i 1
, then the relation is solved. But from the study of sums of terms of sequences; the

sum of the squares of the first n natural numbers is given by


n
n(n  1)(2n  1)
 i2  .
i 1 6
Thus;

56
n
2
an = a0+ 3 i
i 1

 n(n  1)(2n  1) 
 an = 7+3   … since a0 = 7
 6 
n(n  1)(2n  1)
 an = 7 + .
2
Consequently, the unique solution of the given linear nonhomogeneous recurrence
relation is:
1
an = 7 + (n)(n  1)(2n  1), n  0 ///.
2

Note: We could have applied Theorem (1) to arrive at the same result.
Theorem 2
The solution of a nonhomogeneous recurrence relation of the form:
an = Ban-1 + c,
where B and c are constants is given by either of the formula:

n c ( B n  1)
a0B + if B  1.
B 1
an =
a0 + nc if B =1.

Proof: - One can follow a procedure similar to the proof outlined regarding Theorem (1)
above.

3. Solve the relation: an – an-1 = 4, n 1 with an initial condition a5 = 21.


Solution: We can apply iteration to find the unique solution, an.. That is;
an – an-1 = 4
 an = an-1 +4
Thus;
a1 = a0 + 4
a2 = a1 +4 = a0 + 4+4 = a0 + 2(4)
a3 = a2 + 4 = a0 + 2(4) + 4 = a0 + 3(4)
a4 = a3 + 4 = a0 + 3(4) +4 =a0 + 4(4).
---------------------------------------------
---------------------------------------------
an-1 = an-2+ 4 = a0 + (n-2) (4) +4 = a0 + (n-1) (4)
an = an-1 + 4 = a0+ (n-1) (4) +4 = a0 + 4n
 an = a0 +4n
Since the initial condition given is a5 = 21, we then have
a5 = a0 + 4 (5)
 a0 + 20 = 21
 a0 = 1.
Now, putting a0 = 1 in the relation: an = a0 + 4n, we obtain
an = 1+4n = 4n+1, n  0 ///

57
as a unique solution.
Note: We can apply THEOREM (2) directly to get the solution of the given recurrence
relation. That is;
an – an-1 = 4  an = an-1 + 4, from which we see that c= 4 and B = 1. Thus, the
solution of the RR takes the form:
an = a0 + nc
Since a0 = 1, by what we have done above, then the unique solution is:
an = 1+4n = 4n+1, n  0 ///

4. Find an explicit function of n that solves the relation:


an = 2an-1 + 1, n  1 with a1 = 5
Solution: Since B= 2  1 and c= 1 are constants, then the solution of the relation:
an =2an-1+ 1 is of the form:
c (Bn - 1)
an  a 0 B n  ….. by Theorem (2).
B -1
1(2n  1)
 an  a 0 (2) n 
2 1
n n
 an = a0 (2) + 2 –1 … (*)
From: an = 2an-1 + 1, it follows that:
a1 = 2a0 + 1  2a0+ 1= 5  a0 = 2.
Thus, substituting a0 = 2 in (*), we get:
an = 2(2)n + 2n –1
 an = 3(2)n –1.
Consequently, the unique solution of the given Nonhomogeneous linear recurrence
relation is:
an = 3(2)n-1, n  1 ///

58
Exercise 2.4
1. Solve each of the following recurrence relations.
(a) an – an-1 = 2n+3, n  1 and a0 = 1
(b) an+1 – an = 3n2 – n, n  0 and a0 = 3
(c) an – 2an-1 = 5, n  1, and a0 = 1
(d) an+1 – 2an = 2n, n  0, and a0 = 1.
(e) an = an-1 + 2n, n  1, and a0 = 2.
2. On the first day of a European new year Ato Abdo deposits $ 1000 in an account
that pays 6% annual interest compounded monthly. At the beginning of each month he
adds $ 200 to his account. If he continues to do this for the next four years (so that he
makes 47 additional deposits of $ 200), then:
(a) define the amount in his account at the beginning of each month n, recursively.
(b) Solve the recurrence relation and the initial conditions obtained in part (a).
(c) How much will his account worth exactly four years after he opened it?

(2) The Method of Undetermined Coefficients

The intervention or substitution method of solving a linear nonhomogeneous recurrence


relation with constant coefficients yields a solution of the form:
n
an  a0   f (i )
i 1

for the relation: an = an-1 + f(n), n  1. This method will be successful if, from our past
experiences, we can find a summation formula for:
n

 f (i).
i 1

When a formula for the summation is not known, a technique called the Method
of Undetermined Coefficients will handle the problem of solving linear
nonhomogeneous relations.
The method of undetermined coefficients is a method that relies upon the
associated homogeneous relation obtained when f(n) is replaced by 0. This method,
therefore, considers a general or a total solution to the nonhomogeneous relation to be the
sum of two parts; which we shall call the homogeneous solution and the particular
solution.
To have a better insight to this method, consider the kth- order nonhomogeneous relation:
c0an+ c1an-1+ c2an-2+ … + ckan-k = f(n)
which is equivalent to:
c0an+ c1an-1+ … + ck an-k= 0 + f(n).
Thus, the relation can be separated into two parts, namely;
Homogeneous Part: c0an + c1an-1+ c2an-2 + … + ckan-k =0 and
Nonhomogeneous Part: c0an + c1an-1+ c2 an-2 + … + ck an-k = f(n).
The method of undetermined coefficients, then, solves the homogeneous and the
nonhomogeneous parts separately. If the homogeneous solution (the solution of
homogeneous part) and the particular solution (the solution of the nonhomogeneous part)

59
are denoted by an(h) and an(p) , respectively, then the general or total solution a n is the sum
of these two solutions:
an = an(h) + an(p).

Definitions

(1) A homogeneous solution denoted by an(h) is the solution that satisfies the linear
nonhomogeneous recurrence relation when the function f(n) is replaced by 0.
(2) The solution denoted by an(p) that solves the recurrence relation containing the
function f(n), i.e. , the nonhomogeneous part is called a particular solution.
(3) The solution: an = an(h) + an(p) , which is the sum of the homogeneous solution and the
particular solution, is called the general solution or the total solution of the linear
nonhomogeneous recurrence relation with constant coefficients.

It is self evident that we need to find a homogeneous solution an(h) and a particular
solution an(p) to arrive at a total or a complete solution of any nonhomogeneous relation.
To this effect, note that
(1) The homogeneous solution an(h) is obtained by the application of the standard
methods of solving linear homogeneous recurrence relations with constant
coefficients discussed in the preceding units of this chapter.
(2) As said earlier, there is no general technique for determining the particular
solution an(p) that fits a given difference equation. However, when the function
f(n) has a certain form, we can inductively suggest its form (i.e., the form
of an(p) ), in line with the nature of f(n).
Table 2.2. beneath may be used as a guide-table in choosing a suitable particular
solution an(p).

GUIDE-TABLE

No. Nature of the function f (n) Choice of the particular solution: an(p)

1 f(n) = c is a constant function an(p) = A is also a constant

2 f(n) = nk or an(p) = A0+ A1 n +A2n2+ … + Ak nk is also


f(n)= b0+b1 n+b2 n2+ … + bknk a polynomial of degree k in n
is a polynomial function of degree
k in n

3 f(n) = rn is an exponential Arn, if r is not a characteristic


function, where r  R+ root of the homogeneous case.
an(p) =
Anmrn,, if r is a characteristic root
of multiplicity m  1 for
the homogeneous case

60
4 f(n) = nkrn or rn(A0+A1 n+ … Ak nk), if r is not
f(n) = (b0+ b1 n+b2 n2+ … + bknk) rn a characteristic root of the HRR.
is a product of any polynomial and an(p) =
exponential functions. nmrn (A0+ A1 n+ … + Ak nk) , if r is
a characteristic root of the HRR
with multiplicity m 1

Table 2.2
Remark:
The letters A, A0, A1, … , Ak-1, Ak denote constants called undetermined
coefficients. They will determined by substituting the particular solution a n(p) into the
given LNHRRWCC, Furthermore, note that r, k and m are also constants.
We shall now illustrate the method of undetermined coefficients using the
examples below.

Examples

1. Solve the recurrence relation:


an- 7 an-1 + 12 an-2 = 1, n  2
with boundary conditions: a0 = 0 and a1 = 1.
Solution:
(1) Homogeneous Solution
The associated homogeneous relation is:
an – 7an-1+ 12an-2 = 0
and its characteristic equation is:
r2 –7r+12 = 0
 (r-3) (r-4) =0
 r1 = 3 and r2 = 4 are the characteristic roots.

Thus, the homogeneous solution is : an(h) = c1(3)n + c2 (4)n

61
(2) Particular solution
Since f(n) = 1 is a constant function, the particular solution is of the same form (see guide
table 2.2).
an(p) = A, a constant to be determined (undetermined coefficient).
Substituting this suggested solution in the given nonhomogeneous relation:
an- 7an-1+ 12an-2 = 1,
We get:
A - 7A + 12A = 1
 6A = 1
1
 A=
6
( p) 1
So, the particular solution is: an 
6
(3) Total solution
Since the total solution is the sum of the homogeneous and the particular solutions:
an = an(h) + an(p),
then the required general (total) solution will be:

1
an = c1(3)n + c2(4)n + .
6

(4) Unique Solution


We finally solve for the arbitrary constants c1 and c2 in the total solution to obtain the
solution unique to the given recurrence relation. To this end, we use the initial conditions
for the cases n= 0 and n=1. That is:
1
(n =0), a0 = c1 (3)0 + c2 (4)0 + = 0
6
1
(n = 1), a1 = c1 (3)1 + c2 (4)1 + = 1
6
1
c1+ c2 = -
6

5
3c1 + 4c2 = .
6
Upon solving this system of two equations, we get the values:
3 4
c1 = - and c2  .
2 3
Thus, the required unique solution of the given RR is:
3 4 1
an = - (3) n  (4) n  or
2 3 6
1 1 1
an = - (3) n 1  (4)n 1  , n  o //
2 3 6

62
2. (The Towers of Hanoi)

Consider n circular disks with holes in their centers. These disks can be stacked on any of
the pegs (1,2, and 3) shown in Fig 2.1. To start with, the disks are stacked on peg 1 with
no disk resting upon a smaller one.

1 2 3

Figure 2.1

The objective is to transfer all the disks from peg 1 so that we end up with the original
stack on peg 3. To this end, we follow the rules beneath strictly.
(1) Move one disk at a time
(2) Never place a disk upon a smaller disk
(3) Never place a disk outside a peg.
(4) Peg 2 (and possibly peg 3) may be used as a temporary location for any disk
while transferring disks.
Now, find the minimum number of moves needed to transfer n disks from peg 1 to peg 3
so that we end up with a stack (on this peg) identical to the original one.

Solution:
For n  0, let an be the minimum number of moves needed to transfer n disks
from peg 1 to peg 3 in the manner described. To transfer these n disks on peg 1, we do
the following:
(a) Transfer the top (n-1) disks from peg 1 to peg 2, using peg 3 as a temporary
location. This takes an-1 steps or moves.
(b) Transfer the largest disk from peg 1 to peg 3. This takes one move.
(c) Finally, using peg 1 as a temporary location, transfer the (n-1) disks on peg 2
onto the largest disk now on peg 3. This requires another an-1 moves.
The minimum number of moves required to perform these three steps (a), (b) and (c) are
manifested for n= 1,2,3,4 disks in TABLE 2.3 beneath.

63
Peg 1
Minimum Number of Moves Required
Number From Peg 1 Largest disk From peg 2 Total Number
to from to of moves
of disks Peg 2 Peg 1 to peg 3 Peg 3 an

n
1 - 1 - 1
2 1 1 1 3
3 3 1 3 7
4 7 1 7 15

TABLE 2.3

From table 2.3 and the three steps (a), (b) and (c) describing the procedures followed
in transferring the n disks, we clearly see that there are:
an-1 + 1+ an –1 = 2an-1+ 1 moves. Consequently:
an = 2an-1 + 1, n  1; with a1 = 1 ….[1]
as an initial condition.
To find the minimum number of moves required to transfer n disks from peg 1 to
peg 3 in line with the four rules, i.e., to answer the problem on the Towers of Hanoi, we
need to solve the nonhomogeneous relation [1]. To this end:
(1) Homogeneous solution
The associated homogeneous relation is: an = 2an-1 with a characteristic equation:
r = 2. Based on this characteristic root r = 2, we write the general form of the
homogeneous solution as:

an(h) = c (2)n

(2) Particular Solution


Since f(n) = 1 is a constant function, the general form of the particular solution
assumes the same form. That is:
an(p) = A, where A is a constant to be determined.
Thus, the recurrence relation.
an = 2an-1 + 1  an(p) = 2 an-1(p) + 1
 A = 2A +1
 A = -1.
 an(p) = -1

(3) Total solution


As the total solution is the sum: an = an(h) + an(p),
We have:

64
an = c(2)n –1
We determine the arbitrary constant c by using the initial condition
a1 = 1 in the total solution. So,
a1 = c(2)1- 1 = 1  2 c-1 = 1  c =1.
Thus the required unique solution is:
an = 2n –1, n  1. ///

Exercise: Find the minimum number of moves required to transfer n disks (in the manner
described in the problem of the Towers of Hanoi) where n is;
(a)3 (b) 4 (c) 6 (d)10.

3. Solve the relation;


an- 3an-1 = n, n  1 and a0 = 1

Solution:

(1) Homogenous solution


The associated homogenous recurrence relation is:
an – 3an-1 = 0
Thus, the characteristic equation is: r-3 = 0 which gives r = 3 as a characteristic root. So,
the homogeneous solution of the recurrence relation is:

an(h) =c (3)n

(2) Particular solution


Since f(n) = n is a polynomial function of degree one in n, the particular solution
is also a polynomial of degree one in n such that:
an(p)= A1n + A0

Substituting this solution in the given recurrence relation, we get:


(A1n + A0) –3 [A1(n-1) + A0] = n
 (-2A1) n+ (3A1- 2A0) = n

-2A1 = 1

3A1 – 2A0 = 0
1 3
 A1 = - and A0 = - .
2 4
Therefore, the particular solution is an(p) = - 1 n - 3
2 4

65
(3) Total Solution
Since the total solution an is the sum of the homogeneous and particular solutions, it
follows that
an = c(3)n - 1 n - 3 .
2 4
To evaluate the arbitrary constant c, we substitute the initial condition a0 = 1 in the total
solution. Thus
a0 = c(3)0 - 1 (0) - 3 = 1
2 4
3
 c- =1
4
7
 c= .
4
 Finally, the solution unique to the nonhomogeneous relation is:
7
an = (3)n - 1 n - 3 , n  0 ///.
4 2 4

4. Find the particular solution of the recurrence relation:


an + 5an-1 + 6an-2 = 3n2.
Solution:
f(n) =3n2  an(p) = A2 n2 + A1n+ A0 by (2) of GUIDE TABLE 2.2.
Substituting the expression for an(p) in the RR:
an+ 5n-1 + 6an-2 = 3n2
 (A2n2 + A1 n + A0) + 5 [ A2(n-1)2 + A1(n-1) + A0] + 6 [A2(n-2)2 + A1(n-2) +A0] =
3n2.
Upon simplifying, we get:

(12A2) n2 + (12A1- 34A2) n+(29A2- 17A1 + 12A0) = 3n2.


Equating coefficients of terms with the same powers of n on the two sides yields:

1
12A2 = 3 A2 
4
17
12 A1 – 34A2 = 0 so that A1 =
24
115
29 A2 – 17A1 + 12 A0 = 0 A0 = .
288

Thus, the required particular solution is:


1 2 17 115
an(p) = n + n+ ///
4 24 288

5. Solve the recurrence relation


an –4an-1 = 5(4)n, n  1, a0 =2
Solution: The associated homogeneous recurrence relation is an – 4an-1 = 0. It’s
characteristic equation is: r-4 = 0. Therefore, r =4 is the characteristic root. So, the

an(h) = c(4)n.
66
homogeneous solution is :

Since f(n) = 5 (4)n is an exponential function and 4n is a homogeneous solution,


the particular solution will be: an(p)= An(4)n substituting this solution in the recurrence
relation, we get:
[An (4)n] – 4 [A(n-1)(4)n-1] = 5(4)n.
 An(4)n – 4An(4)n-1+ 4A(4)n-1 = 5(4)n
 An (4)n –An (4)n +A(4)n = 5(4)n
 A= 5.
Thus, the total solution is: an = c(4)n+ 5n(4)n. Using the initial condition a0 = 2 gives:
2 = c(4)0 + 5(0) (4)0  c=2
Hence, the complete (Unique) solution of the given recurrence relation is:
an = 2(4)n+ 5n (4)n, n  0 ///.

6. Find the particular solution of the recurrence relation


an+ an-1 = 3n(2)n.
Solution:
The function f(n) = 3n (2)n is a product of a polynomial and an exponential functions and,
the particular solution assumes the same form. That is:
an(p) =2n (A1 n+ A0)
…. Item (4), Guide- Table 2.2.

Substituting this in the given recurrence relation gives:


(A1n+ A0) (2)n+ [A1(n-1) +A0] (2)n-1 = 3n(2)n
 2A1n+ 2A0+ A1n – A1 + A0 = 6n
 (3A1)n + (3A0 – A1) = 6n
Comparing the two sides of this resulting equation, we obtain:
3A1 = 6 and 3A0- A1 = 0.
2
 A1 = 2 and A0 = .
3
Consequently, the particular solution is:
2
an(p) = (2n+ ) (2)n
3
1
= ( + n) (2)n+1 ///
3

7. Find an explicit sequence of n that solves the recurrence relation:


an – 6an-1 + 8 an-2 = n (4)n, n  2
with its initial conditions a0 = 8 and a1 =22.

Solution:
The associated homogenous relation is: an –6an-1+ 8an-2 = 0 and its characteristic equation
is: r2 – 6r +8 = 0. The characteristic roots, upon solving the auxiliary equation, are r1 = 2
and r2 = 4.
Thus, the general form of the homogeneous solution is:
an(h) = c1 (2)n + c2 (4)n.
Since 4 is a characteristic root for the homogeneous case, then by item (4) of Guide-Table
67
2.2, we try: an(p) = n(4)n (A1 n +A0) as the general form of the particular solution.

Substituting the assumed particular solution in the given NRR,


we get:
n(4)n (A1 n + A0)- 6 (n-1) (4)n-1 (A1(n-1) + A0)
+8 (n-2) (4)n-2 (A1(n-2)+ A0) = n(4)n
 16n (A1n + A0) –24 (n-1) (A1n- A1+ A0) +8 (n-2) (A1n-2A1+ A1) = 16 n
 n(16-24+8) (A1n +A0) + (24+24-16-16) A1n
+ (-24+32) A1 + (24-16)A0 = 16n
 (16A1) n +8A1+ 8A0 = 16n.
16A1 = 16 A1 = 1

8A1 + 8A0 A0 = -1
Thus, substituting A1 = 1 and A0 = -1 in the general form of the particular solution, we
obtain:
an(p) = (n2-n) (4)n.
Now, adding the homogeneous and the particular solution, we get the total solution:
an = c1(2)n + c2 (4)n + (n2- n) (4)n.
The substitution of the initial conditions a0 = 8 and a1 = 22 in the total solution yields the
system of equations:

c1+ c2 =8 c1 = 5
So that
2c1 + 4c2 = 22 C2 = 3.
Consequently, the explicit sequence of n that solves the give recurrence relation and its
initial conditions is:
an = 5(2)n +3(4)n + (n2 –n) (4)n, n  0
an = 5(2)n + (n2-n+3) (4)n, n  0 ///

8. Find the solution of the difference equation:


an = 3an-1 – 4n + 3(2)n, n  1 with a1 = 8.

Solution:

(1) Homogeneous solution


The associated homogeneous relation is: an = 3an-1 and its characteristic equation
is: r = 3. So, the characteristic root results in a homogeneous solution of the form:
(h)
= c(3)n
(2) Particular aSolution
n

Note: When f(n) comprises a sum of constant multiples of different types of functions of
n, with each summand form a nonhomogeneous relation. To each of these formed
relations, find a corresponding particular solution separately. Then add these particular
solutions to obtain a solution that stands for the given function f(n) as a whole. We follow
this note to solve for a particular solution that corresponds to f(n) = -4n+3(2)n
f(n) = -4n+3 (2)n is a sum of a polynomial and an exponential functions. So, we
form the relation.

68
an = 3an-1 – 4n
an = 3an-1 + 3(2)n
and treat them separately. Thus
(1) The general form of the particular solution of the relation:
an = 3an-1 – 4n ….(1)

is: an(p) = A1 n+ A0 as f(n) =-4n is a polynomial function of degree one in n.

Substituting this solution in (1), we get


A1 n + A0 = 3 [A1 (n-1) + A0] – 4n.
 A1n + A0 = 3A1 n- 3A1 + 3A0 –4n
 (-2A1)n + (3A1- 2A0) = -4n
 A1 = 2 and A0 = 3.

( p)
 an  2n+3 1

(2) The general form of the particular solution of the relation:


an = 3an-1+ 3(2)n … (2)
( p)
is an2 = A (2)n since f(n) = 3(2)n is an exponential function of n and 2 is not an auxiliary
root of the homogeneous case. Now, putting this solution into (2),
we have:
A(2)n = 3A(2)n-1+3(2)n … (2)
 2A = 3A +6
 -A= 6
 A= -6.

( p)
 an2  6 (2)n

Thus, t he complete particular solution is the sum:

( p) ( p)
an(p) = an1  an2 = 2n+3- 6(2)n.

(3) Total solution


As the total solution is the sum of the homogeneous and particular solutions, we have
an = an(h) + an(p)
an = c(3)n + 2n+3-6(2)n

We now solve for c using the initial condition a1 = 8.


That is:
a1 = c(3)1 + 2(1)+ 3- 6(2)1 =8
 3c + 5 – 12 = 8
 3c = 15
 c =5.

69
Consequently, the required unique (complete) solution of the given nonhomogeneous
recurrence relation is;
an = 5(3)n + 2n+ 3-6(2)n
 an = 5(3)n – 6 (2)n + 2n + 3, n  1 ///

Exercise 2.5
1. Find a recurrence relation which will be solved explicitly by each of the following
discrete functions (sequences); where A and B are constants.
(a) an = A(3)n+ B(4)n (b) an= (A+Bn) (-2)n (c) an = 2(3)n
n n n
(d) an = A(3) + B(5) (e) an = A(4) . (f) an = (A+Bn) (6)n
2. Solve the following sets of recurrence relations and initial conditions.
(a) fn – 2fn-1 = 6n, n  1; f1 =2.
(b) fn = 3fn-1 –2fn-2 + 2; n  2 with (a0, a1) = (1, 1).
1
(c) fn+2 + 2fn+1 – 15 fn = 6n +10, n  0 ; f0= 1 and f1 = - .
2
(d) fn = 3fn-1+ n2-3, n  1; f0 =1.
(e) fn+1+ 2fn = 3+4n , n  0 ; f0 = 2.
(f) fn – 3fn-1 + 2fn-2 = n2, n  2; f0= 0 and f1 =0.
(g) fn – 4fn-1 + 4fn-2 = 3n+2n, n  2 ; (f0, f1) = (1,1).
(h) fn+2 + 3fn+1 +2fn =3n, n  0; (f0, f1) = (0,1).
(i) fn+2 + 4fn+1 + 4fn = 7, n  0; (f0, f1) = (1,2).
(j) fn –5fn-1 = 5n, n  1; f0 =3.
(k) fn+2 + 4fn+1+ 4fn = n2, n  0 ; (f0, f1) = (0,2).
3. The solution of the recurrence relation:
c0an+ c1an-1 + c2an-2 =6
is: an = 3n+ 4n+2; for n  0. Determine the constants c0 , c1 and c2 in the relation.
4. Solve the recurrence relation: an+2 – 6an+1 + 9an = 3(2)n + 7 (3)n, n  0
with a0 = 1 and a1 =4.
5. Find the total solution of the recurrence relation
an+3 – 3an+2 + 3an+1 – an = 3+5n, n 0.
6. Yana borrows $ 2500, at 12% annual interest compounded monthly, to buy a
computer. If the loan is to be paid back over two years, what is his monthly payment?
7. The total solution of the recurrence relation:
an+2 + b1an+1+ b2 an = b3 n + b4 , n 0.
Where b1, b2, b3 and b4 are constants is: an= c1(2)n+ c2(3)n + n-7.
Find bi, 1  i  4.
8. (Problem on Analysis of Algorithms)
For n  1, let S be a set containing 2n real numbers. How many comparisons must be
made between pairs of numbers in S in order to determine the maximum and
minimum elements of S?

9. Environmental records show that for a certain lake the population of a specific species
of snail increases at a rate three times that of the prior year. Starting with 3000 such
snails, and finding 3500 of them in the following year, we remove 200 of them from

70
this lake to increase their numbers in other lakes. Continuing to remove 200 of the
snails at the end of each year, if an represents the snail population in the original lake
after n years, find and solve a recurrence relation for an, n  0.
10. Solve the following recurrence relations.
(a) a2n+2 – 5a2n+1 + 6a2n = 7n ; n  0 and a0 = a1 = 1.
(b) an 2 – 2an-1 = 0, n  1, and a0 =2 (Hint let bn = log 2 an for n 0.)

71
PART II: Graph Theory

Chapter 3

Elements of graph Theory

3.0 Introduction

Graph theory is a branch of mathematics that deals with arrangements of certain objects
and relation ships between these objects. Graph theory is broadly classified into two:
nondirected graphs and directed graphs (digraphs). The next chapter, chapter 4,
exhaustively deals with digraphs. In chapter 3 and 4, we will discuss a number of
important cases of nondirected and directed graphs, as well as a few important properties
that may be possessed by graphs, such as planarity and colorability.

3.1 Basic Definitions and examples

Definition: A graph G s a pair of sets (V,E) consisting of two things


i) A set V= V(G) whose elements are called vertices, Points or node of G
ii) A set E= E(G) called edge list of G
 V is called a vertex set and E is called an edge list.
 Vertices u and v are said to be adjacent if there is an edge e= {u,v}between them.
In such a case u and v are called the end points of e.
 The edge e is said to be incident on each of its end points u and v.
If G is a finite:
 V (G ) denotes the number of vertices in G.
 E (G ) denotes the number of edges in G.
Note: An edge should not pass through more than two vertices.

Graphs are pictured by diagrams in a natural way, specifically, each vertex v in V


is represented by a dot (small circle), and edge e = {v1, v2} is represented by a curve
which connects its end points v1 and v2.
Example 1: consider the graph G given below.

A D G is a graph with G= (V,E) where


e4 i. V = {A,B,C,D}
e1 e5 e3 ii. E= {e1,e2,e3,e4,e5} with
G: e1 = {A,B}, e2 = {B,C}, e3= {C,D}, e4= {A,C}
and e5= {B,D}
B e2 C

Definition: Two or more edges joining the same pair of vertices are called multiple
(parallel) edges. An edge joining a vertex to itself is called a Loop.
Depending on loops (self loops) and parallel edges we state the following types of
graphs.
72
Simple graph: A graph with no loops and parallel edges is called simple graph.
Multigraph: A graph which consists of parallel (multiple edges) is called a multigraph.
Pseudo graph: A graph which consists of loops and parallel edges is called pseudo
graph.

Example 2: State the nature of following graph G'.

A e1 D e6  G' is a graph with set of pairs


(V,E) where
G': e2 e3 i. V= {A,B,C,D} is a vertex set
ii. E= {e1,e2,e3,e4,e5,e6}is an
B e4 C edge list
e5 - e6 is a loop where as e4and e5 are
multiple edges
- The graph is not a multigraph but it is a
pseudo graph
Graphs have proven to be an extremely useful tool for analyzing situations involving a set
of elements in which various pairs of elements are related by some property. The
following are some examples dealing with real life situations.

Examples

1. Electrical network
Transistors: - vertices
Wire: - edges.

2. Telephone communication
Telephones and switching center:-vertices
Telephone lines: -edges

3. Computer flow chart


Instructions:-vertices
Logical flow:-edge

4. Organization chart
People:-vertices
Link between the people:- edge

Degree of a vertex: The degree of a vertex V in a graph G is equal to:


1. The number of edges in G which contain V if it has no loops.
2. The number of edges in G which contain V plus twice the number of loop(s) if it
has loop(s).

Note: For a graph with loops, each loop contributes 2 to the degree of the corresponding
vertex.

73
Example1: Determine the degree of each vertex of the graph given below.

v1 v2 Solution:
deg (v1)= 2
deg (v2)= 3
v3 v4 deg (v3)= 2
deg (v4)= 3

Definition: - i) A vertex is said to be even if its degree is even number and odd if its
degree is odd number.
ii) A vertex of degree zero is called isolated vertex.
iii) A vertex of degree one is called pendant vertex.

Example 2: Consider the following graph G.

V1
V2
G:

V3 .V4
G = (V, E), where i) V= v1, v 2, v3 , v 4 
ii) E = v1, v 2 , v 2, v 3 
deg (v1) = 1 = deg (v3), deg (v2)=2, deg (v4) = 0
V2 and V4 are even vertices
V1 and V3 are odd vertices
Moreover,
- V3 and V4 are not adjacent
- V2 and V3 are adjacent

Minimum and maximum degree

Let G be a graph. The minimum and maximum degrees of G are denoted by  (G) and
(G ) respectively and given by:
 (G)= min deg(v ); v  V (G )& (G ) = max deg v; v  V (G )
Example: Find the minimum and maximum degree of G given below.

v1 v2

G:

v3 v4
Solution:  (G) =2, i.e., deg(v1)
(G ) = 4, i.e., deg(v2)
3.2 The hand shaking lemma
74
In any graph:
 Each edge has two ends and thus contributes 2 to the sum of
vertices degrees.
 In a group of people shaking hands in a party, exactly two hands
are involved in each hand shakes
Theorem: In any graph, the sum of all the vertex degrees is equal to twice the number of
n
edges. That is,  deg(v )  2 E
i 1
i where E is an edge list.

Proof: Let G = (V, E) is a graph with n-vertices.


Each edge v i , v j in a graph G contributes a count of 1 to each of deg (vi) and deg(vj).
n
Consequently 2 to the sum  deg(v ).
i 1
i

n
Then, if E represents the number of edges in G, 2 E accounts for the sum  deg(vi).
i 1
n
Therefore,  deg(v )  2 E
i 1
i

Example 1: If a graph G has 10 edges with 2 vertices of degree 4 each and all others are
of degree 3 each, and then find the number of vertices V (G ) .
Solution: E =10 and 2 vertices have degree 4. Let the other vertices which are of degree
3 each be k in number.
n

 deg(vi)  2 E , n = 2 + k
i 1
2(4)+k(3)=2(10)
8+3k=20  3k=12  k = 4
Therefore, n = 2+k = 2+4 = 6

Consequences of the hand shaking lemma


1. In any graph the sum of all the vertex-degrees is an even number.
2. In any graph the number of vertices of odd degrees is even
Corollary 1: If k =  (G ) is the minimum degree of all the vertices degree of a non
n
directed graph G, then k. V   deg(vi)  2 E .
i 1
Example2:
a. Is there a graph with degree sequence (1,2,3,4,5)?
Solution: By the second consequence of the hand shaking lemma, such a graph
cannot exist since the number of odd vertices is not even. Or 1+2+3+4+5=15 which is
not even. Therefore such a graph cannot exist.
b. Is there a simple graph with degree sequence (1,1,3,3,3,4,6,7)?
Solution: assume there is such a graph. Then the vertex of degree 7 is adjacent to all
other vertices. In particular, it must be adjacent to both vertices of degree 1.
 The vertex V of degree 6 cannot be adjacent to either of the two vertices of degree
1.
But this leaves only six vertices (including it self) to which the vertex V is adjacent.
75
Since the graph is simple, a loop cannot exist at V.
 There can be only 5 vertices adjacent to V.
Then V cannot have degree 6. This contradiction shows that there is no simple graph
with the given degree sequence.

Corollary 2: If t = (G ) is the maximum degree of all the vertices degrees of a non
directed graph G, then 2 E  t. V .

3.3 Matrix representation of Graphs

The essential features of a graph are:


i. The adjacency relationships between vertices and
ii. The incidence relationships between vertices and edges
Thus graphs can be represented by any one of the following types of matrices.
a) Adjacency matrix
- a matrix that describes the adjacency relationships between vertices of
a graph.
b) Incidence Matrix
- A matrix that describes the incidence relationships between vertices
and edges of a graph.

Adjacency Matrix

Definition: Suppose G is a graph with m vertices and suppose the vertices have been
ordered, say v1,v2,- - - ,vm. Then the adjacency matrix A= [aii] of the graph G is the
m  n matrix defined by:
aij = n, if there are n edges joining vi and vj
0, other wise.

Examples
1. Draw the adjacency matrix for:
V2 V3
V1

G:

V4 V5

Solution: Let the vertex set be ordered and labeled as V = {v1, v2, v3, v4, v5}
Then the adjacency matrix A is:

76
v1 v2 v3 v4 v5
v1 0 1 0 1 0
v2 1 0 1 0 1
A=
v3 0 1 0 0 0
v4 1 0 0 0 1
v5 0 1 0 1 0

Note: Adjacency matrix of undirected graph is symmetric.

2. Draw the adjacency matrix for:

e1
v1 v2
e2
e3

v3 v4
e4

Solution: Let the vertex set be ordered and labeled as V = {v1,v2, v3, v4}
Then the adjacency matrix A is:
v1 v 2 v3 v 4
v1 0 2 0 0
A= v 2 2 0 1 0
v3 0 1 0 1
v4 0 0 1 0

3. Write out the adjacency matrix A(G) of the following graph.


v1

v2
v4.

v3

Solution: Let the vertex set be ordered and labeled as V = {v1,v2, v3, v4}
Then the adjacency matrix A is:

77
v1 v2 v3 v4
v1 0 1 1 0
A= v2 1 0 1 0
v3 1 1 1 0
v4 0 0 0 0

Note:-
a. If the entries in a vertex are all zero, then the vertex is isolated.
b. If G is a simple graph, then the adjacency matrix A(G) :
i. Has leading diagonal entries all zero, aii=0 for all i.
ii. Is a Boolean matrix or a (0,1) matrix.
c. In the adjacency matrix of any graph G, the degree of each vertex vi is:
i. The sum of all the entries in the ith row (or jth column) if there is
no loop at vi.
ii. Row (or column) sum plus number of loop(s) if there is (are)
loop(s) at vi.

4: Let G be a graph with adjacency matrix:

v1 v2 v3 v4
v1 1 2 0 1
A= v 2 2 0 0 1
v3 0 0 0 0
v4 1 1 0 0
Then:
a) Find the degree of each vertex.
b) Find the cardinal number of the edge list.
c) Draw the graph.

Solution: a. i. Since there is one loop at v1, degr(v1) = row(column) sum + 1.


 deg (v1) = (1+2+1)+1 = 5. But others are loop free vertices. Thus:
ii. deg(v2) = 2+1 = 3
iii. deg(v3) = 0  v3 is isolated
iv. Deg (v4) = 1+1 = 2

b. By the Hand-shaking lemma:


1
E = (deg(v1 )  deg(v 2 )  deg(v3 )  deg(v 4 ))
2
1
 ( 5  3  0  2)
2
=5
 There are 5 edges in the graph represented by this adjacency matrix.
d. The graph associated with the given matrix is constructed in page 79.

78
v2
V1

.v3

v4

Incidence Matrix

Definition: Suppose G is a graph with vertices v1,v2,…,vm. The incidence matrix I= [bij]
of the graph G is given by:
bij = 1,if ej is incident on vi
0, otherwise
Note: 1. The incident matrix of a graph is not necessarily a square matrix.
2. An incident matrix I has a row for each vertex and a column for each edge.

Example: Find the incidence matrix I for the graph shown below.
v1 e1 v2

v5 . e5 e6 e2
e7
e3
v4 e4 v3

Solution: I is a 5X7 matrix.

e1 e2 e3 e4 e5 e6 e7
v1 1 0 0 0 1 0 0
v2 1 1 0 0 0 1 1
I=
v3 0 1 1 1 0 0 0
v4 0 0 0 1 1 1 1
v5 0 0 0 0 0 0 0

Note: 1. 1 appears in a column only once  the edge dominating the column is a loop.
2. All the entries in a row are zero  the vertex is isolated.
3. 1 appears twice in a column  the edge dominating the column has two end
points.
4. Sum of all the entries in every row is the degree of the vertex leading the row if
there is no loop and the sum plus n if there are n loops at this vertex.

Adjacency table

79
 Used to represent a graph in terms of a table depending on the adjacency
relationship of vertices.
Example1: consider the above example. The adjacency table is:

1 2 3 4 5

2 1 2 1
4 3 3 2
4 4 3
Note that (1,2,3,4,5) = (v1,v2, v3, v4)
1 dominates 2 and 4  v1 is adjacent with v2 and v4.
2 dominates 1 and 3  v2 is adjacent with v1 and v3.
etc.
Example2: Draw the adjacency table for G.
v1 v2

G:
v3
v4
v5
Solution: Adjacency table
1 2 3 4 5
2 1 1 3 3
3 3 2
4
5
Drawbacks of adjacency structure (adjacency table)
 Impossible to determine parallel edges.
 Impossible to determine degree of a vertex and hence hard to determine total
number of edges for non simple graphs.

3.4 Isomorphism of Graphs


It is possible for two graph diagrams two look different but to represent the same graph.
On the other hand, it is possible to look similar but to represent different graphs.
Consider the following diagrams which connects three houses H1,H2,H3 to three
utilities tel., water and electricity.

T W E H1 W T H2 E

T H2

H1 H2 H3 H3 E H1 W H3

G1 G2 G3
G1 and G2 are the same but they look different.
G1 and G3 are different but they look the same.

80
Definition: Graphs G(V,E) and G*(V*,E*) are said to be isomorphic if there exists a one-
to – one correspondence f : V  V * such that {u,v} is an edge of G iff  f (u ), f (v ) is
an edge of G*.

Example: Show that G and H are isomorphic graphs.


v1 v2 d c

v6 H: f
G: v5
a b e
V3 v4

Solution: - The correspondence is


f (v1 )  d f (v 3 )  a f (v 5 )  e
f (v 2 )  c f (v 4 )  f f (v 6 )  b
That is,
v1 , v2  (G )   f (v1 ), f (v2 )  d , c ( H )
v3 , v4  (G)   f (v3 ), f (v4 )  a, f  ( H )

v5 , v6    G)   f (v5 ), f (v6 )  e, b ( H )
G  H .
Note: 1. Two graphs G1(V1,E1) and G2 (V2,E2) are said to be isomorphic if a 1-1
correspondence f exists from V1 to V2 such that u and v are adjacent in G1 iff f(u) and f(v)
are adjacent in G2.
2. If G  H the degrees of corresponding vertices are equal i.e., degrees are
preserved.
3. Two isomorphic graphs must have the same number of vertices and edges.
Example: Prove that G  H . u1
v2 v2 U1
u3 u 4 u5
G: H:
v3 v4 v5 u2

Solution: In G, v1 and v2 are adjacent with v3,v4 and v5 .


In H, u1 and u2 are adjacent with u3,u4 and u5.
 f(vi)=ui, i=1,2,…,5.

3.4.1 Subgraph
A graph H is called a subgraph of G if every vertex of H is also a vertex of G and
every edge of H is also an edge of G.
Symbolically H is a subgraph of G if V(H)  V (G ) and E ( H )  E (G ).
Example: for the graph G, construct some of its subgraphs.

v1 v3

81
G:

v2 v4 v5

Solution: We construct two graphs Below from G.


v3 v1 v3

H2:
H1:

v5 v2 v4

- V ( H 1 )  V (G ) and E ( H 1 )  E (G )
- V ( H 2 )  V (G ) and E ( H 2 )  E (G )
 H 1 and H 2 are subgraphs of G

Note:
1. A null graph is a graph with V  {} and E = {} .
2. A graph and its null graph are trivial subgraphs.
3. A subgraph H of G is called a spanning subgraph of G iff V(H) = V(G).
4. A subgraph H of G is called a proper subgraph if H  G.

3.4.2 Complement of a graph

Let G be a simple graph. The complement of G is a simple graph G such that:


i) The vertices of G are the same as vertices of G
ii) u , v (G ) iff u, v E (G ) i.e, G will have an edge between u &v but G
will not have an edge between u and v.
The diagrams below indicate a graph and its complement.

v1 v2 v1 v2

G: G:
v4 v3 v4 v3

c
Note: If two graphs G1 and G2 are isomorphic graphs, then G1 and G2 c are isomorphic.

82
3.5 paths and connectivity

Paths:
Let G be a graph and e be an edge in G with end points u and v. Then the ordered triple
(u,e,v) is a step (walk) in G.

Definition: A path in a graph G consists of an alternating finite sequence of vertices and


edges of the form:
v0,e1,v1,e2,v2,….en-1,vn-1,en,vn
Where each edge ei contains the vertices vi-1 and vi (which appears on the sides of ei in the
sequence).
Some times, with the understanding that consecutive vertices are adjacent, the path can
be written as:
v0 , v1 ,...v n  with the idea that consecutive vertices are adjacent.
Given the path p = (v0,e1,v1,e2,v2,…,vn-1,en,vn). Then:
- P is said to traverse the edges e1,e2,---,en and visit the vertices
v0,v1,…,vn-1,vn
- v0 is called the initial vertex and vn is the terminal vertex of p.
- The number n of edges is called the length of the path.
- A path is said to be closed if v0 = vn.
- P is said to be open if v0  vn.
- P is called a simple path if all the vertices are distinct.
- P is called a cycle if it is a closed simple path (i.e., all the vertices are
distinct except v0 and vn .
- P is called a trial if all the edges are distinct (i.e., a path that does not
traverse the same edge more than once)
- A loop is a cycle of length 1
- A simple path of length  1 with no repeated edges and whose end
points are equal is called a circuit.
Note: A closed path in which all the edges are distinct is called a closed trial.
Example: Consider the graph G.
P1 p2 p3

G:

P4
p5 P6
Take the following sequences of vertices.
  ( P4 , P1 , P2 , P5 , P1 , P2 , P3 , P6 )
  ( p 4 , p1 , p5 , p 2 , p 6 )
  ( p 4 , p1 , p5 , p 2 , p 3 , p 5 , p 6 )
  ( P4 , P1 , P5 , P3 , P6 )
p  ( P4 , P1 , P2 , P3 , P5 , P4 )
 is an open path form p4 to p6 but it is not a cycle and not a trial as well .
83
 is not a path since there is no edge {p2,p6}in G.
 is a trial (no edge is used twice) but not a cycle.
The sequence  is a simple path as well as a trial between p4 and p6 but not the shortest
path between p4 and p6.
The shortest path between p4 and p6 is (p4,p5,p6) which has length 2.
The sequence p is a circuit of length 5.

3.5.1 Connectivity on nondirected graph


A graph G is connected if there is a path between any two of its vertices. That is, a
graph is connected if it is possible to go from any vertex to any other by following the
edges of the graph.
A graph that is not connected is said to be disconnected.
Example 1: Are the graphs G and H Given below connected?
v2 v4
v3
G: v1

v6 v5

v2
v6
H: v1 v3 v5
V4
v7
Solution:
G is a connected graph because every pair of vertices in G forms a path.
H is a disconnected graph because no path can be constructed from vi,  i = 1,2,3,4 to
vj,  j = 5, 6, 7.
Remark: 1. A disconnected graph is made up of two or more disjoint connected
subgraphs.
2. A graph is connected iff it has only one component.
3. The component of a graph is denoted by C(G).

Theorem: - A connected graph with n-vertices must have at least n-1 edges. (i.e,
E  n  1).
Example 2: a) A connected graph with 2 vertices must have at least (2-1) = 1 edge.
A B

b) A connected graph with 3 vertices must have at least: (3-1) = 2 edges.

v2

v1 v3
c). suppose that G is a graph with 6 vertices and 4 edges. Can G be connected? Why?

84
Solution: - A connected graph with 6 vertices must have at least: E = (6-1) = 5.But the
number of edges in G is 4.
Hence G cannot be a connected graph.

3.5.2 Special classes of graphs


There are a number of interesting special classes of graphs such as complete, regular,
bipartite, cycle, path and wheel graphs. The first three will be discussed in section 3.6.
Cycle graph:
 A cycle graph of order n is a connected graph whose edges form a cycle of length
n.
 Cycle graphs are denoted by Cn.
Path graph:
 A path graph of length n is a graph obtained by removing an edge from a cycle
graph Cn.
 Path graph of order n is denoted by Pn.
Wheel Graph:
 A wheel of order n is a graph obtained by joining a single vertex (the 'hub') to
each vertex of a cycle graph.
 Wheel graph is denoted by Wn.
Null Graph:
 A null graph of order n is a graph with n vertices and no edges and is denoted by
Nn.
Example: graphs of classes C5, W5, P5, and N5 are shown in the figure below from a
through d respectively.

.
. . .

. .
(a) (b) (c) (d)

3.6 Complete, regular and Bipartite Graphs

Complete graph: A graph G is said to be complete if every vertex in G is connected to


every other vertex in G. Thus a complete graph G must be connected.

Notation: The complete graph with n-vertices is denoted by kn.


Example 1: Some of the complete graphs are listed below.
K1: . k2: v1 v2 k3:

K4: k5 :

Remark: In a complete graph;


n(n  1)
 There are edges.
2
85
 All vertices are mutually adjacent.

Regular graph: A graph G is said to be regular of degree k or K-regular if every vertex


has degree k. In other words, a graph is regular if every vertex has the same degree.
Example 2: Here are some examples of regular graphs.
. or or , …
0-regular 1-regular
2-regular
Theorem: A complete graph with n-vertices kn is a regular graph of degree n-1.

Example 3: Consider the graph given below.

This graph is a 3 regular graph but not complete.

Remark:
1. It G is a graph with n-vertices and is regular of degree r, then E = ½ nr
2. The complement Gc of a simple graph G with n-vertices is the subgraph of the
complete graph kn.

Bipartite graphs: A graph G is said to be bipartite if its vertices V can be partitioned into
two subsets M and N such that each edge of G connect a vertex of M to a vertex of N.
(i.e. none of the edges in G connect vertices with in the same set M or N).
By a complete Bipartite graph we mean that each vertex of M is connected to each
vertex of N; this graph is denoted by Km,n where m is the number of vertices in M and n
is the number of vertices in N (m  n) .
Example 1: Complete bipartite graphs K1,5, K2,4, K3,3 are shown below in a, b and c
respectively.

a. b. c.
Example 2: Is the graph given below bipartite? Or complete bipartite?
v2 v3
v1 v4

v6 v5

Solution: Yes it is bipartite since we can partition the vertex set into
M={v1,v3,v5} and N= {v2,v4,v6} such that none of the edges in G connect vertices with in
the same set M or N.
But it is not complete bipartite graph. (why?)

86
Theorem: In a complete bipartite graph Km,n; the number of edges is given by E =mn.
Corollary: A complete bipartite graph Km,n is not a complete graph except K1,1.

3.7 Euler and Hamilton Graphs

3.7.1 Eulerian Graphs

Eulerian Path:
Definition: An Eulerian path in a graph G(V,E) is a path which uses each edge in E
exactly once.
An Euler path that begins and ends at the same vertex is called Eulerian trial.
A graph that contains an Eulerian (closed) trial is called an Eulerian graph.

Theorem: A connected graph is Eulerian iff all of its vertices have even degree.
Examples
1. Consider the graph G and answer the following questions
a. Show that G has an Euler closed trial.
b. Find an Euler trial starting and ending at U.
U

V Z

G:

W Y

X
Solution a) G is a connected graph and degree of each vertex is even (i.e.
deg(u)=deg(x)=2;deg (z)=deg(y)=deg(u) = deg(u)= deg(v)=4).
b) One Euler trial beginning and ending at U is UZWVZYXWYVU.

2. Explain why the two graphs, G1 and G2, given below are not Eulerian (exercise).
a) b)

Graph G1 Graph G2

87
Theorem: A graph G with 3 or more vertices contains an Euler path if and only if:
1. G is connected
2. G has exactly two vertices with odd degrees
3. The Eulerian path in G begins at one odd vertex and ends at an other odd
vertex.

Remark: i) A connected graph G with exactly two odd vertices is called


Semi-Eulerian graph.
ii) A graph (connected) with more than two odd vertices is neither Eulerian nor
semi- Eulerian.
Example 3: Show that the graph G given below is a semi-Eulerian graph.
A

E B

D C
Solution: - G is a connected graph.
E G has exactly two odd vertices D and C.
G: By the theorem, G has an Eulerian path that begins at C(or D) and ends at D(or C).
 G is a semi Eulerian.
One possible Euler path is: CBAEBDCED
D
3.7.2 Hamilton Graph

Hamilton Paths:
- a path that visits every vertex in a graph G exactly once is called a Hamilton
path.
- A closed Hamilton path is called a Hamilton cycle.
- G is called a Hamiltonian graph if it admits a Hamiltonian cycle.

Remark: An Eulerian trial traverses every edge exactly once, but may repeat vertices
while a Hamiltonian cycle (circuit) visits each vertex exactly once but may repeat edges.
Exercise: Draw a Hamilton graph having Hamilton cycle that traverse an edge more than
once.
Example: Consider the following graphs G1 and G2
A B
v1 v2 v3 F
G1:
G2:
E
D C
v6 v5 v4
G1 is Hamiltonian but not Eulerian. G2 is Eulerian but not Hamiltonian

88
Properties of Hamiltonian graph

- Only connected graphs can be Hamiltonian


- There is no simple criterion to identify a graph is Hamiltonian or not.

Theorem: If G is a simple graph with vertices n  3 and if deg(u)+deg(v)  n for all


pairs of non-adjacent vertices u and v, then G is Hamiltonian. (The converse is not
always true)

Example 1: show that a graph G given below is Hamilton.


Solution:
V1 - deg(v1)+deg(v6) = 8  7
v2 - deg(v1)+deg(v7) = 8  7
- deg(v2)+deg(v5) = 8  7
v5 v6 v3 - deg(v2)+deg(v7) = 8  7
v4 - deg(v4)+deg(v6) = 8  7
v7 - deg(v1)+deg(v5) = 8  7 , etc.

G satisfies the condition deg(vi)+deg(vj)  7 for all Paris of non-adjacent vertices vi and
vj.i = j = 1, …, 7.
G is Hamiltonian.
n
Corollary: If G is a simple graph with number of vertices n  3 and if deg(v)  for
2
all vertices v in G, then G is Hamiltonian.

Example 2: Consider the simple graph G and H given below.


A
v5 v3
G: v6 v4 E B
H:

v1 v2 D C

Consider first G:
n
- G satisfies the condition of the corollary. i.e. G is simple and deg vi  for all
2
i = 1, 2, 3,4,5,6.
-  G is a Hamiltonian graph
- One possible Hamiltonian cycle is v5 v1 v6v2 v4 v3v5

Now consider H:
- H has a Hamiltonian cycle, say ABCDEA
-  H is a Hamiltonian graph
But deg(u)=2 for all vertices u  {A, B, C, D, E}.
i.e. deg(u)=2 < n/2 = 5/2 = 2.5.
The converse of the corollary does not hold.

89
3.8 Trees and Forests

Definitions:
 A graph T is called a tree if T is connected and T has no cycle.
 A forest G is a graph with no cycles; hence the connected components of a forest
G are trees.
 A graph without a cycle is said to be cycle-free (acyclic) graph.
 The tree consisting of a single variable with no edges is called the degenerate tree.
 Since a loop is a cycle of length one, then a tree is a loop free graph.

Example 1:- The following graphs are trees or forests.

i) ii) iii) v)
G1
an isolated
vertex G2
A graph on G3
A graph on G4
two vertices a graph on 8 vertices.
three vertices.

G1 is a degenerate tree.
Since these graphs G1, G2, and G3 are connected acyclic graphs, i.e., connected graphs
with no cycles, then they are trees.
G4 is a forest not a tree as it is not connected.
Example 2:- Which of the following graphs is a tree. If the graph is not a tree, justify
why it is not.
v1
a t
i) ii) iii)
v2
c v4 u v
d v6
v5
b v3 w x y z
h v8
v7 r
e f g
v9 v14 p q
v10 v13
G1 v11 G3
v12
G2
Solution:-i) The graph G1 is a tree since it is connected and acyclic.
ii) The graph G2 is not a tree. Even though it is connected, it contains the cycle
V1V2V3V4V1. Hence the acyclic property of a tree is violated.
iii) The graph G3 is not a tree. Though G3 is acyclic, it is not connected. Hence the
connectedness property of a tree is violated.
Notation: - If a graph G is a tree, then it is denoted by T
Note: Consider a tree T. Clearly there is only one simple path between any two vertices
of T.
- T is connected, but would be disconnected if any one edge is removed.
90
- T is acyclic, but would contain a cycle if any edge is added.
Example 3: Sketch all the trees T with exactly 6 vertices.
Solution: - There are 6 non isomorphic trees on 6 vertices which are shown in the
following diagrams.

1) 3) 4)

2) 5) 6)

Note 1) In each of the trees with 6 vertices, there are exactly 5 edges.
2) In each tree T, there are some vertices of degree 1. These vertices (of degree1)
are called leaves.
3) Every tree T with at least one edge has at least two leaves.
4) The edges of a tree T are called branches.
Theorem: Let G be a graph with n>1 vertices. Then the following are equivalent.
i) G is a tree
ii) G is cycle-free and has n-1 edges
iii) G is connected and has n-1 edges.

Example 4: A tree has 4 vertices of degree 3 and 3 vertices of degree 2. The remaining
vertices have degree1. Find the total no of vertices in the tree.
Solution: Let n be the number of vertices of the tree.

Degree of vertex 3 2 1 Total

No of vertex 4 3 n-7 n

Sum of degrees 12 6 n-7 18+(n-7)

Then, 18+(n-7)=2 E (Hand shaking lemma)


But in a tree of n- vertices, we have n-1 edges
 18+(n-7)=2(n-1)
 11+n=2n-2
 n=13
 There are 13 vertices and 6 of them are of degree1.
Spanning Tree
In this section we try to find a sub graph of a graph G such that this sub graph is a tree
graph that contains all the vertices of the graph. This tree - sub graph is called a spanning
tree.
91
Definition: - A spanning tree of a connected graph G is acyclic connected Subgraph of G
which contains all the vertices of G.
Example: - Find the spanning tree of the graph G.

V W Soln: - The following are some spanning


trees of the graph G
i) V W

Z Y X
Z X
G Y

ii) iii)
V W
V W

Z Y X
Z Y X

Note: - For any connected graph G, we can find a spanning tree of G by any of the
following methods.
a) Cutting - down method: We start by choosing any cycle in G and remove one
of its edges - (destroying a cycle containing this edge). We repeat this procedure
until no cycle is left in the resulting graph.

Example: - In the graph G above remove the edges:


VY (destroying the cycle VWYV)
ZY (destroying the cycle VWYZV)
YX (destroying the cycle WXYW). Now, there is no cycle left and this procedure gives
the first spanning tree of G.

b) Building - up method: We select edges of G one at a time in such a way that the
selection on edges does not create a cycle. Repeat this procedure until all the vertices
of G are included in the resulting graph.

Example: - Consider the graph G in the above example once more again. Choose the
edges: VZ, ZY, YX and XW one at a time. Then this choice of edges:
 Includes all the vertices of G
 Does not create a cycle.
 Hence, the 2nd spanning tree of G is obtained by this selection of edges.

3.9 Planar Graphs and Graph Colors

3.9.1 Planar Graphs

92
Consider the complete graph on 4 vertices i.e., K4. It has two common visual
representations as shown in fig. 1 and fig. 2
A B W

D C Y X

figure 1 figure 2

In the representation of K4 shown in fig. 1, the two edges AC and BD appear to cross at a
point where there is no vertex. But in the second depiction, i.e., K4 as represented in fig.
2, this crossing of edges doesn't happen (except at a common vertex).

This brings us to the topic of planarity. The graph in figure 2, the second
depiction of K4 is called a plane representation of K4. Not every graph has a plane
representation. A graph which has a plane representation is called a planner graph.

Definition (planar Graph)


A graph G which can be drawn in a plane with its edges intersecting only at (common)
vertices is called a planar graph. A graph that has no such plane representation (or
depiction) is called a non-planner graph.

Example 1: K4 is a planar graph. The graph K4 given in fig. 1 has planar depictions (or
plane drawings) shown in fig. 2. a , b and c.

a) b) c)
Figure 1
Figure 2
Example 2: A complete graph k5 and a complete bipartite graph k3,3 are non planar.
Faces and planar Graphs
Suppose we draw a planar graph on the plane of a paper. If we cut the graph along its
edges, then the plane of the paper splits in to a number of regions. These regions are
called the faces of the graph. In other words, a plane representation of a planar graph
divides the plane in to regions called faces.

93
Definition: If G is a planar graph, then the plane representation of G splits the plane into
regions called faces of G. The unbounded region outside the graph is called the infinite
face. If f is any face of a graph, then the degree of f , denoted by deg(f), is the number of
edges encountered in a walk(or path)that begins and ends at the same vertex around the
boundaries of the face f. If all faces have the same degree r, then G is a face-regular graph
of degree r.
Example: Let G be a labeled graph with faces f1,f2 , f3 and f4 shown in the figure below.
G has four faces f1,f2, f3 and f4 . f4 is an infinite face of G since it is unbounded region
outside the graph. The degrees of the faces are:
V1 V2 f4 V3

V10
f2
f1 V4
V8 V9
f3 V5
V7 V6
G

Deg f1=3 deg f3 =9


Deg f2 =4 deg f4 = 8

Number of edges e = 12 the sum of the degrees of the faces =24.


Therefore 24 = 2(12)

Remark: - A connected planar


graph has exactly one infinite face.

Hand-Shaking (face) Lemma for planar graph


The sum of all the degrees of the faces in a planar graph is twice the number of edges in
the graph.
 Each edge either (a) borders two different faces (such as edges v2 v7,v3v4,v3v6 etc)
or (b) occurs twice as we walk around a single face (such as the edges
v1 v2,v7v8).Hence each edge contributes 2 to the total degree of the faces. Thus,
Hand shaking face Lemma for planar graphs follows.

Euler's formula
A planar graph may have different plane representations. The number of faces resulting
from each depiction (or embedding) is always the same. If G is a planar graph, then the
number of vertices, number of edges and number of faces in G are interconnected. This
interconnection of vertices, edges and faces of a planar graph is given by Euler's formula.

Theorem 1 (Euler's Formula)

94
For any connected planar graph G,
/V/ - /E/ + /F/ = 2
Where /V/ denotes the number of vertices, /E/ the number of edges and /F/ the number of
faces in G.
Example 1: Verify Euler's formula for the planar graph K4.
Solution: One possible plane representation of K4 is given in the figure below.

V1
e3
e2
e1 f1 f2 f4
V3
e5 e4
f3
V4 e6 V2
K4

For this graph, /V/ = 4, /E/ = 6 and /F/ = 4 further more:


/V/ - /E/ + /F/ = 4 – 6 + 4 = 2, which agrees with Euler's formula.

Example 2: How many faces are there in a cubic planar graph on 10 vertices?
Solution: A cubic graph is a 3 – regular graph, i.e., the degree of each vertex is 3.
Hence the sum of the degrees of all the vertices is:
10(3) = 2/E/ /E/ = 30/2 =15. Since /V/ =10, then by Euler's formula:
/V/ -/E/ + /F/ =2 /F/ =2 - /V/ +/E/ = 2 –10 + 15 = 7
Therefore, there are 7 faces in the graph.
The following corollaries are usually used to prove the nonplanarity of a graph.

Corollary 1:- If G is a simple connected planar graph with /E/  1, then


(i) /E/  3 /V/ - 6
(ii) There is at least one vertex v of G with degree 5 or less. (i.e., deg (v)  5 for
some vertex v of G).

Theorem 2: A complete graph Kn is planar iff n  4 .

Proof: It is easy to see that Kn planar for n = 1,2,3,4. Thus, we have only to show that Kn
is nonplanar if n  5 , and for this it suffices to show that K5 nonplanar. We prove this by
indirect argument.
First find the contra positive of the statement:
"If K5 is a planar graph, then /E/  3 v  6 " for a complete graph K5
Contra positive: If, in a graph K5, /E/>3/V/-6, then G is non planar
But/V/=5 and /E/=10 in K5 and 3/V/=3(5) =15
 3 / V /  6  15  6  9
 10  9  / E /  3 / v /  6
Therefore K5 is non planar and hence Kn nonplanar for n  5 .

Corollary 2: If G is a simple connected planar graph with no-triangles, then


95
(i) 2 /E/  4 /F/ or equivalently
(ii) /E/  2/V/ - 4
Example 3: Show that K3,3 satisfies the inequality /E/  3 /V/ - 6 (i.e. satisfies
corollary1), but is a non planar graph.
Proof:
i) For the bipartite graph K3, 3 we have: /E/ = 9 and /V/ =6.
Hence 3 /V/-6 =3 (6)-6
= 2(6) =12.
 /E/ =9  12 =3/V/-6
i.e; /E/  3 /V/-6
 K 3, 3 satisfies corollary 1.
ii) Since K 3, 3 has no-triangle, we use corollary (2) to prove the non planarity of K 3, 3.
Since /V/ = 6 and /E/ = 9 in K3,3 , we have /E/ = 9  2 /V/ - 4 = 2(6) – 4 = 8; i.e., 9  8.
This contradicts corollary 2. This contradiction shows that K3,3 is non planar.

3.9.2 Graph Coloring

A traditional application of the theory of planar graphs is in the study of map colouring.
The problem is to take a map with various countries, some bordering each other, and to
find how many colors are required to color the countries in such a way that no two
bordering countries have the same color.
If we let the countries be represented by vertices and the borders by edges, then the
coloring problem becomes a problem in the theory of planar graphs.

Definition: Consider a graph G. a vertex coloring or simply a coloring of G is an


assignment of colors to the vertices of G such that adjacent vertices have different colors.

Examples:

1. Given the map of a country with its seven states indicated by the letters
A, B, .................., G, find a planner graph that represents the map and the number of
colors needed to color the map so that no two bordering states have the same colour.

E Map of a country.
A
D F
C
B
G

Solution: Let the states A, B, C, D, E, F, and G in the map be represented by vertices and
an edge be drawn between two vertices iff the states corresponding to these vertices are
bordering states on the map. Then one possible planar graph representation of the map is
the following.

A E
D
F
C 96
G
B
Besides the plane graph representation of the map, we need to know the number of
different colors required to paint the vertices such that adjacent vertices have different
colors. Since the vertices A, B, C and D are mutually adjacent, each need a different
color. By being consistent with the conditions of the problem, the vertices E, F, and G
can be painted by the color of vertices A, B and C. Thus with four colors we can properly
color the seven vertices of the graph. Consequently, we need four different colors to paint
the map under the stated Situation.

4-colouring
D
C
B

Example 2: In each of the graphs below, determine the number of colors needed to color
the vertices of the graph in such a way that no pair of adjacent vertices have the same
color.
a) b) c)
A B C
A B C

D F
E
V1 V2
G H I
G1
G2 G3

Solution:
a) The graph G1 is 2- colorable. The set of non-adjacent vertices X= {A, B, C} can
be painted by one color and the other set of non- adjacent vertices y = (V1, V2} by
another.

97
G2 is 3- colorable as shown by the numbers at the vertices 1 2 1
of the graph.
This is because G2 contains a cycle of odd length.
b) Left as an exercise
2 2
3
Remark:
 A bipartite graph is 2 colorable.
 A graph G is bipartite iff every cycle (circuit) in G has
even length. 1 1
 A graph with a cycle consisting of an odd number of vertices 2
(i.e., a cycle with an odd length) can not be painted with only
two colors (not 2- colorable).

Chromatic Number
Definitions:
1) For a positive integer K, a graph G is said to be K- colorable or K- colored if there
exists a coloring of G which uses K colors.
2) The chromatic number of graph G, denoted by X(G), is the minimum number of
colors needed to paint (or color) G so that no two adjacent vertices receive the
same color.

Examples
1. Find the chromatic numbers of the graphs G and H below.
a) A B C A D
b)

D E F B C E F
G H
Solution:
a) X (G) = 2; since G is a rectangular grid.
b) X (H) = 3; since H contains a cycle ABCA with 3 vertices A , B, C - which is odd
cycle.
2. What is the chromatic number of a cycle?
Solution:
The chromatic number of a cycle is either 2 or 3. It all depends on the type of the cycle. If
the cycle has an even number of vertices (i.e.; it is an even cycle), then it is 2- colorable.
Otherwise, the cycle is three colorable.
A A B
A B
A
F C
E B
E D
C D
B C D C 2- Colorable
Rules on chromatic numbers
3- Colorable 2- Colorable 3 - Colorable

98
Rule 1. If G is a simple graph whose maximum vertex degree is d,
then X(G) ≤ d+1
Rule 2. X(G)  V , where V is the number of vertices of G.
Rule 3. X(Kn) = n, where X(Kn) is a complete graph with n vertices.
Rule 4. If some subgraphs of G requires k colors then X(G)  k .

Welch-Powel algorithm

Step 1: Order the vertices according to decreasing sequence of degrees.

Step 2: Assign the first color c1, to the first vertex in the sequence and then in sequential
order, assign c1, to each vertex w/c is not adjacent to a previous vertices.

Step 3: Repeat step2 with a second color c2 and the subsequence of non colored vertices.

Step 4: Repeat step 3 with color c3, the c4 and so on.

Example: Use Welch – Powel algorithm to find X(G).

A1 A2 A3

A4 A5 A6
A7 A8

Solution
Ordering the vertices in decreasing order of degrees we get:
{A5,A7,A3,A4,A2,A1,A6,A8}.
Now assign the first color c1 for A5 and A1.
Then we obtain the subsequence {A7,A3,A4,A2,A6,A8}to assign the second color c2.
That is assign c2 for A7,A6 and A2
Finally assign the third color c3 for A3, A4 and A8
 G is 3 colorable
 X (G )  3

Remark: The following are equivalent for a graph G


i) G is 2-colorable
ii) G is bipartite
iii) Every cycle of G has even length

99
Exercises
1) Give an example of a graph G with n vertices for which X (G) = n
2) Let Cn be a cycle graph with n-vertices find X (Cn) for all n.
3) Find a 4 - coloring of the graphs G and H in the figure if possible. For each graph,
determine whether its chromatic number is 4 or not.
a)
A B C b) A B C

D E F D E F

Graph G Graph H
4) (The scheduling problem)
Suppose you want to schedule a final examination program such that a student
will not have more than one exam a day. If we call the courses 1,2,3,4,5,6 and 7, then a
star in the ij entry, in the table, means that the courses i and j have at least one student in
common. So you can not have them on the same day. What is the least number of days
you need to schedule all the exams?

1 2 3 4 5 6 7
1 * * * * *
2 * * *
3 * * *
4 * * * *
5 * *
6 * * * *
7 * * *

5. Assign true or false to the following statements


a) A graph with n- vertices can always be n - colored.
b) If G is a complete graph, then X (G) ≤ d + 1, where d = the maximum degree
vertex of G.
6. Using Welch-Powel algorithm find the chromatic numbers of the graphs below.
A A
a) b) c)

F B C D E
E F B F
B
E C
I H G
D C
D
G3
G1 G2
100
7. What is the minimum number of colors needed to color the diagram so that adjacent
regions are different in color?

C
A B
D

E
H
F
G

101
Chapter 4
Directed Graphs
4.1 Introduction to Digraphs

Directed graphs are graphs in which the edges are one way. Such graphs are frequently
more useful in various dynamical systems such as:
 Digital computer
 Flow system
 Communication system
 Transportation system
Definition: a digraph D is a graph consisting of two things:
i) A set V whose elements are called vertices, Points or node of D
ii) A set E whose elements are order pairs (u,v) of distinct vertices called arcs or
directed edges of D.
Suppose e = (u,v) is a directed edge in a digraph D. Then the following terminologies are
used.
 e begins at u and ends at v.
 u is the origin or initial point of e where as v is destination or terminal point of e.
 v is the successor of u and u is the predecessor of v.
 u is adjacent to v where as v is adjacent from u
 If u = v then e is a loop.
 The set of all successor of a vertex u is : suss (u )  {v  V : (u , v)  E}
Example 1: Let D be the directed graph shown in the following figure.

A e1 D
e4

e3 e6 e7
e2
e5
B
C
e8

 e4 = (D,B)  (B,D)
 e8 is a loop.
 Succ(A) = {D}. That is D is adjacent from A.
 e2 and e3 are parallel arcs.
Definition: If D is a digraph, then the graph obtained by ignoring the direction of the arcs
in D is called the underlined graph of D.
Example 2: Consider the ff. diagraph
v2 Whose underlying graph is
v3 v6
V1 v2
v3 v6
v1
v4 102
v4
Sub diagraph: Let G(V,E) be a diagraph and let V  be a subset of vertex set V of G.
Suppose E  is a subset of E such that the end points of the edges in E  belongs to V  .
Then H V , E is a sub diagraph of G.

Example 3: Consider the digraph G:

A e1 D e4 C
e4 e6 e7
G: e2 e3 e6 e7 B
e8 e5 D
e8 e5 C
B
Fig. A Fig. B

Let V  = {B,C,D} and E  = {e4,e7,e5,e6,e8)


Then the sub diagraph H V , E of G (V,E) is constructed as in Fig. B above.

Degree: Suppose G is a direct graph. The out degree of a vertex v of G,


outdeg(V), is the number of edges incident from v, and the in degree of v,
indeg(u), is the number of edges incident to u.

Example 4: Consider the above graph

Outdeg(A) = 1 indeg(A)= 2
Outdeg(B) = 4, indeg(B) = 2
Outdeg(C) = 1, indeg(C) = 2
Outdeg (D) = 2, indeg(D )= 2

Sum (outdeg) =8, sum (indeg) = 8

Theorem: The sum of the out degrees of the vertices of the diagraph G equals the sum of
the in degrees of the vertices, which equals the number of edges in G.
Note: A vertex u in a diagraph with zero in degree is called a source and a vertex u with
zero outdegree is called a sink.

Example 5: In the digraph given below:

A
 A and D are sources since indeg(A) = indeg(D) =0
C  B and C are sinks since outdeg (B) = outdeg(C)= 0
B

103
4.2. Matrix Representation of a diagraph

Adjacency matrix: The adjacency matrix A= [aij] of a diagraph is defined as a matrix


with:

aij = n if number of (vi,vj)  is n


0 otherwise

Example 1: Write the adjacency matrix for the following diagraph.

v1 v2

D1:
v3

v5 v6

Solution: Let the vertex set V of D1 is labeled and ordered as V= {v1,v2,v3v4 v5}. Thus,
the adjacency matrix for D1is:

V1 V2 V3 V4 V5
V1 0 1 0 1 1
A(D1) = V2 0 0 0 1 0
V3 0 0 0 0 0
V4 0 0 0 0 0
V5 0 1 1 0 0

Note: - The sum of entries in the jth column is the same as indeg(vj)
- The sum of entries in the ith row is the same as outdeg(vi)
- Sum of entries in A(D) is equal to the total number of arcs.

0 1 0 0 1
1 0 0 1 0
Example 2: If A(D2) = 0 0 0 0 0
1 0 0 0 0
0 1 0 2 0

is the adjacency matrix of a diagraph D2, then:


a) Determine the in degree and out diagraph of each vertex.
b) Determine the total number of arcs in the diagraph
c) Draw the diagraph
d) Find the component of D2.

Solution: a) Let V = {v1,v2,v3,v4 v5} be a vertex set for D2 and let vi leads the ith row for
all i and the same sequence is used for the columns.
Then: outdeg(v1) = 2 indeg (v1) = 2
outdeg (v2) = 2 indeg (v2) = 2
104
outdeg (v3) = 0 indeg (v3) = 0
outdeg (v4) = 1 indeg (v4) = 3
outdeg (v5) = 3 indeg (v5) = 1
b) The total number of arcs in D2 is 6(1)+2=8
c) The graph represented by A(D2) is:

v1 v2

D2: . v3

v5 v4

d) The component of D2 is 2. That is, C(D2)=2.

Incidence Matrix of a diagraph


The incidence matrix I(D) of a loop-free diagraph is the nxm matrix in which:

1 if arc ej is incident from vi


aij = -1 if arc ej is incident to vi
0 otherwise.

Note: An incidence matrix has a row for each vertex and a column for each arc.
Example: Find the incidence matrix I (D) of the diagraph in the figure.
e1
v1 v2 Solution: The incidence matrix for D is given as:

D3: e4 e5 e1 e2 e3 e4 e5 e6
e6 v1 1 0 0 1 0 0
e3 I(D3) = v2 -1 -1 0 0 1 1
v4 v3 v3 0 1 -1 0 0 0
v4 0 0 1 -1 -1 -1

4.3. Paths and Connectivity


Let G be a directed graph. The concept of path, simple patch, cycle and trial carry
over from non-directed graphs G except that the direction of the edges must agree with
the direction of the path.

Connectivity: There are three types of connectivity in a directed graph D


i) D is strongly connected or strong if, for any pair of vertices u and v in D, there is a
path from u to v and a path from v to u (each is reach able from the other)
ii) G is unilaterally connected or unilateral if, for any pair of vertices u and v, there is a
path from u to v and a path from v to u (one of them is reachable from the other).
iii) G is weakly connected or weak if its underlying graph is connected.

105
Example 1: consider the above diagraph D3
i) D3 is not strongly connected (why?)
ii) D3 is unilaterally connected and it is weak as well.
Spanning Path: is a path that visits all the vertices of a graph G, where G is directed or
non-directed.
Theorem: Let D be a diagraph. Then:
(i) D is strong D has a closed spanning path.
(ii) D is unilateral  D has a spanning path.
(iii) D is weak D has a spanning semi-path.

Note: A semi-path is the same as a path (but not a path) except that the arc ei may begin
at either vi-1 or vi and end at the other vertex. That means there is at least one arc
opposing the direction of the path.
Example 2: Let D4 be the diagraph shown in the figure. Then describe the connectivity
of D4. A D

D4:

B C
Solution:
i) D4 is weakly connected since the under lining graph is connected or D has a spanning
semi-path, like ABCD.
ii) D4 is unilaterally connected since it has a spanning path, like ADBC or BADC.
iii) D4 is not strongly connected since C is a sink (i.e. every vertex is not reachable from
C) or since D has not a closed spanning path.

4.4 Rooted Tree and Binary Tree


Recall: Tree: a connected graph
: cycle free (no cycle)

4.4.1 Rooted Tree


Definition: A rooted tree is a connected diagraph D with no cycles and with a unique
vertex r which has zero indegree. The vertex r is called the root of the tree.
Remark: i) A rooted tree has unique root
ii) An undirected tree can be made into a rooted tree by choosing one
vertex as the root and then directing all edges away from the root.
Example: Consider the tree T given below
k
b d j
i q Undirected tree
T: a e
c
f h
T is not a rooted tree.
To root this tree at “a” we will simply direct all the edges from left to write. Then
it becomes the tree as shown below.
106
k

d j
b j q
a
e
c h

f
Directed tree rooted at a
Definitions:
i) The length of the path from the root r to any vertex u is called the level of u.
ii) The maximum vertex level is called the depth of the tree.
iii) Those vertices with zero outdegree are called leaves of the tree.
iv) The directed path from a vertex to a leaf is called a branch.
Example:- Consider the rooted tree T.
a

c
b

h
d e g
f

k Tree T
 The root of the tree is vertex a.
 The vertices d, k, j, f, g, and h with out degree zero are called leaves of the tree.
 Vertex a is at level 0.
 Vertex b and c are at level 1.
 Vertices d, e, f, g and h are at level 2.
 Depth of t is 3 which is level of k.

Definition: If there is a directed edge from a vertex U to V, we say that U is the parent
of V and that V is the child of U.
Note: - We say that a is a parent of d and d is a child of a since there is a direct edge
from a to d.
- Vertices of the same parent are called siblings e.g. d&e, a, b&c, i&j are siblings.
- Vertices which have children are called internal vertices e.g. a, b, c, f, e, r
are internal vertices.
4.4.2 Binary tree
M-ary tree: A rooted tree is called an m-ary tree if every internal vertex has not more
than m-children. The tree is called a full-m-ary if every internal vertex has exactly m
children.
107
Definition: An m-ary tree with m=2 is called a Binary tree.
Note: A tree T is a full binary tree if there is only one vertex with degree 2(sum of indeg
& outdegree) and the remaining vertices are of degree 1 or 3.

Example: Consider the following two rooted trees rooted at r.


r r

a b c
T1: T2: a b i
c d e f q h
d e f j e
g k
-T1 is a binary tree
-T2 is not a binary tree rather it is a full 3-ary tree.
Theorem: T is a full m-ary rooted tree consisting of n-vertices, i-internal vertices and l
leaves, then
1) n = mi+1 2) l = n-i

Corollary: Consider a full m-ary rooted tree T.


a) If T has i-internal vertices, it has l= (m-1) i+1 leaves.
l 1 ml  1
b) If T has l leaves, it has i = internal vertices and n =
m 1 m 1
c) If T has n-total vertices, it has
n 1 n(m  1)  1
i internal vertices and l  leaves.
m m

Example 1: If 56 people sign up for a tennis tournament, how many matches will be
played in the tournament in order to identify the champion?

. . . Solution

- Players can be regarded as the leaves


. . - tournaments (matchs) as the internal vertices.
. .
. . - m = 2 since every match is performed by
two players only.
. . .
- l = 56 and the chapion is the root of the tree.
.
 The tree is a full binary tree,

l  1 56  1
i=   55 .
m 1 2 1
Hence there are 55 matches played to know the champion.

Example 2: A telephone communication system is set up at a company where 125


executives are employed. The system is initialized by the president who calls four vice

108
presidents. Each vice-president calls four other executives, who in turn call four others
and so on.
a) How many calls are made in reaching all the 125 executives?
b) How many executives, aside from the president, are required to make calls?
c) How many executives are not authorized to make calls?

Solution:

a) Communications between executives = edge of a tree.


|E| = n-1 = 125-1 = 124 (property of a tree).
 124 calls should be made in reaching all 125 executives

b) The tree is a 4-ary tree.  m= 4.


But i = the executives that are required to make calls-including the president.
n  1 125  1 124
Then, i =    31
m 4 4
 31 executives make calls altogether.
 30 executives, aside the president, are required to make calls

c) Exercise

Balanced tree: A rooted k-ary tree of depth h is balanced if all the leaves are at level
h or h-1.

Example: Consider the following two trees.

b d T1 is balanced binary tree of depth 2


T1: a
e
c

b d
T2:a f T2 is not balanced binary tree since leaf c is neither
e at level 2 (h-1) nor at 3(h).
c g

109
Application of a tree

1) Arithmetic and logical expression can be represented in a binary tree from a


computer compiler.

Example a. (– (a+b))  (c-3) b. (a+b)  c). [((q  (d+e)-f) 9]


 .
4
.
Operations –internal vertices  

_ _ . Variables or numbers as leaves g


+ c _
+ c 3
a b  f
a b
q +
d e

2). Binary search Tree: is a binary tree in which each child is either a left or right child,
no vertex has more than one left child and one right child, and the data associated with
vertices must be unique.

In a binary search tree:


 Every child is less than its parent.
 Every right child is grater than its parent.

Example: Build a binary search tree for the words Banana, Peach, Apple Pear,
Coconut, Mango and Papaya using alphabetical order.

Solution: One possible binary search tree of the given words is:

Banana

Apple Mango

Coconut Peach

Papaya Pear

110
Exercise:- 1) Draw a tree or explain why it can not be drawn in each of the following.
a) A tree that has 7 vertices and 12 edges.
b) A tree that has a degree sequence
d= ( 2, 2, 3, 3, 3, 4)
c) A connected graph, but not a tree, with 3 edges and 4 vertices.
d) A tree with 3 vertices and 1 edge
e) A disconnected acyclic graph with 5 vertices and 4 edges.

2) Assign either true or false to each of the following statements.


a) In a simple graph G if every pair of distinct vertices is joined by
exactly one simple path, then G is a tree.
b) If an addition of any edge can form (or produce) a cycle in a simple
acyclic graph G, then G is a tree graph.

3) Is it possible to have a tree with 2 vertices of degree3, one vertex of degree


2, 6 vertices of degree 1 and 9 edges? Justify your answer.

111

You might also like