0% found this document useful (0 votes)
18 views27 pages

Discrete 2

Chapter three discusses recurrence relations, defining them as equations that express terms of a sequence in relation to previous terms. It provides examples and methods for solving linear recurrence relations, including both homogeneous and non-homogeneous types, and illustrates their application in various problems such as population growth and the Fibonacci sequence. The chapter also includes exercises to reinforce the concepts presented.

Uploaded by

ezedinali84
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views27 pages

Discrete 2

Chapter three discusses recurrence relations, defining them as equations that express terms of a sequence in relation to previous terms. It provides examples and methods for solving linear recurrence relations, including both homogeneous and non-homogeneous types, and illustrates their application in various problems such as population growth and the Fibonacci sequence. The chapter also includes exercises to reinforce the concepts presented.

Uploaded by

ezedinali84
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Contents

CHAPTER THREE .................................................................................................................................... 95


RECURRENCE RELATION ........................................................................................................................ 95
3.1 Definition and Examples of Recurrence Relation .......................................................................... 95
3.2 Solving Linear Recurrence Relations ........................................................................................... 103
3.2.1 Solving Linear Homogeneous Recurrence Relations with Constant Coefficients ................... 104
3.2.2 Solving Linear Non-homogeneous Recurrence Relations with Constant Coefficients ............ 113
Chapter three Recurrence Relation

CHAPTER THREE

RECURRENCE RELATION
Introduction

The number of bacteria in a colony doubles every hour. If a colony begins with five bacteria,
how many will be present in hours? To solve this problem, let be the number of bacteria at
the end of hours. Since the number of bacteria doubles every hour, the relationship
holds whenever is a positive integer. This relationship, together with the initial
condition uniquely determines for all nonnegative integers . We can find a formula
for from this information.

Some of the counting problems that cannot be solved using the techniques discussed in Chapter 2
can be solved by finding relationships, called recurrence relations, between the terms of a
sequence, as was done in the problem involving bacteria. We will study a variety of counting
problems that can be modeled using recurrence relations. We will develop methods in this
chapter for finding explicit formulae for the terms of sequences that satisfy certain types of
recurrence relations.

3.1 Definition and Examples of Recurrence Relation


Definition 1: A recurrence relation for the sequence is an equation that expresses in
terms of one or more of the previous terms of the sequence, namely, , for all
nonnegative integers A sequence is called a solution of a recurrence relation if its terms
satisfy the recurrence relation.

Example 1: Let be a sequence that satisfies the recurrence relation for


, and suppose that and What are , and

Solution: We see from the recurrence relation that

and

Discrete Mathematics For HI Page 95


Chapter three Recurrence Relation

Example 2: Determine whether the sequence is a solution of the recurrence relation


for , where

a) for every nonnegative integer


b) for every nonnegative integer
c) for every nonnegative integer

Solution:

a) Suppose that for every nonnegative integer Then for we see that

Therefore, where is a solution of the recurrence relation.

b) Suppose that for every nonnegative integer Note that and


Since We see that , where is
not a solution of the recurrence relation.
c) Suppose for every nonnegative integer Then for we see that

Therefore, where is a solution of the recurrence relation.

The initial conditions for a sequence specify the terms that precede the first term where the
recurrence relation takes effect. For instance, in Example 1, and are the initial
conditions.

MODELING WITH RECURRENCE RELATION

We can use recurrence relations to model a wide variety of problems, such as finding compound
interest, counting rabbits on an island, determining the number of moves in the Tower of Hanoi
puzzle, and counting bit strings with certain properties.

Example 3: (Compound Interest) Suppose that a person deposits 5000 birr in a savings account
at a bank yielding 12% per year with interest compounded annually. How much will be in the
account after 25 years?

Discrete Mathematics For HI Page 96


Chapter three Recurrence Relation

Solution: To solve this problem, let denote the amount in the account after years. Since the
amount in the account after years equals the amount in the account after years plus
interest for the year, we see that the sequence satisfies the recurrence relation

The initial condition is

We can use an iterative approach to find a formula for Note that

since ,

the formula for becomes,

hence after 25 years the account contains

Example 4: (Rabbits and the Fibonacci numbers) A young pair of rabbits (one of each sex) is
placed on an island. A pair of rabbits does not breed until they are 2 months old. After they are 2
months old, each pair of rabbits produces another pair each month. Find a recurrence relation for
the number of pairs of rabbits on the island after months, assuming that no rabbits ever die.

Solution: Suppose that is the number of rabbits after months. At the end of the first month,
the number of pairs of rabbits on the island is Since this pair does not breed during the
second month, also. To find the number of pairs after months, add the number on the

Discrete Mathematics For HI Page 97


Chapter three Recurrence Relation

island the previous month, , and the number of newborn pairs, which equals , since each
newborn pair comes from a pair at least 2 months old.

Consequently, the sequence satisfies the recurrence relation

, for , with and

Some terms of this recurrence relation are , and are called Fibonacci
sequence and each numbers in this sequence are called Fibonacci numbers.

Example 5: (The Tower of Hanoi) A popular puzzle of the late nineteenth century, called the
Tower of Hanoi, consists of three pags mounted on a board together with disks of different sizes.
Initially these disks are placed on the first peg in order of size, with the largest on the bottom(as
shown in Figure 2). 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 a smaller disk. The goal of the puzzle is
to have all the disks on the second peg in order of size, with the largest on the bottom.

Let denote the number of moves needed to solve the Tower of Hanoi problem with disks.
Set up a recurrence relation for the sequence

Discrete Mathematics For HI Page 98


Chapter three Recurrence Relation

Solution: Begin with disks on peg 1. We can transfer the top disks, following the rules
of the puzzle, to peg 3 using moves (see figure 3 for an illustration of the pegs and disks at
this point). We keep the largest disk fixed during these moves. Then, we use one move to
transfer the largest disk to the second peg. We can transfer the disks on peg 3 to peg 2
using additional moves, placing them on top of the largest disk, which always stays fixed
on the bottom of peg 2. Moreover, it is easy to see that the puzzle cannot be solved using fewer
steps. This shows that

The initial condition is since one disk can be transferred from peg 1 to peg 2, according
to the rules of the puzzle, in one move. We can use an iterative approach to solve this recurrence
relation. Note that

Discrete Mathematics For HI Page 99


Chapter three Recurrence Relation

Example 6: Find a recurrence relation and give initial conditions for the number of bit strings of
length n that do not have two consecutive 0’s. How many such bit strings are there of length six?
Solution: Let denote the number of bit strings of length that do not have two consecutive
0’s. To obtain a recurrence relation for , note that by the sum rule, the number of bit strings
of length that do not have two consecutive 0’s equals the number of such bit strings ending
with a 0 plus the number of such bit strings ending with a 1. We will assume that , so that
the bit string has at least three bits.
The bit strings of length ending with 1 that do not have two consecutive 0’s are precisely the
bit strings of length with no two consecutive 0’s with a 1 added at the end. Consequently,
there are such bit strings.
Bit strings of length ending with a 0 that do not have two consecutive 0’s must have 1
th
as their bit; otherwise they would end with a pair of 0’s. It follows that the bit strings
of length ending with a 0 that have no two consecutive 0’s are precisely the bit strings of
length with no two consecutive 0’s with 10 added at the end. Consequently, there are
such bit strings.
We conclude that,
, for

Discrete Mathematics For HI Page 100


Chapter three Recurrence Relation

The initial conditions are because a bit strings of length one are either 1 or 0, do not have
consecutive 0’s, and because a bit strings of length two no consecutive 0’s are 11, 01 or
10. To obtain we use the above equation,

, and

Remark: Note that satisfies the same recurrence relation as the Fibonacci sequence. Since
and it follows that .

Discrete Mathematics For HI Page 101


Chapter three Recurrence Relation

Exercise 1

1. Find the first six terms of the sequence defined by each of the following recurrence
relations and initial conditions.
a)
b)
c)
2. Show that the sequence is a solution of the recurrence relation
if
a)
b)
c)
d)
3. For each of the following sequences find a recurrence relation satisfied by this sequence
a)
b)
c)
d)
4. Find the solution to each of the following recurrence relation using iterative approach.
a)
b)
c)
5. Assume that the population of the world in 2019 is 7 billion and is growing at the rate of
2% a year.
a) Set up a recurrence relation for the population of the world years after 2019.
b) Find an explicit formula for the population of the world years after 2019.
c) What will the population of the world be in 2040?
6. An employee joined a company in 1987 with a starting salary of 15, 000 birr. Every year
this employee receives a raise of 500 birr plus 5% of the salary of the previous year.
a) Set up a recurrence relation for the salary of this employee years after 1987.
b) What is the salary of this employee in 1995?
c) Find an explicit formula for the salary of this employee years after 1987.
7. A set of straight lines in the plane is said to be in general position if none of the lines are
parallel, and if no three of the lines go through the same point. Into how many distinct
regions does a set of lines in general position divide the plane?

Discrete Mathematics For HI Page 102


Chapter three Recurrence Relation

3.2 Solving Linear Recurrence Relations


Introduction

A wide variety of recurrence relations occur in models. Some of these recurrence relations can
be solved using iteration or some other ad hoc technique. However, one important class of
recurrence relations can be explicitly solved in a systematic way. These are recurrence relations
that express the terms of a sequence as linear combinations of previous terms.

Definition 2: A linear recurrence relation of degree k with constant coefficients is a recurrence


relation of the form

where are real numbers, is a function of and

Note: The recurrence relation in the definition is linear because there is no product of ’s. The
recurrence relation is homogeneous if , otherwise non-homogeneous. The coefficients
of the terms of the sequence are all constants, rather than functions that depend on . The
degree is because is expressed in terms of the previous k terms of the sequence.

Example 7:
a) The recurrence relation is a linear homogeneous recurrence relation of
degree one with constant coefficient 1.12.
b) The recurrence relation is a linear homogeneous recurrence relation of
degree two with constant coefficients.
c) The recurrence relation is a linear homogeneous recurrence relation
of degree 7 with constant coefficients 5 and 2.
d) The recurrence relation is not linear because is the product of
itself.
e) The recurrence relation is linear but not homogeneous because of
.
f) The recurrence relation is a linear homogeneous recurrence relation
but does not have constant coefficients.

Discrete Mathematics For HI Page 103


Chapter three Recurrence Relation

3.2.1 Solving Linear Homogeneous Recurrence Relations with Constant Coefficients

Definition 3: A second order linear homogeneous recurrence relation with constant coefficients
is a recurrence relation of the form

where and are constants.

Let us begin our study of this type of recurrence relation by making the substitution in
the above equation, where r is a constant. This gives

Cancelling a factor of gives

or

Thus, we can see that if is any solution to the quadratic equation

then is a solution to the recurrence relation .

The equation is called the characteristic equation for the recurrence


relation , and its solutions are called the characteristic roots of
.

Theorem 1: Consider the second order linear homogeneous recurrence relation with constant
coefficients

With initial conditions and and characteristic equation

1) If the characteristic equation has two distinct real roots and , then the solution to the
recurrence relation is given by

Discrete Mathematics For HI Page 104


Chapter three Recurrence Relation

where the coefficients s and t are determined by the initial conditions.


2) If the characteristic equation has only one real root then the solution to the recurrence
relation is given by

where the coefficients and are determined by the initial conditions.


Proof:
1) Suppose that the characteristic equation has two distinct real roots and . As we
have already seen, both and are solutions to . We need
only show that the sequences is also a solution for
, where and are any constants. But if we make the
substitutions and in the right hand
side of and use the fact that both and satisfy the
recurrence relation, we get

This shows that is a solution to .

2) Suppose that the characteristic equation has only one real root . We know that is
a solution to the recurrence . Here we must show that
is a solution to . In fact, since r is the only
solution to the characteristic equation, it must have the form In other words,
we must have

Multiplying out the right side of this equation gives

and so we must have


and
substituting these values for the coefficients into gives

Discrete Mathematics For HI Page 105


Chapter three Recurrence Relation

Now we can easily show that is a solution to this recurrence relation.


Substituting into the right-hand side of
,
and using the fact that is a solution gives

This shows that is a solution to the recurrence relation


.

Example 8: Solve the recurrence relation


, with and
Solution: Let , this implies that and

Substituting this result into the original equation we have

Dividing both sides by , we have

Here and , we have two distinct roots.

Thus, the solution to this equation is

……………………(i)

Discrete Mathematics For HI Page 106


Chapter three Recurrence Relation

In order to determine the coefficients and , we use the initial conditions and
into (i).

When we get

……………………..(ii)

When we get

………………………….(iii)

From (ii) and (iii), we have

Now we have and since

Now we substitute the values of and into equation (i), and the solution to the recurrence
relation is

Example 9: Solve the recurrence relation

, with and

Solution: Let , this implies that and .

Substituting this result into the original equation we have

Dividing both sides by , we have

Discrete Mathematics For HI Page 107


Chapter three Recurrence Relation

Here , we have only one root.

Hence, the solution to the recurrence must be of the form

…………………………..(i)
In order to determine the coefficients and , we use the initial conditions and
into (i).

When we get

…..……………………..(ii)

When we get

………………………….(iii)

From (ii) and (iii), we have

this implies,

Substitute the values of and into equation (i), and so the solution to our recurrence relation is

Example 10: Solve the Fibonacci recurrence relation

, with and

Solution: In this case, the characteristic equation is

whose solutions are found by the quadratic formula to be

and

Thus, the solution to the Fibonacci recurrence has the form

Discrete Mathematics For HI Page 108


Chapter three Recurrence Relation

…..………………(i)

when , we have

………………………(ii)

when , we have

…………………….(iii)

From (ii) and (iii), we have

and

substitute these values into equation (i), and the solution to the recurrence relation is

We will now state the general result about the solution of linear homogeneous recurrence
relations with constant coefficients, where the degree may be greater than two.

Discrete Mathematics For HI Page 109


Chapter three Recurrence Relation

Theorem 2:

Let be real numbers. Suppose that the characteristic equation

has distinct roots Then a sequence is a solution of the recurrence relation

if and only if

For where are constants.

Example 11: Find the solution to the recurrence relation

with initial conditions and .

Solution: The characteristic polynomial of this recurrence relation is

The characteristic roots are and because

Hence, the solution to this recurrence relation is of the form

To find the constants and use the initial conditions. This gives

When these three simultaneous equations are solved for and , we find that
and Hence, the unique solution to this recurrence relation and the given
initial conditions is the sequence with

Discrete Mathematics For HI Page 110


Chapter three Recurrence Relation

Theorem 3:

Let be real numbers. Suppose that the characteristic equation

has distinct roots with multiplicities respectively, so that


for and Then a sequence is a solution of the
recurrence relation

if and only if

for where are constants for and

Example 12:

Suppose that the roots of the characteristic equation of a linear homogeneous recurrence relation
are 4, 4, 4, 4, 6, 6, 6, 3, 3 and 9 (that is, there are four roots, the root 4 with multiplicity four, the
root 6 with multiplicity three, the root 3 with multiplicity two and the root 9 with multiplicity
one). What is the form of the general solution?

Solution: By theorem 3, the general form of the solution is

Example 13:

Find the solution to the recurrence relation

with initial conditions and

Discrete Mathematics For HI Page 111


Chapter three Recurrence Relation

Solution:
The characteristic equation of this recurrence relation is

Because there are a root of multiplicity two


and a root of multiplicity one of the characteristic equation. From this multiplicity
and By theorem 3 the solution of this recurrence relation are of the form

To find the constants and use the initial conditions. This gives

The simultaneous solution of these three equations is and

Hence, the unique solution to this recurrence relation and the given initial conditions is the
sequence with

Note: The general solution of first order is where is the root of the
characteristic equation and, and are constants.

Discrete Mathematics For HI Page 112


Chapter three Recurrence Relation

3.2.2 Solving Linear Non-homogeneous Recurrence Relations with Constant


Coefficients
A linear non-homogeneous recurrence relation with constant coefficients is a recurrence
relation of the form

Where are real numbers and is a function not identically zero depending only
on The recurrence relation

is called the associated homogeneous recurrence relation.

Example 14:

Each of the recurrence relations


and is a linear nonhomogeneous recurrence
relation with constant coefficients. The associated linear homogeneous recurrence relations are

and respectively.

The key fact about linear non-homogeneous recurrence relations with constant coefficients is that
every solution is the sum of a particular solution and a solution of the associated linear
homogeneous recurrence relation as stated below.

Steps to solve linear non-homogeneous recurrence relations

1. Solve the associated homogeneous linear recurrence relation


2. Solve the particular solution of the non-homogeneous linear recurrence relation
3. Sum the associated homogeneous solution and the particular solution , and
solve the constant c, i.e., .

To solve the particular solution we use theorem bellow.

Discrete Mathematics For HI Page 113


Chapter three Recurrence Relation

Theorem 4:

Suppose that satisfies the linear nonhomogeneous recurrence relation

where are real numbers, and

where and are real numbers. When is not a root of the characteristic equation of
the associated linear homogeneous recurrence relation, there is a particular solution of the form

When is a root of this characteristic equation and its multiplicity is , there is a particular
solution of the form

Example 15: Find the solution of the following recurrence relations.

a) , with and
b) , with and
c)
d) , with

Solution:

a) Step 1: The associated linear homogeneous recurrence relation is


.
Let and then inserting these equations in the
above equation we have the characteristic equation

Discrete Mathematics For HI Page 114


Chapter three Recurrence Relation

We have only one root with multiplicity 2. Thus, the solution of the associated linear
homogeneous recurrence relation is

Step 2: Since , here and . But is the root of the


associated linear homogeneous recurrence relation with multiplicity . Hence by
theorem 4, the particular solution is
…………………..(i)
To obtain we inset into the original equation . That is, by taking

and

Substitute this value into eqn.(i), the particular solution is

Step 3: In this step we sum the result in step 1 and in step 2, and we calculate the constants using
initial conditions.

Discrete Mathematics For HI Page 115


Chapter three Recurrence Relation

Thus,

……………… (ii)

For we have

For we have

But , thus

Now substitute the values of and into eqn. (ii), the solution of the original equation
becomes

b) Step 1: The associated linear homogeneous recurrence relation is


and its characteristic equation is Thus,

and

Hence, .

Step 2: Here where and Since is not the root of the


associated linear homogeneous recurrence relation. Hence using theorem 4, the particular
solution is

Discrete Mathematics For HI Page 116


Chapter three Recurrence Relation

and inserting these equation into the original


equation we gate

Hence,

Step 3: ……………………. (i)

For we have

…………………………(ii)

For we have

………………………….(iii)

From (ii) and (iii), we have and

Inserting these values into eqn.(i) and the last solution of the original equation becomes

c) Step 1: The associated linear homogeneous recurrence relation is

From (a) the root of the characteristic equation is , with multiplicity 2.

Discrete Mathematics For HI Page 117


Chapter three Recurrence Relation

Hence, the solution of the associated linear homogeneous recurrence relation is the same
as (a). i.e.,

Step 2: Since , here


and is the root of the associated linear homogeneous recurrence relation with
multiplicity . So according to theorem 4, the particular solution is

where and are constants. To obtain and we insert the particular


solution into the original equation. That is,

After some process we will find the values of and , and we will insert into the
particular solution. This is left as exercise for the reader.
Step 3: , where
are constants.

d) Step 1: The associated linear homogeneous recurrence relation is and its


characteristic equation is Thus, is the root of the characteristic equation.

Hence,

Step 2: Since , where and . But 1 is the


root of the associated linear homogeneous recurrence relation with multiplicity .
Hence, the particular solution is

Inserting this into the original equation it gives

Discrete Mathematics For HI Page 118


Chapter three Recurrence Relation

and

and

Hence,

Step 3:

For we have

Therefore, .

Discrete Mathematics For HI Page 119


Chapter three Recurrence Relation

Exercise 2
1. Solve the given recurrence relation
a) , with
b) with and
c) with and
d) with and
e) with and
2. A deposit of $100,000 is made to an investment fund at the beginning of a year. On the
last day of each year two dividends are awarded. The first dividend is 20% of the amount
in the account during that year. The second dividend is 45% of the amount in the account
in the previous year.
a) Find a recurrence relation for , where is the amount in the account at the end
of years if no money is ever withdrawn.
b) How much is in the account after years if no money has been withdrawn?
3. What is the general form of the solutions of a linear homogeneous recurrence relation if
its characteristic equation has the roots
4. Solve the given recurrence relation
a) , with
b) , with
c) , with
d) with and
e)
f) (Hint: Look for a particular solution of the form
where and are constants).
g) with and
5. A new employee at an exciting new software company starts with a salary of 50,000 birr
and is promised that at the end of each year her salary will be double her salary the
previous year, with an extra increment of 10,000 birr for each year she has been with the
company.
a) Construct a recurrence relation for her salary for her nth year of employment.
b) Solve this recurrence relation to find her salary for her n th year of employment.

Discrete Mathematics For HI Page 120

You might also like