Transcript Slide 1
Discrete Structures
Chapter 5: Sequences, Mathematical Induction, and
Recursion
5.6 Defining Sequences Recursively
So, Nat’ralists observe, a Flea/Hath smaller Fleas on him prey, /And
these have smaller Fleas to bite ‘em, /And so proceed ad infinitum.
– Jonathan Swift, 1667 – 1745
5.6 Defining Sequences Recursively
1
Definition
• Recurrence Relation
A recurrence relation for a sequence a0, a1, a2, … is
a formula that relates each term ak, to certain of its
predecessors ak-1, ak-2, …, ak-i where i is an integer
with k – i 0.
• Initial Conditions
The initial conditions for such a recurrence relation
specify the values of a0, a1, a2, …, ai-1, if i is a fixed
integer, or a0, a1, a2, …, am where m is an integer with
m 0, if i depends on k.
5.6 Defining Sequences Recursively
2
Example – pg. 302 #2
• Find the first four terms of the recursively
defined sequence.
bk bk 1 3 k , for all integers k 2
b1 1
5.6 Defining Sequences Recursively
3
Example – pg. 302 #10
Let b0 , b1 , b 2 , ... be defined by the form ula
b n 4 , for all integers n 0. S how that
n
this sequence satisfies the recurrence
relation b k 4 b k 1 for all integers k 1.
5.6 Defining Sequences Recursively
4
Fibonacci Numbers
• Fibonacci proposed the following problem:
• A single pair of rabbits (male and female) is born
at the beginning of a year. Assume the following
conditions:
1. Rabbit pairs are not fertile during their first month of
life but thereafter give birth to one new male/female
pair at the end of every month.
2. No rabbits die.
How many rabbits will there be at the end of the year?
5.6 Defining Sequences Recursively
5
Fibonacci Numbers
• The solution is a recurrence relation
(1) Fk Fk 1 Fk 2
(2) F0 1,
F1 1
5.6 Defining Sequences Recursively
6
Tower of Hanoi
• Please read this section in your textbook.
5.6 Defining Sequences Recursively
7
Example – pg. 303 #28
• F0, F1, F2, … is the Fibonacci sequence.
Prove that F
2
k 1
F F
2
k
2
k 1
2 Fk Fk 1 ,
for all integers k 1.
5.6 Defining Sequences Recursively
8
Definition
Given numbers a1, a2, …, an, where n is a positive integer,
• the summation from i = 1 to n of the ai is defined as follows:
1
a
n
ai
i
and
i 1
i 1
n 1
ai ai
i 1
an
if n > 1.
• the product from i = 1 to n of the ai is defined by:
1
a
i 1
n
i
ai
and
i 1
n 1
ai ai a n
i 1
if n > 1.
5.6 Defining Sequences Recursively
9
Example – pg. 304 #42
U se the recursive definition of product,
together w ith m athem atical induction, to
prove that for all positive integers n , if
a1 , a 2 , ..., a n and a1 , a 2 , ..., a n are real
num bers, then
n
a b
i
i 1
i
a i bi .
i 1 i 1
n
5.6 Defining Sequences Recursively
n
10