Lecture 11
Lecture 11
Topics:
1. Sequences and their Summation
2. Recurrence Relations
Sequences
Definition: A sequence is a function from a subset of the set of integers (usually
either the set {0, 1, 2, …} or the set {1, 2, 3, …}) to a set S. We use the notation an
to denote the image of the integer n. We call an a term of the sequence.
an = 1 /n .
The list of the terms of this sequence, beginning with a1, namely,
starts with 1, 1/ 2 , 1 /3 , 1 /4 , . …
Sequences: Geometric Progression
Definition: A geometric progression is a sequence of the form
where the initial term a and the common ratio r are real numbers.
where the initial term a and the common difference d are real numbers.
Sequences: Arithmetic Progression
Example: The sequences {sn} with sn = −1 + 4n and {tn} with tn = 7 − 3n are both arithmetic
progressions with initial terms and common differences equal to −1 and 4, and 7 and −3,
respectively, if we start at n = 0. The list of terms s0, s1, s2, s3, … begins with
−1, 3, 7, 11, … ,
and the list of terms t0, t1, t2, t3,, … begins with
7, 4, 1,−2, … .
Sequences of the form a1, a2, … , an are often used in computer science. These finite
sequences are also called strings. This string is also denoted by a1 a2 … an . The length of a
string is the number of terms in this string. The empty string, denoted by 𝜆, is the string that
has no terms. The empty string has length zero. For example, The string abcd is a string of
length four.
Recurrence Relations
Definition: A recurrence relation for the sequence {an} is an equation that
expresses an in terms of one or more of the previous terms of the sequence,
namely, a0, a1, … , an−1, for all integers n with n ≥ n0, where n0 is a nonnegative
integer. A sequence is called a solution of a recurrence relation if its terms satisfy
the recurrence relation. (A recurrence relation is said to recursively define a
sequence.)
Recurrence Relations
Example: Let {an} be a sequence that satisfies the recurrence relation an = an−1 + 3
for n = 1, 2, 3, … , and suppose that a0 = 2. What are a1, a2, and a3?
and a3 = 8 + 3 = 11.
Recurrence Relations: Fibonacci sequence
Definition: The Fibonacci sequence, f0, f1, f2, … , is defined by the initial
conditions f0 = 0, f1 = 1, and the recurrence relation
fn = fn−1 + fn−2
for n = 2, 3, 4, … .
Recurrence Relations: Fibonacci sequence
Example: Find the Fibonacci numbers f2, f3, f4, f5, and f6.
Solution: The recurrence relation for the Fibonacci sequence tells us that we find
successive terms by adding the previous two terms. Because the initial conditions tell us
that f0 = 0 and f1 = 1, using the recurrence relation in the definition we find that,
f2 = f 1 + f 0 = 1 + 0 = 1 f5 = f 4 + f 3 = 3 + 2 = 5
f3 = f 2 + f 1 = 1 + 1 = 2 f6 = f 5+ f 4= 5 + 3 = 8
f4 = f 3 + f 2 = 2 + 1 = 3
Recurrence Relations: Compound Interest
Example: Suppose that a person deposits $10,000 in a savings account at a bank yielding 11% per year
with interest compounded annually. How much will be in the account after 30 years?
Solution: To solve this problem, let Pn denote the amount in the account after n years. Because the amount
in the account after n years equals the amount in the account after n−1 years plus interest for the nth year,
we see that the sequence { Pn} satisfies the recurrence relation
The initial condition is P0 = 10,000. We can use an iterative approach to find a formula for P n . Note that
P1 = (1.11)P0
P2 = (1.11)P1 = (1.11)2P0
P3 = (1.11)P2 = (1.11)3P0
Pn = (1.11)Pn−1 = (1.11)nP0.
Recurrence Relations: Compound Interest
When we insert the initial condition P0 = 10,000, the formula Pn = (1.11)n10,000 is
obtained.
Inserting n = 30 into the formula Pn = (1.11)n10,000 shows that after 30 years the
account contains
Solution: In this sequence, the integer 1 appears once, the integer 2 appears
twice, the integer 3 appears three times, and the integer 4 appears four times. A
reasonable rule for generating this sequence is that the integer n appears exactly
n times, so the next five terms of the sequence would all be 5, the following six
terms would all be 6, and so on. The sequence generated this way is a possible
match.
Summations
Next, we consider the addition of the terms of a sequence. For this we introduce
summation notation. We begin by describing the notation used to express the sum of
the terms
am, am+1, … , an
am + am+1 + … + an
Summations
Here, the variable j is called the index of summation, and the choice of the letter j
as the variable is arbitrary; that is, we could have used any other letter, such as i
or k. Or, in notation,
Sum of terms of a geometric progression
Theorem:
Sum of terms of a geometric progression
Proof: Let
Sum of terms of a geometric progression