chapter 5: sequences, mathematical induction, and recursion 5.6 defining sequences recursively 1 so,...

10
Discrete Structures Chapter 5: Sequences, Mathematical Induction, and Recursion 5.6 Defining Sequences Recursively 1 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

Upload: catherine-osborne

Post on 30-Dec-2015

219 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Chapter 5: Sequences, Mathematical Induction, and Recursion 5.6 Defining Sequences Recursively 1 So, Nat’ralists observe, a Flea/Hath smaller Fleas on

5.6 Defining Sequences Recursively 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

Page 2: Chapter 5: Sequences, Mathematical Induction, and Recursion 5.6 Defining Sequences Recursively 1 So, Nat’ralists observe, a Flea/Hath smaller Fleas on

5.6 Defining Sequences Recursively 2

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.

Page 3: Chapter 5: Sequences, Mathematical Induction, and Recursion 5.6 Defining Sequences Recursively 1 So, Nat’ralists observe, a Flea/Hath smaller Fleas on

5.6 Defining Sequences Recursively 3

Example – pg. 302 #2

• Find the first four terms of the recursively defined sequence.

1

1

3 , for all integers 2

1k kb b k k

b

Page 4: Chapter 5: Sequences, Mathematical Induction, and Recursion 5.6 Defining Sequences Recursively 1 So, Nat’ralists observe, a Flea/Hath smaller Fleas on

5.6 Defining Sequences Recursively 4

Example – pg. 302 #10

0 1 2

1

Let , , ,... be defined by the formula

4 , for all integers 0. Show that

this sequence satisfies the recurrence

relation 4 for all integers 1.

nn

k k

b b b

b n

b b k

Page 5: Chapter 5: Sequences, Mathematical Induction, and Recursion 5.6 Defining Sequences Recursively 1 So, Nat’ralists observe, a Flea/Hath smaller Fleas on

5.6 Defining Sequences Recursively 5

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?

Page 6: Chapter 5: Sequences, Mathematical Induction, and Recursion 5.6 Defining Sequences Recursively 1 So, Nat’ralists observe, a Flea/Hath smaller Fleas on

5.6 Defining Sequences Recursively 6

Fibonacci Numbers

• The solution is a recurrence relation

1 2

0 1

(1)

(2) 1, 1k k kF F F

F F

Page 7: Chapter 5: Sequences, Mathematical Induction, and Recursion 5.6 Defining Sequences Recursively 1 So, Nat’ralists observe, a Flea/Hath smaller Fleas on

5.6 Defining Sequences Recursively 7

Tower of Hanoi

• Please read this section in your textbook.

Page 8: Chapter 5: Sequences, Mathematical Induction, and Recursion 5.6 Defining Sequences Recursively 1 So, Nat’ralists observe, a Flea/Hath smaller Fleas on

5.6 Defining Sequences Recursively 8

Example – pg. 303 #28

• F0, F1, F2, … is the Fibonacci sequence.

2 2 21 1 1Prove that 2 ,

for all integers 1.k k k k kF F F F F

k

Page 9: Chapter 5: Sequences, Mathematical Induction, and Recursion 5.6 Defining Sequences Recursively 1 So, Nat’ralists observe, a Flea/Hath smaller Fleas on

5.6 Defining Sequences Recursively 9

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:

if n > 1.

• the product from i = 1 to n of the ai is defined by:

if n > 1.

1 1

1 1 1

and n n

i i i i ni i i

a a a a a

1 1

1 1 1

and n n

i i i i ni i i

a a a a a

Page 10: Chapter 5: Sequences, Mathematical Induction, and Recursion 5.6 Defining Sequences Recursively 1 So, Nat’ralists observe, a Flea/Hath smaller Fleas on

5.6 Defining Sequences Recursively 10

Example – pg. 304 #42

1 2 1 2

1

Use the recursive definition of product,

together with mathematical induction, to

prove that for all positive integers , if

, , ..., and , , ..., are real

numbers, then

n n

n

i ii

n

a a a a a a

a b 1 1

.n n

i ii i

a b