Part-I Combinatorics: Elementary Counting Principles Objectives
Part-I Combinatorics: Elementary Counting Principles Objectives
CHAPTER 1
ELEMENTARY COUNTING PRINCIPLES
Objectives:-On completion of the chapter the students will be able to:
Introduction
Combinatorics is a fascinating branch of discrete Mathematics, which deals with the
art of counting. Very often we ask the question, In how many ways can a certain task
be done? Usually combinatorics comes to our rescue. In most cases, listing the
possibilities and counting them is the least desirable way of finding the answer to such
a problem. Enumeration, the counting of objects with certain properties is an
important part of combinatorics. We must count objects to solve many different type
of problems.
Counting is also required to determine whether there are enough telephone numbers
or internet protocol addresses to meet demand. Furthermore, counting techniques are
used extensively when probabilities of events are computed.
Discrete Mathematics And Combinatorics (Math 393) 2012
The elementary counting principle, which we will study section 1.1 to 1.3 can solve a
tremendous variety of problems. We can phrase many counting problems in terms of
ordered or unordered arrangements of the objects and combinations are used in many
counting problems.
Let 𝐴 and 𝐵 be two mutually exclusive tasks. Suppose task 𝐴 can be done in 𝑚 ways
and task 𝐵 in 𝑛 ways.Then there are 𝑛 + 𝑚 ways to do one of these tasks.
Example 1.1 Suppose that either a member of the mathematics faculty or a student
who is mathematics major is chosen as a representative to a university committee.
How many different choices are there for this representative if there are 37 members
of the mathematics faculty and 83 mathematics majors?
Solution: Let 𝐴 be the task, choosing a member of the mathematics faculty, can be
done in 37 ways. Let 𝐵 be the task, choosing a mathematics major, can be done in 83
ways. From the sum (addition) rule, it follows that there are 37 + 83 = 120 possible
ways to pick this representative.
The addition principle can be extended to any finite number of pair wise mutually
exclusive tasks, using induction, for instance, let 𝑇1 , 𝑇2 , 𝑇3 ,…, 𝑇𝑛 be 𝑛 pair wise
mutually exclusive tasks. Suppose task 𝑇𝑖 can be done in 𝑚𝑖 ways, where1 ≤ i ≤ n.
Then task𝑇1 , 𝑇2 , 𝑇3 ,…, 𝑇𝑛 can be done to 𝑚1 + 𝑚2 + ⋯ + 𝑚𝑛 ways.
Example 1.2: A freshman has selected four courses and needs one more course for
the next term. There are 15 courses in English, 10 in French and 6 in German. She is
eligible to task. In how many ways can she choose the fifth course?
Solution: Let 𝐸 be the task of selecting a course in English, 𝐹 be the task of selecting
a course in French and 𝐺 that of selecting a course in German.
These tasks can be done in 15,10 and 6 ways, respectively, and are mutually
exclusive, so by addition principle, the fifth course can be selected in |𝐸| + |𝐹| +
|𝐺| = 15 + 10 + 6 = 31 way.
Example 1.3: A student can choose a computer project from one of three lists. The
three lists contain 23,15and 19 possible projects, respectively. How many possible
projects are there to choose from?
Solution: Let 𝐴, 𝐵 𝑎𝑛𝑑 𝐶 be the first, second and third lists respectively. And the
list can be done 23, 15 and 19 ways respectively. Hence there are 23+15+19=57
projects to choose from.
The sum can be phrased in terms of sets as: if 𝐴1 , 𝐴2 , … , 𝐴𝑛 are disjoint sets, then the
number of elements in the union of these sets is the sum of the number of elements in
them. To relate this to our statement of the sum rule, let 𝑇𝑖 be the task of choosing an
element from 𝐴𝑖 for 𝑖 = 1,2, … , 𝑛. There are |𝐴𝑖 | (|𝐴𝑖 | is the notation for the
cardinality of 𝐴𝑖 ) ways to do 𝑇𝑖 . From the sum rule, since no two of the tasks can be
done, at the same time the number of ways to choose an element from one of the sets,
which is the number of elements in the union is
|𝐴1 ∪ 𝐴2 ∪ … 𝐴𝑛 | = |𝐴1 | + |𝐴2 | + ⋯ + |𝐴𝑛 |
This equality applies only when the sets in question are disjoint.
Exercise 1.1
1. There are 18 mathematics majors and 325 computer science major at a
college. How many ways are there to pick one representative who is either
mathematics major or a computer science major?
2. Let 𝐴 and 𝐵 be finite disjoint sets, where |𝐴| = 𝑎, and |𝐵| = 𝑏. find |𝐴 ∪ 𝐵|
3. Let 𝑈 be a universal set contain the disjoint set 𝐴 and 𝐵 such that |𝐴| = 2𝑎 +
𝑏, |𝑈| = 2𝑎 + 3𝑏. find |𝐴 ∪ 𝐵|
Objective: After completing this section the student should be able to:
Understand the method of inclusion-exclusion principle
Understand the difference between the method of sum rule and
inclusion-exclusion principle.
Proof:
|𝐴 ∪ 𝐵 ∪ 𝐶| = |𝐴 ∪ (𝐵 ∪ 𝐶)|
= |𝐴| + |𝐵 ∪ 𝐶| − |𝐴 ∩ (𝐵 ∪ 𝐶)| (By theorem 1.2)
= |𝐴| + [|𝐵| + |𝐶| − |𝐵 ∩ 𝐶|] − [|𝐴 ∩ 𝐵| ∪ |𝐴 ∩ 𝐶|]
= |𝐴| + |𝐵| + |𝐶| − |𝐵 ∩ 𝐶| − [|𝐴 ∩ 𝐵| + |𝐴 ∩ 𝐶| − |(𝐴 ∩ 𝐵) ∩ (𝐴 ∩ 𝐶)|]
= |𝐴| + |𝐵| + |𝐶| − |𝐵 ∩ 𝐶| − |𝐴 ∩ 𝐵| − |𝐴 ∩ 𝐶| + |𝐴 ∩ 𝐵 ∩ 𝐶|
Example 1.6: Find the number of positive integers ≤ 2076 and divisible by 3, 5 and
7.
Solution: Let 𝐴, 𝐵 𝑎𝑛𝑑 𝐶 denote the sets of positive integers ≤ 2076 and divisible by
3, 5 and 7, respectively, by the corollary 1.3
|𝐴 ∪ 𝐵 ∪ 𝐶| = |𝐴| + |𝐵| + |𝐶| − |𝐴 ∩ 𝐵| − |𝐴 ∩ 𝐶| − |𝐵 ∩ 𝐶| + |𝐴 ∩ 𝐵 ∩ 𝐶|
2076 2076 2076 2076 2076 2076 2076
= + + − − − +
3 5 7 15 21 35 105
Figure 1.1
- 13 students like vanilla and chocolate, so |𝑉 ∩ 𝐶| = 13 but 5 of them like
strawberry also, therefore, |(𝐶 ∩ 𝑉) − 𝑆| = 8
Of the 28 students who like strawberry, we have already a accounted for 7+5+6=18.
So, the remaining 10 students belongs to the set (𝑆 − (𝑉 ∪ 𝐶))
Similarly, |𝑉 − (𝐶 ∪ 𝑆)| = 30 𝑎𝑛𝑑 |𝐶 − (𝑆 ∪ 𝑉)| = 24
Thus, we have accounted for 90 of the 100 students.
The remaining 10 students lie outside the region 𝑉 ∪ 𝑆 ∪ 𝐶 as in figure 1.Now,
a) |𝐶 − 𝑆| = 8 + 24 = 32
So, 32 students like chocolate but not strawberry
b) |(𝐶 ∩ 𝑆) − 𝑉| = 6 Therefore, 6 students like both chocolate and strawberry
but not vanilla.
c) 30 + 8 + 24 = 62 students like vanilla or chocolate but not strawberry. They
are presented by the region (𝑉 ∩ 𝐶) − 𝑆.
Exercise 1.2
2. Let 𝐴 𝑎𝑛𝑑 𝐵 be finite disjoint set, where |𝐴| = 𝑎, |𝐵| = 𝑏. Find the
cardinality of each set
a) 𝐴∪𝐵 b) 𝐴 − 𝐵 c) 𝐵 − 𝐴
3. Find the cardinality of each set in (2) where 𝐴 ⊆ 𝐵, B is finite
4. According to a survey among 160 college students, 95 students takes a course
in English , 72 takes a course in French, 67 takes a course in German , 35 take a
course in English and in French , 37 takes a course in French and in German, 40
takes a course in
German and in English and 25 take a course in all three language. Find the number
of students in the survey who take a course in
a) English but not German b) English, French or German
Objective: After completing this section the student should be able to:
Understand the multiplication principle
Solve some counting problems using multiplication principle
The most important counting principle is the multiplication principle. It allows for
counting (like, example the experiment consisting of both rolling a dice and tossing a
coin), and this principle apply when a procedure is made up of separate task.
Multiplication principle: if an experiment consisting of 𝑘 independent steps, in such a
way that:
The first step has 𝑛1 possible out come
Any outcome of the first can be followed by 𝑛2 outcome of the 2nd step,
Any one of the first and the second step can be followed 𝑛3 outcome of the 3rd
step
.
.
.
Then the total number of outcomes 𝑛1 , 𝑛1 ,…, 𝑛𝑘
In total 𝑛1 𝑛2 𝑛3 =
3 × 2 × 4 = 24
possible out coomes.
Example 1.8 How many distinct phone numbers are there if we assume that a phone
number is made of 6 digits with the first digit begin different from 0 and 1?
Solution: Assume that 𝑎1 be the first digit, 𝑎2 be the second digits, 𝑎3 , 𝑎4, 𝑎5, 𝑎6 be
the 3rd , 4th ,5th and 6th digit respectively. But 𝑎1 ≠ 0 𝑎𝑛𝑑 1. So we have 8 possible
choice of 𝑎1 and we have 10 possible choices for the digit 𝑎2 to 𝑎6 .
Therefore, 8 × 105 = 800,000 distinct phone number.
Example 1.9 In how many ways can the letters of the word ‘CAR’ be reordered to
produce distinct ‘words’.
Solution: We have 3 possibilities for the first letter, 2 possibilities for the 2nd letter
and have to use the remaining letter. So, there are 3 × 2 × 1 = 6 distinct ‘words’.
Theorem 1.4 (Multiplication principle)
Suppose a task 𝑇 is made up of two subtasks. Subtask 𝑇1 followed by subtask 𝑇2 . If
subtask 𝑇1 can be done in 𝑚 1ways and subtask 𝑇2 in 𝑚 2 different way for each way
subtask 𝑇1 can be done, then task 𝑇 can be done in 𝑚1 𝑚2 ways.
Example 1.10 Find the number of two letter words that being with a vowel a,e,i,o or
u.
Solution :The task of forming a two-letter word consists of two subtasks 𝑇1 𝑎𝑛𝑑 𝑇2 ,
𝑇1 consisting of the first letter and 𝑇2 selecting the second letter; as figure 1.3 shows
Number of choices
? ?
Subtask 𝑇1 Subtask 𝑇2
Figure 1.3
Since each word must begin with a vowel, 𝑇1 can be accomplished in five ways.
There is no restriction on the choice of the 2nd letter, so 𝑇2 can be done in 26 ways
(figure 1.4).
Number of choices
5 26
Subtask 𝑇1 Subtask 𝑇2
Figure1. 4
Therefore, by the multiplication principle the task can be performed in
5 × 26 = 130 different ways. In other words, 130 two letter words begin with a
vowel.
The multiplication principle can also be extended to any finite number of subtasks.
Suppose a task 𝑇 can be done by n successive subtasks, 𝑇1 , 𝑇2 , … , 𝑇𝑛 . If subtask 𝑇𝑖 can
be done in 𝑚𝑖 different ways after𝑇𝑖−1 has been completed, where 1 ≤ 𝑖 ≤ 𝑛, then
task 𝑇 can be done in 𝑚1 × 𝑚2 × 𝑚3 × … × 𝑚𝑛 ways.
The multiplication principle can be applied to prove that a set with size n has 2𝑛
subsets, as shown below.
Example 1.11: Show that a set 𝑆 with n elements has 2𝑛 subset.
Solution: Every subset of 𝑆 can be uniquely identified by an 𝑛 − bit words (see
figure1.5). The task of forming an 𝑛 –bit word can be broken down to n subtasks.
Selecting a bit for each of the n- positions. Each position in the word
…
? ? ? ? ? ? ? ?
Figure 1.5
has two choices 0 or 1: so by the multiplication principle, the total number of n-bit
words that can be formed is 2.2 .2…2=2n(see figure1. 6)
…
2 2 2 2 2 2 2
Figure 1. 6
Example 1.12: How many one to one functions are there from a set with 𝑚 elements
to one with 𝑛 elements?
Solution: First note when 𝑚 > 𝑛 there is no one to one functions from a set with 𝑚
elements to a set with 𝑛 elements. Now let 𝑚 ≤ 𝑛. Suppose the elements in the
domain are 𝑎1 , 𝑎2 , … , 𝑎𝑚 . There are 𝑛 ways to choose the value of the function at 𝑎1 .
Since the function is one to one, the value of the function at 𝑎2 can be picked in (𝑛 −
1) ways (since the value used for 𝑎1 can’t be used again). In general, the value of the
function at 𝑎𝑘 can be choosen in 𝑛 − 𝑘 + 1 ways. By the multiplication principle,
there are
𝑛(𝑛 − 1)(𝑛 − 2) … (𝑛 − 𝑚 + 1) one to one functions from aset with 𝑚 elements to
one with 𝑛 element.
For instance, there are 5 × 4 × 3 = 60 one to one functions from a set with three
elements to a set with five elements.
Exercise 1.3
1. How many bit strings are there of length eight.
2. How many bit strings of length ten begin and end with a 1?
3. How many different functions are there from a set with 10 elements to a set
with the following numbers of elements
a) 2 b) 3 c) 4 d) 5
4. How many one to one function are there from a set with five elements to a set with
the following number of element
a) 4 b) 5 c) 6 d) 7
5. A multi-choice test contains ten questions. There are four possible answer for each
question
a) How many ways can a student answer the questions on the test if every
question is answered?
b) How many ways can a student answer the question on the test if the student
can leave answers blank?
6. A particular brand of shirt comes in 12 colors, has a male version and a female
version and comes in three sizes for each sex. How many different types of this shirt
are made?
1.4 permutation and combination
Objective: After completing this section the student should be able to:
Understand the method of permutation and combination
Explain the definition of permutation with and without repetition
Explain the definition of combination with and without repetition
Solve the counting problems using these methods.
Most counting problems we will be dealing with can be classified into one of four
categories. We explain such categories by means of an example.
Example1.13: Consider the set {𝑎, 𝑏, 𝑐, 𝑑}. Suppose we “select” two letters from these
four. Depending on our interpretation, we may obtain the following answers.
i. Permutations with repetitions. The order of listing the letters is important,
and repetition is allowed. In this case there are 4 ·4 = 16 possible selections:
𝑎𝑎 𝑎𝑏 𝑎𝑐 𝑎𝑑
𝑏𝑎 𝑏𝑏 𝑏𝑐 𝑏𝑑
𝑐𝑎 𝑐𝑏 𝑐𝑐 𝑐𝑑
𝑑𝑎 𝑑𝑏 𝑑𝑐 𝑑𝑑
𝑏𝑎 𝑏𝑐 𝑏𝑑
𝑐𝑎 𝑐𝑏 𝑐𝑑
𝑑𝑎 𝑑𝑏 𝑑𝑐
iii. Combinations with repetitions. The order of listing the letters is not
important, and repetition is allowed. In this case there are
4 ·3
+ 4 = 10 possible selections:
2
𝑎𝑎 𝑎𝑏 𝑎𝑐 𝑎𝑑
𝑏𝑏 𝑏𝑐 𝑏𝑑
𝑐𝑐 𝑐𝑑
𝑑𝑑
iv. Combinations without repetitions. The order of listing the letters is not
important, and repetition is not allowed. In this case there are.
4 ·3
= 6 Possible 𝑎𝑏 𝑎𝑐 𝑎𝑑
2
selections:
𝑏𝑐 𝑏𝑑
𝑐𝑑
Figure 1.7
Example 1.15 .Eight runners take part in a race. How many different of ways of
allocating medals (gold, silver and bronze) are there?
Solution: We choose 𝑟 = 3 medalists from the 𝑛 = 8 runners (the order dosen’t
matter). The number of 3 −permutation of 8 runners is 8 × 7 × 6 = 336 ways the
medals can be handed out, thus, 𝑝(8,3) = 336.
If we went to choose only 𝑟 ≤ 𝑛 of the n objects and retain the order in which we
choose the object the there are 𝑝(𝑛, 𝑟) = 𝑛(𝑛 − 1)(𝑛 − 2) … (𝑛 − 𝑟 + 1) different
ways of doing so.
Theorem 1.5: The number of 𝑟 −permutation of a set of 𝑛 (distinict) elements is
given by
𝒏!
𝑝(𝑛, 𝑟) = (𝒏−𝒓)!
Proof: The first elements of the permutation can be chosen in 𝑛 ways, since there are
𝑛 elements in the set. There are (𝑛 − 1) ways to choose the second elements of the
permutation. Since there are (𝑛 − 1) elements left in the set after using the element
picked for the first position.Similarlly, there are (𝑛 − 2) ways to choose the third
element, as so on until there are exactly 𝑛 − (𝑟 − 1) = 𝑛 − 𝑟 + 1 ways to choose the
nth element. Thus, by the multiplication principle,
𝑝(𝑛, 𝑟) = 𝑛(𝑛 − 1)(𝑛 − 2) … (𝑛 − 𝑟 + 1)
(𝑛−𝑟)(𝑛−𝑟−1)…2×1
= 𝑛(𝑛 − 1)(𝑛 − 2) … (𝑛 − 𝑟 + 1) (𝑛−𝑟)(𝑛−𝑟−1)…2×1
𝑛(𝑛−1)(𝑛−2)…(𝑛−𝑟+1)(𝑛−𝑟)(𝑛−𝑟−1)…2×1 𝑛!
= (𝑛−𝑟)(𝑛−𝑟−1)…2×1
= (𝑛−𝑟)!
𝑛!
𝑝(𝑛, 𝑟) =
(𝑛−𝑟)!
𝑛!
In particular, suppose 𝑟 = 𝑛 then 𝑝(𝑛, 𝑟) = 𝑝(𝑛, 𝑛) = = 𝑛!. So, 𝑝(𝑛, 𝑛) = 𝑛!
0!
Example 1.16 How many ways are there to select a first-prize winner, a second-
prize winner and a third-prize winner, from 100 different people who have entered
contest?
Solution: The number of ways to pick the three prize winner (1st ,2nd and 3rd ) is the
number of ordered selections of three elements from a set of 100 elements, that is the
3 −permutations of a set of 100 elements.
(100)! (100)! 100×99×98×97!
𝑝(100,3) = (100−3)! = = = 100 × 99 × 98 = 970,200
(97)! (97)!
Example 1.17: Find the number of words that can be formed by scrambling the letter
of the word SCRAMBLE (remember, a word is just an arrangement of symbols, it
need not make sense )?
Solution: The word SCRAMBLE contains eight distinct letters. Therefore, the
number of words that can be formed equals. The number of arrangement of the letters
in the word, namely
𝑝(8,8) = 8! = 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 = 40,320
Combinations without Repetitions
Consider again the case that we want to choose 𝑟 ≤ 𝑛 from 𝑛 objects, but this time
we do not want to retain the order. If we retained the order, there would be 𝑝(𝑛, 𝑟) =
𝑛!
possibilities. But 𝑟! of these ways result in the same set of 𝑟 objects. Since the
(𝑛−𝑟)!
Solution:
Exactly one subset contains zero element, the null set
Number of 0 − 𝑐ombinations: 𝐶(3,0) = 1
Three subsets contain one elements each: {𝑎}, {𝑏} 𝑎𝑛𝑑 {𝑐}.
Number of 1 −combinations: 𝐶(3,1) = 3
Three subset contains two elements each: {𝑎, 𝑏}, {𝑏, 𝑐}, 𝑎𝑛𝑑 {𝑐, 𝑎}
Number of 2 −combinations: 𝐶(3,2) = 3
Finally, exactly one subset contains three elements: the set itself
Number of 3 −compinations: 𝐶(3,3) = 1
Theorem 1.6: The number of 𝑟 −combinatios of a set with n elements, where 𝑛 is a
nonnegative integer and 𝑟 is an integer with 0 ≤ 𝑟 ≤ 𝑛 equals
𝑛!
𝐶(𝑛, 𝑟) = (𝑛−𝑟)!𝑟!
Note:
𝑛!
1. 𝐶(𝑛, 0) = 0!(𝑛−0)! = 1, that is, the number of 0 −combinations of a set with n
elements is one.
𝑛!
2. 𝐶(𝑛, 𝑛) = 𝑛!(𝑛−𝑛)! = 1, that is, the number of 𝑛 −combinations of a set with 𝑛
Example 1.21 Find the number of bytes contain exactly three 0’s
Solution:
𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑏𝑦𝑡𝑒𝑠 𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑏𝑦𝑡𝑒𝑠 𝑐𝑜𝑛𝑡𝑎𝑛𝑖𝑛𝑔 𝑡ℎ𝑟𝑒𝑒 0′ 𝑠
( )=( )
𝑐𝑜𝑛𝑡𝑎𝑖𝑛𝑔 𝑒𝑥𝑎𝑐𝑡𝑙𝑦 𝑡ℎ𝑟𝑒𝑒 0′𝑠 𝑎𝑛𝑑 𝑓𝑖𝑣𝑒 1′ 𝑠
=
𝑛𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑝𝑒𝑟𝑚𝑢𝑡𝑎𝑡𝑖𝑜𝑛𝑠 𝑜𝑓 𝑒𝑖𝑔ℎ𝑡 𝑠𝑦𝑚𝑏𝑜𝑙𝑠 𝑜𝑓
( )
𝑤ℎ𝑖𝑐ℎ 𝑡ℎ𝑟𝑒𝑒 𝑎𝑟𝑒 𝑙𝑖𝑘𝑒 (0′ 𝑠)𝑎𝑛𝑑 𝑓𝑖𝑣𝑒 𝑎𝑟𝑒 𝑎𝑙𝑖𝑘𝑒 (1′𝑠)
8!
= 3!5!
= 56
Example 1.22. Find the number of different arrangement of the letter of the word
REFERENCE.
Solution: The word REFERENCE contain nine letters; two R’s and four E’s, the
9!
remaining letters are distinct, now by theorem 1.9, the total number of words are2!4! =
7560.
Combinations with Repetitions
Just as permutation can deal with repeated elements, so can combinations (called
selections).
Example 1.23 Find the number of 3 −combination of the set 𝑆 = {𝑎, 𝑏}
Solution: 𝑆 contains 𝑛 = 2 elements. Since each combination must contain three
elements 𝑟 = 3. Since 𝑟 > 𝑛, the elements of each combination must be repeated.
Consequently, a combination may contain three a’s, two a’s and one b’s, one a’s and
two b’s or three b’s. Using the set notation, the 3-combinations are
{𝑎, 𝑎, 𝑎}, {𝑎, 𝑎, 𝑏}, {𝑎, 𝑏, 𝑏}, 𝑎𝑛𝑑 {𝑏, 𝑏, 𝑏}
So, there are four 3-combination of a set of two elements.
Theorem 1.10: The number of 𝑟 −combinations with repetition from a set of 𝑛
elements is
𝐶(𝑛 + 𝑟 − 1, 𝑟).
Proof: Each 𝑟 −combination with repeated elements from a set of 𝑛 elements can be
considered a string of 𝑟 𝑥′𝑠 and (𝑛 − 1) slashes (that means, for instance if 𝑛 =
3 𝑥𝑥 ∕ 𝑥𝑥 ∕ 𝑥𝑥 indicates that two elements select 1st task, two select 2nd and two
select 3rd task) each strings contains 𝑛 + 𝑟 − 1 symboles,of which 𝑟 are alike (𝑥’𝑠)
6. In how many different ways can five elements be selected order from a set with
three elements when repetition is allowed?
7. How many ways are there to select five unordered elements from a set with three
elements when repetition is allowed.
8. How many different ways are there to choose a dozen dounts from the 21 varieties at
a dount shpo?
9. A bagel shop has onion bagels, poppy seed bagels, egg bagels, salty bagels and plain
bagels. How many ways are there to choose.
a. Six bagels
b. A dozen bagels
c. Two dozen bagels
d. A dozen bagels with at least one of each kind
e. A dozen bagels with at least three egg bagels and no more than two slaty
bagels
10. How many different strings can be made from the letters in MISSISSIPPI, using all
the letters.
11. How many different strings can be made from the letter in ORONO, using some or all
of the letters
12. How many strings with five or more characters can be formed from the letters in
SEERESS?
4 4
( ) (2𝑎)(−3𝑏)3 + ( ) (−3𝑏)4
3 4
= (2𝑎)4 + 4(2𝑎)3 (−3𝑏) + 6(2𝑎)2 (−3𝑏)2 + 4(2𝑎)(−3𝑏)3 + (−3𝑏)4
= 16𝑎4 − 96 𝑎3 𝑏 + 216 𝑎2 𝑏 2 − 216𝑎𝑏 3 + 81𝑏 4
Example 1.26: What is the coefficient of 𝑥12 𝑦 13 in the expansion of (2𝑥 − 3𝑦)25
Solution : (2𝑥 − 3𝑦)25 = (2𝑥 + (−3𝑦))25. By the binomial theorem, we have
𝑛 𝑛
(2𝑥 − 3𝑦)25 = ∑𝑛𝑟=0 ( ) 𝑥 𝑛−𝑟 𝑦 𝑟 = ∑𝑛𝑟=0 ( ) (2𝑥)𝑛−𝑟 (−3𝑦)𝑟 .
𝑟 𝑟
Consequently, the coefficient of 𝑥12 𝑦 13 in the expansion is obtained when
𝑟 = 13 ,namely,
25 (2𝑥)25−13 25
( ) (−3𝑦)13 = ( ) (2𝑥)12 (−3𝑦)13
12 12
25
= ( ) (2)12 𝑥12 (−3)13 𝑦 13
12
25
= ( ) (2)12 (−3)13 𝑥12 𝑦 13
12
25!
= 13!12! 212 (−13)13
Corollary 1.14
𝑛 𝑛 𝑛 𝑛 𝑛 𝑛
( ) + ( ) + ( ) + ⋯ += ( ) + ( ) + ( ) + ⋯
0 2 4 1 3 5
Where 𝑛 ≥ 1,that is, the sum of the “even” binomial coefficient equals that of the
“odd” binomial coefficients.
Proof: By using the corollary 1.13, we have
𝑛
0 = ∑𝑛𝑟=0(−1)𝑟 ( )
𝑟
𝑛 𝑛 𝑛 𝑛
= ( ) (−1)0 + ( ) (−1)1 + ( ) (−1)2 + ⋯ + ( ) (−1)𝑛
0 1 2 𝑛
𝑛 𝑛 𝑛 𝑛 𝑛 𝑛
=( )−( )+( )−( )+( )−( )+⋯
0 1 2 3 4 5
𝑛 𝑛 𝑛 𝑛 𝑛 𝑛
= [( ) + ( ) + ( ) + ⋯ ] − [( ) + ( ) + ( ) + ⋯ ]
0 2 4 1 3 5
𝑛 𝑛 𝑛 𝑛 𝑛 𝑛
( )+( )+( )+⋯=( )+( )+( )+⋯
0 2 4 1 3 5
Corollary 1.15 Let n be a non negative integer. Then
𝑛
∑𝑛𝑟=0 2𝑟 ( ) = 3𝑛
𝑟
Proof: Again by the binomial theorem, put 𝑥 = 1 𝑎𝑛𝑑 𝑦 = 2 , then
𝑛 𝑛
(1 + 2)𝑛 = ∑𝑛𝑟=0 ( ) (1)𝑛−𝑟 (2)𝑟 = ∑𝑛𝑟=0 ( ) 2𝑟
𝑟 𝑟
𝑛
Hence , ∑𝑛𝑟=0 2𝑟 ( ) = 3𝑛
𝑟
Pascal’s identity and triangle
𝑛
Definition 1.3 The various binomial coefficients ( ) ,where 0 ≤ 𝑟 ≤ 𝑛, can be
𝑟
arranged in the form of a triangle, called Pascal’s triangle [Although Pascal’s triangle
is named after pascal, it appeared in 1330 work by the Chinese Mathematician
Chushi-kie], as shown in figure 1.8 and figure 1.9
0
( ) row 0
0
1 1
( ) ( ) row 1
0 1
2 2 2
( ) ( ) ( ) row 2
0 1 1
3 3 3 3
( ) ( ) ( ) ( ) row 3
0 1 2 3
4 4 4 4 4
( ) ( ) ( ) ( ) ( ) row 4
0 1 2 3 4
Figure 1.8
1 row 0
1 1 row 1
1 2 1 row 2
1 3 3 1 row 3
1 4 6 4 1 row 4
Figure1.9
Theorem 1.16 (Pascal identity) Let 𝑛 and 𝑟 be positive integers with 𝑛 ≥ 𝑟. Then
𝑛+1 𝑛 𝑛
( )=( )+( )
𝑟 𝑟−1 𝑟
Pascal’s triangle has the following property
𝑛 𝑛
Pascal’s identity, together with the initial condition ( ) = ( ) = 1 for all
0 𝑛
integers 𝑛, can be used to recursive define binomial coefficients.
Pascal’s triangle is symmetric about a vertical line through the middle. This is
so since 𝐶(𝑛, 𝑟) = 𝐶(𝑛, 𝑛 − 𝑟)
𝑛 𝑛
The last equality was obtained using the identity ( ) = ( )
𝑘 𝑛−𝑘
Theorem 1.19: Let 𝑛 and 𝑟 be non negative integers with 𝑟 ≤ 𝑛. Then
𝑛+1 𝑗
( ) = ∑𝑛𝑗=𝑟 ( )
𝑟+1 𝑟
Exercise 1.5
Chapter summery
Addition principle
If 𝐴 and 𝐵 are two mutually exclusive tasks and can be done in 𝑚 and 𝑛 ways,
respectively, then task a 𝐴 or 𝐵 can be done in 𝑚 + 𝑛 ways .
Inclusion-exclusion principle
Suppose task 𝐴 can be done in 𝑚 ways and task 𝐵 in 𝑛 ways. If both can be done in
𝑘 ways, then task A or 𝐵 can be done in 𝑚 + 𝑛 − 𝑘 ways.
Multiplication principle
𝑛!
𝑝(𝑛, 𝑟) =
(𝑛 − 𝑟)!
The permutation of n distinct objects are n!, 𝑝(𝑛, 𝑛) = 𝑛!
The number of 𝑟 −permutation of a set of 𝑛 objects with repetition allowed is 𝑛𝑟 .
An 𝑟-combination of a set of 𝑛 elements is a subset with size r, where 0 ≤ 𝑟 ≤ 𝑛.
𝑛
The number of r-combination is denoted by 𝐶(𝑛, 𝑟) 𝑜𝑟 ( ).
𝑟
𝑛!
𝐶(𝑛, 𝑟) = 𝑟!(𝑛−𝑟)! , 𝐶(𝑛, 𝑟) = 𝐶(𝑛, 𝑛 − 𝑟
𝑛
𝑛
(𝑥 + 𝑦) = ∑ ( ) 𝑥 𝑛−𝑟 𝑦 𝑛
𝑛
𝑟
𝑟=0
∑𝑛𝑟=0 𝐶(𝑛, 𝑟) =2 . 𝑛
A = {2,4,6, . . . ,114}.
9. Find the number of ways of dividing a set of size 𝑛 into two disjoint subsets of
sizes 𝑟 and 𝑛 − 𝑟
10. Find the number of three digit numerals that can be formed using the digit
2,3,5,6 and 9 if repetitions are not allowed
11. Find the number of ways seven boys and three girls can be seated in a row if
a) A boy sit at each end of the row
b) A girl sits at each end of the row
c) The girl sit together at one end of the row
12. Find the coefficient of each:
a) 𝑥 3 𝑦 5 in the expansion of (𝑥 + 𝑦)8
b) 𝑥 4 𝑦 6 in the expansion of (𝑥 − 𝑦)10
c) 𝑥 2 𝑦 6 in the expansion of (2𝑥 + 𝑦)8
13. Use the binomial theorem, expand each
a) (𝑥 + 𝑦)6 c) (2𝑥 − 1)6
b) (𝑥 − 𝑦)5 d) (𝑥 + 2𝑦)5
14. Find the largest binomial coefficient in the expansion of each
a) (𝑥 + 𝑦)5 c) (𝑥 + 𝑦)6
b) (𝑥 + 𝑦)4 d) (𝑥 + 𝑦)8
Reference:-
1. A. W.F.Edwards,Pascal’s Arithmeticical Triangle. The Johns Hopkins University
Press, Baltimore,MD, 2002.
2. Branislav Kisacanin, Mathematical problems and proof, combinatorics, number
theory and geometry
3. C.Oliver, “ The Twelve Days of Christmas,” Mathematics Teacher, Vol. 70
4. D .P.Acharjya Sreekumar, Fundamental Approach to Discrete Mathematics, 3rd
eedition.
5. Discrete Mathematics, Handbook of discrete and Compinatorial Mathematics
6. Hewel Hus, Schaum’s outline, probability Random Variable
7. J.M.Harris.Jeffry L.Hirst.Michael J.Mossinghoff, Combinatorics and Graph Theory,
2nd edition
8. Kenneth H.Rosen, Discrete Mathematics and its application, 3rd edition.
9. KOSHY, Discrete Mathematics with application
10. M.Eng and J.Casey, “Pascal’s Arithmetical Triangle-ASerendipitious Source for
programming Activities,’’ Mathematics Teacher, Vol 76
11. Mott, Knadel and Baker, Discreate Mathematics
12. P.Z.Chinn,’’inductive patterns, finite Difference, and a Missing Region,’’
Mathematics Teacher, Vol.81(Sept.1988)
13. R.P.GRIMALDI and B.V.RAMANA pearson, Discreate combinatorial
mathematics
14. Seymour Lipschutz,Schaum’s outline, Discrete Mathematics, 3rd edition
15. Steven G. Krantz, Discrete Mathematics
CHAPTER 2
ELEMENTARY PROBABILITY THEORY
Objective: At the end of this chapter the student should be able to:
Introduction
Probability theory is a mathematical modeling of the phenomenon of chance or
randomness. If a coin is tossed in a random manner, it can land heads (𝐻) or tails
(𝑇),with equally likely. Each of them, 𝐻 or 𝑇 is an outcome of the experiment to
tossing the coin. The set {𝐻, 𝑇} of the possible outcomes of the experiment is the
sample space of the experiment. A probabilistic mathematical model of random
phenomena is defined by assigning “probabilities” to all the possible outcomes of an
experiment. The reliability of our mathematical model for a given experiment depends
upon the closeness of the assigned probabilities to the actual limiting relative
frequencies.
In this chapter the basic concepts of probability theory are presented. We see the
definition of important terms that are used to solve the probability of a given
experiments. In section 2.1 we will study experiments with finitely many out comes
that are not necessary equally likely. From section 2.2 to 2.4 we introduce some
probability concepts in probability theory, including conditional probability and
independence of events. Finally we discussed the concept of the random variable and
the expectation and variance of a random variable.
Definition 2.1:
A) Random experiments:
An experiment is a procedure that yields one of a given set of possible outcomes. An
experiment is called a random experiment if its outcome cannot be predicted.
Typical experiments of a random experiment are the roll of a die, the toss of a coin or
drawing a card from a deck.
B) Sample space
The set 𝑆 of all possible outcomes of a given experiment is called the sample space or
universal set (𝑆 is the notation for a sample space and assumes that 𝑆 is non- empty).
A particular outcome, i.e., an element in S, is called a sample point. Each outcome of
a random experiment corresponding to a sample point.
Example 2.1 Find the sample space for the experiment of tossing a coin (a) one and
(b) twice
Solution: a) There are two possible outcomes, head or tails, thus
𝑆 = {𝐻, 𝑇}
b) There are four possible outcomes. They are pairs of heads and tails.
Thus,
𝑆 = {𝐻𝐻, 𝐻𝑇, 𝑇𝐻, 𝑇𝑇}
Example 2.2: Find the sample space for the experiment of tossing a coin repeatedly
and of counting the number of tosses required until the first head appears.
Solution: Clearly all possible outcomes for this experiment are the terms of the
sequence 1,2,3 …. Thus
𝑆 = {1,2,3, … }
Note that there are infinite number of outcomes (i.e. the sample space is infinite).
Example 2.3: Find the sample space for the experiment of toss a (six sided) die.
The sample consists of the six possible numbers, that is
𝑆 = {1,2,3,4,5,6} .
Note that: Any particular experiment can be often having many different sample
spaces depending on the observation of interest.
EXAMPLE 2.5: Consider the experiment of toss a coin three times. Let 𝐴 be the
event of obtaining exactly two heads, let 𝐵 be that of obtaining at least two heads and
C that of obtaining four heads. Express events A, B and C
Solution: By the multiplication principle, the sample space S consists of 2 × 2 ×
2 = 8 possible outcome: see figure 2.1
The sample space consists of the following eight elements:
𝑆 = {𝐻𝐻𝐻, 𝐻𝐻𝑇, 𝐻𝑇𝐻, 𝐻𝑇 𝑇, 𝑇 𝐻𝐻, 𝑇𝐻𝑇 , 𝑇 𝑇𝐻, 𝑇 𝑇 𝑇 }
H 𝐻 𝐻𝐻𝐻
H T HHT
T H HTH
T 𝐻𝑇𝑇
𝑇 T𝐻𝑇
T 𝐻 𝐻 𝑇𝐻𝐻
H TTH
T
Figure 2.1 T 𝑇𝑇𝑇
EXAMPLE 2.7 Consider the experiment toss a pair of dice. Let 𝐴 be the event that
the sum of two numbers is 6, and let 𝐵 be the event that the largest of the two number
is 4. Express the event 𝐴 and 𝐵
Solution: There are six possible numbers, 1, 2, . . . , 6, on each die. Thus 𝑆 consists of
the pairs of numbers from 1 to 6, and hence 𝑛(𝑆) = 36. Figure 2.2 shows these 36
pairs of numbers arranged in an array where the rows are labeled by the first die and
the columns by the second die.
𝐴 = {(1, 5), (2, 4), (3, 3), (4, 2), (5, 1)},
𝐵 = {(1, 4), (2, 4), (3, 4), (4, 4), (4, 3), (4, 2), (4, 1)} .
Then the event “𝐴 and 𝐵” consists of those pairs of integers whose sum is 6 and
whose largest number is 4 or,in other words, the intersection of 𝐴 and 𝐵.
Thus
𝐴 ∩ 𝐵 = {(2, 4), (4, 2)}
Similarly, “𝐴 or 𝐵,” the sum is 6 or the largest is 4, shaded in Fig. 2.2, is the union A
First die
1 2 3 4 5 6
1 (1,1) (1,2) (1,3) (1,4) (1,5) (1,6)
2 (2,1) (2,2) (2,3) (2,4) (2,5) (2,6)
3 (3,1) (3,2) (3,3) (3,4) (3,5) (3,6)
Second die
4 (4,1) (4,2) (4,3) (4,4) (4,5) (4,6)
5 (5,1) (5,2) (5,3) (5,4) (5,5) (5,6)
6 (6,1) (6,2) (6,3) (6,4) (6,5) (6,6)
Figure 2.2
Exercise 2.1
1. Consider a random experiment of tossing a coin three times.
a. Find the sample space 𝑆1, if we wish to observe the number of heads
and tails obtained.
b. Find the sample space 𝑆2 , if we wish to observe the number of heads in
the three tosses.
a) Find the sample space 𝑆1 of the experiment if the first card is replaced before
the second is drawn.
b) Find the sample space 𝑆2 of the experiment if the first card is not replaced.
4. Consider the experiment of selecting items from a group consisting of three
{𝑎, 𝑏, 𝑐}.
a) Find the sample space 𝑆1 of the experiment in which two items are selected
without replacement.
b) Find the sample space 𝑆2 of the experiment in which two items are selected
with replacement.
5. Find the sample space for experiment consisting of measurement of the
voltage 𝑉 from a transducer, the maximum and minimum of which are +5 and −5
volts, respectively.
6. An experiment consists of tossing two dice.
a) Find the sample space 𝑆
b) Find the event 𝐴 that the sum of the dotes on the dice is greater than 10
c) Find the event 𝐵 that the sum of the dotes on the dice is greater than 12
d) Find the event 𝐶 that the sum of the dotes on the dice is greater than 7
2.2 Probability of an event
Objective: After study this section the student should be able to:
Define the probability of an event
Explain the property of probability
Calculate the probability of events
Definition 2.2: Let 𝑆 be a finite sample space, say 𝑆 = {𝑎1 , 𝑎2 , 𝑎3 , … , 𝑎𝑛 }. A finite
probability space, or probability model, is obtained by assigning to each point 𝑎𝑖 in S
a real number 𝒑𝒊 called the probability of 𝒂𝑖 satisfying the following properties:
I. Each 𝑝𝑖 is nonnegative, that is, 𝑝𝑖 ≥ 0.
II. The sum of the 𝑝𝑖 is 1, that is, is 𝑝1 + 𝑝2 +・ ・ ・+𝑝𝑛 = 1
The probability of an event 𝐴 written 𝑃(𝐴), is then defined to be the sum of the
probabilities of the points in 𝐴. The singleton set {𝑎𝑖 } is called an elementary event
and, for notational convenience, we write P(𝑎𝑖 ) for P({𝑎𝑖 }).
EXAMPLE 2.8: Suppose three coins are tossed, and the number of heads is recorded.
Let 𝐴 be the event that at least one head appears, and let B be the event that all heads
or tails appears. Find the probability of event 𝐴 and 𝐵.
Solution: The sample space is 𝑆 = {0, 1, 2, 3}. The probability of the elements of 𝑆.
1 3 3 1
P(0) = 8 , P(1) = 8 , P(2) = 8 , P(3) = 8
That is, each probability is nonnegative, and the sum of the probabilities is 1.
𝐴 = {1, 2, 3} 𝑎𝑛𝑑 𝐵 = {0, 3}.
3 3 1 7
Then, by definition, 𝑃(𝐴) = 𝑃(1) + 𝑃(2) + 𝑃(3) = + + = and
8 8 8 8
1 1 1
𝑃(𝐵) = 𝑃(0) + 𝑃(3) = + =
8 8 4
Example 2.9: Let a card be selected from an ordinary deck of 52 playing cards. Let
A = {the card is a spade} and B = {the card is a face card}.
What is P(A), P(B), and P(A ∩ B).
number of spades 13 1
Solution: Using definition 2.3, P(A) = = 52 = 4
number of card
number of face cards 12 3
P(B) = = 52 = 12
number of card
number of spade face cards 3
P(A ∩ B) = = 52
number of card
Example 2.10 An urn contains four blue ball and five red ball. What is the probability
that a ball chosen from the urn is blue?
Solution: Calculate the probability, note that there are nine possible outcomes, and
four of these possible outcomes produce a blue ball, hence, the probability that a blue
4
is chosen is .
9
4. 𝑃(∅) = 0
5. 𝑃(𝐴 ∪ 𝐵) = 𝑃(𝐴) + 𝑃(𝐵) − 𝑃(𝐴 ∩ 𝐵)
Example 2.11: Find the probability of obtaining at least one head when three coins
are tossed.
Solution: Let A be the event of obtaining at least one head. Then Ac denotes the
1
event of obtaining no heads occur, p(Ac ) = 8, therefore ,
1 7
p(A) = 1 − p(Ac ) = 1 − 8 = 8
Definition 2.4: Suppose that 𝑆 is a set with 𝑛 elements. The uniform distribution
1
assigns the probability to each elements of 𝑆. The experiment of selecting an
𝑛
Definition 2.5: The probability of the event E is the sum of the probabilities of the
outcomes in E. that is, 𝑝(𝐸) = ∑𝑠∈𝐸 𝑃(𝑠)
Example 2.13: Suppose that a die is biased (or loaded) so that 3 appears twice as
often as each other number but that the other five outcomes are equally likely. What is
the probability that an odd number appears when we roll is this die?
Solution: We want to find the probability of the event,{1,2,3,4,5,6} , 𝐴 = {1,3,5}
and given that
𝑝(3) = 2𝑝(1) = 2𝑝(2) = 2𝑝(4) = 2𝑝(5) = 2𝑝(6)
𝑃(𝐸) = ∑6𝐼=1 𝑝(𝑎𝑖 ) = 1
𝑝(𝑎1 ) + 𝑝(𝑎2 ) + 𝑝(𝑎3 ) + 𝑝(𝑎4 ) + 𝑝(𝑎5 ) + 𝑝(𝑎6 ) = 1
𝑝(1) + 𝑝(2) + 𝑝(3) + 𝑝(4) + 𝑝(5) + 𝑝(6) = 1
1 1 1 1 1
𝑝(3) + 2 𝑝(3) + 𝑝(3) + 2 𝑝(3) + 2 𝑝(3) + 2 𝑝(3) = 1
2
7 1
𝑝(3) = 1 => 𝑝(3) = 7
2
1 1
𝑃(1) = 𝑃(2) = 𝑃(4) = 𝑃(5) = 𝑃(6) = 7 , 𝑝(3) = 7.
1 2 1 4
It follows that 𝑝(𝐴) = 𝑝(1) + 𝑝(3) + 𝑝(5) = 7 + 7 + 7 = 7.
Suppose that there are 𝑛 equally likely outcomes; each possible outcome has
1
probability 𝑛, since the sum of their probability is 1. Suppose the event E contains m
𝑚 |𝐸|
𝑝(𝐸) = = |𝑆|
𝑛
Theorem 2.1 (Inclusion- exclusion principle). If A and B are any two events of a
finite sample space, S. The probability that at least one of them will occurs is given by
𝑝(𝐴 ∪ 𝐵) = 𝑝(𝐴) + 𝑝(𝐵) − 𝑝(𝐴 ∩ 𝐵)
Proof: By the inclusion –exclusion principle on a set,
|𝐴 ∪ 𝐵| = |𝐴| + |𝐵| − |𝐴 ∩ 𝐵|
|𝐴∪𝐵| |𝐴| |𝐵| |𝐴∩𝐵|
Then |𝑆|
= |𝑆|
+ |𝑆| − |𝑆|
.
That
𝑝(𝐴 ∪ 𝐵) = 𝑝(𝐴) + 𝑝(𝐵) − 𝑝(𝐴 ∩ 𝐵).
In particular, if 𝐴 and 𝐵 are mutually exclusive 𝐴 ∩ 𝐵 = ∅ and hence
𝑝(𝐴 ∩ 𝐵) = 0.
Therefore,
𝑝(𝐴 ∪ 𝐵) = 𝑝(𝐴) + 𝑝(𝐵)
Theorem 2.2: (Addition Principle): If 𝐴 and B are mutually exclusive events of a
finite sample space. Then 𝑃(𝐴 ∪ 𝐵) = 𝑃(𝐴) + 𝑃(𝐵).
EXAMPLE 2.14: Suppose a student is selected at random from 100 students where
30 are taking mathematics,20 are taking chemistry, and 10 are taking mathematics and
chemistry. Find the probability p that the student is taking mathematics or chemistry.
Solution: Let M = {students taking mathematics} and C = {students taking
chemistry}.
30 3
𝑃(𝑀) = = ,
100 10
20 1
𝑃(𝐶) = =5
100
10 1
P(Mand C) = P(M ∩ C) = = 10
100
Example 2.15 A survey among 50 house wives about the two laundry detergent
Lex(L) and Rex(R), shows that 25 like Lex, 30 like Rex, 10 like both, and 5 like
neither. A house wives is selected at random from the group surveyed. Find the
probability that she likes neither Lex nor Rex.
25 30
Solution: Using the Venn diagram in figure 2.2, we have 𝑝(𝐿) = 50 , 𝑝(𝑅) = 50
10
𝑝(𝐿 ∩ 𝑅) = 50,
1 3 1 9
𝑝(𝐿 ∪ 𝑅) = 𝑃(𝐿) + 𝑃(𝑅) − 𝑃(𝐿 ∩ 𝑅) = 2 + 5 − 5 = 10
Exercise 2.2
1. A card is drawn at random from a standard deck of cards. Find the
probability of obtaining
a) A king c) A king or a queen
b) A club d) A club or a diamond
2. What probability should be assigned to the out come of heads when a biased
coin is tossed, if heads is three times as likely to come up as tail. What probability
should be assigned to the outcome of tails?
3. Two dice are rolled. Find the probability of obtaining
a) Two five c) A five and a six
b) A sum of four d) A sum less than five
4. Two cards are drawn at random from a standard deck of card. Find the
probability that:
a) Both are king d) One is a king and the other a
queen
b) Both are club
c) One is a club and the other a diamond.
5. Let 𝑈 = {𝑎, 𝑏, 𝑐, 𝑑, 𝑒} be the sample space of an experiment, where the
outcomes are equally likely. Find the probability of each event
a) {𝑎} c ) {𝑎, 𝑐 , 𝑑}
b) {𝑎, 𝑏} d) ∅
6. Let 𝑝(𝐴) = 0.9 and 𝑝(𝐵) = 0.8. show that 𝑝(𝐴 ∩ 𝐵) ≥ 0.7
7. A random experiment has sample space 𝑆 = {𝑎, 𝑏, 𝑐}. Suppose that 𝑝(𝑎, 𝑐) =
0.75 and 𝑝(𝑏, 𝑐) = 0.6.Find the probability of the elementary events.
1
8. Let 𝐴, 𝐵 𝑎𝑛𝑑 𝐶 be three events in 𝑆. If 𝑝(𝐴) = 𝑝(𝐵) = 3 , 𝑝(𝐴 ∩ 𝐵) =
1 1
, 𝑝(𝐴 ∩ 𝐶) = and 𝑝(𝐵 ∩ 𝐶) = 0 find 𝑃(𝐴 ∪ 𝐵 ∪ 𝐶)
8 6
6 1
Suppose 𝐸 be the event of rolling a sum of seven with two dice. Then 𝑝(𝐸) = =
36 6
. Suppose a 3 comes up on one of the dice. This reduces the sample space to
{(1,3), (2,3), (3,1), (3,2), (3,3), (3,4), (3,5), (3,6), (4,3), (5,3), (6,3)}
consequently, a sum of 7 can be obtained in two ways: {(3,4), (4,3)}. Therefore, the
2
probability of getting a sum of seven, knowing that a three has been rolled is 11. Thus
Suppose 𝑆 is a sample space, and 𝑛(𝐴) denotes the number of elements in 𝐴. Then
𝑛(𝐴∩𝐵) 𝑛(𝐵) 𝑝(𝐴∩𝐵) 𝑛(𝐴∩𝐵)
𝑃(𝐴 ∩ 𝐵) = , 𝑝(𝐵) = , and so on 𝑝(𝐴\𝐵) = =
𝑛(𝑆) 𝑛(𝑆) 𝑝(𝐵) 𝑛(𝐵)
EXAMPLE 2.16; (a) A pair of fair dice is tossed. The sample space 𝑆 consists of the
36 ordered pairs (𝑎, 𝑏), where 𝑎 and 𝑏 can be any of the integers from 1 to
1
6.(see example 2.6 )Thus the probability of any point is 36 . Find the probability
known that:
𝑖) 𝐴𝑡 least one of the children is a boy;
(𝑖𝑖) the older child is a boy.
Solution: Let 𝐸 be the set contain both children are boy, 𝐸 = {𝑏𝑏}
𝑖) Here the reduced space consists of three elements, 𝐴 = {bb, bg, gb}; then
𝑃(𝐴∩𝐸) 1
𝑝 = 𝑝(𝐸\𝐴) = =3
𝑃(𝐴)
𝑖𝑖) Here the reduced space consists of only two elements 𝐵 = {bb, bg};
𝑃(𝐵∩𝐸) 1
Then 𝑝 = 𝑝(𝐸\𝐵) = =2
𝑝(𝐵)
Example 2.17: A bit strength of length four is generated at random, so that each of
the 16 bit strings of length four is equally likely. What is the probability that it
contains at least two consecutive 0’s, given that its bit is a 0? (We assume that 0 bit
and 1 bit are equally likely)
Solution: Let 𝐴 be the event that a bit strings of length four contains at least two
consecutive 0𝑠, and 𝐵 be the event that the first bit of a bit string of length four is a 0.
The probability that a bit string of length four has at least two consecutive 0s, given
𝑝(𝐴∩𝐵)
that its first bit is a 0. Equals 𝑝(𝐴\𝐵) = .
𝑝(𝐵)
FIGURE 2.3
The multiplication theorem gives us a formula for the probability that events 𝐴 and 𝐵
both occur. It can easily be extended to three or more eventsA1 , A2 , . . . Am ; that is,
𝑃(A1 ∩ A2 ∩ . . .∩ Am ) = 𝑃(A1 ) ・ 𝑃(A2 \A1 ) ・ ・ ・ 𝑃(Am \A1 , A2 , . . . Am−1 )
EXAMPLE 2.17 A lot contains 12 items of which 4 are defective. Three items are
drawn at random from the lot one after the other. Find the probability p that all three
are non-defective.
8
Solution: The probability that the first item is non-defective is 12 since 8 of 12 items
are non-defective. If the first item is non-defective, then the probability that the next
7
item is non-defective is since only 7 of the remaining 11 items are non-defective.
11
If the first 2 items are non-defective, then the probability that the last item is non-
6
defective is 10 since only 6 of the remaining 10 items are now non-defective.
Example 2.18: Two marbles are drawn successively from a box of three black and
four white marbles. Find the probability that both are black if the first marble is not
replaced before the second drawing.
3
Solution: Let 𝐵1 be the event drawing the first black marble, then 𝑝(𝐵1 ) = 7 and
let 𝐵2 be the event of drawing a second black marble. Since the first marble is not
replaced before the second is drawn, there are only two black balls left in the box at
2
the second drawing. Therefore, 𝑝(𝐵2 \𝐵1 ) = . Consequently, the probability of
6
Exercise 2.3
1. What is the conditional probability that a family with two children has two
boys, given they have at least one boy.
2. Find 𝑝(𝐴\𝐵) if a) 𝐴 ∩ 𝐵 = ∅, b) 𝐴 ⊂ 𝐵 and c) 𝐵 ⊂ 𝐴
3. Two manufacturing plants produce similar parts. Plant 1 produces 1000
parts, 100 of which are defective. Plant 2 produce 2000 parts, 150 of which are
defective. A part is selected at random and found be defective. What is the probability
that it came from plant 1?
4. Two cards are drawn at random from a deck. Find the probability that both
are aces.
There are also eight bit strings of length four that contain an even number of ones:
0000,0011,0101,0110,1001,1010,1100 𝑎𝑛𝑑 1111.
8 1
Since there are 16 bit strings of length four, it follows that 𝑝(𝐴) = 𝑝(𝐵) = 16 = 2.
4 1
Because 𝐴 ∩ 𝐵 = {1111,1100,1010,1001}, we see that 𝑝(𝐴 ∩ 𝐵) = 16 = 4. Since
1 1 1
𝑝(𝐴 ∩ 𝐵) = 4 = 2 × 2 = 𝑝(𝐴)𝑝(𝐵). We conclude that A and 𝐵 are independent.
Example 2.20: A fire coin is tossed three times. Consider the events:
A = {𝑓𝑖𝑟𝑠𝑡 𝑡𝑜𝑠𝑠 𝑖𝑠 ℎ𝑒𝑎𝑑𝑠}
B = {𝑠𝑒𝑐𝑜𝑛𝑑 𝑡𝑜𝑠𝑠 𝑖𝑠 ℎ𝑒𝑎𝑑𝑠}
C = {𝑒𝑥𝑎𝑐𝑡𝑙𝑦 𝑡𝑤𝑜 ℎ𝑒𝑎𝑑𝑠 𝑖𝑛 𝑟𝑜𝑤}
Show that A and C are independent.
Solution: The sample space is
S = {𝐻𝐻𝐻, 𝐻𝐻𝑇, 𝐻𝑇𝐻, 𝐻𝑇𝑇, 𝑇𝐻𝐻, 𝑇𝐻𝑇, 𝑇𝑇𝐻, 𝑇𝑇𝑇} and the events are:
A = {𝐻𝐻𝐻, 𝐻𝐻𝑇, 𝐻𝑇𝐻, 𝐻𝑇𝑇}, B = {𝐻𝐻𝐻, 𝐻𝐻𝑇, 𝑇𝐻𝐻, 𝑇𝐻𝑇}𝑎𝑛𝑑 C =
{𝐻𝐻𝑇, 𝑇𝐻𝐻}
And A ∩ B = {𝐻𝐻𝐻, 𝐻𝐻𝑇}, A ∩ C = {𝐻𝐻𝑇} 𝑎𝑛𝑑 B ∩ C = {𝐻𝐻𝑇, 𝑇𝐻𝐻}
We have:
4 1 4 1 2 1
𝑝(𝐴) = 8 = 2 , 𝑝(𝐵) = 8 = 2 , 𝑝(𝐶) = 8 = 4
1 1 1
𝑝(𝐴 ∩ 𝐵) = 4 , 𝑝(𝐴 ∩ 𝐶) = 8 , 𝑝(𝐵 ∩ 𝐶) = 4
Accordingly,
1 1 1
𝑝(𝐴)𝑝(𝐵) = 2 × 2 = 4 = 𝑝(𝐴 ∩ 𝐵), and so 𝐴 and 𝐵 are independent
1 1 1
𝑝(𝐴)𝑝(𝐶) = 2 × 4 = 8 = 𝑝(𝐴 ∩ 𝐶), and so 𝐴 and 𝐶 are independent
1 1 1
𝑝(𝐶)𝑝(𝐵) = 2 × 2 = 4 ≠ 𝑝(𝐶 ∩ 𝐵), and so 𝐶 and 𝐵 are dependent
Example 2.21: Are the event 𝐴, that a family with three children has children of both
sexes, and 𝐵 that a family with three children has at most one boy,
independent? Assume that the eight ways a family can have three children are equally
likely.
Solution: By assumption, each of the eight ways a family can have three children.
𝐵𝐵𝐵, 𝐵𝐵𝐺, 𝐵𝐺𝐵, 𝐵𝐺𝐺, 𝐺𝐵𝐵, 𝐺𝐵𝐺, 𝐺𝐺𝐵, 𝑎𝑛𝑑 𝐺𝐺𝐺 , Where G represents girl and B
1
represents boy, has a probability . Since
8
𝐴 = {𝐵𝐵𝐺, 𝐵𝐺𝐵, 𝐵𝐺𝐺, 𝐺𝐵𝐺, 𝐺𝐺𝐵, 𝐺𝐵𝐵}, 𝐵 = {𝐵𝐺𝐺, 𝐺𝐵𝐺, 𝐺𝐺𝐵, 𝐺𝐺𝐺} and
Exercise 2.4
1. Consider the experiment of throwing two fair dice. Let A be the event that the
sum of the dice is 7, let B be the event that the sum of the dice is 6, and C be the event
that the first die is 4. Show that events A and C are independent, but event B and C
are not independent.
2. Suppose we draw a card from a standard deck of 52 cards, replace it, draw
another card, and continue for a total of ten draws. Is this an independent trials
process?
3. Suppose we draw a card from a standard deck of 52 cards, discard it (i.e. we
do not replace it), draw another card and continue for a total of ten draws. Is this an
independent trials process?
4. In three flips of a coin, is the event that we have at most one tail independent
of the event that not all flips are identical?
2.5 Random variable and expectation
Objective: After study this section the student should be able to:
Define a random variable
Calculate the expected value
A random variable for an experiment with a sample space 𝑆 is a function that assigns
a number to each element of 𝑆. Typically instead of using 𝑓 to stand for such a
function we use 𝑋 (at first, a random variable was conceived of as a variable related to
an experiment, explaining the use of 𝑋, but it is very helpful in understanding the
mathematics to realize it actually is a function on the sample space).
For example, if we consider the process of tossing a coin 𝑛 times, we have the set of
all sequences of 𝑛 𝐻𝑠 and 𝑇s as our sample space. The “number of heads” random
variable takes a sequence and tells us how many heads are in that sequence.
Somebody might say “Let 𝑋 be the number of heads in tossing a coin 5 times.” In that
case 𝑋(𝐻𝑇𝐻𝐻𝑇) = 3 while X(THTHT) = 2. It may be rather jarring to see 𝑋 used
to stand for a function, but it is the notation most people use.
Definition 2.7
Consider a random experiment with sample space 𝑆. A random variable 𝑋(𝜏) is a
single-valued real function that assigns a real number called the value of 𝑋(𝜏) to each
sample point 𝜏 of 𝑆.
Note: A random variable is not a variable at all in the usual sense, and it is a function.
The sample space 𝑆 is termed the domain of the random variable 𝑋(𝜏) , and the
collection of all numbers (values of 𝑋(𝜏)) is termed the range of the random variable.
Thus the range of 𝑋(𝜏) is a certain subset of the set of all real numbers (figure 2.4)
S
𝜏 * 𝑋(𝜏)
Type equation here.
𝑋(𝜏)
Figure 2.4 Random variable 𝑋(𝜏) as a function.
Example 2.22 : In the experiment of tossing a coin once, we might define the random
variable 𝑋(𝜏) as (figure 2.5)
S T*
𝑋(𝐻) = 1 𝑋(𝑇) = 0
𝐻*
Type equation here.
0 1 R
Fig.2.5 One random variable associated with coin tossed
Note that we could also define another random variable, say Y or Z, with
𝑌(𝐻) = 0, 𝑌(𝑇) = 1 𝑜𝑟 𝑍(𝐻) = 0, 𝑍(𝑇) = 1
These events have probabilities that are denoted by
𝑝(𝑋 = 𝑥) = 𝑝(𝜏: 𝑋(𝜏) = 𝑥)
𝑝(𝑋 ≤ 𝑥) = 𝑝(𝜏: 𝑋(𝜏) ≤ 𝑥)
𝑝(𝑋 > 𝑥) = 𝑝(𝜏: 𝑋(𝜏) > 𝑥)
𝑝(𝑥1 < 𝑋 ≤ 𝑥2 ) = 𝑝(𝜏: 𝑥1 < 𝑋 ≤ 𝑥2 )
EXAMPLE 2.23 In the experiment of tossing a fair coin three times, the sample
space 𝑆1 consists of eight equally likely sample points 𝑆1 = (𝐻𝐻𝐻, . . . , 𝑇𝑇𝑇). If 𝑋 is
the random variable giving the number of heads obtained, find
Solution:
(a) Let 𝐴 ⊂ 𝑆1 be the event defined by 𝑋 = 2. Then, we have
A = (X = 2) = {τ: X(τ) = 2) = {HHT, HTH, THH)
Since the sample points are equally likely, we have
3
𝑃(𝑋 = 2) = 𝑃(𝐴) = 8
EXAMPLE 2.24: A pair of dice is tossed. Let 𝑋 be assign to each point in 𝑆 the sum
of the numbers: 𝑋 is a random variable with range space
𝑅𝑥 = {2,3,4, … 12}
Note 𝑛(𝑆) = 36, and 𝑅𝑥 = {2, 3, . . . , 12}. Using Theorem 2.4, we obtain the
distribution 𝑓 of 𝑋 as follows:
𝑓 (2) = 1/36, since there is one outcome, (1, 1) whose sum is 2.
𝑓 (3) = 2/36, Since there are two outcomes, (1, 2) and (2,1), whose sum is 3.
𝑓 (4) = 3/36, since there are three outcomes, (1, 3), (2, 2) and (3, 1),whose sum is 4.
Similarly,𝑓 (5) = 4/36, 𝑓 (6) = 5/36, . . . , 𝑓 (12) = 1/36.Thus the distribution
of 𝑋 as follows.
𝑥 2 3 4 5 6 7 8 9 10 11 12
𝑓(𝑥) 1⁄ 2⁄ 3⁄ 4⁄ 5⁄ 6⁄ 5⁄ 4⁄ 3⁄ 2⁄ 1⁄
36 36 36 36 36 36 36 36 36 36 36
Expected value:
The expected value of a random variable is the sum over all elements in a sample
space of the product of the probability of the element and the value of the random
variable at this element.
Definition 2.8 The expected value (or expectation) of the random variable 𝑋(𝑠) on
the sample space Sis equal to
𝐸(𝑋) = ∑𝑠𝜖𝑆 𝑝(𝑠)𝑋(𝑠).
Note that when the sample space 𝑆 has n elements
𝑆 = {𝑥1 , 𝑥2 , … , 𝑥𝑛 }, 𝐸(𝑋) = ∑𝑛𝑖=1 𝑝(𝑥𝑖 )𝑋(𝑥𝑖 )
Remark: We are concerned only with random variables with finite expected values
here.
Example 2.25 A fair coin is tossed six times. Let 𝑆 be the sample space of the 64
possible outcomes, and let 𝑋 be the random variable that assigns to an outcome the
number of heads in this outcome. What is the expected value of 𝑋?
Solution: The number of heads which can occur with their respective probabilities
follows:
𝑥𝑖 0 1 2 3 4 5 6
𝑝𝑖 1⁄ 6⁄ 15⁄ 20⁄ 15⁄ 6⁄ 1⁄
64 64 64 64 64 64 64
Example 2.26 Three horses 𝑎, 𝑏 and 𝑐 are in a race, suppose their respective
1 1 1
probabilities of winning are , 𝑎𝑛𝑑 6. Let 𝑋 denote the pay of a function for the
2 3
winning horse, and suppose 𝑋 pay $2, $6 𝑜𝑟 $9 according as 𝑎, 𝑏 𝑜𝑟 𝑐 wins the race.
What is the expected value of ?
Solution: Expected value of 𝑋 is
𝐸(𝑋) = 𝑋(𝑎)𝑝(𝑎) + 𝑋(𝑏)𝑝(𝑏) + 𝑋(𝑐)𝑃(𝑐)
𝟏 𝟏 𝟏
= 2 (𝟐) + 6 (𝟑) + 9 (𝟔) = 4.5
Theorem 2.5: The expected number of successes when n Bernoulli trials are
performed, where 𝑝the probability of success on each trial is 𝑛𝑝.
Exercise 2.5
1. A random sample with replacement of size 𝑛 = 2 is drawn from the set
{1,2,3}, yielding the following 9-element equiprobable sample space
𝑆 = {(1,1), (1,2), (1,3), (2,1), (2,2), (2,3), (3,1), (3,2), (3,3)}
a) Let 𝑋 denote the sum of the two numbers. Find the distribution 𝑓 of 𝑋, and
find the expected value 𝐸(𝑋).
b) Let 𝑌 denote the minimum of the two numbers. Find the distribution 𝑔 of 𝑌
,and find the expected value 𝐸(𝑌)
2. A coin is weighted so that 𝑝(𝐻) = 3/4, and 𝑃(𝑇) = 1/4. The coin is tossed
three times. Let 𝑋 denote the number of heads that appear
a) Find the distribution of 𝑓 of 𝑋
b) Find the expected 𝐸(𝑋)
3. A player tossed three fair coins. He wins $5 if three heads occur, $3 if two
heads occur, and $1 if only one head occurs. On the other hand, he losses $15 if
three tails occur. Find the value of the game to the player.
4. What is the expected sum of the tops of n dice when we roll them?
Chapter summery:
An experiment is a procedure that yields one of a given set of possible outcome.
A sample space is the set of all possible outcomes of a given experiment,denoted by 𝑺.
An event 𝐸 is a set of outcome.
Two events 𝐴 and 𝐵 are called mutually exclusive if they are disjoint, i.e. 𝐴 ∩ 𝐵 = ∅.
Let 𝐸 be an event of a finite sample space 𝑆 consisting of equally likely outcomes.
𝑝(𝐸)
Then 𝑝(𝐸) = .
𝑃(𝑆)
Suppose that 𝑆 is a set with n elements. The uniform distribution assigns the
1
probability 𝑛 to each elements of 𝑆.
If 𝐴 and 𝐵 are any two events, then 𝑝(𝐴 ∪ 𝐵) = 𝑃(𝐴) + 𝑃(𝐵) − 𝑃(𝐴 ∩ 𝐵)
(Inclusion exclusion principle)
If A and B are mutually exclusive events, then 𝑝(𝐴 ∪ 𝐵) = 𝑃(𝐴) + 𝑃(𝐵) (addition
principle).
Two events are dependent if the occurrence of one event affects the probability of the
event occurring.
The event 𝐴 and 𝐵 are independent if and only if 𝑝(𝐴 ∩ 𝐵) = 𝑝(𝐴)𝑝(𝐵)
A random variable for an experiment with a sample space 𝑆 is a function that assigns
a number to each element of 𝑆.
Consider a random experiment with sample space 𝑆. A random variable 𝑋(𝜏) is a
single-valued real function that assigns a real number called the value of 𝑋(𝜏) to each
sample point 𝜏 of 𝑆.
The expected value (or expectation) of the random variable 𝑋(𝑠) on the sample space
Sis equal to 𝐸(𝑋) = ∑𝑠𝜖𝑆 𝑝(𝑠)𝑋(𝑠).
2. A coin is weighted so that head is three times as likely to appear as tails. Find
𝑝(𝐻) and 𝑝(𝑇)
3. Suppose 𝐴 and 𝐵 are events with 𝑝(𝐴) = 3/5, 𝑃(𝐵) = 3/10 and 𝑝(𝐴 𝐵) =
1/5. Find the probability that
a) 𝐴 does not occur
b) 𝐵 does not occur
c) 𝐴 or 𝐵 occur
d) (𝐴 ∩ 𝐵)𝑐
Reference:
1. A. W.F.Edwards,Pascal’s Arithmeticical Triangle. The Johns Hopkins University
Press, Baltimore,MD, 2002.
2. C.Oliver, “ The Twelve Days of Christmas,” Mathematics Teacher, Vol. 70
3. David A.Santos, Discrete Mathematics Note
4. Discrete Mathematics, Handbook of discrete and Compinatorial Mathematics
5. Hewel Hus, Schaum’s outline, probability Random Variable
6. J.M.Harris.Jeffry L.Hirst.Michael J.Mossinghoff, Combinatorics and Graph Theory,
2nd edition
7. J.Varnadore, “ Pascal’s Triangle and Fibonacci Numbers,” Mathematics Teacher,
Vol,81.
8. Ken Bogart and Cliffstein, Discrete math in computer science
9. Kenneth H.Rosen, Discrete Mathematics and its application, 3rd edition.
10. M.Eng and J.Casey, “Pascal’s Arithmetical Triangle-ASerendipitious Source for
programming Activities,’’ Mathematics Teacher, Vol 76
11. Mott, Knadel and Baker, Discreate Mathematics
12. P.Z.Chinn, “ inductive patterns, finite Difference, and a Missing Region,’’
Mathematics Teacher, Vol.81(Sept.1988)
13.R.P.GRIMALDI and B.V.RAMANA pearson, Discreate combinatorial
mathematics
14.Rose, Discrete Mathematics
15. Seymour Lipschutz, Schaum’s outline, Discrete Mathematics, 3rd edition
CHAPTER 3
RECURRENCE RELATION
Objectives:- On completion of the chapter the students will be able to:
Define recurrence relation.
Solve linear homogeneous recurrence relation with constant coefficient.
Solve linear nonhomogeneous recurrence relation with constant coefficient.
3.1 Introduction
Many counting problems cannot be solved easily using the methods discussed in
chapter 1. One such problem is: how many bit strings of length 𝑛 + 1 do not contain
two consecutive zeros? To solve this problem let 𝑎𝑛 be the number of such strings of
length 𝑛 + 1. An argument can be given that shows 𝑎𝑛+2 = 𝑎𝑛+1 + 𝑎𝑛 . This equation,
called recurrence relation, and the initial conditions 𝑎0 = 2 and 𝑎1 = 3 determine the
sequence {𝑎𝑛 }∞
𝑛=0 . Moreover the explicate formula can be found for 𝑎𝑛 from the
equation relating the terms of the sequence. As we will see, a similar technique can be
found to solve many different types of counting problems.
Definition 3.1: A recurrence relation for a sequence {𝑎𝑛 }∞
𝑛=0 is an equation that
(a) Check that the given formula gives the correct initial value
(b) Check that the given formula solves the recurrence relation.
Putting 𝑛=0 in 𝑎𝑛 = 2𝑛 − 1 gives 𝑎0 = 1 − 1 as required.
To do (b) we evaluate 2𝑎𝑛−1 + 1 using the given formula and show that it is equal to
𝑎𝑛 .
Now 𝑎𝑛−1 = 2𝑛−1 – 1 so
2𝑎𝑛−1 + 1 = 2(2𝑛−1 – 1) + 1 = 2𝑛 – 1
Recurrence relations have many applications. Suppose that you put £100 into a savings
account yielding 4% compounded annually. Let 𝑎𝑛 be the amount (in pounds) in the
account after 𝑛 years. Then 𝑎𝑛 is equal to the amount in the account after 𝑛 − 1 years
plus the interest for the 𝑛th year. For example, 𝑎1 is equal to 100 plus the interest which
is 4. Hence 𝑎1 = 104.
In general, 𝑎𝑛 = 𝑎𝑛−1 + (0.04)𝑎𝑛−1 so that
𝑎𝑛 = (1.04)𝑎𝑛−1 , 𝑛 ≥ 1
with 𝑎0 = 100.
Solving this we obtain
𝑎1 = 100(1.04)
𝑎2 = (1.04)𝑎1 = 100(1.04)2
𝑎3 = (1.04)𝑎2 = 100(1.04)3
and in general
𝑎𝑛 = 100(1.04)𝑛 .
Exercises 3.1
1. Let 𝑎𝑛 = 2𝑎𝑛−1 + 𝑎𝑛−2 with 𝑎0 = 1 and 𝑎1 = 1 . Find 𝑎2 , 𝑎3 , 𝑎4 and 𝑎5 .
2. Verify that the solution of the recurrence relation 𝑎𝑛 = 3𝑎𝑛−1 with 𝑎0 = 4 is 𝑎𝑛 =
4(3)𝑛 .
3. Verify that the solution of 𝑎𝑛 = 5𝑎𝑛−1 − 12 with 𝑎0 = 13 is 𝑎𝑛 = 10(5)𝑛 + 3.
3.2 Linear recurrence relation with constant coefficient
Objectives:- On completion of this section the students will be able to:
Define a linear recurrence relation with constant coefficient of degree 𝑘.
The basic approach for solving linear homogeneous recurrence relations is to look for
the solutions of the form 𝑎𝑛 = 𝑟 𝑛 , where 𝑟 is constant. Note that 𝑎𝑛 = 𝑟 𝑛 is the
solution of the recurrence relation
𝑎𝑛 + 𝑐1 𝑎𝑛−1 + 𝑐2 𝑎𝑛−2 + ⋯ + 𝑐𝑘 𝑎𝑛−𝑘 = 0 (2)
if and only if
𝑟 𝑛 + 𝑐1 𝑟 𝑛−1 + 𝑐2 𝑟 𝑛−2 + ⋯ + 𝑐𝑘 𝑟 𝑛−𝑘 = 0.
When both side of the equation is divided by 𝑟 𝑛−𝑘 we obtain the equation
𝑟 𝑘 + 𝑐1 𝑟 𝑘−1 + 𝑐2 𝑟 𝑘−2 + ⋯ + 𝑐𝑘−1 𝑟 + 𝑐𝑘 = 0 . (3)
Consequently the sequence {𝑎𝑛 }∞ 𝑛
𝑛=0 with 𝑎𝑛 = 𝑟 is the solution if and only if 𝑟 is the
solution of the last equation (3), which is called the characteristic equation of the
recurrence relation (2). The solutions of the characteristic equation (3) are called
characteristic roots of the recurrence relation (2). As we will see, these characteristic
roots can be used to give an explicit formula for all the solutions of the recurrence
relation (2).
Let us first see the rule to find all the possible solutions (general solution)
homogeneous recurrence relation with constant coefficients of degree 1.
All the possible solutions or general solution to the linear homogenous recurrence
relation with constant coefficient of degree 1
𝑎𝑛 + 𝑐𝑎𝑛−1 = 0
is 𝑎𝑛 = 𝑝(−𝑐)𝑛 , where 𝑝 is a constant.
Example 3.2. Find the solution of the recurrence relation
𝑎𝑛 − 5𝑎𝑛−1 = 0
with initial condition 𝑎0 = 7
Solution. The general solution is 𝑎𝑛 = 𝑝(5𝑛 ) .
Since 𝑎0 = 7,
⟹ 𝑎0 = 𝑝(50 ) = 7
Thus,
𝑝 = 7 and hence the solution is 𝑎𝑛 = 7(5𝑛 ) .
Now we will develop rules that deal with linear homogeneous recurrence relation with
constant coefficients of degree 2. Then corresponding general rules when the degree
may be greater that two will be stated. Because the proofs needed to establish the
general rules in general case are more complicated. We now turn our attention to linear
recurrence relations of degree two.
Theorem 3.1: Consider a linear homogeneous recurrence relation with constant
coefficient of degree 2
𝑎𝑛 + 𝑐1 𝑎𝑛−1 + 𝑐2 𝑎𝑛−2 = 0 (4)
for 𝑛 ≥ 2, where 𝑐1 and 𝑐2 are constants, and consider its characteristic equation
𝑟 2 + 𝑐1 𝑟 + 𝑐2 = 0 . (5)
i. If the characteristic equation (5) has two distinct roots 𝑟1 and 𝑟2 , then the sequence
{𝑎𝑛 }∞
𝑛=0 is the solution of the recurrence relation (4) if and only if
𝑎𝑛 = 𝑑1 𝑟1 𝑛 + 𝑑2 𝑟2 𝑛 (6)
where 𝑑1 and 𝑑1 are constants.
ii. If the characteristic equation (5) has only one root 𝑟0 , then the sequence {𝑎𝑛 }∞
𝑛=0 is
𝑎0 = 𝐶0 = 𝑑1 + 𝑑2
𝑎1 = 𝐶1 = 𝑑1 𝑟1 + 𝑑2 𝑟1
We can solve these two equations for 𝑑1 and 𝑑2 . From the first equation it follows that
𝑑2 = 𝐶0 − 𝑑1 . Inserting this equation in to the second equation gives 𝐶1 = 𝑑1 𝑟1 +
(𝐶0 − 𝑑1 )𝑟2.
Hence,
𝐶1 = 𝑑1 (𝑟1 − 𝑟2 ) + 𝐶0 𝑟2
This shows that
(𝐶1 −𝐶0 𝑟2 )
𝑑1 = 𝑟1 −𝑟2
and
(𝐶1 −𝐶0 𝑟2 ) 𝐶0 𝑟1 −𝐶1
𝑑2 = 𝐶0 − 𝑑1 = 𝑑2 = 𝐶0 − =
𝑟1 −𝑟2 𝑟1 −𝑟2
where these expressions for 𝑑1 and 𝑑2 depend on the fact that 𝑟1 ≠ 𝑟2. ( When 𝑟1 = 𝑟2 ,
this theorem is not true.)
Hence, with those values for 𝑑1 and 𝑑2 , the sequence {𝑎𝑛 } with 𝑑1 𝑟1𝑛 + 𝑑2 𝑟2𝑛 satisfies
the two initial conditions. Since this recurrence relation and these initial conditions
uniquely determine the sequence, it follows that 𝑎𝑛 = 𝑑1 𝑟1𝑛 + 𝑑2 𝑟2𝑛 .∎
ii. Exercise.
Note that: The solution (6) or (7) are all possible solutions of the recurrence relation
(4). And we call the solution general solution of the recurrence relation (4).
Example 3.3. Find the general solution of
𝑎𝑛 − 𝑎𝑛−1 − 2𝑎𝑛−2 = 0 , for 𝑛 ≥ 2
Solution: The characteristic equation of the given recurrence relation is 𝑟 2 − 𝑟 − 2 = 0.
Then, find the roots of the characteristic equation using quadratic formula
(factorization).
𝑟2 − 𝑟 − 2 = 0
⇒ (𝑟 + 1)(𝑟 − 2) = 0
So 𝑟 = −1 and 𝑟 = 2. Thus, the characteristic equation has two distinct roots 𝑟 = −1
and 𝑟 = 2
Hence, the general solution is
𝑎𝑛 = 𝑑1 (−1)𝑛 + 𝑑2 (2)𝑛
where 𝑑1 and 𝑑2 are constants.
gives, we have
𝑑1 = 1 and
3 3
𝑑 + 2 𝑑2 = 10.
2 1
17
Solving these gives 𝑑1 = 1 and 𝑑2 = .
3
Hence,
3 𝑛 17 3 𝑛
𝑎𝑛 = (2 ) + 𝑛 (2 )
3
is the solution.
We will now state the general result about the solution of linear homogeneous
recurrence relation with constant coefficients of degree 𝑘, where the degree 𝑘 ≥ 2
under the assumption that the characteristic equation has 𝑘 distinct roots 𝑟1 , 𝑟2 , … , 𝑟𝑘 or
the characteristic equation has t distinct roots 𝑟1 , 𝑟2 , … , 𝑟𝑡 with multiplicity
𝑚1 , 𝑚2 , … , 𝑚𝑡 respectively, so that 𝑚𝑖 ≥ 1, for 𝑖 = 1,2, … , 𝑡 and 𝑚1 + 𝑚2 + ⋯ +
𝑚𝑡 = 𝑘.
Theorem 3.2: Consider the linear homogeneous recurrence relation with constant
coefficient of degree k k k k k k k k k k k k k k k k k k k k k k k k k k k k k kk k k k k k
𝑎𝑛 + 𝑐1 𝑎𝑛−1 + 𝑐2 𝑎𝑛−2 + ⋯ + 𝑐𝑘 𝑎𝑛−𝑘 = 0 (8)
and consider its characteristic equation I I ik ihh hh hbh hh h h n n n n
𝑟 𝑘 + 𝑐1 𝑟 𝑘−1 + 𝑐2 𝑟 𝑘−2 + ⋯ + 𝑐𝑘−1 𝑟 + 𝑐𝑘 = 0. (9)
i. If the characteristic equation (9) has 𝑘 distinct roots 𝑟1 , 𝑟2 , … , 𝑟𝑘 , then the sequence
{𝑎𝑛 }∞
𝑛=0 is the solution of the recurrence relation (8) if and only if
𝑎𝑛 = 𝑑1 𝑟1 𝑛 + 𝑑2 𝑟2 𝑛 + ⋯ + 𝑑𝑘 𝑟𝑘 𝑛 (10)
where 𝑑1 , 𝑑2 , … , 𝑑𝑘 are constants.
ii. If the characteristic equation (9) has t distinct roots 𝑟1 , 𝑟2 , … , 𝑟𝑡 with multiplicity
𝑚1 , 𝑚2 , … , 𝑚𝑡 respectively, so that 𝑚𝑖 ≥ 1, for 𝑖 = 1,2, … , 𝑡 and 𝑚1 + 𝑚2 + ⋯ +
𝑚𝑡 = 𝑘, then the sequence {𝑎𝑛 }∞
𝑛=0 is the solution of the recurrence relation (8) if and
only if
is
1 𝑛
𝑎𝑛 = (𝑑1 + 𝑑2 𝑛)(2 )𝑛 + 𝑑3 (2) + 𝑑3 (−5)𝑛
We have seen how to solve linear homogeneous recurrence relation with constant
coefficients. Is there a relatively simple technique for solving a linear, but not
homogeneous, recurrence relation with constant coefficients, such as 𝑎𝑛 = 3𝑎𝑛−1 +
2𝑛 ? We will see that the answer is yes for a certain families of such recurrence
relations.
The recurrence relation 𝑎𝑛 = 3𝑎𝑛−1 + 2𝑛 is an example of linear nonhomogeneous
recurrence relations with constant coefficients, that is recurrence relation of the
form
𝑎𝑛 + 𝑐1 𝑎𝑛−1 + 𝑐2 𝑎𝑛−2 + ⋯ + 𝑐𝑘 𝑎𝑛−𝑘 = 𝑓(𝑛)
where 𝑐1 , 𝑐2 , … , 𝑐𝑘 are constants and 𝑐𝑘 ≠ 0 and 𝑓(𝑛) is a function not identically zero
depending only on 𝑛. The recurrence relation
𝑎𝑛 + 𝑐1 𝑎𝑛−1 + 𝑐2 𝑎𝑛−2 + ⋯ + 𝑐𝑘 𝑎𝑛−𝑘 = 0
is called the associated homogenous recurrence relation. It plays an important role in
the solution of the nonhomogeneous recurrence relation.
Theorem 3.3: Consider the linear nonhomogeneous recurrence relations with constant
coefficients of degree 𝑘
𝑎𝑛 + 𝑐1 𝑎𝑛−1 + 𝑐2 𝑎𝑛−2 + ⋯ + 𝑐𝑘 𝑎𝑛−𝑘 = 𝑓(𝑛) (12)
and its associated homogenous recurrence relation
𝑎𝑛 + 𝑐1 𝑎𝑛−1 + 𝑐2 𝑎𝑛−2 + ⋯ + 𝑐𝑘 𝑎𝑛−𝑘 = 0 (13)
𝑔 ∞
Then every solution of the recurrence relation (12) is of the form {𝑎𝑛𝑝 + 𝑎𝑛 }𝑛=0 , where
𝑎𝑛𝑝 is the particular solution of the recurrence relation (12) and 𝑎𝑛ℎ is the solution of the
recurrence relation (13).
Proof: Let 𝑎𝑛𝑝 be the particular solution of the non homogeneous recurrence relation.
Thus,
𝑎𝑛𝑝 + 𝑐1 𝑎𝑛−1
𝑝 𝑝
+ ⋯ + 𝑐𝑘 𝑎𝑛−𝑘 = 𝑓(𝑛). (14)
Now suppose that 𝑎𝑛𝑠 is any other solution of the nonhomogeneous recurrence relation.
Thus,
𝑠 𝑠
𝑎𝑛𝑠 + 𝑐1 𝑎𝑛−1 + ⋯ + 𝑐𝑘 𝑎𝑛−𝑘 = 𝑓(𝑛) . (15)
Subtracting the equation (a) from equation (b)
𝑠
[𝑎𝑛𝑠 + 𝑐1 𝑎𝑛−1 𝑠
+ ⋯ + 𝑐𝑘 𝑎𝑛−𝑘 ] − [𝑎𝑛𝑝 + 𝑐1 𝑎𝑛−1
𝑝 𝑝
+ ⋯ + 𝑐𝑘 𝑎𝑛−𝑘 ] = 0 + 𝑓(𝑛)
where 𝑎𝑛𝑝 is the particular solution of the recurrence relation (12) and 𝑎𝑛ℎ is the solution
of the recurrence relation (13).
Problem: What is the general solution of the linear nonhomogeneous recurrence
relation (12)?
The general solution (all solutions) of the linear nonhomogeneous recurrence
𝑔 ∞
relation (12) is the sequence {𝑎𝑛𝑝 + 𝑎𝑛 }𝑛=0 , where 𝑎𝑛𝑝 is the particular solution of
𝑔
the linear nonhomogeneous recurrence relation (12) and 𝑎𝑛 is the general solution
of the associated homogenous recurrence relation (13).
Problem: How can we find or choose the particular solution 𝑎𝑛𝑝 for the linear
nonhomogeneous recurrence relation (12)?
𝑓(𝑛) Choice of 𝑎𝑛𝑝
𝑞𝑚 𝑛𝑚 + 𝑞𝑚−1 𝑛𝑛−1 + ⋯ + 𝑞1 𝑛 + 𝑞0 𝑝𝑚 𝑛𝑚 + 𝑝𝑚−1 𝑛𝑛−1 + ⋯ + 𝑝1 𝑛 + 𝑝0
𝛼(𝑏 𝑛 ) 𝛽(𝑏 𝑛 )
(𝑞𝑚 𝑛𝑚 + 𝑞𝑚−1 𝑛𝑛−1 + ⋯ + 𝑞1 𝑛 + 𝑞0 )𝑏 𝑛 (𝑝𝑚 𝑛𝑚 + 𝑝𝑚−1 𝑛𝑛−1 + ⋯ + 𝑝1 𝑛 + 𝑝0 )𝑏 𝑛
Rules:
If 𝑓(𝑛) is one of the terms on the left side of the table choose the particular solution
𝑎𝑛𝑝 from the right side of the table and determine the underdetermined coefficients by
using the original equation in (12).
If 𝑏 is the root of the characteristic equation to the recurrence relation (13) with
multiplicity 𝑚, then multiply 𝑎𝑛𝑝 by 𝑛𝑚 .
That is if 𝑏 is the root of the characteristic equation to the recurrence relation (13)
with multiplicity 𝑚, choose the particular solution 𝑎𝑛𝑝 = 𝛽𝑛𝑚 (𝑏 𝑛 ) for the case
𝑓(𝑛) = 𝛼(𝑏 𝑛 ) and choose the particular solution
𝑎𝑛𝑝 = 𝑛𝑚 (𝑝𝑚 𝑛𝑚 + 𝑝𝑚−1 𝑛𝑛−1 + ⋯ + 𝑝1 𝑛 + 𝑝0 )𝑏 𝑛
for the case 𝑓(𝑛) = (𝑞𝑚 𝑛𝑚 + 𝑞𝑚−1 𝑛𝑛−1 + ⋯ + 𝑞1 𝑛 + 𝑞0 )𝑏 𝑛 .
So 𝑟 = 7 and 𝑟 = −1.
𝑓(𝑛) = 7𝑛 , and 𝑏 = 7 is the root of the characteristic equation with multiplicity 1.
Thus we choose particular solution 𝑎𝑛𝑝 = 𝑞𝑛(7𝑛 ) , where 𝑞 is a constant.
Then, we have to find 𝑞 by substituting 𝑎𝑛𝑝 in to the given recurrence relation, that is
𝑎𝑛𝑝 − 6𝑎𝑛−1
𝑝 𝑝
− 7𝑎𝑛−2 = 7𝑛 .
Observe that 𝑎𝑛𝑝 = 𝑞𝑛(7𝑛 ) , 𝑎𝑛−1
𝑝 𝑝
= 𝑞(𝑛 − 1)(7𝑛−1 ) and 𝑎𝑛−2 = 𝑞(𝑛 − 2)(7𝑛−2 ) .
Thus,
[𝑞𝑛(7𝑛 )] − 6[𝑞(𝑛 − 1)(7𝑛−1 )] − 7[𝑞(𝑛 − 2)(7𝑛−2 )] = 7𝑛
⟹ 𝑞𝑛(7𝑛 ) − 6𝑞𝑛7𝑛−1 + 6𝑞7𝑛−1 − 7𝑞𝑛7𝑛−2 + 14𝑞7𝑛−2 = 7𝑛
6 6 1 2
⟹ 𝑞𝑛(7𝑛 ) − 7 𝑞𝑛(7𝑛 ) + 7 𝑞(7𝑛 ) − 7 𝑞𝑛(7𝑛 ) + 7 𝑞7𝑛−2 = 7𝑛
8 8 7
⟹ 𝑞(7𝑛 ) = 7𝑛 ⟺ 7𝑞 = 1 ⟺ 𝑞 = 8
7
7
Hence, 𝑎𝑛𝑝 = 𝑛(7𝑛 ) is the particular solution of the recurrence relation.
8
1+√5 1−√5
So 𝑟 = and 𝑟 = .
2 2
Hence,
5
𝑎𝑛 = −(3𝑛 ) + 3 𝑛(3𝑛 ) + 𝑛2 (3𝑛 )
is the solution.
Example 3.11. Find the general solution of the recurrence relation
𝑎𝑛 + 9𝑎𝑛−1 + 20𝑎𝑛−2 = (𝑛2 + 𝑛 − 1 )5𝑛 , for 𝑛 ≥ 2
Solution. We are given a recurrence relation
𝑎𝑛 − 10𝑎𝑛−1 + 25𝑎𝑛−2 = 𝑓(𝑛), where 𝑓(𝑛) = (𝑛2 + 𝑛 − 1 )5𝑛 .
The associated homogeneous recurrence relation to the given recurrence relation is
𝑎𝑛 − 10𝑎𝑛−1 + 25𝑎𝑛−2 = 0
and its characteristic equation is 𝑟 2 − 10𝑟 + 25 = 0.
Thus, 𝑟 2 − 10𝑟 + 25 = 0
⟹ (𝑟 − 5)2 = 0
Thus,
𝑎𝑛𝑝 − 𝑎𝑛−1
𝑝 𝑝 𝑝
− 10𝑎𝑛−2 + 8𝑎𝑛−3 = 𝑓(𝑛) , where 𝑓(𝑛) = 6𝑛
⟹ [𝑞1 (𝑛 − 1) + 𝑞0 ] − [𝑞1 𝑛 + 𝑞0 ] − 10[𝑞1 (𝑛 − 2) + 𝑞0 ] + 8[𝑞1 (𝑛 − 3) + 𝑞0 ] = 6𝑛
⟹ −2𝑞1 𝑛 − 3𝑞1 − 𝑞0 = 6𝑛
⟺ −2𝑞1 = 6 and −3𝑞1 − 𝑞0 = 0
⟺ 𝑞1 = −3 and 𝑞0 = 9
Thus, 𝑎𝑛𝑝 = −3𝑛 + 9 is the particular solution of the given recurrence relation.
Hence, the general solution is
𝑎𝑛 = 𝑑1 (1𝑛 ) + 𝑑2 (2𝑛 ) + 𝑑3 (−4)𝑛 − 3𝑛 + 9
where 𝑑1 , 𝑑2 and 𝑑3 are constants.
b. 𝑓(𝑛) = (−1)𝑛 (4)𝑛 = (−4)𝑛 , and 𝑏 = −4 is the root of the characteristic equation and
the multiplicity of −4 is 1, so we choose the particular solution to the given
nonhomogeneous recurrence relation to be 𝑎𝑛𝑝 = 𝑞𝑛(−4)𝑛 , where 𝑞 is constant to be
determined by substituting 𝑎𝑛𝑝 in to the given recurrence relation.
Thus,
𝑎𝑛𝑝 − 𝑎𝑛−1
𝑝 𝑝 𝑝
− 10𝑎𝑛−2 + 8𝑎𝑛−3 = 𝑓(𝑛) , where 𝑓(𝑛) = (−4)𝑛 .
The rest of the steps are left as an exercise.
Exercise 3.3.2
1. Find the general solution (all the solutions) of the recurrence relation
a. 𝑎𝑛 = 3𝑎𝑛−1 + 2𝑛 , for 𝑛 ≥ 1
b. 𝑎𝑛 = −4𝑎𝑛−1 − 3𝑎𝑛−2 + 10𝑛2 − 2𝑛 + 3 , for 𝑛 ≥ 2
2. Solve the recurrence relation together with the initial conditions given.
a. 𝑎𝑛 − 2𝑎𝑛−1 = −2𝑛 , for 𝑛 ≥ 1 , 𝑎0 = 3
b. 𝑎𝑛 + 5𝑎𝑛−1 + 6𝑎𝑛−2 = 42(4𝑛 ) , for 𝑛 ≥ 2 , 𝑎0 = 4 , 𝑎1 = 1 .
3. Find the general solution (all the solutions) of the recurrence relation
a. 𝑎𝑛 − 6𝑎𝑛−1 + 12𝑎𝑛−2 − 8𝑎𝑛−3 = 𝑛2 , for 𝑛 ≥ 3
Summary
A recurrence relation for a sequence {𝑎𝑛 }∞
𝑛=0 is an equation that expresses 𝑎𝑛 in terms
𝑎𝑛 = 𝑑1 𝑟1 𝑛 + 𝑑2 𝑟2 𝑛 + ⋯ + 𝑑𝑘 𝑟𝑘 𝑛
where 𝑑1 , 𝑑2 , … , 𝑑𝑘 are constants.
iv. If the characteristic equation (iii) has t distinct roots 𝑟1 , 𝑟2 , … , 𝑟𝑡 with multiplicity
𝑚1 , 𝑚2 , … , 𝑚𝑡 respectively, so that 𝑚𝑖 ≥ 1, for 𝑖 = 1,2, … , 𝑡 and 𝑚1 + 𝑚2 +
⋯ + 𝑚𝑡 = 𝑘, then the sequence {𝑎𝑛 }∞
𝑛=0 is the solution of the recurrence relation
The general solution (all solutions) of the linear nonhomogeneous recurrence relation
𝑔 ∞
(iv) is the sequence {𝑎𝑛𝑝 + 𝑎𝑛 }𝑛=0 , where 𝑎𝑛𝑝 is the particular solution of the linear
𝑔
nonhomogeneous recurrence relation (iv) and 𝑎𝑛 is the general solution (all possible
solutions) of the associated homogenous recurrence relation (v).
6. Find the general solution (all the solutions) of the recurrence relation
a. 𝑎𝑛 − 6𝑎𝑛−1 + 12𝑎𝑛−2 − 8𝑎𝑛−3 = 𝑛2 , for 𝑛 ≥ 3
b. 𝑎𝑛 − 6𝑎𝑛−1 + 12𝑎𝑛−2 − 8𝑎𝑛−3 = 𝑛2 2𝑛 , for 𝑛 ≥ 3
7. Solve the recurrence relation
𝑎𝑛 = 8𝑎𝑛−2 − 16𝑎𝑛−4 + 2 , for 𝑛 ≥ 3
with initial condition 𝑎0 = 1 , 𝑎1 = 2 , 𝑎2 = 3 and 𝑎3 = 0.
Reference:
1. A. W.F.Edwards,Pascal’s Arithmeticical Triangle. The Johns Hopkins University
Press, Baltimore,MD, 2002.
2. C.Oliver, “ The Twelve Days of Christmas,” Mathematics Teacher, Vol. 70
3. Hewel Hus, Schaum’s outline, probability Random Variable.
4. J.M.Harris.Jeffry L.Hirst.Michael J.Mossinghoff, Combinatorics and Graph Theory,
2nd edition
5. J.Varnadore, “ Pascal’s Triangle and Fibonacci Numbers,” Mathematics Teacher,
Vol,81.
6. Kenneth H.Rosen, Discrete Mathematics and its application, 3rd edition.
7. M.Eng and J.Casey, “Pascal’s Arithmetical Triangle-ASerendipitious Source for
programming Activities,’’ Mathematics Teacher, Vol 76
mathematics
8. Mott, Knadel and Baker, Discreate Mathematics
9. P.Z.Chinn, “ inductive patterns, finite Difference, and a Missing Region,’’
Mathematics Teacher, Vol.81(Sept.1988)
10. R.P.GRIMALDI and B.V.RAMANA pearson,Discreate combinatorial
11. Rosen , Discrete Mathematics
12. Seymour Lipschutz,Schaum’s outline, Discrete Mathematics, 3rd edition
13. Berman G.Fryer K.D, introduction to combinatorics
14. Andweson I, A first course in Discrete Mathematics
15. D.P.Acharjya Sreekumar, Fundamental Approach to Discrete Mathematics.
CHAPTER 4
Introduction
You learn even in high school about graphs of functions. The graph of a function is
usually a curve drawn in the 𝒙𝒚 − plane. See Fig. (𝒂). But the word “graph” has other
meanings. Infinite or discrete mathematics, a graph is a collection of points and edges
or arcs in the plane. Fig. (𝒃) illustrates a graph as we are now discussing the concept.
Leonhard Euler (1707–1783) is considered to have been the father of graph theory. His
paper in 1736 on the seven bridges of Königsberg is considered to have been the
foundational paper in the subject. It is worthwhile now to review that topic.
Königsberg is a town, founded in 1256, that was originally in Prussia. Aftera stormy
history, the town became part of the Soviet Union and was renamed Kaliningrad in
1946. In any event, during Euler’s time the town had seven bridges (named Krämer,
Schmiede, Holz, Hohe, Honig, Köttel, and Grünespanning) spanning the Pregel River.
Fig. (𝒄) gives a simplified picture of how the bridges were originally configured (two
of the bridges were later destroyed during World War II, and two others demolished by
the Russians). The question that fascinated people in the eighteenth century was
whether it was possible to walk a route that never repeats any part of the path and that
crosses each bridge exactly once.
Euler in effect invented graph theory and used his ideas to show that it is impossible to
devise such a route. We shall, in the subsequent sections, devise a broader version of
Euler’s ideas and explain his solution of the Königsberg bridge problem.
Definition 4.1: A graph G consists of a finite non-empty set V(G) of elements called
vertices together with a finite set E(G) of unordered pairs of (not necessarily distinct)
vertices called edges.
Example 4.1: The following are examples of graphs with vertices 𝑉(𝐺) and edges
𝐸(𝐺).
v1 v4 v5
(i) V(G) = {v1 , v 2 , v3 , v 4 , v5 }
E(G) = {v1v 2 , v1v3 , v 2 v3 , v 2 v 4 , v3 v 4 , v3 v5 }
v2 v3
v1 v4 v6
(iii) V(G) = {v1 , v 2 , v3 , v 4 , v5 , v6 , v7 }
E(G) = {v1v 2 , v 2 v3 , v 2 v 4 , v3 v 4 , v5 v6 } v7
v7 is an isolated vertex.
v2 v3 v5
Definition 4.2: In a graph, two or more edges joining the same pair of vertices are
multiple edges. An edge joining a vertex to itself is a loop. A graph with no multiple
edges or loops is a simple graph.
Thus, the graphs in example4.1 (i) and (iii) are simple, that in (ii) is not, it is a non-
simple graph.
Graphs (such as those in examples (i) and (ii) ) which ‘come in one piece’ are said to be
connected. The graph in (iii) is not connected: it is the union of three connected
subgraphs, called the components of the graph.
Definition 4.3: Two vertices u and v of a graph G are adjacent if there is an edge uv
joining them and we then say that u and v are incident with the edge (or that the edge is
incident with u and v). Similarly, two edges are adjacent if they have a vertex in
common.
Example 4.2: v1 and v2 are adjacent in the following graph, each being incident with
edge e1. We call v1 and v2 the end-vertices of e1. Also edges e1 and e2 are adjacent.
v1 v4
e1 e2 e4
v2 e3 v3
The degree (size) of a vertex v, denoted by deg(v), is the number of edges incident with
v. Thus, in the graph above,
deg(v1) = 2 , deg (v2) = 2 , deg (v3) = 3 , deg (v4) = 1 .
In example 4.1 (ii), deg (v2) = 5 (count the loop twice), deg (v3) = 3.
In example4.1 (iii), deg (v7) = 0. (An isolated vertex has degree 0.)
The order of a graph G is the number of vertices, |𝑉|, where V is the set of vertices.
If there is more than one edge between the same pair of vertices, then the edges are
termed as parallel edges. Consider the graph G as
By the degree sequence of a graph, we mean the vertex degrees written in ascending
order with repeats where necessary. Thus the degree sequence in example 4.1 (i) is
1,2,2,3,4, that in (iii) is 0,1,1,1,2,2,3.
Theorem 4.1: Handshaking Lemma (Degree Sum Theorem): For a graph with vertex
set {v1 , v2 ,, vn } and m edges,
n
deg(v
k 1
k ) 2m .
Note: As a consequence, in any graph the number of vertices of odd degree must be
even. And if a sequence d1 , d 2 , , d n with d1 d 2 d n is the degree sequence of
n
a graph, then d
j 1
j must be even. Also, for a simple graph, d n n 1 . However, these
two conditions are not sufficient for d1 , d 2 , , d n to be the degree sequence of a simple
graph. For example, the sequence 1, 1, 3, 3 is not graphic.
Subgraphs
In mathematics we often study complicated objects by looking at simpler objects of the
same type contained in them - subsets of sets, subgroups of groups, and so on. In graph
theory we make the following definition.
Definition 4.4: A subgraph of a graph G is a graph all of whose vertices are vertices of
G and all of whose edges are edges of G.
Example 4.4: The following graphs are all subgraphs of the graph G on the left, with
vertices {𝑢, 𝑣, 𝑤, 𝑥} and edges {1, 2, 3, 4, 5}.
Example 4.5: The following graphs are all subgraphs of the unlabelled graph H on the
left; the configuration in graph (c) occurs at each corner of H.
Union of graphs
Intersection of graphs
If 𝐺1 and 𝐺2 be two graphs with at least one vertex in common, then their intersection
𝐺1 ∩ 𝐺2 is the graph with
𝑉(𝐺1 ∩ 𝐺2 ) = 𝑉(𝐺1 ) ∩ 𝑉(𝐺2 ) and 𝐸(𝐺1 ∩ 𝐺2 ) = 𝐸(𝐺1 ) ∩ 𝐸(𝐺2 ).
√ Check-List
Put a tick (√) mark if you can perform the task and a cross (x) mark if you
can’t in the box against the following questions.
1. Can you define simple graph? .........................................................
2. Can you identify the difference between adjacent and incident? ..
3. Can a given graph is simple? ...........................................................
Exercise 4.1
1. Write down the vertices and edges of each of the following graphs. are these graphs
simple graphs?
2. Draw the graphs whose vertices and edges are as follows. Are these graphs simple
graphs?
a. vertices: {𝑢, 𝑣, 𝑤, 𝑥} edges: {𝑢𝑣, 𝑣𝑤, 𝑣𝑥, 𝑤𝑥}
b. vertices: {1, 2, 3, 4, 5,6, 7, 8} edges: {12, 22, 23, 34, 35, 67, 68, 78}
3. Draw, if possible, simple graphs with the following degree sequences:
(i) 2,3,3,4,5,5 (ii) 3,3,5,5,5,5 (iii) 2,2,3,3,4,5,5.
4. Which of the following statements hold for the graph on the right?
a. vertices 𝑣 and ware adjacent;
b. vertices 𝑣 and 𝑥 are adjacent;
c. vertex 𝑢 is incident with edge 2;
d. edge 5 is incident with vertex 𝑥.
8. For each of the graphs in Problem 6, write down:the number of edges; the sum of the
degrees of all the vertices. What is the connection between your answers? Can you
9. (a) Use the handshaking lemma to prove that, in any graph, the number of
vertices of odd degree is even.
(b) Verify that the result of part (𝑎) holds for each of the graphs in Pro. 6.
4.2 Isomorphism
It follows from the definition that a graph is completely determined when we know its
vertices and edges, and that two graphs are the same if they have the same vertices and
edges. Once we know the vertices and edges, we can draw the graph and, in principle,
any picture we draw is as good as any other; the actual way in which the vertices and
edges are drawn is irrelevant - although some pictures are easier to use than others!
For example, recall the utilities graph, in which three houses A, Band Care joined to the
three utilities gas (g), water (w) and electricity (e). This graph is specified completely
by the following sets:
vertices: {A, B, C, g, w, e}
edges: {Ag, Aw, Ae, Bg, Bw, Be, Cg, Cw, Ce},
Each of these diagrams has six vertices and nine edges, and conveys the same
information - each house is joined to each utility, but no two houses are joined, and no
two utilities are joined. It follows that these two dissimilar diagrams represent the same
graph.
On the other hand, two diagrams may look similar, but represent different graphs. For
exan1ple, the diagrams below look similar, but they are not the same graph: for
example, AB is an edge of the second graph, but not the first.
We express this similarity by saying that the graphs represented by these two diagrams
are isomorphic. This means that the two graphs have essentially the same structure: we
can relabel the vertices in the first graph to get the second graph - in this case, we
simply interchange the labels wand B.
Example 4.6: The following two graphs are isomorphic with the following one-one
correspondence: v1 u1 , v2 u 4 , v3 u 2 , v 4 u 3 .
v3 u1
v1 v4 u4
v2 u2 u3
Likewise the following graphs are isomorphic:
v1 v2 v3 u4 u5
u2
u3
v4 v5 v6 u1 u6
Sometimes it is unnecessary to have labels on the graphs. In such cases, we omit the
labels and refer to the resulting object as an unlabelled graph.
Indeed, it also corresponds to either of the following graphs, which are isomorphic to
the above two:
are isomorphic if labels can be attached to their vertices so that they become the same
graph.
√ Check-List
Put a tick (√) mark if you can perform the task and a cross (x) mark if you can’t in the
box against the following questions.
1. Can you define isomorphic graphs?...................................................
2. Can you determine whether two graphs are isomorphic or not?..........
Exercise 4.2
1. By suitably relabelling the vertices, show that the following pairs of graphs are
isomorphic:
2. Are the following two graphs isomorphic? If so, find a suitable one-one
correspondence between the vertices of the first and those of the second; if not, explain
why no such one-one correspondence exists.
3. By suitably labelling the vertices, show that the following unlabelled graphs are
isomorphic:
Explain the terms walk, trail, path, closed walk, closed trail, cycle, connected
graph, disconnected graph and component;
Explain the terms edge connectivity, vertex connectivity, cutset and vertex
cutset;
Introduce concepts relating to how a connected graph can be disconnected.
Apply the concept of path and connectivity to the real world.
Many applications of graphs involve getting from one vertex to another. For example,
you may wish to find the shortest route between one town and another. Other examples
include the routeing of a telephone call between one subscriber and another, the flow of
current between two terminals of an electrical network, and the tracing of a maze. We
now make this idea precise by defining a walk in a graph.
This walk is denoted by 𝑢𝑣𝑤𝑥. . . 𝑦𝑧, and is referred to as a walk between 𝑢 and 𝑧.
We can think of such a walk as going from 𝑢 to 𝑣, then from 𝑣 to 𝑤, then from 𝑤 to 𝑥,
and so on, until we arrive eventually at the vertex 𝑧. Since the edges are undirected, we
can also think of it as a walk from 𝑧 to 𝑦 and on, eventually, to 𝑥, 𝑤, 𝑣 and 𝑢. So we
can equally well denote this walk by 𝑧𝑦. . . 𝑥𝑤𝑣𝑢, and refer to it as a walk between 𝑧
and 𝑢.
Note that we do not require all the edges or vertices in a walk to be different.
Example 4.8: In the following graph, 𝑢𝑣𝑤𝑥𝑦𝑤𝑣𝑧𝑧𝑦 is a walk of length 9 between the
vertices 𝑢 and 𝑦, which includes the edge 𝑣𝑤 twice and the vertices 𝑣, 𝑤, 𝑦 and 𝑧 twice.
Definition 4.7: A trail is a walk in which no edge has been traversed more than once
(in either direction) but repeated vertices are allowed. It is closed if the last vertex is the
same as the first, and open otherwise. A path is a walk in which all the edges and all
the vertices are different.
Example 4.9: In the following graph above, the walk 𝑣𝑧𝑧𝑦𝑤𝑥𝑦 is a trail which is not a
path, since the vertices 𝑦 and 𝑧 both occur twice, whereas the walk 𝑣𝑤𝑥𝑦𝑧 has no
repeated vertices, and is therefore a path.
e b
d c
We can use the concept of a path to define a connected graph. Intuitively, a graph is
connected if it is 'in one piece';
Example 4.11: The following graph is not connected, but can be split into four
connected subgraphs.
The observation that there is a path between x and y (which lie in the same subgraph),
but not between II and y (which lie in different subgraphs), leads to the following
definitions.
Definition 4.8: A graph is connected if there is a path between each pair of vertices,
and is disconnected otherwise. An edge in a connected graph is a bridge if its removal
leaves a disconnected graph. Every disconnected graph can be split up into a number of
connected subgraphs, called components.
Example 4.12: In the graph in exercise 4.3 (2), the edge 𝑡𝑧 is a bridge; and the
following disconnected graph has three components:
It is also useful to have a special term for those walks or trails that start and finish at the
same vertex. We say that they are closed.
The closed walk 𝑣𝑦𝑤𝑥𝑦𝑧𝑣 is a closed trail which is not a cycle, whereas the closed
trails 𝑧𝑧, 𝑣𝑤𝑥𝑦𝑣 and 𝑣𝑤𝑥𝑦𝑧𝑣 are all cycles. A cycle of length 3, such as 𝑣𝑤𝑦𝑣 or
𝑤𝑥𝑦𝑤, is called a mangle. In describing closed walks, we can allow any vertex to be
the starting vertex. For example, the triangle 𝑣𝑤𝑦𝑣 can equally well be written as
𝑤𝑦𝑣𝑤 or 𝑦𝑣𝑤𝑦 or (since the direction is immaterial) by 𝑣𝑦𝑤𝑣, 𝑤𝑣𝑦𝑤 or 𝑦𝑤𝑣𝑦.
Recall that a graph is connected if there is a path joining each pair of vertices. Let G be
a connected graph. By a disconnecting set we mean a set of edges whose deletion
results in a disconnected graph. A cutset is a disconnecting set, no proper subset of
which is a disconnecting set.
Example 4.14: In graph G1, e2 , e3 , e4 and e1 ,e2 are disconnecting sets but e3 , e5
is not.
e2 e7
G1 e1 e3 e5 e6
e4
If a disconnecting set has only one edge e (as in G2 below), then e is called a bridge (or
cut-edge).
e
G2
The edge connectivity of G is the size of the smallest disconnecting set of G, in other
words, it is the smallest number of edges whose deletion disconnects G. It is denoted by
G .
In the graph G1 above since e1 ,e2 is a disconnecting set of size 2, then G1 2.
Result
Let G denote the minimum degree of G. Then G (G) .
Example 4.15: In graph G3, u, v is a separating set, but u is not.
u
G3
If a separating set contains only one vertex w, then w is called a cut-vertex. The vertex
connectivity of a connected graph G is the size of the smallest separating set. In other
words, it is the smallest number of vertices whose removal disconnects G. It is denoted
by G .
√ Check-List
Put a tick (√) mark if you can perform the task and a cross (x) mark if you
can’t in the box against the following questions.
1. Can you define walk? ..........................................................................
2. Do you know the difference between trail and path?...........................
3. Do you know the difference between closed trail and cycle?...............
4. Can a simple graph is connected graph? ...............................................
Exercise 4.3
1. Write down all the paths between 𝑠 and 𝑦 in the following graph:
2. Draw:
a. a connected graph with eight vertices;
b. a disconnected graph with eight vertices and two components;
c. a disconnected graph with eight vertices and three components.
3. For the graph on the right, write down:
a. a closed walk that is not a closed trail;
b. a closed trail that is not a cycle;
c. all the cycles of lengths 1,2,3 and 4.
4. Find the vertex connectivity and the edge connectivity for each of the following
graphs, giving reasons for your answers.
(i) (ii)
(iii) (iv)
Null graphs
N4
Complete graphs
Definition 4.10: The complete graph on n vertices, denoted by Kn, is the simple graph
in which every pair of vertices is joined by an edge.
K3 K4
K5 K6
Regular graphs
These are graphs in which every vertex has the same degree. For example, Kn is regular
of degree n-1. Regular graphs of degree 3 are called cubic graphs. The number of edges
of a regular graph with n vertices is given by n(n - 1)/2. The following regular graph,
called the Petersen graph is an interesting example.
Bipartite graphs
Definition 4.11: A graph G is bipartite if every vertex can be labelled with either a or
b, so that every edge is an ab edge. In these graphs, the vertex set is the union of two
non-empty disjoint sets A and B with each edge of the graph joining a vertex in A to a
vertex in B.
a b A a a a
b b a
a b B b b b b
Kr,s denotes the simple bipartite graph in which the sets A and B (as above) contain r
and s vertices and every vertex in A is adjacent to every vertex in B.
K3,4 or
These are formed from the vertices and edges of the 5 regular (Platonic) solids:
Definition 4.12: The complement of a simple graph G is the simple graph with the
same vertex set as G with two vertices adjacent if and only if they are not adjacent in G.
It is denoted by G .
Theorem 4.3: In a connected graph G, we have G (G) (G) , for G K n .
Example 4.19: 2, 1.
√ Check-List
Put a tick (√) mark if you can perform the task and a cross (x) mark if you can’t in the
box against the following questions.
1. Can you define complete graph? ........................................................
2. Can you define regular and bipartite graph? .......................................
3. Can you explain the relation between a simple graph and its complement?..
4. Can you define platonic graph? ...............................................................
Exercises 4.4
(iv) (v)
(i) (ii)
Theorem 4.4: (Euler 1736). A connected graph is Eulerian if and only if every vertex
has even degree.
To find an Eulerian trail in a given graph, start in an arbitrary vertex and traverse along
the edges, ensuring all the edges are traversed before returning to the starting vertex.
If G is not Eulerian, but there is an open trail containing every edge of G, then G is
semi-Eulerian.
Example 4.21:
Theorem 4.5: A connected graph is semi-Eulerian if and only if precisely two of its
vertices have odd degree.
To obtain a semi-Eulerian trail in a given graph, you must start at one of the odd degree
vertices and end in the other odd degree vertex.
Definition 4.14: A graph G is Hamiltonian if there is a cycle that passes through every
vertex of G. Such a cycle is a Hamiltonian cycle.
If G is not Hamiltonian, but there is an open path which includes every vertex of G,
then G is semi- Hamiltonian, and such a path is a Hamiltonian path.
Example 4.22:
Bipartite graphs can only be Hamiltonian if sets A and B of vertices (as previously
defined) have the same number of vertices. It follows that if the total number of
vertices in a bipartite graph is odd then it cannot be Hamiltonian. There is no known
general criterion for testing whether a graph is semi-Hamiltonian.
√ Check-List
Put a tick (√) mark if you can perform the task and a cross (x) mark if you can’t in the
box against the following questions.
Exercises 4.5
1. Determine whether the following graphs are Eulerian, semi-Eulerian or neither. For those
that are Eulerian or semi-Eulerian, find a suitable trail.
(i) ii) v1 v2 v3
v1 v5 v6 v2
v7
v8
v3 v7 v9 v8 v4 v4 v5 v6
v9 v9 v9 v7
v5 v7 v5 v7 v5
v4 v8 v3 v4 v8 v3 v4 v8 v3
A D
4. Determine whether the following graphs are Hamiltonian, semi- Hamiltonian or neither.
Find a Hamiltonian cycle or path if one exists.
(i) (ii)
(iii) (iv)
(v) (vi)
5. Decide which of the following graphs are Eulerian and/or Hamiltonian, and write down an
Eulerian trail or Hamiltonian cycle where possible.
Objectives: After working through this topic, you should be able to:
The concept of a tree is one of the most important and commonly used ideas in graph
theory, especially in the applications of the subject. It arose in connection with the
work of Gustav Kirchhoff on electrical networks in the 1840s, and later with Arthur
Cayley's work on the enumeration of molecules in the 1870s. More recently, trees have
proved to be of value in such areas as computer science, decision making, linguistics,
and the design of gas pipeline systems.
Trees are often used to model situations involving various physical or conceptual tree-
like structures. These structures are also commonly referred to as 'trees'. In the
following examples, we classify such 'trees' in terms of the type of application in which
they occur.
Many trees have a physical structure which may be either natural or artificial and either
static or time-dependent. Two examples of natural trees are the biological variety with
trunk, branches and leaves, and the drainage system of tributaries forming a river basin.
Less obvious examples of tree structures are provided by the chemical structure of
certain organic molecules.
One of the most important classes of bipartite graphs is the class of trees. If G is a tree
then G is bipartite, i.e. all of its vertices can be labelled with either a or b so that every
edge is an ab edge (no aa or bb edges).
Examples 4.25:
Starting with the tree with just one vertex, we can build up any tree we wish by
successively adding a new edge and a new vertex. At each stage, the number of vertices
exceeds the number of edges by 1, so every tree with n vertices has exactly n - 1 edges.
At no stage is a cycle created, since each added edge joins an old vertex to a new
vertex.
At each stage, the tree remains connected, so any two vertices must be connected by at
least one path. However, they cannot be connected by more than one path, since any
two such paths would contain a cycle (and possibly other edges as well).
We therefore deduce that any two vertices in a tree are connected by exactly one path.
In particular, any two adjacent vertices are connected by exactly one path - the edge
joining them. If this edge is removed, then there is no path between the two vertices.
It follows that the removal of any edge of a tree disconnects the tree. Moreover, any
two vertices v and w are connected by a path, and the addition of the edge vw produces
a cycle - the cycle consisting of the path and the added edge vw.
Several of the above properties can be used as definitions of a tree. In the following
theorem, we state six possible definitions. They are all equivalent: anyone of them can
be taken as the definition of a tree, and the other five can then be deduced.
Theorem 4.8: Let G be a graph with n vertices. Then the following statements are
equivalent.
Example 4.26: The following diagram shows a graph and three of its spanning trees.
Given a connected graph, we can construct a spanning tree by using either of the
following two methods. We illustrate these by applying them to the graph G above.
Building-up method: Select edges of the graph one at a time, in such a way that no
cycles are created; repeat this procedure until all vertices are included.
Example 4.27: In the above graph G, we select the edges 𝑣𝑧, 𝑤𝑥, 𝑥𝑦, 𝑦𝑧; then no
cycles are created. We obtain the following spanning tree.
Cutting-down method : Choose any cycle and remove any one of its edges; repeat this
procedure until no cycles remain.
Example 4.28: From the above graph G, we remove the edges 𝑣𝑦 (destroying the
cycle 𝑣𝑤𝑦𝑣), 𝑦𝑧 (destroying the cycle 𝑣𝑤𝑦𝑧𝑣), 𝑥𝑦 (destroying the cycle 𝑤𝑥𝑦𝑤). We
obtain the following spanning tree.
√ Check-List
Put a tick (√) mark if you can perform the task and a cross (x) mark if you can’t in the
box against the following questions.
Exercise 4.6
1. Draw the branching tree representing the outcomes of two throws of a six-sided die.
2. 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. Use the handshaking lemma to prove that every tree with n vertices, where 𝑛 ≥ 2, has
at least two vertices of degree 1.
4. Use a proof by contradiction to show that the removal of an edge cannot disconnect a
tree into more than two components.
5. Use a proof by contradiction to show that the addition of a new edge to a tree cannot
create more than one cycle.
6. Use each method to construct a spanning tree in the complete graph K5.
7. The graph G below has twenty-one spanning trees. Find as many of them as you can.
Definition 4.17: A graph G is planar if it can be drawn in the plane without its edges
crossing. Such a drawing is called a plane drawing or a plane graph. A graph G is
non-planar if no plane drawing of G exists.
Example 4.29:
For some graphs, such as K3,3, it is impossible to find a drawing that involves no
crossings, therefore, K3,3 is an example of non planar graph.
Definition 4.18: A plane graph divides the plane into regions called faces. If we denote
the i-th face by f i , then f i represents the number of edges bordering f i .
Example 4.30:
(i) (ii)
f3
f1 f2 f3 f1 f2 f3 f4 f5
f4
Theorem 4.9: Let G be a connected plane graph, and let n, m and f be the respective
number of vertices, edges and faces of G. Then
f
fi 2m .
i 1
Informal proof. Take a walk around every face of the graph. You will traverse every
edge exactly twice, because an edge either borders exactly two faces (hence is counted
twice as you walk) or borders the same face twice.
4
In Example 4.30 (i) above, n = 6, m = 8, f = 4 and f
i 1
i 16 .
5
In (ii), n = 9, m = 12, f = 5 and f
i 1
i 24 .
Theorem 4.10( Euler’s Formula) (Euler 1750): Let G be a connected plane graph, and
let n, m and f be the respective number of vertices, edges and faces of G as before.
Then
n – m + f = 2.
Theorem 4.11: Let G be a simple planar graph with n 3 vertices and m edges. Then
m 3n 6 .
Proof. Assume that we have a plane drawing of G with f faces. Since each face is
bounded by at least 3 edges, we have f i 3 for every i = 1, 2, …, f. Hence,
f
fi 2m 3 f . So 3 f 2m , and by using Euler’s formula we have
i 1
3(m n 2) 2m or m 3n 6 .
graph K 3,3 , which has 6 vertices and 9 edges, we have 9 > 3 6 – 6 =12. As 9 is not
greater than 12 then the condition is not satisfied, but this does not mean K 3,3 is planar.
The graphs K 5 and K 3,3 are in fact two important examples of non-planar graphs as we
shall see later. These graphs are known as Kuratowski graphs. It is also useful to note
that the complete graph K n has exactly n(n 1) / 2 edges.
Given an edge e in a graph G, by contracting the edge e, we mean combining its end
vertices by bringing them closer and closer together until they become one and
replacing multi-edges by a single edge. We denote the graph obtained in this by G\e.
Deletion of an edge is denoted by G-e.
Example 4.32:
e
G G–e G\e
e
G G–e G\e
(i.e. add an edge) then it still remains non-planar. This is the basis for the Kuratowski
theorem.
Theorem 4.12 (Kuratowski theorem): A graph G is non-planar then it MUST contain
either a K 5 or K 3,3 minor.
minor.)
e Contract e, f, g, h, i.
-->
i f
h g
Petersen K5
b a
h f i Delete e, f, g and
e g contract h, i.
--> b a
K 3,3 a b
Dual Graphs
Cube Octahedron
The following hold for a connected planar graph G.
(i) If G has n vertices, m edges and k faces, then G * has k vertices, m edges and
n faces.
(ii) G ** is isomorphic to G.
√ Check-List
Put a tick (√) mark if you can perform the task and a cross (x) mark if you can’t in the
box against the following questions.
Exercise 4.7
1. Show that if G is a simple planar graph with no cycles of length 3 or 4 then
5
m (n 2) , where n is the number of vertices and m the number of edges of G.
3
2.Deduce that the Petersen graph is non-planar.
3.Show that the Petersen graph has a K 3,3 minor.
4.Use Kuratowski’s theorem to show that the following graphs are non-planar.
(i) (ii)
(iii) (iv)
Introduction
A chemical company wants to ship 6 chemicals, C1 ,, C 6 , in such a way that those
which react violently together are stored in separate containers. The problem is how to
store the chemicals using minimum number of containers. Pairs of chemical that react
violently together are:
The problem can be solved by drawing a ‘react violently’ graph, F, whose vertices are
C i and its edges are Ci C j (i, j 1, ,6) , where C i and C j react together violently. If
we now assign colours to the vertices of F so that no two adjacent vertices have the
same colour, we see that we require at least three colours. This minimum number of
colours is called the chromatic number and is denoted by the Greek letter , (chi). For
this problem, therefore, ( F ) 3 , as two colours would not be sufficient to colour the
adjacent vertices differently. So three containers are required to transport the chemicals
safely.
C6 C2 (blue)
(green) OR: C1 C2 C6
C5 (blue) C3 (red) C3 C5
C4 (red) C4
Definition 4.20: For a simple graph G, we say that G is k-colourable if we can colour
each vertex from a set of k colours in such a way that for every edge its two end
vertices have a different colour. The smallest k for which this is possible is called the
chromatic number of G, denoted by (G ) .
Note that the graph F above is tripartite. Its vertices can be split into three sets (red,
blue and green) and the edges connect vertices in different sets.
Example 4.35:
Remark 4.13: The above definitions are given only for simple graphs. Loops must be
excluded since, in any 𝑘-colouring, the vertices at the ends of each edge must be
assigned different colours, so the vertex at both ends of a loop would have to be
assigned a different colour from itself. We also exclude multiple edges, since the
presence of one edge between two vertices forces them to be coloured differently, and
the addition of further edges between them is then irrelevant to the colouring. We
therefore restrict our attention to simple graphs.
We usually show a k-colouring by writing the numbers 1,2, ..., 𝑘 next to the appropriate
vertices. For example, diagrams (a) and (b) below illustrate a 4-colouring and a 3-
colouring of a graph G with five vertices; note that diagram (c) is 1lot a 3-colouring of
G, since the two vertices coloured 2 are adjacent.
Since G has a 3-colouring, (G) < 3; thus 3 is an upper bound for (G). Also, G
contains three mutually adjacent vertices (forming a triangle) that must be assigned
different colours, so (G) > 3; thus 3 is a lower bound for (G). Combining these
inequalities, we obtain (G) = 3.
The question that we are now interested in is how many k-colourings does a graph
have. Let G (k ) be the number of k-colourings of G. Then (G ) is the smallest k for
which G (k ) 1 , since this means that there is at least one (G ) -colouring of G, (and
Example 4.36: Let H be the path on 3 vertices. Then, H (1) 0 , H (2) 2 , (so
( H ) 2 ), H (3) 12 , H (4) 36 , and so on.
k k -1 k -1 k -1 k k -1
OR
So we have H (k ) k (k 1) 2 .
Example 4.37:
1. Null graphs.
2. Trees.
3. Complete graphs.
k k -1
k -3 k -2
Theorem 4.14 (Brooks 1941): If G is a simple connected graph which is not an odd
cycle or a K n , then (G ) (G ) . (That is, G is (G ) -colourable.)
n
i(G) (G) (G) ,
where n is the number of vertices of G and the symbol a means the smallest integer
greater than or equal to the real number a.
i i
3 parts clique-partition K5, K3, K3 5 parts clique-partition K4, K3, K2, K1, K1
In the above example, we had equality between i (L) and some k. This need not always
be the case. For example the Petersen graph, P, has no K 3 ' s, K 4 ' s, as subgraphs;
only K 2 ' s (edges) and K1 ' s (vertices). It has 10 vertices, so every clique-partition with
k parts must have k 5 . But i ( P) 4 k . So clique-partitions cannot always be used
to find the independence number M.
Labelling Procedure
Labelling K 4 as above illustrates the general procedure. As you label vertices with
𝑘, 𝑘 − 1, … you can label a new vertex with k – i provided its labelled neighbours form
an i-clique (a complete subgraph K i ).
k -1 k -2 k -2 k
OR
k k -2 k -2 k -1
J (k ) k (k 1)(k 2) 2 .
Sometimes, when labelling, you might reach a conflict, i.e. the labelled neighbours of a
vertex you want to label do not form a clique. A different labelling may avoid this.
For example, the labelling on the left below reaches a conflict but the one on the right
works.
k k –1 k k -3
k –2 k -1
k -2 or k -3 ? k -1 k –2 k –2
J (k ) k (k 1)(k 2) 2 (k 3)
However, there are some graphs that CANNOT be labelled in a conflict free manner.
We need the deletion-contraction theorem to break such graphs into two or more
graphs, each of which having a conflict free labelling.
The graph F below, for example, cannot be labelled in a conflict free manner.
? k -1
k –2 k -1
Deletion-Contraction Theorem
Recall that G – e denotes the graph obtained from G by deleting edge e, and G \ e
denotes the graph obtained by contracting e.
This is a useful result as the two graphs on the right-hand side of the above equation
have fewer edges than G, so we can use the Deletion-Contraction theorem repeatedly
until we reach graphs for which we can compute the chromatic polynomial by a
conflict free labelling, e.g. for null graphs, complete graphs or trees.
We can now find the chromatic polynomial of F by applying the above result.
k -1
e
k-2 k -2
k k -1
F F–e F \ e (this is K4)
F (k ) = F e (k ) − F \ e (k )
= k (k 1) 2 (k 2) 2 − k (k 1)(k 2)(k 3)
= k (k 1)(k 2)(k 2 4k 5) .
√ Check-List
Put a tick (√) mark if you can perform the task and a cross (x) mark if you can’t in the
box against the following questions.
1. Can you define a k-colourable? .................................................................
2. Can you state Brooks theorem? ............................
3. Can you 4-colouring theorem? ............................................................................
4. Can you find the chromatic number of a given graph? ................................
Exercises 4.8
1. Determine the chromatic number of each of the following graphs.
(e)
(f)
Petersen graph
(g) (h)
2. For the graphs in 1 above, find the independence number and the Max degree in each
case and check that (G ) obeys the bounds
n
i(G) (G) (G) .
5. In how many ways can the graph in part (iii) above be coloured
(a) with 3 colours? (b) with 4 colours?
6. Find the chromatic polynomial of the disconnected graph.
(a) (b)
Chapter Summary
A graph is a diagram consisting of points, called vertices, joined by lines, called
edges; each edge joins exactly two vertices.
In a graph, two or more edges joining the same pair of vertices are multiple edges.
An edge joining a vertex to itself is a loop.
A graph with no multiple edges or loops is a simple graph.
Two vertices adjacent if they have an edge in common.
Two edges are adjacent if they have a vertex in common.
A subgraph of a graph G is a graph all of whose vertices are vertices of G and all of
whose edges are edges of G.
Handshaking Lemma states that in any graph, the sum of all the vertex degrees is
equal to twice the number of edges.
Two graphs are isomorphic if there is a one-one correspondence between their
vertex sets.
A walk in a graph G is a finite sequence of edges of the form
v0 v1 , v1v 2 , v 2 v3 ,, v m 1v m (also written v0 v1v 2 v3 v m ).
u5 u2 v2 v5
u1 v3 v4
(b) Give a reason why the following two graphs cannot be isomorphic:
v1 v4 u1 u4
v5 v8 u5 u8
v6 v7 u6 u7
v2 v3 u2 u3
5. By suitably labelling the vertices, show that the following graphs are isomorphic:
11. Draw:
a. two non-isomorphic regular graphs with 8 vertices and 12 edges;
b. two non-isomorphic regular graphs with 10 vertices and 20 edges.
12. For which values of n, rand s are the following graphs Eulerian? For which values
are they semi-Eulerian?
a. the complete graph 𝐾𝑛 ;
b. the complete bipartite graph 𝐾𝑟,𝑠 ;
c. the 𝑛-cube 𝑄𝑛 .
13. For which values of 𝑛, 𝑟and 𝑠 are the graphs in Exercise 9 Hamiltonian? For which
values are they semi-Hamiltonian?
14. Draw two graphs each with 10 vertices and 13 edges: one that is Eulerian but not
Hamiltonian and one that is Hamiltonian but not Eulerian.
15. Decide which of the following graphs are planar.
17. Let G be a planar graph with k components, and let 𝑛, 𝑚 and 𝑓 denote,
respectively, the numbers of vertices, edges and faces in a plane drawing of G.
a. Show that if each component has at least three vertices, then Euler's
formula has the form
𝑛 − 𝑚 + 𝑓 = 𝑘 + 1.
b. Deduce that if G is simple and each vertex has degree at least 2, then
𝑚 < 311 − 3(𝑘 + 1).
18. Give an example of a connected planar graph G with 7 vertices such that its
complement is also planar.
REFERENCE
CHAPTER 5
DIRECTED GRAPHS
Understand the terms digraph, labelled digraph, unlabelled digraph, vertex, arc,
adjacent, incident, multiple arcs, loop, simple digraph, underlying graph and
subdigraph;
Appreciate the uses of rooted trees in different areas;
determine whether two given digraphs are isomorphic;
Understand the terms in-degree, out-degree, in-degree sequence and out-degree
sequence.
state and use the handshaking dilemma;
realize walk, trail, path, closed walk, closed trail, cycle, connected, disconn-
ected and strongly connected in the context of digraphs;
Know the terms Eulerian digraph and Eulerian trail;
State a necessary and sufficient condition for a connected digraph to be
Eulerian;
Know the terms Hamiltonian digraph and Hamiltonian Cycle;
describe the use of digraphs in ecology, social networks, the rotating drum
problem, and ranking in tournaments.
Introduction
In this chapter we discuss digraphs and their properties. Our treatment of the subject is
similar to that of Chapters 4 for graphs, except that we need to take account of the
directions of the arcs.
define the terms digraph, labelled digraph, unlabelled digraph, vertex, arc,
adjacent, incident, multiple arcs, loop, simple digraph, underlying graph and
subdigraph;
determine whether two given digraphs are isomorphic;
explain the terms in-degree, out-degree, in-degree sequence and out-degree
sequence
state and use the handshaking dilemma;
Definition 5.1: A directed graph (digraph) consists of a set of elements called vertices
and a set of elements called arcs. Each arc joins two vertices in a specified direction.
Example 5.1: the digraph shown below has four vertices {𝑢, 𝑣, 𝑤, 𝑥} and six arcs
{1, 2, 3, 4, 5, 6}. Arc 1 joins 𝑥 to 𝑢, arc 2 joins 𝑢 to 𝑤, arcs 3 and 4 join 𝑤 to 𝑣,
We often denote an arc by specifying its two vertices in order; for example, arc 1 is
denoted by 𝑥𝑢, arcs 3 and 4 are denoted by 𝑤𝑣, and arc 6 is denoted by 𝑥𝑥. Note that
𝑥𝑢 is not the same as ux.
The above digraph contains more than one arc joining 𝑤 to 𝑣, and an arc joining the
vertex 𝑥 to itself. The following terminology is useful when discussing such digraphs.
Definition 5.2: In a digraph, two or more arcs joining the same pair of vertices in the
same direction are multiple arcs. An arc joining a vertex to itself is a loop. A digraph
with no multiple arcs or loops is a simple digraph.
Example 5.2: digraph (a) below has multiple arcs and digraph (b) has a loop, so neither
is a simple digraph. Digraph (c) has no multiple arcs or loops, and is therefore a simple
digraph.
The digraph analogues of adjacency and incidence are similar to the corresponding
definitions for graphs, except that we take account of the directions of the arcs.
Definition 5.3: The vertices 𝑣 and 𝑤 of a digraph are adjacent vertices if they are
joined (in either direction) by an arc 𝑒. An arc e that joins 𝑣 to 𝑤 is incident from v and
incident to 𝑤; 𝑣 is incident to 𝒆, and 𝑤 is incident from 𝑒.
Example 5.3: in the digraph below, the vertices 𝑢 and 𝑥 are adjacent, vertex 𝑤 is
incident from arcs 2 and 5 and incident to arcs 3 and 4, and arc 6 is incident to (and
from) the vertex 𝑥.
Isomorphism
It follows from the definition that a digraph is completely determined when we know
its vertices and arcs, and that two digraphs are the same if they have the same vertices
and arcs. Once we know the vertices and arcs, we can draw the digraph and, in
principle, any picture we draw is as good as any other; the actual way in which the
vertices and arcs are drawn is irrelevant - although some pictures are easier to use than
others!
are not the same, but they are isomorphic, since we can relabel the vertices in the
digraph C to get the digraph D, using the following one-one correspondence:
Sometimes it is unnecessary to have labels on the digraphs. In such cases, we omit the
labels, and refer to the resulting object as an ll1l1abelled digraph.
We say that two unlabelled digraphs are isomorphic if labels can be attached to their
vertices so that they become the same digraph.
Example 5.6: The following digraphs are all subdigraphs of the digraph D on the left,
with vertices {𝑢, 𝑣, 𝑤, 𝑥} and arcs {1, 2, 3, 4, 5, 6}.
Example 5.7: The following digraphs are all subdigraphs of the unlabelled digraph C
on the left:
Definition 5.6: The underlying graph of a digraph D is the graph obtained by replacing
each arc of D by the corresponding undirected edge.
To obtain the underlying graph, we simply remove the arrows from the arcs.
Example 5.8:
Definition 5.7: In a digraph, the out-degree of a vertex 𝑣 is the number of arcs incident
from 𝑣, and is denoted by outdeg 𝒗; the in-degree of 𝑣 is the number of arcs incident to
v, and is denoted by indeg 𝑣.
Remark 5.2: Each loop contributes 1 to both the in-degree and the out-degree of the
corresponding vertex.
Example 5.9: The digraph below has the following out-degrees and in-degrees:
There are also analogues of the degree sequence of a graph, corresponding to the out-
degree and in-degree of a vertex.
Example 5.10: The above digraph has out-degree sequence (0, 1,2,2,2,3) and in-degree
sequence (0, 0, 1, 1, 2, 6).
Handshaking Dilemma
In the solution to Problem 4.10, you should have noticed that the sum of the out-
degrees and the SUI11 of the in-degrees of each digraph are both equal to the number
of arcs. A corresponding result holds for any digraph; we call it the handshaking
dilemma!
Theorem 5.3( Handshaking Dilemma): In any digraph, the sum of all the out-degrees
and the sum of all the in-degrees are both equal to the number of arcs.
Proof: In any digraph, each arc has two ends, so it contributes exactly 1 to the sum of
the out-degrees and exactly 1 to the sum of the in-degrees. The result follows
immediately.
√ Check-List
Put a tick (√) mark if you can perform the task and a cross (x) mark if you can’t in the
box against the following questions.
1. Can you define a digraph? .........................................................................
2. Can you state Handshaking dilemma? .......................................................
3. Can you define isomorphic digraphs? ...............................................................
4. Can you distinguish the difference between in-degree and out-degree? .............
Exercise 5.1
1. Write down the vertices and arcs of each of the following digraphs. Are these digraphs
simple digraphs?
2. Which of the following statements hold for the digraph on the right?
a. vertices 𝑣 and 𝑤 are adjacent;
b. vertices 𝑣 and 𝑥 are adjacent;
c. vertex 𝑢 is incident to arc 2;
d. arc 5 is incident from vertex 𝑣.
3. Draw the digraphs whose vertices and arcs are as follows. Are these digraphs simple
digraphs?
a. vertices: {𝑢, 𝑣, 𝑤, 𝑥} arcs: {𝑣𝑤, 𝑤𝑢, 𝑤𝑣, 𝑤𝑥, 𝑥𝑢}
b. vertices: {𝑙, 2, 3, 4, 5,6,7, 8} arcs: {𝑙2, 22,23,34,35,67,68, 78}
4. By suitably labelling the vertices, show that the following unlabelled digraphs are
isomorphic:
5. By suitably relabelling the vertices, show that the following digraphs are isomorphic:
6. Are the following two digraphs isomorphic? If so, find a suitable one-one correspondence
between the vertices of the first and those of the second; if not, explain why no such one-
one correspondence exists.
9. Write down the out-degree and in-degree sequences of each of the following digraphs:
Explain the terms walk, trail, path, closed walk, closed trail, cycle, connected,
disconnected and strongly connected in the context of digraphs;
explain the terms Eulerian digraph and Eulerian trail;
state a necessary and sufficient condition for a connected digraph to be
Eulerian;
explain the terms Hamiltonian digraph and Hamiltonian Cycle;
Just as you may be able to get from one vertex of a graph to another by tracing the
edges of a walk, trail or path, so you may be able to get from one vertex of a digraph to
another by tracing the arcs of a 'directed' walk, trail or path. This means that you have
to follow the directions of the arcs as you go, just as if you were driving around a one-
way street system in a town. We make this idea precise, as follows.
Example 5.11: In the following diagram, the walk 𝑣𝑤𝑥𝑦𝑣𝑤𝑦𝑧𝑧𝑢 is a walk of length 9
from 𝑣 to 𝑢, which includes the arc 𝑣𝑤 twice and the vertices 𝑣, 𝑤, 𝑦 and 𝑧 twice. The
walk 𝑢𝑣𝑤𝑦𝑣𝑧 is a trail which is not a path, since the vertex 𝑣 occurs twice, whereas the
walk 𝑣𝑤𝑥𝑦𝑧 has no repeated vertices and is therefore a path.
The terms closed walk, closed trail and cycle also apply to digraphs.
In the digraph above, the closed walk 𝑢𝑣𝑤𝑦𝑣𝑧𝑢 is a closed trail which is not a cycle
(since the vertex 𝑣 occurs twice), whereas the closed trails 𝑧𝑧, 𝑤𝑥𝑤, 𝑣𝑤𝑥𝑦𝑣 and
𝑢𝑣𝑤𝑥𝑦𝑧𝑢 are all cycles. In describing closed walks, we can allow any vertex to be the
starting vertex. For example, the triangle 𝑣𝑤𝑦𝑣 can also be written as 𝑤𝑦𝑣𝑤 or 𝑦𝑣𝑤𝑦.
As with graphs, we can use the concept of a path tell us whether or not a digraph is
connected. Recall that a graph is connected if it is 'in one piece', and this means that
there is a path between each pair of vertices. For digraphs these two ideas are not the
same, and this leads to two different definitions of the word connected for digraphs.
path from 𝑧 to 𝑦. Digraph (c) is strongly connected, since there are paths joining all
pairs of vertices.
Alternatively, you can think of driving around a one-way street system in a town. If the
town is strongly connected, then you can drive from any part of the town to any other,
following the directions of the one-way streets as you go; if the town is merely
connected, then you can still drive from any part of the town to any other, but you may
have to ignore the directions of the one-way streets!
In Chapter 4, we discussed the problem of finding a route that includes every edge or
every vertex of a graph exactly once, and it is natural to consider the corresponding
problem for digraphs. This leads to the following definitions.
Much of the earlier discussion of Eulerian and Hamiltonian graphs can be adapted to
Eulerian and Hamiltonian digraphs. In particular, there is an analogue of Theorem 3.2.
We ask you to discover this analogue in the following problem.
Activity 5.1:
a. Guess a necessary and sufficient condition for a digraph to be Eulerian, involving the
in-degree and out-degree of each vertex.
b.Use the condition obtained in part (a) to check which of the digraphs in are Eulerian.
Theorem 5.4: A connected digraph is Eulerian if and only if, for each vertex, the out-
degree equals the in-degree.
Theorem 5.5: An Eulerian digraph can be split into cycles, no two of which have an
arc in common.
The proofs of these theoren1s are similar to those of Theorems 4.4 and 4.5. In the
sufficiency part of the proof of Theorem 5.4, the basic idea is to show that the digraph
contains a (directed) cycle, and then to build up the required Eulerian trail from cycles
step by step, as in the proof of Theorem 4.4. We omit the details. There is an analogue
of Ore's theoren1 for Hamiltonian graphs, but it is harder to state and prove than the
theorem for graphs, so we omit it.
√ Check-List
Put a tick (√) mark if you can perform the task and a cross (x) mark if you can’t in the
box against the following questions.
1. Can you define a walk in a digraph? .................................................................
2. Can you define Eulerian digraph and Eulerian trial? ...................................
3. Can you define Hamiltonian and Hamiltonian cycle? ....................................
Exercise 5.2
21. Decide which of the following digraphs are Eulerian and/or Hamiltonian, and write down
an Eulerian trail or Hamiltonian cycle where possible.
distinguish between physical and conceptual tree structures, and give examples
of each type;
appreciate the uses of rooted trees in different areas;
construct the bipartite graph representation of a given braced rectangular frame-
work and use it to determine whether the system is rigid; if so, determine
whether the system is minimally braced.
Among the examples of tree structures, one particular type of tree occurs repeatedly.
This is the hierarchical structure in which one vertex is singled out as the starting point,
and the branches fan out from this vertex. We call such trees rooted trees, and refer to
the starting vertex as the root. For example, the tree representing the lines of
responsibility of a company is a rooted tree, with the managing director as the root.
A rooted tree is often drawn as follows, with the root indicated by a small square at the
top, and the various branches descending from it. When a path from the top reaches a
vertex, it may split into several new branches. Although a top-to-bottom direction is
often implied, we usually draw a rooted tree as a graph with undirected edges, rather
than as a digraph with arcs directed downwards. A rooted tree in which there are at
most two descending branches at any vertex is a binary tree.
Such trees are often called branching trees. We have already seen two instances of
branching trees - the family tree and the hierarchical tree. There are many further
examples, as we now show.
Outcomes of Experiments
If we toss a coin or throw a die several times, then the possible outcomes can be
represented by a branching tree. In the case of tossing a coin, each possible outcome
has two edges leading from it, since the next toss may be a head (H) or a tail (T), and
we obtain a binary tree.
Example 5.13: if we toss a coin three times, then there are eight possible outcomes,
and we obtain the following branching tree.
Grammatical Trees
Branching trees occur in the parsing of a sentence in a natural language, such as
English. The tree represents the interrelationships between the words and phrases of the
sentence, and hence the underlying syntactic structure. Such a branching tree is
obtained by splitting the sentence into noun phrases and verb phrases, then splitting
these phrases into nouns, verbs, adjectives, and so on.
Example 5.14: The structure of the sentence Good students read books can be
represented by the following tree.
Computer Science
Rooted tree structures arise in computer science, where they are used to model and
describe branching procedures in programming languages (the languages used to write
algorithms to be interpreted by computers). In particular, they are used to store data in a
computer's memory in many different ways.
Example 5.15: Consider the list of seven numbers 7, 5, 4, 2, I, 6, 8. The following trees
represent ways of storing this list in the memory - as a stack and as a binary tree. Each
representation has its advantages, depending on how the data is to be manipulated, but
in both representations it is important to distinguish where the data starts, so the trees
are rooted trees.
We obtain the tree by writing the numbers in a string 7542168, 'promoting' every
second number (5, 2, 6) and then 'promoting' the new second number (2).
√ Check-List
Put a tick (√) mark if you can perform the task and a cross (x) mark if you can’t in the
box against the following questions.
1. Can you define a rooted tree? .................................................................
Exercise 5.3
1. Draw the branching tree representing the outcomes of two throws of a six-sided die.
2. The ambiguous sentence Help rape victims appeared as a newspaper headline l and can be
interpreted in two ways. Draw two tree structures that correspond to this sentence.
Chapter Summary
2. Of the following four digraphs, which two are the same, which one is isomorphic to these
two, and which is not isomorphic to any of the others?
3. Draw two non-isomorphic non-simple digraphs, each with 4 vertices and 7 arcs. Explain
why your digraphs are not isomorphic.
4. Write down the out-degree sequence and the in-degree sequence for each of the digraphs in
Exercise 2.
5. (a) If two digraphs have the same out-degree sequence and the same in- degree sequence,
must they be isomorphic?
(b) If two digraphs are isomorphic, must they have the same out-degree
sequence and the same in-degree sequence?
6. Draw a digraph with 4 vertices and 7 arcs such that the number of vertices with odd out-
degree is odd and the number of vertices with odd in-degree is odd.
7. For the digraph shown on the right, write down (if possible):
a. a walk of length 7 from 𝑢 to 𝑤;
b. cycles of lengths 1, 2, 3 and 4;
c. a path of maximum length.
8. Draw four connected digraphs, D1, D2, D3 and D4, each with 5 vertices and 8 arcs,
satisfying the following conditions:
Dl is a simple digraph;
D2 is a non-simple digraph with no loops;
D3 is a digraph with both loops and multiple arcs;
D4 is strongly connected.
9. Classify each of the following digraphs as disconnected, connected but not strongly
connected, or strongly connected:
10. A graph is orientable if a direction can be assigned to each edge in such a way that the
resulting digraph is strongly connected. Show that K5 and the Petersen graph are
orientable, and find a graph that is not.
REFERENCE
CHAPTER 6
MATRICES AND GRAPHS
Up to now, you have seen two ways of representing a graph or digraph - as a diagram
of points joined by lines, and as a set of vertices and a set of edges or arcs. The pictorial
representation is useful in many situations, especially when we wish to examine the
structure of the graph or digraph as a whole, but its value diminishes as soon as we
need to describe large or complicated graphs and digraphs. For example, if we need to
store a large graph in a computer, then a pictorial representation is unsuitable and some
other representation is necessary.
One possibility is to store the set of vertices and the set of edges or arcs. This method is
often used, especially when the graph or digraph is 'sparse', with many vertices but
relatively few edges or arcs. Another method is to take each vertex in turn and list those
vertices adjacent to it; by joining each vertex to its neighbours, we can reconstruct the
graph or digraph. Yet another method is to give a table indicating which pairs of
vertices are adjacent, or indicating which vertices are incident to which edges or arcs.
Each of these methods has its advantages, but the last one is particularly useful. Using
this method, we represent each graph or digraph by a rectangular array of numbers,
called a matrix. Such matrices lend themselves to computational techniques, and are
often the most natural way of formulating a problem. There are various types of matrix
that we can use to specify a given graph or digraph. Here we describe the two simplest
types - the adjacency matrix and the incidence matrix.
On the left we have a graph with four labelled vertices, and on the right we have a
matrix with four rows and four columns - that is, a 4 𝑥 4 matrix. The numbers
appearing in the matrix refer to the number of edges joining the corresponding vertices
in the graph. For example,
vertices 1 and 2 are joined by 1 edge, so 1 appears in row 1 column 2, and in row 2
column 1;
vertices 2 and 4 are joined by 2 edges, so 2 appears in row 2 column 4, and in row 4
column 2;
vertices 1 and 3 are joined by 0 edges, so 0 appears in row 1 column 3, and in row 3
column 1;
vertex 2 is joined to itself by 1 edge, so 1 appears in row 2 column 2.
Definition 6.1: Let G be a graph with n vertices labelled 1,2,3, . . . , 𝑛. The adjacency
matrix 𝐴( 𝐺) of G is the 𝑛 𝑥 𝑛 matrix in which the entry in row 𝑖 and column 𝑗 is the
number of edges joining the vertices 𝑖 and 𝑗.
The adjacency matrix of a graph is symmetrical about the main diagonal (top-left to
bottom-right). Also, for a graph without loops, each entry on the main diagonal is 0,
and the sum of the entries in any row or column is the degree of the vertex
corresponding to that row or column.
e1 e3 e4
e6
v2 e2 v3
Example 6.2:
On the left we have a digraph with four labelled vertices, and on the right we have a
matrix with four rows and four columns. The numbers appearing in the matrix refer to
the number of arcs joining the corresponding vertices in the digraph. For example,
vertices 1 and 2 are joined (in that order) by 1 arc, so 1 appears in row 1 column 2;
vertices 2 and 4 are joined (in that order) by 2 arcs, so 2 appears in row 2 column 4;
vertices 4 and 1 are joined (in that order) by 0 arcs, so 0 appears in row 4 column 1;
vertex 2 is joined to itself by 1 arc, so 1 appears in row 2 column 2.
The adjacency matrix of a digraph is not usually symmetrical about the main diagonal.
Also, if the digraph has no loops, then each entry on the main diagonal is 0, the sum of
the entries in any row is the out-degree of the vertex corresponding to that row, and the
sum of the numbers in any column is the in-degree of the vertex corresponding to that
column.
We can establish the existence of walks in a graph or digraph by using the adjacency
matrix. In the following, we restrict our attention to digraphs: similar results can be
derived for graphs.
Consider the following digraph and table:
Example 6.3:
The table shows the number of walks of length 1 between each pair of vertices. For
example,
the number of walks of length 1 from a to c is 0, so 0 appears in row 1 column 3;
the number of walks of length 1 from b to a is 1, so 1 appears in row 2 column 1;
the number of walks of length 1 from d to b is 2, so 2 appears in row 4 column 2.
Now a walk of length 1 is an arc, so the table above is the adjacency matrix A of the
digraph:
Next, we consider walks of lengths 2 and 3. For example, there are two different walks
of length 2 from 𝑎 to 𝑏, because there is one arc from a to 𝑑 and two arcs from 𝑑 to 𝑏.
Similarly, there are two different walks of length 3 from 𝑑 to 𝑑, since there are two arcs
from d to b, and one walk of length 2 from 𝑏 to d, namely, 𝑏𝑎𝑑.
Theorem 6.1: Let D be a digraph with 𝑛 vertices labelled 1,2, . . . , 𝑛, let A be its
adjacency matrix with respect to this listing of the vertices, and let 𝑘 be any positive
integer. Then the number of walks of length 𝑘 from vertex 𝑖 to vertex 𝑗 is equal to the
entry in row 𝑖 and column 𝑗 of the matrix 𝐴𝑘 (the kth power of the matrix A).
Write down the adjacency matrix A, calculate the matrices A2 , A3 and A4 , and hence
find the numbers of walks of lengths 1, 2,3 and 4 from 𝑏 to 𝑑. Are there walks of
lengths 1, 2, 3 or 4 from 𝑑 to 𝑏?
Recall that a digraph is strongly connected if there is a path from vertex i to vertex j, for
each pair of distinct vertices i and j, and that a path is a walk in which all the vertices
are different. For example, in the digraph considered earlier, there are four vertices, so a
path has length 1, 2 or 3. We have seen that the numbers of walks (including the paths)
of lengths 1, 2 and 3 between pairs of distinct vertices are given by the non-diagonal
entries in the matrices
By examining these matrices, we can see that each pair of distinct vertices is indeed
joined by at least one path of length 1, 2 or 3, so the digraph is strongly connected.
However, we can check this more easily if we consider the matrix B obtained by
adding the three matrices together:
Let 𝑏𝑖𝑗 denote the entry in row 𝑖 and column 𝑗 in the matrix B. Then each entry 𝑏𝑖𝑗 is
the total number of walks of lengths 1, 2 and 3 from vertex 𝑖 to vertex 𝑗. Since all the
non-diagonal entries are positive, each pair of distinct vertices is connected by a path,
so the digraph is strongly connected.
We generalize this result in the following theorem; the proof is given at the end of this
section.
Theorem 6.2: let D be a digraph with 𝑛 vertices labelled 1,2, . . . , 𝑛, let A be its
adjacency matrix with respect to this listing of the vertices, and let B be the matrix
𝐵 = 𝐴 + 𝐴2 + ⋯ + 𝐴𝑛−1
Counting walks
Let A aij be the adjacency matrix of a graph G with vertex set {v1 , v2 ,, vn } . The
n
(i, j ) th element of A2 is k 1
aik a kj and this is the number of walks of length 2 from
v i to v j .
Example 6.4: If G is v1 v2
v3 v4
then
0 1 1 0 2 1 1 2
1 0 1 1 1 3 2 1
A and A
2
.
1 1 0 1 1 2 3 1
0 0 2 2
1 1 1 1
Hence, for example, the number of walks of length 2 from v2 to v3 is 2, and the number
of walks of length 2 from v2 to v2 is 3.
Generally, for any positive integer r, the number of walks of length r from vi to vj is
given by the (i, j ) th element of Ar .
√ Check-List
Put a tick (√) mark if you can perform the task and a cross (x) mark if you can’t in the
box against the following questions.
1. Can you define a adjacency matrix of a graph? ...........................................
2. Can you define a adjacency matrix of a digraph? ........................................
Exercise 6.1
5. Complete the following tables for the numbers of walks of lengths 2 and 3 in the above
digraph.
b. Find the matrix products A2 and A3 , where A is the adjacency matrix of the
above digraph.
c. Comment on your results.
6. Consider the following digraph:
7. Find B for the digraph in Problem 5.6, and hence determine whether the digraph is
strongly connected.
8. Determine whether the digraph with the following adjacency matrix is strongly connected:
For convenience, in this section we restrict our attention to graphs all digraphs with out
loops.
Whereas the adjacency matrix of a graph or digraph involves the adjacency of vertices,
the incidence matrix involves the incidence of vertices and edges or arcs. To see what
is involved, consider the following example:
On the left we have a graph with four labelled vertices and six labelled edges, and on
the righ t we have a matrix with four rows and six columns. Each of the numbers
appearing in the matrix is 1 or 0, depending on whether the corresponding vertex and
edge are incident with each other. For example,
Definition 6.3: Let G be a graph without loops, with 𝑛 vertices labelled ①, ②, ...,
and 𝑚 edges labelled 1,2, 3, . . . , 𝑚. The incidence matrix I(G) of G is the n x m matrix
in which the entry in row 𝑖 and column 𝑗 is
In the incidence matrix of a graph without loops, each column contains exactly two 1s,
as each edge is incident with just two vertices; the sum of the numbers in a row is the
degree of the vertex corresponding to that row.
Whereas the adjacency matrix of a digraph involves the adjacency of vertices, the
incidence matrix of a digraph involves the incidence of vertices and arcs. Since an arc
can be incident from, incident to, or not incident with a vertex, we have to take account
of this when defining the matrix. To see what is involved, consider the following
example:
Example 6.5:
On the left we have a digraph with four labelled vertices and six labelled arcs, and on
the right we have a matrix with four rows and six columns. Each of the numbers
appearing in the matrix is 1, −1 or 0, depending on whether the corresponding arc is
incident from, incident to, or not incident with, the corresponding vertex. For example,
Definition 6.4: Let D be a digraph without loops, with n vertices labelled ①, ②, ...,
and 𝑚 arcs labelled 1, 2,3, … , 𝑚. The incidence matrix I(D) of D is the 𝑛 𝑥 𝑚
matrix in which the entry in row𝑖 and column 𝑗 is
In the incidence matrix of a digraph without loops, each column has exactly one 1 and
one −1, since each arc is incident from one vertex and incident to one vertex; the
number of 1s in any row is the out-degree of the vertex corre- sponding to that row, and
the number of −1s in any row is the in-degree of the vertex corresponding to that row.
√ Check-List
Put a tick (√) mark if you can perform the task and a cross (x) mark if you can’t in the
box against the following questions.
3. Can you define a incidence matrix of a graph without loops? ..........................
4. Can you define a incidence matrix of a digraph without loops? .......................
Exercise 6.2
Chapter Summary
The adjacency matrix for a loopless graph G is the n n matrix whose ijth
element is the number of edges joining v i to v j .
The incidence matrix I(D) of a digraph D is the 𝑛 𝑥 𝑚 matrix in which the entry
in row 𝑖 and column 𝑗 is
1 if arc j is incident from vertex i,
{−1 if arc j is incident to vertex,
𝑜 otherwise.
v1 v4
e1 e2
e3 e4
e5
v2 v3
e6
0 1 1 1 1
1 0 1 0 1
1 1 0 0 0 .
1 0 0 0 1
1 0
1 0 1
0 0 0 1 0 1 0
1 0 1 1 0 0 1
1 1 0 0 0 0 0 .
0 1 1 0 1 1 0
0 1
0 0 0 1 0
2. Write down the adjacency matrices of the following graph and digraph.
3. Draw the graph corresponding to adjacency matrix (a) and the digraph corresponding to
adjacency matrix (b).
Write down the adjacency matrix A, calculate the matrices A2, A3 and A4, and hence find
the numbers of walks of lengths 1, 2, 3 and 4 from 𝑤 to 𝑢. Is there a walk of length 1, 2, 3
or 4 from 𝑢 to 𝑤?
6. Write down the incidence matrices of the following graph and digraph.
8. The following matrix is the incidence matrix of a graph G. What is the adjacency matrix of
G with the same labelling?
REFERENCE
[13]. K. H. Rosen, Discrete Mathematics and Its Applications 6th ed. McGraw Hill.
[14]. R. J. Wilson, Introduction to Graph Theory, Longman, 1996.
[15]. D. B. West, Introduction to Graph Theory, 2005.