100 likes | 195 Views
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.
E N D
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
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 iis 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
Example – pg. 302 #2 • Find the first four terms of the recursively defined sequence. 5.6 Defining Sequences Recursively
Example – pg. 302 #10 5.6 Defining Sequences Recursively
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: • 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. • No rabbits die. How many rabbits will there be at the end of the year? 5.6 Defining Sequences Recursively
Fibonacci Numbers • The solution is a recurrence relation 5.6 Defining Sequences Recursively
Tower of Hanoi • Please read this section in your textbook. 5.6 Defining Sequences Recursively
Example – pg. 303 #28 • F0, F1, F2, … is the Fibonacci sequence. 5.6 Defining Sequences Recursively
Definition Given numbers a1, a2, …, an, where n is a positive integer, • the summation from i = 1 to n of the aiis defined as follows: if n > 1. • the product from i = 1 to n of the aiis defined by: if n > 1. 5.6 Defining Sequences Recursively
Example – pg. 304 #42 5.6 Defining Sequences Recursively