Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Discrete Lecture - Notes

Download as pdf or txt
Download as pdf or txt
You are on page 1of 48

Chapter 1

Elementary Counting Principles

This chapter develops some techniques for determining, without direct enumeration, the
number of possible outcomes of a particular event or the number of elements in a set. Such
sophisticated counting is sometimes called combinatorial analysis. It includes the study of
permutations and combinations

1.1 Basic counting principles


There are two basic counting principles used throughout this chapter. The first one involves
addition and the second one multiplication.

1.1.1 Addition Principle(AP)


Proposition 1. (Addition Principle) If A and B are two disjoint sets, then |A ∩ B| =
|A| + |B|.

Suppose some event E can occur in m ways and a second event F can occur in n ways,
and suppose both events cannot occur simultaneously. Then E or F can occur in m + n
ways.
Example 1

How many students are there in your class? The class contains male students and female
students. Let A be the set of male students in your class and let B be the set of female
students in your class.
Simple observations:
1.A ∩ B = ∅ and
2. A ∪ B is the set of students in your class.
So, if |A| = 15 and |B| = 35, then there are a total of 15 + 35 = 50 students in your class.
Example 2
A student can choose a maths project from one of three lists. The three lists contain 23,

By Mesfin M, AAU
1.1 Basic counting principles 2

15, and 19 possible projects, respectively. No project is on more than one list. How many
possible projects are there to choose from?
Solution: The student can choose a project by selecting a project from the first list, the
second list, or the third list. Because no project is on more than one list, by the sum rule
there are 23 + 15 + 19 = 57 ways to choose a project.
Example 3
Suppose E is the event of selecting a prime number less than 10 and F is the event of selecting
an even number less than 10. Then E can happen in 4 ways, and F can happen in 4 ways.
But, because 2 is even and prime, E or F can happen in only 4+4-1=7 ways.

Generalized Addition Principle


If A1 , A2 , A3 , ..., An are pairwise disjoint sets, then | ni=1 Ai | = ni=1 |Ai |,
S P
Example
1. One can reach city B from city A by bus, car, foot or train. Suppose that there are 3
ways by train, 2 ways by bus, 4 ways on foot and 5 ways by car. What is the total number
of ways going from city A to city B?
Solution: by (AP), there are a total of 2+3+4+5=14 ways to go from city A to city B.
2. There are four different blood types: O, A, B, and AB. If the Red Cross collects blood
donations from 10 people of type O, 15 type A, 12 type B, and 8 type AB, then it has
collected blood from a total of 10 + 15 + 12 + 8 = 45 people.

1.1.2 Multiplication Principle(MP)


Assume that a procedure can be break down in to a sequence of two tasks, if there are n1
ways to do the first and there n2 ways to do the second task, then there are n1 n2 ways to
do the procedure.
Example
A book shelf holds 6 different English books, 8 different mathematics books, and 10 different
chemistry books, there are
i) 6 × 8 × 10 = 480 ways of selecting 3 books, in each subject;
ii) An English and a mathematics books can be selected in 6 × 8 = 48 ways, an English and a
chemistry books, in 6 × 10 = 60 ways, a mathematics and a chemistry books, in 8 × 10 = 80
ways. Thus there are 48 + 60 + 80 = 188 ways of selecting 2 books in 2 subjects.

In general, suppose that an event E can be decomposed in to r ordered events E1 , E2 , ..., Er


and that there are
n1 Ways for the event E1 to occur
n2 Ways for the event E2 to occur
n3 Ways for the event E3 to occur
.
.
.

By Mesfin M, AAU
1.1 Basic counting principles 3

nr Ways for the event Er to occur


Then
Qr the total number of ways for the event E to occur is given by n1 × n2 × n3 × ... × nr
= i=1 ni .

Example
1. To reach city D from city A, one has to pass through city B and then through city C. If
there are 2 ways to travel from city A to city B, 5 ways to travel from city B to city C and
3 ways from city C to city D, what is the number of ways to go from city A to city D via
city B and city C.
Solution: By multiplication principle, the number of ways is 2 ∗ 5 ∗ 3 = 30.
2. There are five different mathematics books, six different chemistry books, and eight dif-
ferent physics books. How many ways are there to pick an (unordered) pair of two books
not both in the same subject?
Solution: If one mathematics and one chemistry book are chosen, the multiplication prin-
ciple says that the selection can be done in 5 × 6 = 30 ways; if one mathematics and one
physics book, 5 × 8 = 40 ways; and if one chemistry and one physics book, 6 × 8 = 48
ways. These three types of selections are disjoint, and so by the addition principle there are
30 + 40 + 48 = 118 ways in all.
3. The digits 0, 1, 2, 3, and 4 are to be used in 4 digit identification card. How many
different cards are possible if
a) Repetitions are permitted.
b) Repetitions are not permitted
Solution
There are four steps
1. Selecting the 1st digit, this can be made in 5 ways.
2. Selecting the 2nd digit, this can be made in 4 ways.
3. Selecting the 3rd digit, this can be made in 3 ways.
4. Selecting the 4th digit, this can be made in 2 ways.
5*4*3*2 120 different cards are possible.
Exercise
Give your brief answer for the following questions.
1. Find the number of positive divisors of 600, inclusive 1 and 600 itself. (Ans=24)
2. How many two-digit numbers have distinct and non-zero digits? (Ans=72)
3. Each user on a computer system has a password, which is six to eight characters long,
where each character is an uppercase letter or a digit. Each password must contain at least
one digit. How many possible passwords are there?

By Mesfin M, AAU
1.2 Permutations and Combinations 4

1.2 Permutations and Combinations


1.2.1 Permutations
An arrangement of n objects in a specified order is called permutation of the objects.
Permutation Rules:

1. The number of permutations of n distinct objects taken all together is n!.


Where n! = n × (n − 1) × (n − 2) × ..... × 3 × 2 × 1

2. The arrangement of n objects in a specified order using r objects at a time is called


the permutation of n objects taken r objects at a time, where 0 ≤ r ≤ n. It is written
as P (n, r) and is given by the formula:

n!
P (n, r) =
(n − r)!

Note that: P (n, 0) = 1 ,whenever n is nonnegative integer , because there is exactly


one way to order zero elements. That is, there is exactly one list with no elements on
it, namely empty set.

3. The number of permutations of n objects in which k1 are alike, k2 are alike, ...,kn are
alike is given by:
n!
P (n; k1 , k2 , ..., kn ) =
k1 ! × k2 ! × ... × kn !
Note that: The third rule of permutation is called Permutation with repetitions.
Example
1. Suppose we have a letters A,B, C, D

a) How many permutations are there taking all the four?

b) How many permutations are there taking two letters at a time?

2. Find the number of even integers between 20,000 and 70,000 in which no digit is repeated.
3. How many different permutations can be made from the letters in the word
“CORRECTION”?
4. How many integers between 100 and 999 inclusive consist of distinct odd digits?
5. There are 7 boys and 3 girls in a gathering. In how many ways can they be arranged in
a row, so that the 3 girls form a single block?
Solutions:
1. a) Here n = 4, there are four distinct objects
⇒ There are 4! = 24 permutations.
b) Here n = 4 and r = 2

By Mesfin M, AAU
1.2 Permutations and Combinations 5

4!
⇒ There are P (4, 2) = (4−2)! = 12 permutations.
2. Let abcde be a required even integer. The first digit a can be chosen from {2, 3, 4, 5, 6} and
the fifth digit e can be chosen from {0, 2, 4, 6, 8}. Since {2, 3, 4, 5, 6}∩{0, 2, 4, 6, 8} = {2, 4, 6},
we divide the problem in to two disjoint cases.
Case I: a∈ {2, 4, 6}, so a has 3 choices, e has 4 choices and bcd has P (10 − 2, 3) = P (8, 3)
choices. By MP, there are 3 × 4 × P (8, 3) = 4032 such even numbers.
Case II: a∈ {3, 5}, in this cases, a has 2 choices, e has 5 choices and bcd has P (10 − 2, 3) =
P (8, 3) choices, by MP, there are 2 × 5 × P (8, 3) = 3360 such even numbers.
Now by AP, the total number of required even numbers is 4032 + 3360 = 7392.
3. Here n = 10 of which 2 are C, 2 are O, 2 are R, 1E, 1T,1I,1N
⇒ k1 = 2, k2 = 2, k3 = 2, k4 = k5 = k6 = k7 = 1. Using permutation with repetitions we
have
10!
P (10; 2, 2, 2, 1, 1, 1, 1) = 2!×2!×2!×1!×1!×1!×1! = 453600 permutations.
4. The odd digits are 1, 3, 5, 7, 9; the even digits are 0, 2, 4, 6, 8. An integer such as 723 is
not to be counted because it contains the even digit 2; and an integer such as 373 is not
to be counted because it does not have distinct digits. The question amounts to asking for
the number of permutations of the five distinct digits 1, 3, 5, 7, 9, taken three at a time. The
answer is
5!
P (5, 3) = = 60.
(5 − 3)!
5. Since the 3 girls must be together, we can treat them as single entity. The number of
ways to arrange the 7 boys together with this entity is (7 + 1)! . As the girls can permute
among themselves within the entity in 3! ways, the desired number of ways is, by MP, 8!3!.
Exercises:
1. Six different mathematics books, seven different physics books, and 3 different computer
books are arranged on a shelf. How many different arrangements are possible if;
a. The books in each particular subject must all stand together
b. Only the statistics books must stand together
2. If the permutation of the word “WHITE” is selected at random, how many of the
permutations
a. Begins with a consonant?
b. Ends with a vowel?
c. Has a consonant and vowels alternating?
3. What is the number of ways to order the 26 letters of the alphabet so that no two of the
vowels a,e,i,o and u occur consequently? (Ans = 21! ∗ P (22, 5))

1.2.2 Circular Permutations


The permutations that we have considered so far are called linear permutations because they
are permutations of things in a line or in a row.
Permutations of things in a circle, or circular permutations, occur in such a problem as:
In how many ways can five persons be seated around table?

By Mesfin M, AAU
1.2 Permutations and Combinations 6

Solution:
If we label the persons A, B, C, D, E, we see that the five linear permutations

ABCDE, BCDEA, CDEAB, DEABC, EABCD

are identical when thought of as circular permutations. This is so because two arrangements
of people around table are considered to form the same circular permutation if one can be
obtained from the other by rotating everybody around the circle by the same amount and
in the same direction. This is the case, for example, if everybody moves one place to his
right. Hence we can get at the number of circular permutations by relating them to the
linear permutations: each circular permutation corresponds to five linear permutations, so
there are only 51 as many circular permutations as there are linear permutations. But there
are 5! linear permutations of five objects, and hence the answer to the question is
1
(5!) = 4! = 24.
5
Hence number of r-circular permutation of a set A with n objects is

P (n, r) n!
Q(n, r) = =
r r(n − r)!

In particular, Q(n, n) = (n − 1)!

Example:
In how many ways can 5 boys and 3 girls be seated around a table if
i. There is no restriction?
ii. Boy B1 and girl G1 are not adjacent?
iii. No girls are adjacent?
Solution:
i. The number of ways is Q(8, 8) = (8 − 1)! = 7!.
ii. The 4 boys and 3 girls not including B1 can be seated in Q(7, 7) = (7 − 1)! = 6! Ways.
Given such an arrangement B1 has (7 − 2) = 5 choices for a seat not adjacent G1 , this is
equals to 6! ∗ 5 = 3600.
iii. We first seat the 5 boys around the table in (5−1)! = 4! ways. Given such an arrangement
there are 5 ways to seat G1 . As no girls are adjacent, G2 and G3 have 4 and 3 choices,
respectively. Thus the desired number of ways is 4! ∗ 5 ∗ 4 ∗ 3 = 1440.

1.2.3 Combinations
A selection of objects with out regard to order is called combination. , i.e. a combination of
a set of objects is an unordered selection of the objects. Thus, an r-combination is simply a
subset of the set with r elements(r-subsets).
Note that:Permutation is an ordered arrangement of objects and Combination is a selection

By Mesfin M, AAU
1.2 Permutations and Combinations 7

without regard to order. Example: Given the letters A, B, C, and D list the permutation
and combination for selecting two letters.
Solutions:

Permutation Combination
AB BA CA DA AB BC
AC BC CB DB AC BD
AD BD CD DC AD DC

Note that in permutation AB is different from BA. But in combination AB is the same
as BA.
Combination Rule
The number of combinations of r objects selected from n objects without repetition is denoted
by C(n, r) or nr , where 0 ≤ r ≤ n and is given by the formula:


 
n P (n, r) n!
C(n, r) = = = .
r r! r! ∗ (n − r)!

These numbers are also called binomial coefficients. Note that: The symbol C(n, r) or nr


is read as “n choose r”.


n
= 0 if r > n, or r is negative, and 0r = 0 if r > 0.

r
0
0
=1
Examples:
1. In how many ways a committee of 5 people be formed from a group of 11 people consisting
of 4 teachers and 7 students if:
a)There is no restriction in the selection?
b)The committee must include exactly 2 teachers?
c)Two of them are T1 and T2
d)The committee must include at least 3 teachers?
e)A particular teacher and a particular student cannot both in the committee?
2. A student wishes to walk from the corner X to the corner Y through streets as shown
below. How many shortest routes are there from X to Y available to the student?

Solutions
1. The  number of ways is
11
a) 5 =  462
b) 42 73 = 210
c) 93 , because T1 and T2 are already chosen
4 7 4 7

d) 3 2 + 4 1

By Mesfin M, AAU
1.2 Permutations and Combinations 8

e) 11 9 9
  
5
− 3
= 378, since there are 3
ways to form a committee which contains a particular
teacher and a particular student.
2. Note that every route consists of 7 continuous segments  of which
 4 are horizontal and 3
are vertical. The number of shortest route is then 73 = 74 = 3+4

3
= 35.

In general, in a rectangular grid, to go from one intersection point to another intersection


point with m horizontal segments and n vertical segments, the number of shortest routes is
   
m+n m+n
= .
m n

1.2.4 Combination with repetitions


Theorem 1. The number of r-combination with repetition from a set of n elements is C(n +
r − 1, r).
Note that:The following are equivalent

1. The number of non-negative integer solution to the equation x1 + x2 + x3 + ... + xn = r

2. The number of selections, with unrestricted repetition of size r from a collection of size
n.

3. The number of ways of distributing r identical objects into n distinct boxes.


The common number for the above is
 
n+r−1
C(n + r − 1, r) =
r
Example:
1. Five friends would like to order beverages with their dinner at a local restaurant that
serves iced tea, hot tea, or coffee. Find the number of beverage orders possible.
2. In how many ways can you distribute 10 birr to 4 children A, B, C and D?
a) Without any restrictions.
b) If each child gets at least 1 birr?
3. Find the number of solutions of the equation

x 1 + x2 + x3 = 5 (1.1)

where x1 , x2 , and x3 are nonnegative integers.


Solution:
1. A convenient notation will prevent confusion. Denote each type of beverage by a dash
and separate them using two slashes, as shown below:

By Mesfin M, AAU
1.2 Permutations and Combinations 9

/ /
Iced tea hot tea coffee

Mark each person’s selection by an X in the appropriate area. For instance, the distri-
bution XX / X / XX indicates that two people selected iced tea, one selected hot tea, and
two selected coffee; the distribution XXX/ /XX means, three people selected iced tea, none
ordered hot tea, and two selected coffee.Thus the number of possible beverage orders equals
the number of permutations of seven items (five X’s and two /’s) of which five are alike (X’s)
and the other two are alike (/’s):
7!
= = 21.
2!5!
2. a) 10+4−1 13
 
10
= 10
b) 6+4−1 = 96 = 84.
 
6
3. Here we have r = 5 and n = 3. By Theorem (1), the number of solutions is C(n+r−1, r) =
C(3 + 5 − 1, 5) = C(7, 5) = 21.
Can you list all the solutions?
Taking this example a step further, suppose you would like to find all solutions of equation
(1.1)in the above example, where x1 , x2 , x3 ≥ 1. To find the number of solutions for this
equation, make the substitution yi = xi − 1, 1 ≤ i ≤ 3. Clearly, yi ≥ 0. After this
substitutions, equation (1.1) becomes y1 + y2 + y3 = 2, Where yi are nonnegative integers.
By Theorem (1), the number of solutions for this equation is C(n+r−1, r) = C(3+2−1, 2) =
C(4, 2) = 6.
Those are: (0,1,1),(1,0,1),(1,1,0),(2,0,0),(0,2,0),and (0,0,2). Consequently, Equation (1) with
xi ≥ 1 has six solutions those are:
(1,2,2),(2,1,2),(2,2,1),(3,1,1),(1,3,1),and (1,1,3).

Theorem 2. Let S = {a1 , a2 , a3 , ..., an } be a set with n elements. Then, the number of
combinations of size r taken from S with the property that the element ai must be repeated
at least Si times in any combination is
 
n + (r − S1 − S2 − ... − Sn − 1)
n−1

Example
The number of combinations of size 10 taken from a set S = {a, b, c, d, e, f } with the property
that a must be repeated
 at10least twice b repeated at least 3 times is
6+(10−2−3−0−0−0−0−1)
6−1
= 5 .

Exercise
1. Consider a group of 20 people. If everyone shakes hands with everyone else, how many
handshakes take place?
2. Out of 5 Mathematician and 7 Statistician a committee consisting of 2 Mathematician
and 3 Statistician is to be formed. In how many ways this can be done if:

By Mesfin M, AAU
1.3 The Inclusion- Exclusion principles 10

a) There is no restriction
b) One particular Statistician should be included
c) Two particular Mathematicians can not be included on the committee.
3. A committee of k people is to be chosen from a set of 7 women and 4 men. How many
ways are there to form the committee if:
(a) The committee has 5 people, 3 women and 2 men. (Ans 210 ways)
(b) The committee can be any positive size but must have equal numbers of women and
men. (Ans 329 ways)
(c) The committee has 4 people and one of them must be Mr. Abebe. (Ans 120 ways) 4.
Seven friends go to a restaurant for lunch and order from the menu that has four items: fish,
meat, vegetable or pasta. How many different orders are there? (Ans.=120)
5. How many positive integers less than 1000,000 have the sum of their digits equals to 9?
14

(Ans 9 )
6. How many solutions in a non negative integers are there to

34 23
 
a) x1 + x2 + x3 + x4 + x5 = 30 and x1 ≤ 10 (Ans 10
− 19
)

b) x1 + x2 + x3 + x4 ≤ 30 (Ans 34

10
)

1.3 The Inclusion- Exclusion principles


This section we develop a set-theoretic formula for counting problems involving several in-
teracting properties in which either all properties must hold or none must hold.
Theorem 3. Let U be a finite set. Suppose A and B are two subsets of U . Then the number
of elements of U that are neither in A nor in B are
|U | − |A| − |B| + |A ∩ B|
.
Or equivalently, |A ∪ B| = |A| + |B| − |A ∩ B|.
A generalization of this to three subsets A, B and C is also well known. To get a result
that generalizes Theorem 3 for n subsets A1 , A2 , ..., An , we need the following notations:

S1 = ni=1 |Ai |,
P P P
S2 = 1≤i<j≤n |Ai ∩ Aj |, S3 = 1≤i<j<k≤n |Ai ∩ Aj ∩ Ak |,
Sn = |A1 ∩ A2 ∩ A3 ∩ ... ∩ An |

With the notations as defined above, we have the following theorem, called the inclusion-
exclusion principle.
Theorem 4. (Inclusion-Exclusion Principle) Let A1 , A2 ,..., An be n subsets of a finite set
U . Then the number of elements of U that are in none of A1 , A2 ,..., An is given by:
|AC C C n
1 ∩ A2 ∩ ... ∩ An | = |U | − S1 + S2 − S3 + ... + (−1) Sn = |U | − |A1 ∪ A2 ∪ ... ∪ An |.

By Mesfin M, AAU
1.3 The Inclusion- Exclusion principles 11

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

Examples
1. How many bit strings of length eight either start with a 1 bit or end with two bits 00?
2. Let U = {1, 2, 3, ..., 500}. Then find
a) The number of integers in U which are divisible by 2, 3, or 5.
b)The number of integers in U which are divisible by none of 2, 3, or 5.
3. How many combination of size 13 are there taken from the set S = {a1 , a2 , a3 } with the
property that a1 can be repeated at most 4 times, a2 can be repeated at most 5 times, a3
can be repeated at most 6 times.

Solutions:
1. Let A be set of bit strings of length eight that start with 1 and B be set of bit strings
of length eight that end with 00. Then A ∩ B is set of bit strings of length eight that start
with 1 and end with 00. This implies that,
|A| = 27 , |B| = 26 and |A ∩ B| = 25 . By Inclusion-Exclusion principle,
|A ∪ B| = |A| + |B| − |A ∩ B|= 27 + 26 − 25 = 160.
Hence, there are 160 bit strings of length eight that start with 1 or end with 00.
2. First note the following facts,
i. The number of integers in U which are divisible by n ∈ N is b 500 n
c, an integer less or equal
to 500
n
. i.e., b 500
n
c ≤ 500
n
.
ii. For a, b, c ∈ N, c is divisible by both a and b if and only if c is divisible by the LCM of a
and b.

Let Ak = {x ∈ U |x is divisible by k}.


Thus, |A2 | = b 500
2
c = 250, |A3 | = b 500
3
c = 166, |A5 | = b 500
5
c = 100, |A2 ∩ A3 |=|A6 | = b 500
6
c=
500 500 500
83, |A10 | = b 10 c = 50, |A15 | = b 15 c = 33, and |A2 ∩ A3 ∩ A5 | = |A30 | = b 30 c = 16
Hence,
a) |A2 ∪ A3 ∪ A5 | = (|A2 | + |A3 | + |A5 |) − (|A6 | + |A10 | + |A15 |) + |A30 | = 366.
b)|AC C C
2 ∩ A3 ∩ A5 | = |U | − |A2 ∪ A3 ∪ A5 | = 134.
3. Let p1 be the property that a1 must be repeated at least 5 times.
Let p2 be the property that a2 must be repeated at least 6 times.
Let p3 be the property that a3 must be repeated at least 7 times.
Let U be the set of all combinations of size 13 taken from the set S = {a1 , a2 , a3 }.
Let A1 be the set of all combinations in U that satisfy property p1 .
Let A2 be the set of all combinations in U that satisfy property p2 .
Let A3 be the set of all combinations in U that satisfy property p3 .
Then we have,
|U | = 3+13−1 = 15 |A1 ∩ A2 | = 3+(13−5−6−0)−1 = 42 = 6
   
3−1 2 
= 105, 3−1
|A1 | = 3+(13−5−0−0)−1 10 3+(13−5−0−7)−1 3
  
3−1
= 2
= 45 |A 1 ∩ A3 | = 3−1
= =3
3+(13−0−6−0)−1
 9 3+(13−0−6−7)−1
 2
2
|A2 | = 3−1
= 2 = 36 |A2 ∩ A3 | = 3−1
= 2 =1

By Mesfin M, AAU
1.4 The Pigeonhole Principle 12

|A3 | = 3+(13−0−0−7)−1 8 3+(13−5−6−7)−1


  
3−1
= 2
= 28 |A 1 ∩ A 2 ∩ A 3 | = 3−1
=0
By Inclusion-exclusion principle, we have
|AC C C
1 ∩ A2 ∩ A3 | = |U | − |A1 | − |A2 | − |A3 | + |A1 ∩ A2 | + |A1 ∩ A3 | + |A2 ∩ A3 | − |A1 ∩ A2 ∩ A3 | =
105 − 45 − 36 − 28 + 6 + 3 + 1 = 6.

Excersise
Find the number of integers between 1 and 1000, inclusive, which are divisible by none of 5,
6 or 8.

1.4 The Pigeonhole Principle


Pigeonhole principle also known as the Dirichlet pigeonhole principle presents the most
essential and basic part in combinatorial mathematics. The simplest form of the pigeonhole
principle is the following fairly obvious assertion.

Proposition 2. (Pigeonhole principle) If n + 1 objects are placed into n boxes/containers,


then some box must contain at least 2 objects.

Proof. We prove the pigeonhole principle using proof by contraposition. Suppose that none
of the n boxes contains more than one object. Then the total number of objects would be at
most n. This is a contradiction, because there are at least n + 1 objects.

Generalization of pigeonhole principle


A generalized version of this principle states that, if n objects are placed into m boxes, then
n
some box must contain at least d m e objects.
Remark: Recall that the expression dxe, called the ceiling function, is the smallest integer
k, such that k ≥ x and the expression bxc, called the floor function, is the largest integer r,
such that r ≤ x.

We will illustrate the usefulness of the pigeonhole principle. We first show that it can be
used to prove a useful corollary about functions.

Corollary 1. A function f from a set with k + 1 or more elements to a set with k elements
is not one-to-one.

Proof. Suppose that for each element y in the codomain of f we have a box that contains
all elements x of the domain of f such that f (x) = y. Because the domain contains k + 1 or
more elements and the codomain contains only k elements, the pigeonhole principle tells us
that one of these boxes contains two or more elements x of the domain. This means that f
cannot be one-to-one.

Examples
1. Among any group of 367 people, there must be at least two with the same birthday,

By Mesfin M, AAU
1.5 The Binomial Theorem 13

because there are only 366 possible birthdays.


2. How many students must be in a class to guarantee that at least two students receive the
same score on the final exam, if the exam is graded on a scale from 0 to 100 points?
Solution: There are 101 possible scores on the final. The pigeonhole principle shows that
among any 102 students there must be at least 2 students with the same score.
3. If 50 people donate blood at the Red Cross, there must be at least 13 people of the same
blood type.
4. Among 100 people there are at least d 100
12
e = 9 who were born in the same month.
5. What is the minimum number of students required in a discrete mathematics class to be
sure that at least six will receive the same grade, if there are five possible grades, A, B, C,
D, and F?
Solution: The minimum number of students needed to ensure that at least six students
receive the same grade is the smallest integer N such that d N5 e = 6. The smallest such
integer is N = 5 × 5 + 1 = 26. If you have only 25 students, it is possible for there to be five
who have received each grade so that no six students have received the same grade. Thus, 26
is the minimum number of students needed to ensure that at least six students will receive
the same grade.

1.5 The Binomial Theorem


Binomial: An expression with two terms.
Example: x + y, 3x + 2y, 2x + 1, 5x − 3y

Theorem 5. (Binomial Theorem) Let x, y ∈ R. Then for n ∈ N, the expression of (x + y)n


is given by:
          n  
n n n n n−1 n n−2 2 n n−1 n n X n n−k k
(x+y) = x + x y+ x y +...+ xy + y = x y
0 1 2 n−1 n k=0
k

Example
1. Expand (x2 + 3y)4 using binomial theorem.
2. What is the coefficient of x3 y 4 in the expansion of (2x + y 2 )5 ?
Solutions:
1. (x2 + 3y)4 = 40 (x2 )4 + 41 (x2 )3 (3y) + 42 (x2 )2 (3y)2 + 43 x2 (3y)3 + 44 (3y)4
    

2. Let z = y 2 , then apply binomial theorem to (2x + z)5 , and find the coefficient 3 2
 of x z .
3 2 5 3 2 3 2 3 4 5 3

The term involving x z is 2 (2x) z . Hence the coefficient of x z = x y is 2 2 = 80.
Exercise
1. Expand (2xy − y3 )5 using binomial theorem.
2. What is the coefficient of x3 y 194 in the expansion of (2x + y 2 )100 ?
3. Find the constant
Pn term in the expansion of (2x2 − x1 )12 . (Ans 7920)
n k

4. Show that k=0 k 2 = 3n

By Mesfin M, AAU
1.5 The Binomial Theorem 14

1.5.1 Pascal triangle and identities


The binomial coefficients are often written out in the form of a triangular array, known as
Pascal’s Triangle:
0

0
1 1
 
0 1
2 2 2
  
0 1 2
3 3 3 3
   
0 1 2 3
4 4 4 4 4
    
0 1 2 3 4
5 5 5 5 5 5
     
0 1 2 3 4 5
6 6 6 6 6 6 6
      
0 1 2 3 4 5 6
7 7 7 7 7 7 7 7
       
0 1 2 3 4 5 6 7
That is,
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1
n−1 n−1 n−1 n−1
   
The nth row of the triangle is 0 1 2
... n−1
.
Theorem
n
 n−1
6. (Pascals
n−1
 theorem) For all integers n and k with 1 ≤ k ≤ n − 1,
k
= k + k−1

1.5.2 Multinomial
We have seen the value of binomial coefficients in expanding a power of a binomial. It
is natural to ask whether a similar family of coefficients might prove helpful when we wish
to expand a power of a ”trinomial” (x+y+z) or in general a ”multinomial” (x1 +x2 +...+xm ).

Theorem 7. (Multinomial Theorem)


n
X n!
(x1 + x2 + ... + xk )n = xi11 xi22 ...xikk
i1 +i2 +...+ik
i !i
=n 1 2
!...i k !

By Mesfin M, AAU
1.5 The Binomial Theorem 15

Example: 1. The coefficient of x21 x2 x23 x4 in the expansion of (x1 + x2 + x3 + x4 )6 is


6!
2!2!1!1!
= 180.
6!
2. The coefficient of x31 x2 x23 in the expansion of (2x1 − 3x2 + 5x3 )6 equals 3!1!2! 23 (−3)52 =
−36000.
Notation: The quantity i1 ,i2n,...,ik = i1 !i2n!!...ik ! is called a multinomial coefficient.


Exercise
1. Prove the
 following using the idean of
 Pascal identity
n n n n n
 
i. 0 − 1 + 2 − 3 + ... + (−1) n  = 0
ii. n0 − n1 + n2 − n3 + ... + (−1)k nk = (−1)k n−1

k
2. Expand (2x1 − x2 + 3x3 )4 .

By Mesfin M, AAU
1.5 The Binomial Theorem 16

Worksheet 1
1. a) How many permutations of size 3 can one produce with the letters p,r,m and n? List
them.
b) List all combinations of size 3 that one produce with the letters p,r,m,t and n?
2. m boys and n girls are to be arranged in a row, where m, n ∈ N with n ≥ m. Find the
number of ways this can be done in each of the following cases:
a) There are no restrictions;
b) No boys are adjacent;
c) The n girls make a single block;
d) A particular boy and a particular girl must be adjacent.
3. In how many ways can 7 boys and 2 girls be lined up in a row such that the girls must
be separated by exactly 3 boys?
4. New licence plates in Addis Ababa start with a letter (English alphabet) followed by five
digits. How many different license plates can be made if
a) Repetition of digits is allowed
b) Repetition of digits is not allowed
c) The letters R and Q are not used with no repetition of digits.
d) Vowels are not used and the numbers begin with odd digits and end in even digits.
5. Find the value(s) of n in each of the following
a) P (n, 2) = 90 c) P (n, 3) = 3P (n, 2)
b) 2P (n, 2) + 50 = P (2n, 2) d) 6P (n, 1) = P (n, 3)
6. For all positive integersm and n show that
a) n m+n = (m + 1) m+n b) For n > 1, n2 + n−1
 
m m+1 2
is a perfect square

7. Determine x if 50 50 r 100
P 
r=0 r 8 = x
8. Find the coefficient of x4 y 2 in the expansion of (2x − 3y)6 .
9. Determine the number of positive integers whose decimal expansion contains exactly 4
digits, doesnt contain equal digits, and doesnt contain the digit 3.
10. How many integers between 1 and 1000 have all their digits different and dont contain
the digit 5 in their decimal expansion?
11. How many bit strings of length 10 contain at least three 1s and at least three 0s.
12. Find the number of positive integers less than 601 that are not divisible by 3 or 5 or 7.
13. Find the number of even integers between 10,000 and 60,000 in which no digit is repeated.
14. 25 points, no 3 collinear (no three of the points lie on a line), are given in the plane.
How many streight lines do they determines? How many triangle do they determine?
15. In a certain part of our town, the streets form a square grid, and each street is one-way
to the north or to the east. Let us assume that our car is currently at the southwest corner
of this grid, which we will denote by O(0,0) as shown below:
A. In how many ways can drive to the point X=(6,4)?
B. In how many ways can we drive to the point X, if we want to stop at the bakery at

By Mesfin M, AAU
1.5 The Binomial Theorem 17

Y=(4,2)?
C. In how many ways can we drive to the point X, if we want to stop at either the ice cream
shop at U=(3,2) or at the coffee shop at V=(2,3)?
D. In how many ways can drive to the point X, if the street UY is closed?

16. How many ways are there to put 30 identical balls into 5 different boxes if each box
must contain at least 3 balls?
17. How many solutions are there of the equation x1 + x2 + x3 + x4 = 6 where each
xi , i ∈ {1, 2, 3, 4} is a non-negative integer?
18. Show that among any n + 1 positive integers not exceeding 2n there must be an integer
that divides one of the other integers.
19. Assume that in a group of six people, each pair of individuals consists of two friends or
two enemies. Show that there are either three mutual friends or three mutual enemies in the
group.
20. How many non negative integer solutions are there to the equation x1 + x2 + x3 + x4 +
x5 + x6 = 29 such that

a) xi > 1 for all i ∈ {1, 2, 3, 4, 5, 6}

b) xi ≥ i for all i ∈ {1, 2, 3, 4, 5, 6}

c) x1 ≤ 5

d) x1 < 8 and x2 > 8

21. How many positive integers less than 1,000,000 have exactly one digit equal to 9 and
have a sum of digits equal to 13?
22. How many combinations of size 25 are there taken from a set S = {a1 , a2 , a3 }, with
the property that a1 must be repeated at least two times but at most 8 times. a2 must be
repeated at least three times but at most 12 times. a3 must be repeated at least seven times
but at most 10 Ptimes.
23. Show that ni1 +i2 +...+ik =n i1 !i2n!!...ik ! = k n .

By Mesfin M, AAU
Chapter 2

Recurrence Relation

A sequence can be defined by giving a general formula for its nth term or by writing few of
its terms. An alternative approach is to write the sequence by finding a relationship among
its terms. Such a relationship is called a recurrence relation or sometimes called difference
equation.
Definition 1. A recurrence relation for the sequence {an } is an equation that relates an
interms of one or more of the previous terms of the sequence, namely a0 , a1 , ..., an−1 for all
integers n >= n0 , where n0 is a non negative integer. The values a0 , a1 , ..., an−1 are explicitly
given values and are not defined by recursive formula. They are called initial conditions or
boundary conditions of the recurrence relation.
Definition 2. Initial condition: the information about the beginning of the sequence.

2.1 Types of recurrence relation


1. Consider the recurrence relation below

an − c1 an−1 − c2 an−2 − c3 an−3 − ... − ck an−k = f (n), (ck 6= 0, n ≥ k)

with f (n) is a function and c1 , c2 , ..., ck are constants. Then this Recurrence Relation is
called
i. Homogeneous Recurrence Relation of degree k if f (n) = 0.
ii. Non homogeneous Recurrence Relation if f (n) 6= 0.
2. A Recurrence Relation is non-linear if it is expressed as a power or product of terms of a
sequence. Otherwise it is called linear Recurrence Relation.
Example: Which of the following Recurrence Relations are homogeneous, non-homogeneous,
linear and non-linear?

1. an − 3an−1 + 2an−2 = 0

By Mesfin M, AAU
2.2 Recurrence Relation Models 19

2. 2an + 5an−1 + 3an−2 = an−3

3. an − 3an−1 + 2an−2 (an−3 ) = 0

4. an − 3an−1 + 2an−2 + 5 = 0

5. an − 3an−1 + 2an−2 = 2n − 4

6. an − 3an−1 + 2an−2 = 2n + an−3

7. an − 3an−1 + 2(an−2 )3 = an−3

2.2 Recurrence Relation Models


We can use recurrence relation to model a wide variety of real life problems. Modelling of
problems with recurrence relation are illustrated below.
Example 1(Compound interest) A person invests 10,000$ at 12% interest compounded
annually. How much will be there at the end of 15 years?
Solution Let An represents the amount at the end of n years. So at the end of n − 1 years,
the amount is An−1 . Since the amount after n years equals the amount after n − 1 years plus
interest for the nth year. Thus the sequence {An } satisfies the recurrence relation.

An = An−1 + (0.12)An−1 = (1.12)An−1 , n ≥ 1.

A0 = 10, 000 with initial condition.


The recurrence relation with initial condition allow us to compute the value of An for any n.
For example,
A1 = (1.12)A0 , A2 = (1.12)A1 = (1.12)2 A0 , A3 = (1.12)A2 = (1.12)3 A0 ,..., An = (1.12)n A0
which is an explicit formula and the required amount can be derived from the formula by
putting n = 15.
So, A15 = (1.12)15 (10000).
Example 2(Fibonacci sequence) Eight centuries ago Fibonacci studied the population
growth of rabbits. He considered the following model of growth. He start with a pair of
rabbits,(one male and female) born on some month. He assumes that:
1. rabbit begin to produce young two months after their own birth;
2. After reaching the age of two months, each pair produces a mixed pair, (one male, one
female), and then another mixed pair each month there after; and
3. no rabbit die
4. all months are of equal length. Then

By Mesfin M, AAU
2.3 Solving Recurrence Relations 20

How many pair of rabbits will there be after n months?


To answer this question,we let Fn be the number of pairs after n- months including the new
born pairs of rabbit. Then, F0 = 1 and F1 = 1
After two months ,the pair of rabbits produces a pair of offspring and so F2 = 2. At the end
of the third months, there will be 3 pairs of rabbits, that is ,F3 = 3.
In general,we can obtain information about the number Fn by reasoning as follows. At the
end of the nth month, the Fn−1 pairs of rabbits that were alive at the end of the previous
month will still be alive, since we assume that no rabbits die. This contributes Fn−1 pairs
of rabbits to the total number of pairs for the nth month.But, there will also be some new
born pairs.In fact, each of the Fn−2 pairs of rabbits that were alive 2 months prior to the
nth month, being at least 2 months old themselves, will bear anew pair of rabbits. This
contributes Fn−2 additional pairs of rabbits the total for the nth months. Hence, we have the
recurrence relation Fn = Fn−1 + Fn−2 for all values of n ≥ 2 with initial values F0 = 1
and F1 = 1.
The first few terms of the this sequence are:
1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, ...
This sequence is called the Fibonacci sequence and the numbers in the sequence are called
Fibonacci numbers.
Example 3(Tower of Hanoi) The tower of Hanoi is a puzzle consisting of three pegs and
n circular disks of increasing size on one peg, with the largest disk on the bottom. These
disks are to be transferred, one at a time, onto another of the pegs with their relative po-
sitions unchanged. The rules of the puzzle allow disks to be moved one at a time from one
peg to another as long as a disk is never placed on the top of smaller one. The problem is
to determine the number of moves necessary for the transfer.
Solution : Let hn denote the number of moves needed to solve the Tower of Hanoi problem
with n disks. If there is only one disk, we simply move it to the second peg in one way.
Thus h1 = 1. If we have n > 1, we can transfer n − 1 disks to the second peg in hn−1 moves.
During the moves, the largest disk at the bottom of the first peg stays fixed.Then we use
one move to transfer the largest disk to the second peg. We can now move again n − 1 disks
on the second peg to the third peg using hn−1 moves. Therefore,

hn = 2hn−1 + 1, n > 1
with initil condition h1 = 1.

2.3 Solving Recurrence Relations


A sequence is called a solution of a recurrence relation if its terms satisfy the recurrence
relation.
There are a few methods used to find an explicit formula for the terms of a sequence given
by a recurrence relation. Some of the methods are:
1. induction/recursion

By Mesfin M, AAU
2.3 Solving Recurrence Relations 21

2. the characteristic equation method


3. matrix representations (eigenvalues and eigenvectors)
4. generating functions
But in this course we will see only characteristic equation method of solving recurrence re-
lation.
The characteristic equation method is easily applied to solve ‘linear homogeneous recurrence
relations with constant coefficients’ and can be adapted to solve ‘linear non-homogeneous
recurrence relations with constant coefficients’.

2.3.1 Solutions of Linear Homogeneous Recurrence Relations(LHRR)


Note that if an = can−1 for n ≥ n0 is a LHRRWCC of degree 1, the solution is of the form
an = kcn for some constant k.
Let an = c1 an−1 + c2 an−2 + ... + ck an−k be a LHRRWCC. We will similarly ‘guess’ that the
solution will be exponential (that is, an = rn for some r ).
Observe that, if this is correct, then r must satisfy the equation

rn = c1 rn−1 + c2 rn−2 + ... + ck rn−k .

In other words, r is a root of the equation

xk − c1 xk−1 − c2 xk−2 − ... − ck−1 x − ck = 0.

We call this equation the characteristic equation of the recurrence relation. The roots of the
characteristic equation are called characteristic roots.

Theorem 8. Suppose that the characteristic equation to the recurrence relation


an = q1 an−1 + q2 an−2 + ... + qk an−k has k distinct roots r1 , r2 ,..., rk then
an = c1 r1n + c2 r2n + ... + ck rkn for n = 0, 1, 2, ... , where c1 , c2 , ..., ck are constants is the general
form of the solutions for the HRR an = q1 an−1 + q2 an−2 + ... + qk an−k

Examples
Solve the following recurrence relations with the given initial values.
1. an = 2an−1 + 3an−2 , with initial conditions a0 = 0, and a1 = 8.
2. an = 2an−1 + an−2 − 2a−3 (n ≥ 3), with initial values a0 = 1, a1 = 2 and a2 = 0.
Solutions
1. The characteristic equation of this RR is x2 − 2x − 3 = 0 , whose roots are r1 = −1, and
r2 = 3. Hence the solution to this RR must be of the form an = c1 (−1)n + c2 (3)n ,with the
given initial conditions we get
an = −2(−1)n + (3)n
2. The characteristic equation of the recurrence relation is x3 − 2x2 − x + 2 = 0, and it has
three roots: r1 = 1, r2 = −1 and r3 = 2. Then we have
an = c1 (1)n + c2 (−1)n + c3 (2)n = c1 + c2 (−1)n + c3 (2)n is the general solution. Now we are

By Mesfin M, AAU
2.3 Solving Recurrence Relations 22

going to find the value of the constants c1 , c2 ,and c3 using the initial values. So that

c1 + c2 + c3 = 1,
c1 − c2 + 2c3 = 2,
c1 + c2 + 4c3 = 0

The unique solution of the system can be found to be c1 = 2 ,c2 = −2


3
, c3 = −13
.
2 n 1 n
Thus, an = 2 − 3 (−1) − 3 2 is the solution of the given recurrence relation.

Theorem 9. Suppose that the characteristic equation to the recurrence relation


an = q1 an−1 + q2 an−2 + ... + qk an−k has t distinct roots (t < k), r1 , r2 ,..., rt with multiplicities
m1 , m2 , ..., mt . Then,

an = (c11 +nc12 +...+n(m1 −1) c1m1 )r1n +(c21 +nc22 +...+n(m2 −1) c2m2 )r2n +...(ct1 +nct2 +...+n(mt −1) ctmt )rtn .

for n = 0, 1, 2, ..., where ci,j are constant is the general form of the solutions for the HRR
an = q1 an−1 + q2 an−2 + ... + qk an−k .

Examples
Solve the following recurrence relation with the given initial values.
1. an = −6an−1 − 9an−2 , with initial conditions a0 = 2, and a1 = −3.
2. an = 4an−1 − 4an−2 for n ≥ 4 where a2 = 1 and a3 = 4.
3. an = 7an−1 − 15an−2 + 9an−3 for n ≥ 3 where a0 = 1, a1 = 2 and a2 = 3.
Solution:
1. The characteristic equation of this recurrence relation is x2 +6x+9 = 0, with characteristic
roots r1 = r2 = −3
Hence the solution of this RR must be of the form an = c1 (−3)n + c2 n(−3)n . After
substituting the initial values we get, an = 2(−3)n − n(−3)n = (2 − n)(−3)n
2. The characteristic equation of this recurrence relation is x2 −4x+4 = 0, with characteristic
roots r1 = r2 = 2
Hence the solution of this RR must be of the form an = c1 2n + c2 n2n . After substituting
the initial values we get, an = 81 n2n = n2n−3
3. The characteristic equation of this recurrence relation is x3 − 7x2 + 15x − 9 = 0, with
characteristic roots r1 = 1, r2 = r3 = 3
Hence the solution of this RR must be of the form an = c1 1n +c2 3n +nc3 3n . After substituting
the initial values we get, an = 3n − 31 n3n = 3n−1 (3 − n).
Exercise
Solve the following recurrence relation with the given initial value.
1. an+2 − 5an+1 + 6an = 0 for n ≥ 3 where a0 = 1, a1 = −1.
2. an − 12an−1 + 48an−2 − 64an−3 = 0 for n ≥ 3 where a0 = 1, a1 = 4 and a2 = 32.

By Mesfin M, AAU
2.3 Solving Recurrence Relations 23

2.3.2 Linear Non homogeneous Recurrence Relation(LNHRR)


A recurrence relation of the form
c0 an − c1 an−1 − c2 an−2 − c3 an−3 − ... − ck an−k = f (n), (c0 , ck 6= 0, 1 ≤ k ≤ n)
with f (n) is a function of n and c1 , c2 , ..., ck are constants, is called the rth order non homo-
geneous recurrence relation for the sequence an .
To solve linear non homogeneous recurrence relation:
1. Find the general solution of the homogeneous recurrence relation denoted by ahn

2. Find a particular solution for the given non homogeneous recurrence relation denoted
by apn

3. Combine the general solution of the homogenous recurrence relation and the particular
solution and determine the values of the constants arising in the general solution so
that the combined solution satisfies the initial conditions. i.e, an = ahn + anp

Note that: We find the values of the constants after we get the general solution, not only
after we get the homogeneous solution!!!
Examples
Solve the following recurrence relation with the given initial value.
1. an = 2an−1 + 3n , (n ≥ 1) ,with initial conditions a0 = 2.
2. an − 3an−1 = 2 − 2n2 ,with initial conditions a0 = 3.
Solutions:
1. Since the homogeneous recurrence relation an = 2an−1 , has only one characteristic root
r = 2, its general solution is ahn = c2n
The particular solution of an = 2an−1 + 3n , is in the form of apn = k3n , where k is constant.
By substituting it in the given LNHRR we get
k3n = 2k3n−1 +3n , after cancellation it reduces to, 3k = 2k +3 or equivalently, k = 3. Hence,
an = c2n + 3n+1 is a solution for each choice of the constants c. We now want to determine
c so that the initial condition a0 = 2 is satisfied. This gives c = −1 and the solution of the
problem is an = −2n + 3n+1 , (n ≥ 1).
2. First find ahn by solving an − 3an−1 = 0. The characteristic equation is x − 3 = 0, implies
x = 3 is the characteristic root. Therefore, ahn = A3n , where A is a constant.
To find apn , since f (n) = 2 − 2n2 is a polynomial of degree 2, we let apn = Bn2 + Cn + D,
where B, C and D are constants then, Bn2 +Cn+D −3(B(n−1)2 +C(n−1)+D) = 2−2n2 .
This yields by equating corresponding coefficients, we have

 B − 3B = −2

C + 6B − 3C = 0

−3B + 3C − 2D = 2

By Mesfin M, AAU
2.4 System of linear Recurrence relations 24

By solving this system of equation we get, B = 1, C = 3 and D = 2. This implies that,


apn = n2 + 3n + 2 Therefore, an = A3n + n2 + 3n + 2. By using the given initial condition
a0 = 3, we get A = 1.
The required solution is then an = 3n + n2 + 3n + 2(n ≥ 0).

2.4 System of linear Recurrence relations


For two sequences an and bn we will solve recurrence relations of the form
(
an = −pan−1 + qbn−1
bn = ran−1 + sbn−1

where p, q, r and s are arbitrary constants.


Example: Solve the system of recurrence relations
(
an + 2an−1 − 4bn−1 = 0 (1)
bn + 5an−1 − 7bn−1 = 0 (2)

Given that a1 = 4 and b1 = 1.


Solution: From (1) we have, bn−1 = 41 (an + 2an−1 ) (3)
Substituting (3) in to (2) gives,
1 1
(an+1 + 2an ) + 5an−1 − 7( (an + 2an−1 )) = 0.
4 4
That is, an+1 − 5an + 6an−1 = 0. The characteristic equation of this RR is x2 − 5x + 6 = 0
with characteristic roots r1 = 2 and r2 = 3.
Thus, an = A2n + B3n , where A and B are constants is the solution of this RR. Substituting
it in to (3) gives,
1
bn = (an+1 + 2an )
4
1
⇒ bn = (A2n+1 + B3n+1 + 2(A2n + B3n ))
4
1
⇒ bn = (4A2n + 5B3n ).
4
Using the given initial condition we have,
(
2A + 3B = 4
2A + 45 B = 1

By Mesfin M, AAU
2.4 System of linear Recurrence relations 25

Solving this we get A = 8 and B = −4.


Hence, (
an = 2n+3 − 4(3n )
bn = 2n+3 − 5(3n ) (n ≥ 1)

are the required solutions.

Worksheet II
1. Find recurrence relations that are satisfied by the sequence formed from the following
functions.
n!
a)an = 15! b) an = n2 − 6n + 8
2. Find a cubic polynomial whose roots are 5, −1, and 3. Then find a LHRRWCC with this
characteristic polynomial.
3. Solve the following recurrence relations by inspection.
a) an = 2an−1 for n > 1, a1 = 1. c) an = an−1 +k for n > 0, a1 = 1 and k constant.
b) an = an−1 + (2n − 2) for n > 1, a1 = 0. d) an = an−1 + (n − 1)2 for n > 1, a1 = 1
4. Show that an = 4 , an = n4 , and an = 2.4 + 3n.4n are all solutions of the same recur-
n n n

rence relation an = 8an−1 − 16an−2 .


5. Solve the following recurrence relations with the given initial values and find a10 and a15 .
a) an = −an−1 + 16an−2 − 20an−3 , ao = 0, a1 = 1 and a2 = 1.
b) an = an−1 + n2 , ao = 1.
c) an − an−1 − an−2 = 0, a0 = 1, a1 = 1.
d) an = 3an−1 − 2an−2 , a0 = 2, a1 = 3.
e) an = 2an−1 + 3an−2 , a0 = a1 = 1.
f) an = 3an−1 + 4an−2 , a0 = a1 = 1.
g) an = 3an−1 − 3an−2 + an−3 , a0 = a1 = 1, a2 = 2.
h) an = an−1 + n, a0 = 2.
i) an = 3an−1 − 4n + 32n , a1 = 8.
j) an = an−1 + n(n − 1), a0 = 3.
k) an = 7an−1 − 15an−2 + 9an−3 , a0 = 1, a2 = 2, a3 = 3.
6. Solve the system of recurrence relations and find a6 and b7 .
(
an+1 = an − bn (1)
bn+1 = an + 3bn (2)
with the initial conditions
a) a0 = 2 and b1 = 1.
b) a0 = −1 and b0 = 5.

By Mesfin M, AAU
2.4 System of linear Recurrence relations 26

7. What is the general form of the particular solution of the linear nonhomogeneous recur-
rence relation an = 6an−1 − 12an−2 + 8an−3 + F (n) if
a) F (n) = n2 ? d) F (n) = n2 2n ?
n
b) F (n) = 2 ? e) F (n) = n3 (−2)n ?
c) F (n) = n2n ? f) F (n) = 3?
8. An employee joined a company in 1987 with a starting salary of 50, 000. Every year this
employee receives a raise of 1000 plus 5% of the salary of the previous year. Then
a) Find a recurrence relation for the salary of this employee n years after 1987.
b) Find an explicit formula for the salary of this employee n years after 1987.
c) What is the salary of this employee in 1995?
9. Find a recurrence relation for the number of binary strings of length n that do not contain
the pattern 0000 and find the initial values.
10. Suppose that each year you deposit d birr into a bank account, at an annual interest
rate equal to i%. Find a recurrence relation for the amount in your account at the end of
n-years. Solve the recurrence relation.

By Mesfin M, AAU
Chapter 3

Elements of Graph Theory

3.1 Definition and Examples of a graph


Definition 3. A graph is a pair G = (V, E) of sets where E contains elements from the
union of the one and two element subsets of V . The elements of V are called the vertices
(or nodes) of G. V (sometimes written V (G)) is called the vertex set of G. The elements of
E are called the edges of G. E (sometimes written E(G)) is called the edge set of G. An
edge connecting vertices u and v is denoted by uv or {u, v} and u and v are said to be the
edge’s ends.

Example
1. G1 = (V1 , E1 ), where V1 = {a, b, c, d, e} and

E1 = {{a, b}, {a, d}, {b, c}, {b, e}, {b, d}, {c, d}, {c, e}, {d, e}}.

2. G2 = (V2 , E2 ), where V2 = {1, 2, 3, 4, 5, 6} and

E2 = {{1, 2}, {1, 3}, {1, 6}, {2, 3}, {2, 5}, {2, 4}, {3, 5}, {3, 6}, {4, 5}, {5, 6}}.

Graphs are usually represented pictorially by drawing dots (or circles) for the vertices and
joining two dots if the corresponding vertices form an edge.
Note that: The shape of an edge or the position of a vertex in the plane are not importance
in graph. What matter is:

• whether or not there is an edge between two vertices.

• which of two vertices are the end vertices of an edge.

By Mesfin M, AAU
3.1 Definition and Examples of a graph 28

a 1
b c 2 6

d e 3 5
4
G1 G2
Figure 3.1: Pictorial representations of graphs G1 and G2

All graphs are generally divided into two main classes, simple graphs and multi graphs.
The classifications depends on the presence or absence of two features, loops and multiple
edges.
Definition 4. An edge for which the two ends are the same is called a loop at the common
vertex. A set of two or more edges of a graph is called a set of multiple edges if they have
the same ends.
Definition 5. A graph is simple if it has no loops and no multiple edges. A graph is
considered a multi graph if it contains at least one loop or multiple edge.
Next, we will define some important terms used when describing a graph.
Definition 6. The order of a graph G is the cardinality of V (G), denoted |V (G)| or |G|.
The size of a graph G is the cardinality of E(G), denoted |E(G)| or ||G||.
Example: In the above graphs G1 and G2 , we have |V (G1 )| = 5, |E(G1 )| = 8 and
|V (G2 )| = 6, |E(G2 )| = 10.
Definition 7. Given u, v ∈ V , if uv ∈ E, then u and v are adjacent vertices. If an edge
e has a vertex v as an end, then v and e are incident. Two edges e and f are adjacent if
they have a vertex in common.
Example: Recall the graph G1 from before:
• Vertices a and b are adjacent.

• Vertices a and c are not adjacent.

• Edges ab and ad are adjacent.

• Edge ab and vertex a are incident.

By Mesfin M, AAU
3.1 Definition and Examples of a graph 29

Definition 8. A graph of order 0 or 1 is called a trivial graph. An empty graph is a graph


with no edges. A complete graph is a graph that has an edge between every pair of vertices.
A complete graph on n vertices is denoted by Kn .

We can obtain a formula for the number of edges in the complete graph with n vertices, using
the following reasoning. Each edge in the graph corresponds to a selection of two distinct
vertices from the set of n vertices, without taking order into account. This selection can be
carried out in 2 ways. Hence the number of edges in Kn is 2 , which equals n(n−1)
n n

2
.

Definition 9. The neighborhood of a vertex v, denoted N (v), is the set of vertices adjacent
to v. The degree dG (v) = d(v) of a vertex v is the number of edges incident to v. Equivalently,
d(v) = |N (v)|. A vertex of degree 0 is called an isolated vertex.
The minimum degree of G is δ(G) = min{d(v) : v ∈ V }. The maximum degree of G is
4(G) = max{d(v) : v ∈ V }. If dG (v) = k for all v ∈ V , then G is called a k-regular graph
(or, simply, a regular graph). A complete graph Kn is (n − 1)-regular.

K1 K2 K3 K4 K5 K6

Figure 3.2: Complete graphs

Exercise:
1. Give an example of a 2-regular graph, a 3-regular graph.
2. Find δ(Kn ) and 4(Kn ).

There is a simple relationship between the degrees of the vertices of any graph and the
number of edges of the graph. It is given by the following lemma.

Lemma 1. (Handshaking Lemma) Let G = (V, E) be a graph. Then,


X
d(v) = 2|E|.
v∈V

The lemma follows immediately from the fact that if we add the degrees of all the vertices,
every edge will be counted twice, since each edge is incident to two vertices.

Corollary 2. In any graph G, the number of vertices of odd degree is even.

By Mesfin M, AAU
3.1 Definition and Examples of a graph 30

Exercise
Let G be a simple graph with 5 vertices. If each vertex of G is adjacent with any two other
vertices, then find the number of edges of G.

Definition 10. Let G = (V, E) be a graph with V = {v1 , v2 , ..., vn }. The degree sequence of
G is a non increasing sequence of non negative integers d1 , d2 , d3 , ...., dn , where di = deg(vi ).

Example:
The degree sequence of the following graph G is 3,3,2,1,1.

a b

c d e
G
Figure 3.3:

Obviously, for any graph G, there exists a non increasing sequence of non negative integers
which is the degree sequence of G. Is the converse is true? i.e., given a non increasing
sequence of non negative integers does there always exists a graph G corresponding to it?
Example
1. Does 5,4,3,2,1 correspond to a graph?
2. Does 4,3,2,1 correspond to a graph?

Theorem 10. A sequence of non P increasing and non negative integers d1 , d2 , d3 , ...., dn cor-
responds to a graph if and only if ni=1 di = 2k for some non negative integer k.

Definition 11. A sequence of non increasing and non negative integers is said to be graphic
if it is a degree sequence of a simple graph.

Exercise
1. Show that the following sequence are graphic.

a) 4,2,2,1,1 b) 4,4,4,4,4

2. Show that the following sequence are not graphic.

a) 4,3,2,1 b) 7,6,5,4,3,3,2
Pn
Note that: If a degree sequence d1 , d2 , d3 , ...., dn is graphic, then i=1 di is even.

By Mesfin M, AAU
3.2 Matrix representation of a graph 31

3.2 Matrix representation of a graph


While a pen-and-paper drawing of a graph is convenient for working with small graphs by
hand, it is not suitable if a graph is to be handled on a computer. For this purpose, other
ways of representing graphs have been developed. The most commonly used representation
is known as an adjacency matrix.

Definition 12. (Adjacency Matrix). Let G = (V, E) be a graph and assume that V =
{v1 , v2 , ..., vn }. The adjacency matrix of G is an n × n matrix M defined as:

0, if vi vj ∈
 / E,
Mi,j = 1, if vi vj ∈ E and vi vj is not a loop,

2, if vi vj ∈ E and vi vj is a loop

Note that:
1. Mi,j is the number of edges joining vi and vj .
2. The adjacency matrix of a (simple) graph is symmetric with respect to its diagonal
consisting of zeros because simple graphs do not have loops.
A graph has usually many different adjacency matrices, one for each ordering of its set V of
vertices. a graph with n vertices could have up to n! different adjacency matrices because
there are n! different ways in which n items can be arranged.
Exercise
1. Write down the adjacency matrix of the following graphs.

a b e a b
d c
c d e
f
a) b)
Figure 3.4:

2. Draw the graph represented


 by each of the following adjacency matrices.
0 1 1 0 1 1  
 1 0 1 0 0 1  0 2 0 1 1
   2 0 0 1 1 
 1 1 0 1 0 0   
 0 0 1 0 1 1  b)  0 0 0 0
a)  2 
 

   1 1 0 0 2 
 1 0 0 1 0 1 
1 1 2 2 0
1 1 0 1 1 0

By Mesfin M, AAU
3.2 Matrix representation of a graph 32

Definition 13. (Incidence Matrix). Let G = (V, E) be a graph with V = {v1 , v2 , ..., vm }
and E = {e1 , e2 , ..., en }. Then the incidence matrix of G is an m × n matrix A with:

0, if vi is not incident with ej

Ai,j = 1, if vi is incident with ej and ej is not a self loop

2, if vi is incident with ej and ej is a self loop

Theorem 11. Let G = (V, E) be a graph with V = {v1 , v2 , ..., vm } and E = {e1 , e2 , ..., en }
with incidence matrix A. The sum of every column in A is 2 and the sum of each row in A
is the degree of the vertex corresponding to that row.

Proof. Consider any column in A, it corresponds to an edge e of G. If the edge is a loop,


there is only one vertex adjacent to e and thus only one non-zero entry in this column.
Therefore its sum is 2. Conversely, if e connects two vertices, then there are precisely two
vertices adjacent to e and thus two entries in this column that are non-zero both with value
1, thus again the sum of the column is 2.

Now consider any row in A, it corresponds to a vertex v of G. The entries in this row
are 1 if there is some edge that is adjacent to v and 2 if there is a loop at v. Adding these
values up yields the degree of the vertex v. This completes the proof.

Note that the adjacency matrix of a graph involves adjacency of vertices, where incidence
matrix of a graph involves incidence of vertices and edges.

Exercise
1. Write down the incidence matrix of the following graphs.

a b c
a b c
d
f
e d
e
g
a) b)

Figure 3.5:

2. Draw the graph represented by each of the following incidence matrices.

By Mesfin M, AAU
3.3 Subgraph 33

 
  0 1 1 0 0 0 1
0 1 0 1 1
 1 0 0
 1 1 0 0 0 1 0 
1 0   
   1 0 0 1 0 0 0 
 0 0 1
a)  0 0  b)  
 0 1 1
  0 0 0 0 0 1 1 
0 0   
 0 0 0 1 1 0 0 
1 0 0 0 1
0 0 1 0 1 1 0

3.3 Subgraph
Definition 14. A graph H is called a subgraph of a graph G, written H ⊆ G, if V (H) ⊆
V (G) and E(H) ⊆ E(G). If H ⊆ G but H 6= G, we call H a proper subgraph of G. If H
is a subgraph of G, then G is called a super graph of H. A spanning subgraph of G is a
subgraph that contains all vertices of G.
Definition 15. Let G = (V, E) and let V 0 ⊂ V . The subgraph of G induced by V 0 , denoted
G[V 0 ], is the graph H = (V 0 , E 0 ) where, for every x, y ∈ V 0 , xy ∈ E 0 if and only if xy ∈ E.
We say H = G[V 0 ] is an induced subgraph of G. The subgraph of G obtained by deleting V 0
is G[V \V 0 ], which is usually written as G − V 0 . If V 0 = {v}, it is common to write G − v.

3.4 Isomorphic Graphs


Definition 16. Let G = (V1 , E1 ) and H = (V2 , E2 ) be two simple graphs. An isomorphism
from G to H is a function f : V1 → V2 with the following properties:
a) f is one-to-one and onto.
b) For any two vertices u and v of G, if u and v are adjacent in G, then f (u) and f (v) are
adjacent in H, and if u and v are not adjacent in G, then f (u) and f (v) are not adjacent in
H.
If there exists an isomorphism from G to H, then we say that G and H are isomorphic.
Notation: If G and H are isomorphic, then we write G ≡ H (or simply G = H).
Example: The following two graphs are isomorphic.
u
e a
y v
b
d c x w
G H
Figure 3.6: Isomorphic graphs

Proof: The bijection f = {(a, v), (b, w), (c, y), (d, u), (e, x)} is an isomorphism between
the two graphs.

By Mesfin M, AAU
3.4 Isomorphic Graphs 34

How can we show that two graphs are not isomorphic? A better way of showing that two
graphs are not isomorphic is to find a graph-theoretic property that one graph has but the
other does not. For example two graphs with different numbers of edges or vertices cannot
possibly be isomorphic. If two graphs have the same number of edges and the same number
of vertices, then the problem is more difficult. In such cases, it is often useful to look at the
degrees of the vertices. For example, if one graph has two vertices with degree 3, and the
other has only one, then the graphs are not isomorphic. Sometimes even this test fails, and
it is necessary to look for another property that distinguishes the two graphs.
Example Show that the pairs of graphs shown below are not isomorphic.
G H

a b u v

d c w x
a)
a f u z
b e v y
c d w x
G H
b)
Figure 3.7:

Solution
(a) Both graphs in Figure 3.7 (a) have four vertices and three edges. However, the second
graph has a vertex with degree 3, while the first does not, so the graphs are not isomorphic.
(Note that it would be incorrect to say that they are not isomorphic because vertex a has
degree 2 in the first graph and degree 1 in the second. An isomorphism from one graph
to another does not necessarily associate vertices that happen to be labelled with the same
letter.)
(b) Both graphs in Figure 3.7(b) have six vertices and seven edges. Also, both graphs have
four vertices with degree 2 and two vertices with degree 3. However, the first graph has a se-
quence def of three vertices with degree 2, with d adjacent to e and e adjacent to f , whereas
there is no such sequence of three vertices with degree 2 in the second graph. Therefore the
graphs are not isomorphic.

By Mesfin M, AAU
3.5 Bipartite graph 35

Exercise
1. Find all non-isomorphic graphs on 3 vertices.
2. Find all non-isomorphic graphs on 4 vertices.
3. Find all non-isomorphic graphs with 5 vertices and 6 edges.

Definition 17. (Complement of a graph)The complement of a graph G denoted by Ḡ is a


graph with V (Ḡ) = V (G) but uv ∈ E(Ḡ) if and only if uv ∈
/ E(G).

Example

G Ḡ

G Ḡ
Figure 3.8:

Exercise
1. Draw a graph on 5 vertices and 6 edges. How many edges does its complement have?
2. If G has 12 vertices and 23 edges, how many edges does Ḡ have?

Definition 18. A simple graph G is said to be self complementary if G ≡ Ḡ.

Exercise
1. How many edges does a self-complementary graph on n vertices have?
2. Find self-complementary graphs on 4 vertices and 5 vertices.

3.5 Bipartite graph


Definition 19. A bipartite graph is a graph whose vertex set can be partitioned into two
subsets X and Y such that each edge has one end in X and one end in Y .
Such a partition (X, Y ) is called a bipartition of the graph. A complete bipartite graph is
a bipartite graph with bipartition (X, Y ) in which every vertex in X is adjacent to every
vertex in Y . The complete bipartite graph with parts of size |X| = n and |Y | = m is denoted
by Kn,m .

By Mesfin M, AAU
3.6 Paths and Connectivity of a graph 36

Example The complete bipartite graphs K2,3 , K3,4 and K3,3 are displayed below.

K2,3 K3,4 K3,3

Figure 3.9: Complete bipartite graphs

Exercise
1. How many edges does Kn,m have?
2. Let G be
P a bipartite P
graph with bipartition (X, Y ). Prove that
|E(G)| = x∈X d(x) = y∈Y d(y).

3.6 Paths and Connectivity of a graph


Definition 20. A walk in G is a nonempty sequence W = v0 e1 v1 e2 v2 e3 ...ek vk whose terms
are alternately vertices and edges, such that, ei = vi−1 vi for every i, 1 ≤ i ≤ k. We say W
is a walk from v0 to vk (or a (v0 , vk )-walk). The vertices v0 and vk are called the ends of
W . The vertices v1 , v2 , ...vk−1 are called the internal vertices. The integer k, which is the
number of edges in W , is the length of W .
Note: it is possible to specify W using only the sequence of vertices v0 , v1 , ...vk .

v1
e1 e2 e3
v7 v8 e4 v2
e5
e8
e10 v5 v3
e9 e7 e6
v6 v4

Figure 3.10:

The following are walks from the above graph.


1. W1 = v1 e2 v8 e4 v2 e5 v3 e6 v4 e7 v5 e8 v8 e2 v1 e1 v7
2. W2 = v6 e9 v5 e8 v8 e4 v2 e3 v1 e3 v2 e5 v3
3. W3 = v8 e4 v2 e3 v1 e2 v8 e8 v5 e7 v4
4. W4 = v7 e10 v6 e9 v5 e7 v4 e6 v3

Definition 21. Let W = v0 e1 v1 e2 v2 e3 ...ek vk be a walk. If all k edges in W are distinct, we


call W a trail. If all vertices in W are distinct, we call W a path.

By Mesfin M, AAU
3.6 Paths and Connectivity of a graph 37

Definition 22. The path graph Pn = (V, E) is the graph with V = (v1 , v2 , ..., vn ) and
E = (v1 v2 , v2 v3 , ...vn−1 vn ).

Figure 3.11: The path graphs P0 , P1 , P2 and P3 .

Definition 23. A walk is closed if it has positive length and it starts and ends at the same
vertex. A closed trail is called a cycle. A cycle of length k is called a k-cycle and denoted by
Ck . A k-cycle is an even cycle if k is even. A k-cycle is an odd cycle if k is odd. A 3-cycle
is usually called a triangle.
From the above definitions, one can note the following properties of paths and cycles:
• in a path the degree of each vertex is 2, except for the end vertices for which the degree
is 1,

• in a cycle the degree of each vertex is 2, and

• in a path the number of edges is one less than the number of vertices; in a cycle the
number of edges and of vertices are equal.

3.6.1 Connectivity and Graph Components


The connectivity is an important concept in graph theory. Two vertices u and v in G are
said to be connected if there is a (u, v)-path in G.
Definition 24. A graph G is connected if for any pair of vertices u and v of G, there is a
path from u to v.
Let G = (V, E) be a non-connected graph. The set partitioning is defined:
Definition 25. (Set partitioning) A set V is partitioned into subsets V1 , V2 , ..., Vk if
V1 ∪ V2 ∪ ... ∪ Vk = V and for all i and j with i 6= j, Vi ∩ Vj = ∅. {V1 , V2 , ..., Vk } is called a
partition of V .
Since the graph G is not connected, the vertex set V can be partitioned into subsets
V1 , V2 , ..., Vk and each vertex induced subgraph G[V1 ], G[V2 ], ..., G[Vk ] is connected, then there
exist no path between a vertex in subset Vi and a vertex in Vj , i 6= j.
Definition 26. The subgraphs G[V1 ], G[V2 ], ..., G[Vk ] are called the components of G. If G
has exactly one component,then G is connected. Otherwise, G is disconnected.

By Mesfin M, AAU
3.6 Paths and Connectivity of a graph 38

Example

a g a

b f i h b e

c d
c e

Figure 3.12: Connected graphs

1 v2 v3

v1 v4 v6
5 4 v7

6 2 v5 v8

Figure 3.13: Graphs with 2 components

By Mesfin M, AAU
3.6 Paths and Connectivity of a graph 39

Worksheet III

1.(a) If G is a k-regular graph with n vertices, how many edges does G have?
b) Draw a 3-regular graph with 11 vertices or prove that no such graph exists.
2. Find the order of a graph of size 45 with seven vertices of degree 6, five vertices of degree
4 and the remaining vertices of degree 7.
3. Is every subgraph of a complete graph is complete?
4. Let V = {1, 2, 3, 4, ..., n}. How many different simple graphs with vertex set V are there?
5. What is the maximum order of a simple graph of size 21 of deg(v) ≥ 3, ∀v ∈ V (G).
6. For each of the following, decide if the sequence is graphic. If so, find a graph with the
given degree sequence.
a) 2, 2, 2, 2, 2, 2 c) 7, 6, 5, 4, 3, 2, 1
b) 5, 5, 4, 3, 2, 1 d) 5, 4, 3, 3, 3, 2, 1
7. Find the degree sequence of k regular graph of order n.
8. Show that G ∼ = H if and only if G ∼ = H.
9 Consider the graph G = (V, E) with V = {1, 2, 3, 4, 5} and E = {12, 13, 23, 24, 34, 45}.
Give the set of edges, the incidence and adjacency matrices, and a drawing of the graphs
Gc , G − 4, G − 45 and G + 25.
2
10. Show that if G is simple and bipartite, then ||G|| ≤ |G|4 .
11. Show that δ ≤ 2||G||
|G|
≤ 4.
12. Prove that every subgraph of a bipartite graph is bipartite.
13. Prove that if a graph is regular of odd degree, then it has even order.
14. Are any of the following graphs isomorphic to each other? if no why?

G1 G2

G3 G4

Figure 3.14:

By Mesfin M, AAU
3.6 Paths and Connectivity of a graph 40

15. Construct an isomorphism between the following graphs:

G1
G2

Figure 3.15:

16. Find adjacency and incidence matrix for G1 and G2 .

17. If k is odd and G is k regular. Show that ||G|| is a multiple of k.


18. If G is self complementary graph on n vertices, then show that n ≡ 1( mod 4) or n ≡ 0(
mod 4).
19. Are there any self-complementary graphs on 6 vertices? 7 vertices? 8 vertices? If not,
prove why not. If possible, draw one.
20. In a company, there are 50 employees and some committees. If each employee belongs
to 6 committees and each committee consists of 10 people, how many committees are there?

By Mesfin M, AAU
3.7 Eulerian and Hamiltonian graphs 41

3.7 Eulerian and Hamiltonian graphs


Can we travel along the edges of a graph starting at a vertex and returning to it by traversing
each edge of the graph exactly once? Similarly, can we travel along the edges of a graph
starting at a vertex and returning to it while visiting each vertex of the graph exactly once?
Although these questions seem to be similar, the first question, which asks whether a graph
has an Euler circuit, can be easily answered simply by examining the degrees of the vertices
of the graph, while the second question, which asks whether a graph has a Hamilton circuit,
is quite difficult to solve for most graphs. In this section we will study these questions
and discuss the difficulty of solving them. Although both questions have many practical
applications in many different areas, both arose in old puzzles.

Definition 27. A trail in G is a walk in which no edge is repeated. A circuit is a closed


trail.

3.7.1 Euler paths and circuits.


Let G = (V,E) be a graph with no isolated vertices. An Euler path in G is a simple path
that transverses every edge of the graph exactly once. Analogously, an Euler circuit in G is
a simple circuit that transverses every edge of the graph exactly once.

Existence of Euler Paths and Circuits.The graphs that have an Euler path can be
characterized by looking at the degree of their vertices. Recall that the degree of a vertex
v, represented deg(v), is the number of edges that contain v (loops are counted twice). An
even vertex is a vertex with even degree; an odd vertex is a vertex with odd degree. The
sum of the degrees of all vertices in a graph equals twice its number of edges, so it is an even
number. As a consequence, the number of odd vertices in a graph is always even.

Let G be a connected multigraph. Then G contains an Euler circuit if and only if all
vertices of G have even degree. Also, G contains an Euler path from vertex a to vertex
b(6= a) if and only if a and b have odd degree, and all its other vertices have even degree.

3.7.2 Hamiltonian paths and circuits.


A Hamilton circuit in a graph G is a circuit that contains each vertex of G once (except for
the starting and ending vertex, which occurs twice). A Hamilton path in G is a path (not a
circuit) that contains each vertex of G once. Note that by deleting an edge in a Hamilton
circuit we get a Hamilton path, so if a graph has a Hamilton circuit, then it also has a
Hamilton path. The converse is not true, i.e., a graph may have a Hamilton path but not a
Hamilton circuit.

In general it is not easy to determine if a given graph has a Hamilton path or circuit,
although often it is possible to argue that a graph has no Hamilton circuit. For instance

By Mesfin M, AAU
3.8 Trees and forests 42

if G = (V, E) is a bipartite graph with vertex partition {V1 , V2 } (so that each edge in G
connects some vertex in V1 to some vertex in V2 ), then G cannot have a Hamilton circuit
if |V1 || =
6 |V2 |, because any path must contain alternatively vertices from V1 and V2 , so any
circuit in G must have the same number of vertices from each of both sets.
Theorem 12. (Diracs Theorem) If G is a simple graph with n vertices with n ≥ 3 such that
the degree of every vertex in G is at least n2 , then G has a Hamilton circuit.
Theorem 13. (Ores Theorem) If G is a simple graph with n vertices with n ≥ 3 such that
deg(u) + deg(v) ≥ n for every pair of nonadjacent vertices u and v in G, then G has a
Hamilton circuit.
Note that: A graph G is said to be Hamiltonian graph if it contains a Hamiltonian cycle
and Eulerian graph if it contains an Eulerian circuit. For example consider the following
four graphs:

b c b c b c b c

a g d g g a g d

f e f e f e e
f

G1 G2 G3 G4
Figure 3.16:

Graph a) is both Eulerian and Hamiltonian


Graph b) is Eulerian but not Hamiltonian. An Eulerian tour is bcgfegb
Graph c) is Hamiltonian but not Eulerian. A Hamiltonian cycle is bcgefb.
Graph d) is neither Eulerian nor Hamiltonian.

3.8 Trees and forests


One of the important classes of graphs is the trees so named because such graphs resemble
trees.. The importance of trees is evident from their applications in various areas, especially
theoretical computer science and molecular evolution. Trees are particularly useful in com-
puter science, where they are employed in a wide range of algorithms. For instance, trees
are used to construct efficient algorithms for locating items in a list.
Definition 28. A graph having no cycles is said to be acyclic. A tree is a connected graph
with no cycles, or a tree is a connected acyclic graph. The edges of a tree are called branches.
In a tree, a leaf is a vertex of degree 1.

By Mesfin M, AAU
3.8 Trees and forests 43

Figure 3.17:

Theorem 14. Let T be a graph with n vertices. Then the following statements are equiva-
lent.

1. T is a tree.

2. T contains no cycles and has n − 1 edges.

3. T is connected and has n − 1 edges.

4. T is connected, and the removal of any edge disconnects T .

5. Any two vertices of T are connected by exactly one path.

6. T contains no cycles, but the addition of any new edge creates a cycle.
Exercise Give an example of a tree with seven vertices and
a) exactly two vertices of degree 1
b) exactly four vertices of degree 1
c)exactly six vertices of degree 1

3.8.1 Spanning trees


Definition 29. A tree T is said to be a spanning tree of a connected graph G, if T is a
subgraph of G and T contains all vertices of G.
For example, the above diagram shows a graph and its three of its spanning trees.
The following result shows the existence of spanning trees in connected graphs.

Theorem 15. Every connected graph has at least one spanning tree.

By Mesfin M, AAU
3.8 Trees and forests 44

graph G Spanning tree Spanning tree Spanning tree

Figure 3.18:

Proof. Let G be a connected graph. If G has no cycles, then it is its own spanning tree. If
G has cycles, then on deleting one edge from each of the cycles, the graph remains connected
and cycle free containing all the vertices of G.

3.8.2 Rooted Trees


Sometimes it is convenient to consider one vertex of a tree as special; such a vertex is then
called the root of this tree. A tree with a fixed root is called a rooted tree.

Definition 30. A rooted tree is a tree in which a particular vertex is designated as the root
and every edge is directed away from the root.

We can change an un rooted tree into a rooted tree by choosing any vertex as the root.
Note that different choices of the root produce different rooted trees. We draw rooted trees
with the root at the top. The arrows indicating the directions of the edges can be omitted.
root

rooted graph

Figure 3.19:

The level of a vertex v is the length of the simple path from the root to v. The height of
a rooted tree is the maximum level of its vertices.
Let T be a tree with root v0 . Suppose that x, y and z are vertices in T and that (v0 , v1 , ..., vn )
is a simple path in T . Then:

By Mesfin M, AAU
3.9 Planar graphs 45

1. vn−1 is the parent of vn .

2. v0 , v1 , ..., vn−1 are ancestors of vn .

3. vn is a child of vn−1 .

4. If x is an ancestor of y, y is a descendant of x.

5. If x and y are children of z, x and y are siblings.

6. If x has no children, it is called a terminal vertex or leaf.

7. If x is not a terminal vertex, it is an internal or branch vertex.

8. The subtree of T rooted at x is the graph (V, E), where V is x together with its descen-
dants and E = edges of simple paths from x to some vertex in E.

Exercise
In the rooted tree T (with root a) shown in Figure 5, find the parent of c, the children of g,
the siblings of h, all ancestors of e, all descendants of b, all internal vertices, and all leaves.
What is the subtree rooted at g?

3.8.3 Binary trees


Definition 31. (Binary trees) A binary tree is a rooted tree in which each vertex has at
most two children, designated as left child and right child. If a vertex has one child, that
child is designated as either a left child or a right child, but not both.

root

Figure 3.20: Binary tree

3.9 Planar graphs


Definition 32. A graph G is planar if it can be drawn in the plane with its edges intersecting
at their vertices only. One such drawing is called an embedding of the graph in the plane.
A graph G is non planar if no plane drawing of G exists.

By Mesfin M, AAU
3.9 Planar graphs 46

For example, K4 is planar, since it can be drawn in the plane without edges crossing.
The following diagram shows three plane drawings of K4 .

Figure 3.21: plane drawing of K4

Definition 33. A plane graph G partitions the rest of the plane into a number of connected
regions; these regions are called the faces of G. We shall denote the set of faces and the
number of faces by F (G) and φ(G) respectively, in plane graph G. Each plane graph has
exactly one unbounded face, called the exterior face.
For example, any plane drawing of K4 divides the plane into four regions: three triangles(3
cycles) and one infinite region.
For example consider the following planar graph.
Note that there is one unbounded face (f4 here). This is called the exterior face.
Definition 34. The boundary of a face, f , is denoted by b(f ). The boundary can be
regarded as a closed walk with cut-edges traversed twice.
Example From the above graph,
b(f1 ) = v1 e1 v2 e8 v8 e8 v2 e9 v9 e11 v6 e6 v7 e7 v1 .
b(f 2) = v2 e2 v3 e3 v4 e10 v9 e9 v2 .
Definition 35. A face f is said to be incident with the vertices and edges in its boundary.
If e is a cut-edge, there is only one face incident to it. Otherwise, there are two faces incident
with e. We say that an edge separates the faces incident with it. The degree, dG (f ), of a
face f is the number of edges incident with it (cut edges are counted twice).

f4 f4
f2
f4 f3 f1
f3 f2 f1
f2 f3
f1

Figure 3.22:

By Mesfin M, AAU
3.10 Graph coloring 47

e2 v3
v2 e3
e1 e9 f2e v4
10
v1 e8 v9
v8 e11 f3 e4
e7 f1 v5
e5
v7 e6 v6
f4
Figure 3.23:

3.9.1 Euler’s formula


Theorem 16. (Euler’s Formula) Let G be a connected plane graph with v vertices, e edges,
and f faces. Then,
v+f −e=2
Corollary 3. If G is a (simple) planar graph and v(G) ≥ 3, then e ≤ 3v − 6.
Corollary 4. Let G be a (simple) planar graph. Then δ(G) ≤ 5.
Exercise Verify Euler’s formula for each of the following graphs.

G1
G2 G3

Figure 3.24:

3.10 Graph coloring


3.10.1 Vertex coloring
Definition 36. A vertex coloring of a graph is an assignment of a color to each vertex of the
graph. A vertex coloring is called a proper coloring if it assigns different colors to adjacent
vertices.
Note: as many applications consider proper vertex-colorings, the term k-coloring usually
refers to proper colorings with k colors.
G is said to be k-colorable if there is a proper k-coloring of its vertices.

By Mesfin M, AAU
3.10 Graph coloring 48

Definition 37. The minimum number of colors needed to properly color a given graph
G = (V, E) is called the chromatic number of G, and is represented χ(G).
Theorem 17. 1. Let G be a simple graph. The following statements are equivalent:

a) χ(G) = 2

b) G is bipartite

c) Every cycle in G has even length

2. Let G a simple graph whose maximum vertex degree is 4, then χ(G) ≤ 4 + 1.


Exercise
1. What is the chromatic number of K3 ?K4 ?K5 ?Kn ?
2. Find the chromatic numbers of the following graphs:

a) b) c) d)

Figure 3.25:

Hint: For each graph, devise a suitable coloring and explain why there is no coloring with
fewer colors.

3.10.2 Edge coloring


Definition 38. Given a simple graph G = (V, E), a k-coloring of the edges of G is an
assignment of one of k colors to each of the edges of G. A coloring is proper if no two
adjacent edges are assigned the same color. G is said to be k-edge-colorable if there is a
proper k-edge-coloring of its edges. The edge-chromatic number, or chromatic index, of G,
denoted χ0 (G), is the smallest k for which G is k-edge colorable.
If χ0 (G) = k, then G is called a k-edge chromatic graph.
Exercise
1. What is the edge-chromatic number of Kn ?
2. What is the edge-chromatic number of Cn ?

By Mesfin M, AAU

You might also like