0% found this document useful (0 votes)
102 views

Discrete Lecture - Notes

Discrete mathematics lecture notes

Uploaded by

rehiwott
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views

Discrete Lecture - Notes

Discrete mathematics lecture notes

Uploaded by

rehiwott
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Chapter 1

Elementary Counting Principles

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

1.1 Basic counting principles


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

1.1.1 Addition Principle(AP)


Proposition 1. (Addition Principle) If A and B are two disjoint sets, then |A ∩ B| =
|A| + |B|.
Suppose some event E can occur in m ways and a second event F can occur in n ways,
and suppose both events cannot occur simultaneously. Then E or F can occur in m + n
ways.
Example 1.1.1. How many students are there in your class? The class contains male
students and female students. Let A be the set of male students in your class and let B be
the set of female students in your class.
Simple observations:
i. A ∩ B = ∅ and
ii. A ∪ B is the set of students in your class.
So, if |A| = 15 and |B| = 35, then there are a total of 15 + 35 = 50 students in your class.
Example 1.1.2. A student can choose a maths project from one of three lists. The three
lists contain 23, 15, and 19 possible projects, respectively. No project is on more than one
list. How many possible projects are there to choose from?

By Mesfin M, AAU
1.1 Basic counting principles 2

Solution. The student can choose a project by selecting a project from the first list, the
second list, or the third list. Because no project is on more than one list, by the sum rule
there are 23 + 15 + 19 = 57 ways to choose a project.
Example 1.1.3. Suppose E is the event of selecting a prime number less than 10 and F is
the event of selecting an even number less than 10. Then E can happen in 4 ways, and F can
happen in 4 ways. But, because 2 is even and prime, E or F can happen in only 4+4-1=7
ways.
Generalized Addition Principle
If A1 , A2 , A3 , ..., An are pairwise disjoint sets, then | ni=1 Ai | = ni=1 |Ai |.
S P

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

1.1.2 Multiplication Principle(MP)


It count the number of elements in the Cartesian product of sets.
If A and B are any two finite sets, then |A × B| = |A| × |B|.

In other words, if a task can be broken down into first and second stage, and if there
are m possible ways of performing in the first stage and n possible ways of performing the
second stage, then the possibilities that the task can be carried out is m × n. In other
words,if procedure can be break down in to a sequence of two tasks, if there are n ways to do
the first and there m ways to do the second task, then there are nm ways to do the procedure.

Example 1.1.6. A book shelf holds 6 different English books, 8 different mathematics books,
and 10 different chemistry books, there are
i) 6 × 8 × 10 = 480 ways of selecting 3 books, in each subject;
ii) An English and a mathematics books can be selected in 6 × 8 = 48 ways, an English and a
chemistry books, in 6 × 10 = 60 ways, a mathematics and a chemistry books, in 8 × 10 = 80
ways. Thus there are 48 + 60 + 80 = 188 ways of selecting 2 books in 2 subjects.
In general, suppose that an event E can be decomposed in to r ordered events E1 , E2 , ..., Er
and that there are
n1 Ways for the event E1 to occur
n2 Ways for the event E2 to occur
n3 Ways for the event E3 to occur

By Mesfin M, AAU
1.1 Basic counting principles 3

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

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

By Mesfin M, AAU
1.2 Permutations and Combinations 4

1.2 Permutations and Combinations


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

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


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

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


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

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


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

3. The number of permutations of n objects in which k1 are alike, k2 are alike, ...,kn are
alike is given by:
n!
P (n; k1 , k2 , ..., kn ) =
k1 ! × k2 ! × ... × kn !
Note that: The third rule of permutation is called Permutation with repetitions.

Example 1.2.1. Suppose we have a letters A,B, C, D

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

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

Solution. a) Here n = 4, there are four distinct objects


⇒ There are 4! = 24 permutations.
b) Here n = 4 and r = 2
4!
⇒ There are P (4, 2) = (4−2)! = 12 permutations.

Example 1.2.2. Find the number of even integers between 20,000 and 70,000 in which no
digit is repeated.

Solution. Let abcde be a required even integer. The first digit a can be chosen from
{2, 3, 4, 5, 6} and the fifth digit e can be chosen from {0, 2, 4, 6, 8}. Since {2, 3, 4, 5, 6} ∩
{0, 2, 4, 6, 8} = {2, 4, 6}, we divide the problem in to two disjoint cases.
Case I: a∈ {2, 4, 6}, so a has 3 choices, e has 4 choices and bcd has P (10 − 2, 3) = P (8, 3)

By Mesfin M, AAU
1.2 Permutations and Combinations 5

choices. By MP, there are 3 × 4 × P (8, 3) = 4032 such even numbers.


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

By Mesfin M, AAU
1.2 Permutations and Combinations 6

1.2.2 Circular Permutations


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

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

ABCDE, BCDEA, CDEAB, DEABC, EABCD

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

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

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

Example 1.2.6. In how many ways can 5 boys and 3 girls be seated around a table if

i. There is no restriction?

ii. Boy B1 and girl G1 are not adjacent?

iii. No girls are adjacent?

Solution. i. The number of ways is Q(8, 8) = (8 − 1)! = 7!.


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

By Mesfin M, AAU
1.2 Permutations and Combinations 7

1.2.3 Combinations
A selection of objects with out regard to order is called combination. , i.e. a combination of
a set of objects is an unordered selection of the objects. Thus, an r-combination is simply a
subset of the set with r elements(r-subsets).
Note that:Permutation is an ordered arrangement of objects and Combination is a selection
without regard to order.
Example 1.2.7. Given the letters A, B, C, and D list the permutation and combination for
selecting two letters.
Solution:

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

Note that in permutation AB is different from BA. But in combination AB is the same
as BA.
Combination Rule
The number of combinations of r objects selected from n objects without repetition is denoted
n

by C(n, r) or r , where 0 ≤ r ≤ n and is given by the formula:
 
n P (n, r) n!
C(n, r) = = = .
r r! r! ∗ (n − r)!

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


is read as “n choose r”.


n 0

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

Example 1.2.8. In how many ways a committee of 5 people be formed from a group of 11
people consisting of 4 teachers and 7 students if:
a)There is no restriction in the selection?
b)The committee must include exactly 2 teachers?
c)Two of them are T1 and T2
d)The committee must include at least 3 teachers?
e)A particular teacher and a particular student cannot both in the committee?

Exercise
1. Consider a group of 20 people. If everyone shakes hands with everyone else, how many
handshakes take place?

By Mesfin M, AAU
1.3 The inclusion- exclusion principles 8

2. Out of 5 Mathematician and 7 Statistician a committee consisting of 2 Mathematician


and 3 Statistician is to be formed. In how many ways this can be done if:

a) There is no restriction

b) One particular Statistician should be included

c) Two particular Mathematicians can not be included on the committee.

3. A committee of k people is to be chosen from a set of 7 women and 4 men. How many
ways are there to form the committee if:

a) The committee has 5 people, 3 women and 2 men. (Ans 210 ways)

b) The committee can be any positive size but must have equal numbers of women and
men. (Ans 329 ways)

c) The committee has 4 people and one of them must be Mr. Abebe. (Ans 120 ways)

4. Seven friends go to a restaurant for lunch and order from the menu that has four items:
fish, meat, vegetable or pasta. How many different orders are there? (Ans.=120)
5. How many positive integers less than 1000,000 have the sum of their digits equals to 9?
14

(Ans 9 )

1.3 The inclusion- exclusion principles


This section we develop a set-theoretic formula for counting problems involving several in-
teracting properties in which either all properties must hold or none must hold.

Theorem 1. Let U be a finite set. Suppose A and B are two subsets of U . Then

a) the number of elements of U that are either in A or in B is given by

|A ∪ B| = |A| + |B| − |A ∩ B|.

b) the number of elements of U that are neither in A nor in B is given by

|Ac ∩ B c | = |U | − |A| − |B| + |A ∩ B|.

By Mesfin M, AAU
1.3 The inclusion- exclusion principles 9

A generalization of this to three subsets A, B and C is also well known. To get a re-
sult that generalizes Theorem 1 for n subsets A1 , A2 , . . . , An , we need the following notations:

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

With the notations as defined above, we have the following theorem, called the inclusion-
exclusion principle.

Theorem 2. (Inclusion-Exclusion Principle) Let A1 , A2 ,. . . , An be n subsets of a finite set


U . Then
a) the number of elements of U that are either in A or in B are in any of A1 , A2 ,. . . , An is
given by:
|A1 ∪ A2 ∪ · · · ∪ An | = S1 − S2 + S3 − S4 + · · · + (−1)n−1 Sn .
b) the number of elements of U that are in none of A1 , A2 ,. . . , An is given by:

|AC C C n
1 ∩ A2 ∩ · · · ∩ An | = |U | − S1 + S2 − S3 + · · · + (−1) Sn = |U | − |A1 ∪ A2 ∪ · · · ∪ An |.

Example 1.3.1. How many bit strings of length eight either start with a 1 bit or end with
two bits 00?

Solution. Let A be set of bit strings of length eight that start with 1 and B be set of bit
strings of length eight that end with 00. Then A ∩ B is set of bit strings of length eight that
start with 1 and end with 00. This implies that,
|A| = 27 , |B| = 26 and |A ∩ B| = 25 . By Inclusion-Exclusion principle,
|A ∪ B| = |A| + |B| − |A ∩ B|= 27 + 26 − 25 = 160.
Hence, there are 160 bit strings of length eight that start with 1 or end with 00.

Example 1.3.2. Let U = {1, 2, 3, . . . , 500}. Then find


a) The number of integers in U which are divisible by 2, 3, or 5.
b)The number of integers in U which are divisible by none of 2, 3, or 5.

Solution. First note the following facts,


i. The number of integers in U which are divisible by n ∈ N is ⌊ 500 n
⌋, an integer less or equal
500 500 500
to n . i.e., ⌊ n ⌋ ≤ n .
ii. For a, b, c ∈ N, c is divisible by both a and b if and only if c is divisible by the LCM of a
and b.
Let Ak = {x ∈ U |x is divisible by k}.
Thus, |A2 | = ⌊ 5002
⌋ = 250, |A3 | = ⌊ 500
3
⌋ = 166, |A5 | = ⌊ 500
5
⌋ = 100, |A2 ∩ A3 |=|A6 | = ⌊ 500
6
⌋=
500 500 500
83, |A10 | = ⌊ 10 ⌋ = 50, |A15 | = ⌊ 15 ⌋ = 33, and |A2 ∩ A3 ∩ A5 | = |A30 | = ⌊ 30 ⌋ = 16
Hence,
a) |A2 ∪ A3 ∪ A5 | = (|A2 | + |A3 | + |A5 |) − (|A6 | + |A10 | + |A15 |) + |A30 | = 366.
b)|AC C C
2 ∩ A3 ∩ A5 | = |U | − |A2 ∪ A3 ∪ A5 | = 134.

By Mesfin M, AAU
1.4 The Pigeonhole Principle 10

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

1.4 The Pigeonhole Principle


Pigeonhole principle also known as the Dirichlet pigeonhole principle presents the most
essential and basic part in combinatorial mathematics. The simplest form of the pigeonhole
principle is the following fairly obvious assertion.
Proposition 2. (Pigeonhole principle) If n + 1 objects are placed into n boxes/containers,
then some box must contain at least 2 objects.
Proof. We prove the pigeonhole principle using proof by contraposition. Suppose that none
of the n boxes contains more than one object. Then the total number of objects would be
at most n. This is a contradiction, because there are at least n + 1 objects.
Generalization of pigeonhole principle
A generalized version of this principle states that, if n objects are placed into m boxes, then
n
some box must contain at least ⌈ m ⌉ objects.
Remark: Recall that the expression ⌈x⌉, called the ceiling function, is the smallest integer
k, such that k ≥ x and the expression ⌊x⌋, called the floor function, is the largest integer r,
such that r ≤ x.

We will illustrate the usefulness of the pigeonhole principle. We first show that it can be
used to prove a useful corollary about functions.
Corollary 1. A function f from a set with k + 1 or more elements to a set with k elements
is not one-to-one.
Proof. Suppose that for each element y in the codomain of f we have a box that contains
all elements x of the domain of f such that f (x) = y. Because the domain contains k + 1 or
more elements and the codomain contains only k elements, the pigeonhole principle tells us
that one of these boxes contains two or more elements x of the domain. This means that f
cannot be one-to-one.
Examples
1. Among any group of 367 people, there must be at least two with the same birthday,
because there are only 366 possible birthdays.
2. How many students must be in a class to guarantee that at least two students receive the
same score on the final exam, if the exam is graded on a scale from 0 to 100 points?
Solution. There are 101 possible scores on the final. The pigeonhole principle shows that
among any 102 students there must be at least 2 students with the same score.

By Mesfin M, AAU
1.5 The Binomial Theorem 11

3. If 50 people donate blood at the Red Cross, there must be at least ⌈ 50 4


⌉ = 13 people
of the same blood type.
4. Among 100 people there are at least ⌈ 100
12
⌉ = 9 who were born in the same month.
5. What is the minimum number of students required in a discrete mathematics class to be
sure that at least six will receive the same grade, if there are five possible grades, A, B, C,
D, and F?

Solution. The minimum number of students needed to ensure that at least six students
receive the same grade is the smallest integer N such that ⌈ N5 ⌉ = 6. The smallest such
integer is N = 5 × 5 + 1 = 26. If you have only 25 students, it is possible for there to be five
who have received each grade so that no six students have received the same grade. Thus, 26
is the minimum number of students needed to ensure that at least six students will receive
the same grade.

1.5 The Binomial Theorem


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

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


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

Example 1.5.1. Expand (x2 + 3y)4 using binomial theorem.

Solution. (x2 + 3y)4 = 40 (x2 )4 + 41 (x2 )3 (3y) + 42 (x2 )2 (3y)2 + 4 4


    
3
x2 (3y)3 + 4
(3y)4 .

Example 1.5.2. What is the coefficient of x3 y 4 in the expansion of (2x + y 2 )5 ?

Solution. Let z = y 2 , then apply binomial theorem to (2x + z)5 , and find the coefficient
ofx3 z 2 . The term involving x3 z 2 is 52 (2x)3 z 2 . Hence the coefficient of x3 z 2 = x3 y 4 is

5 3
2
2 = 80.

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

4.

By Mesfin M, AAU
1.5 The Binomial Theorem 12

1.5.1 Pascal triangle and identities


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

0
1 1
 
0 1
2 2 2
  
0 1 2
3 3 3 3
   
0 1 2 3
4 4 4 4 4
    
0 1 2 3 4
5 5 5 5 5 5
     
0 1 2 3 4 5
6 6 6 6 6 6 6
      
0 1 2 3 4 5 6
7 7 7 7 7 7 7 7
       
0 1 2 3 4 5 6 7
That is,
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1
n−1 n−1 n−1 n−1
   
In general, for all n ≥ 1, the nth row of the triangle is 0 1 2
... n−1
.

Theorem 4. (Pascal’s theorem) For all integers n and k with 1 ≤ k ≤ n − 1,


n n−1 n−1
 
k
= k + k−1

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

Theorem 5. (Multinomial Theorem)


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

By Mesfin M, AAU
1.5 The Binomial Theorem 13

Examples:
6!
1. The coefficient of x21 x2 x23 x4 in the expansion of (x1 + x2 + x3 + x4 )6 is 2!2!1!1!
= 180.
6!
2. The coefficient of x31 x2 x23 in the expansion of (2x1 − 3x2 + 5x3 )6 equals 3!1!2! 23 (−3)52 =
−36000.

Notation: The quantity i1 ,i2n,...,ik = i1 !i2n!!...ik ! is called a multinomial coefficient.




Exercise
1. Prove the following using the idea of Pascal identity

i. n0 − n1 + n2 − n3 + · · · + (−1)n nn = 0
    

ii. n0 − n1 + n2 − n3 + · · · + (−1)k nk = (−1)k n−1


     
k

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

By Mesfin M, AAU
1.5 The Binomial Theorem 14

Worksheet I

1. a) How many permutations of size 3 can one produce with the letters p,r,m and n? List
them.
b) List all combinations of size 3 that one produce with the letters p,r,m,t and n?
2. m boys and n girls are to be arranged in a row, where m, n ∈ N with n ≥ m. Find the
number of ways this can be done in each of the following cases:
a) There are no restrictions;

b) No boys are adjacent;

b) The n girls make a single block;

b) A particular boy and a particular girl must be adjacent.


3. In how many ways can 7 boys and 2 girls be lined up in a row such that the girls must
be separated by exactly 3 boys?
4. New licence plates in Addis Ababa start with a letter (English alphabet) followed by five
digits. How many different license plates can be made if
a) Repetition of digits is allowed?

b) Repetition of digits is not allowed?

c) The letters R and Q are not used with no repetition of digits?

d) Vowels are not used and the numbers begin with odd digits and end in even digits?
5. Find the value(s) of n in each of the following
a) P (n, 2) = 90 c) P (n, 3) = 3P (n, 2)

b) 2P (n, 2) + 50 = P (2n, 2) d) 6P (n, 1) = P (n, 3)


6. For all positive integers m and n show that
a) n m+n = (m + 1) m+n b) For n > 1, n2 + n−1
   
m m+1 2
is a perfect square

7. Determine x if 50 50 r
P  100
r=0 r 8 = x
8. Find the coefficient of x y in the expansion of (2x − 3y)6 .
4 2

9. Determine the number of positive integers whose decimal expansion contains exactly 4
digits, doesn’t contain equal digits, and doesn’t contain the digit 3.
10. How many integers between 1 and 1000 have all their digits different and don’t contain
the digit 5 in their decimal expansion?
11. How many bit strings of length 10 contain at least three 1s and at least three 0s?
12. Find the number of positive integers less than 601 that are not divisible by 3 or 5 or 7.

By Mesfin M, AAU
1.5 The Binomial Theorem 15

13. Find the number of even integers between 10,000 and 60,000 in which no digit is re-
peated.
14. Show that among any n + 1 positive integers not exceeding 2n there must be an integer
that divides one of the other integers.
15. Assume that in a group of six people, each pair of individuals consists of two friends or
two enemies. Show that there are either three mutual friends or three mutual enemies in the
group.
16. How many positive integers less than 1,000,000 have exactly one digit equal to 9 and
have a sum of digits equal to 13?

By Mesfin M, AAU
Chapter 2

Recurrence Relation

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

2.1 Types of recurrence relation


1. Consider the recurrence relation below

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

with f (n) is a function and c1 , c2 , ..., ck are constants. Then this Recurrence Relation is
called
i. Homogeneous Recurrence Relation of degree k if f (n) = 0.

ii. Non homogeneous Recurrence Relation if f (n) ̸= 0.


2. A Recurrence Relation is non-linear if it is expressed as a power or product of terms of a
sequence. Otherwise it is called linear Recurrence Relation.
Example 2.1.1. Which of the following Recurrence Relations are homogeneous, non-homogeneous,
linear and non-linear?

By Mesfin M, AAU
2.2 Recurrence Relation Models 17

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

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

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

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

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

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

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

2.2 Recurrence Relation Models


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

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

A0 = 10, 000 with initial condition.


The recurrence relation with initial condition allow us to compute the value of An for any n.
For example,
A1 = (1.12)A0 , A2 = (1.12)A1 = (1.12)2 A0 , A3 = (1.12)A2 = (1.12)3 A0 ,..., An = (1.12)n A0
which is an explicit formula and the required amount can be derived from the formula by
putting n = 15.
So, A15 = (1.12)15 (10000).
Example 2(Fibonacci sequence) Eight centuries ago Fibonacci studied the population
growth of rabbits. He considered the following model of growth. He start with a pair of
rabbits,(one male and female) born on some month. He assumes that:

i. rabbit begin to produce young two months after their own birth;

By Mesfin M, AAU
2.2 Recurrence Relation Models 18

i. After reaching the age of two months, each pair produces a mixed pair, (one male, one
female), and then another mixed pair each month there after; and

i. no rabbit die

i. all months are of equal length. Then

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


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

Solution. Let hn denote the number of moves needed to solve the Tower of Hanoi problem
with n disks. If there is only one disk, we simply move it to the second peg in one way. Thus
h1 = 1. If we have n > 1, we can transfer n − 1 disks to the second peg in hn−1 moves.
During the moves, the largest disk at the bottom of the first peg stays fixed.Then we use one
move to transfer the largest disk to the second peg. We can now move again n − 1 disks on
the second peg to the third peg using hn−1 moves. Therefore,

hn = 2hn−1 + 1, n > 1

with initil condition h1 = 1.

By Mesfin M, AAU
2.3 Solving Recurrence Relations 19

2.3 Solving Recurrence Relations


A sequence is called a solution of a recurrence relation if its terms satisfy the recurrence
relation.
There are a few methods used to find an explicit formula for the terms of a sequence given
by a recurrence relation. Some of the methods are: induction/recursion, the characteris-
tic equation method, matrix representations (eigenvalues and eigenvectors) and generating
functions.
In this course, we will see only characteristic equation method of solving recurrence
relation.
The characteristic equation method is easily applied to solve ‘linear homogeneous recurrence
relations with constant coefficients’ and can be adapted to solve ‘linear non-homogeneous
recurrence relations with constant coefficients’.

2.3.1 Solutions of Linear Homogeneous Recurrence Relations(LHRR)


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

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

In other words, r is a root of the equation

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

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

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


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

Example 2.3.1. Solve the following recurrence relations with the given initial values.
1. an = 2an−1 + 3an−2 , with initial conditions a0 = 0, and a1 = 8.
2. an = 2an−1 + an−2 − 2a−3 (n ≥ 3), with initial values a0 = 1, a1 = 2 and a2 = 0.

Solution. 1. The characteristic equation of this RR is x2 − 2x − 3 = 0 , whose roots are


r1 = −1, and r2 = 3. Hence the solution to this RR must be of the form an = c1 (−1)n +c2 (3)n
,with the given initial conditions we get
an = −2(−1)n + (3)n

By Mesfin M, AAU
2.3 Solving Recurrence Relations 20

2. The characteristic equation of the recurrence relation is x3 − 2x2 − x + 2 = 0, and it has


three roots: r1 = 1, r2 = −1 and r3 = 2. Then we have
an = c1 (1)n + c2 (−1)n + c3 (2)n = c1 + c2 (−1)n + c3 (2)n is the general solution. Now we are
going to find the value of the constants c1 , c2 ,and c3 using the initial values. So that

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

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


, c3 = −1
3
.
Thus, an = 2 − 32 (−1)n − 31 2n is the solution of the given recurrence relation.
Theorem 7. Suppose that the characteristic equation to the recurrence relation
an = q1 an−1 + q2 an−2 + ... + qk an−k has t distinct roots (t < k), r1 , r2 ,..., rt with multiplicities
m1 , m2 , ..., mt . Then,

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

for n = 0, 1, 2, ..., where ci,j are constant is the general form of the solutions for the HRR
an = q1 an−1 + q2 an−2 + ... + qk an−k .
Example 2.3.2. Solve the following recurrence relation with the given initial values.
1. an = −6an−1 − 9an−2 , with initial conditions a0 = 2, and a1 = −3.
2. an = 4an−1 − 4an−2 for n ≥ 4 where a2 = 1 and a3 = 4.
3. an = 7an−1 − 15an−2 + 9an−3 for n ≥ 3 where a0 = 1, a1 = 2 and a2 = 3.
Solution. 1. The characteristic equation of this recurrence relation is x2 + 6x + 9 = 0, with
characteristic roots r1 = r2 = −3
Hence the solution of this RR must be of the form an = c1 (−3)n + c2 n(−3)n . After substi-
tuting the initial values we get, an = 2(−3)n − n(−3)n = (2 − n)(−3)n
2. The characteristic equation of this recurrence relation is x2 − 4x + 4 = 0, with character-
istic roots r1 = r2 = 2
Hence the solution of this RR must be of the form an = c1 2n + c2 n2n . After substituting the
initial values we get, an = 81 n2n = n2n−3
3. The characteristic equation of this recurrence relation is x3 − 7x2 + 15x − 9 = 0, with
characteristic roots r1 = 1, r2 = r3 = 3
Hence the solution of this RR must be of the form an = c1 1n +c2 3n +nc3 3n . After substituting
the initial values we get, an = 3n − 31 n3n = 3n−1 (3 − n).
Exercise
Solve the following recurrence relation with the given initial value.
1. an+2 − 5an+1 + 6an = 0 for n ≥ 3 where a0 = 1, a1 = −1.
2. an − 12an−1 + 48an−2 − 64an−3 = 0 for n ≥ 3 where a0 = 1, a1 = 4 and a2 = 32.

By Mesfin M, AAU
2.3 Solving Recurrence Relations 21

2.3.2 Linear Non homogeneous Recurrence Relation(LNHRR)


A recurrence relation of the form

c0 an − c1 an−1 − c2 an−2 − c3 an−3 − ... − ck an−k = f (n), (c0 , ck ̸= 0, 1 ≤ k ≤ n)

with f (n) is a function of n and c1 , c2 , ..., ck are constants, is called the rth order non homo-
geneous recurrence relation for the sequence an .
To solve linear non homogeneous recurrence relation:
1. Find the general solution of the homogeneous recurrence relation denoted by ahn

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

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

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

 B − 3B = −2

C + 6B − 3C = 0

−3B + 3C − 2D = 2

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

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


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

2.4 System of linear Recurrence relations


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

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

Example 2.4.1. Solve the system of recurrence relations


(
an + 2an−1 − 4bn−1 = 0 (1)
bn + 5an−1 − 7bn−1 = 0 (2)
Given that a1 = 4 and b1 = 1.

Solution. From (1) we have, bn−1 = 14 (an + 2an−1 ) (3)


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

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

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


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

are the required solutions.

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

Worksheet II
1. Find recurrence relations that are satisfied by the sequence formed from the following
functions.
n!
(a) an = 15!
(b) an = n2 − 6n + 8

2. Find a cubic polynomial whose roots are 5, −1, and 3. Then find a LHRRWCC with this
characteristic polynomial.
3. Solve the following recurrence relations by inspection.

a) an = 2an−1 for n > 1, a1 = 1. c) an = an−1 + k for n > 0, a1 = 1 and k constant.

b) an = an−1 + (2n − 2) for n > 1, a1 = 0. d) an = an−1 + (n − 1)2 for n > 1, a1 = 1

4. Show that an = 4n , an = n4n , and an = 2.4n + 3n.4n are all solutions of the same
recurrence relation an = 8an−1 − 16an−2 .
5. Solve the following recurrence relations with the given initial values and find a10 and a15 .

a) an = −an−1 + 16an−2 − 20an−3 , ao = 0, a1 = 1 and a2 = 1.

b) an = an−1 + n2 , ao = 1.

c) an − an−1 − an−2 = 0, a0 = 1, a1 = 1.

d) an = 3an−1 − 2an−2 , a0 = 2, a1 = 3.

e) an = 2an−1 + 3an−2 , a0 = a1 = 1.

f) an = 3an−1 + 4an−2 , a0 = a1 = 1.

g) an = 3an−1 − 3an−2 + an−3 , a0 = a1 = 1, a2 = 2.

h) an = an−1 + n, a0 = 2.

i) an = 3an−1 − 4n + 32n , a1 = 8.

j) an = an−1 + n(n − 1), a0 = 3.

k) an = 7an−1 − 15an−2 + 9an−3 , a0 = 1, a2 = 2, a3 = 3.

6. Solve the following system of recurrence relations and find a6 and b7 .


(
an+1 = an − bn (1)
bn+1 = an + 3bn (2)

with the initial conditions

a) a0 = 2 and b1 = 1 b) a0 = −1 and b0 = 5.

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

7. What is the general form of the particular solution of the linear nonhomogeneous recur-
rence relation an = 6an−1 − 12an−2 + 8an−3 + F (n) if

a) F (n) = n2 ? d) F (n) = n2 2n ?

b) F (n) = 2n ? e) F (n) = n3 (−2)n ?

c) F (n) = n2n ? f) F (n) = 3?

8. An employee joined a company in 1987 with a starting salary of 50, 000. Every year this
employee receives a raise of 1000 plus 5% of the salary of the previous year. Then

a) Find a recurrence relation for the salary of this employee n years after 1987.

b) Find an explicit formula for the salary of this employee n years after 1987.

c) What is the salary of this employee in 1995?

9. Find a recurrence relation for the number of binary strings of length n that do not contain
the pattern 0000 and find the initial values.
10. Suppose that each year you deposit d birr into a bank account, at an annual interest
rate equal to i%. Find a recurrence relation for the amount in your account at the end of
n-years. Solve the recurrence relation.

By Mesfin M, AAU

You might also like