Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 13: Sequences & Series L13.2 Recursive Definitions + Function Iteration.

Similar presentations


Presentation on theme: "Chapter 13: Sequences & Series L13.2 Recursive Definitions + Function Iteration."— Presentation transcript:

1 Chapter 13: Sequences & Series L13.2 Recursive Definitions + Function Iteration

2 Warmup Examine each sequence and tell how you would compute the 20 th term if you were given the 19 th term: 1) 6, 15, 24, 33, … 2) 5, 10, 20, 40, … 3) 1, 2, 6, 24, 120, … 4) −1, −3, −5, −7, … 5) 1, 3, 7, 15, 31, … 6) 1, 2, 8, 64, 1024, … t 20 = t 19 + 9 t 20 = 2·t 19 t 20 = 20·t 19 t 20 = t 19 – 2 t 20 = 2·t 19 + 1 or t 20 = t 19 + 2 19 t 20 = 2 19 ·t 19 These example computations involve recursion – defining something in terms of itself / relying on what has preceded.

3 Explicit vs. Recursive Definitions In Lesson 13.1, all sequence definitions were explicit. You can find the value of any term given the formula. Ex: Find the 1 st six terms and the 100 th term of the sequence in which t n = n 2 – 1 t 1 = 1 2 – 1 = 0 t 2 = 2 2 – 1 = 3 t 3 = 3 2 – 1 = 8 t 4 = 4 2 – 1 = 1 t 5 = 5 2 – 1 = 24 t 6 = 6 2 – 1 = 35 t 100 = 100 2 – 1 = 9,999

4 Explicit vs. Recursive Definitions A recursive definition of a sequence has 2 parts: –An initial condition that tells how the sequence starts. –A recursive formula that tells how any term in the sequence is related to the preceding term(s). Ex: Find the 1 st six terms and the 100 th term of the sequence in which t 1 = 3 and t n = t n-1 + 2 for all n > 1 t 1 = 3 t 4 = t 3 + 2 = 9 t 5 = t 4 + 2 = 11 t 6 = t 5 + 2 = 13 t 100 = t 99 + 2 = ?? Finding the 100 th term requires the prior, 99 th term! In this particular case, since this is an arithmetic sequence with t 1 = 3 and d = 2, we can deduce the explicit formula. T 100 = 3 + (100 – 1)2 = 201 a.k.a. “seed” value t 2 = t 1 + 2 = 5 t 3 = t 2 + 2 = 7

5 It is generally straight-forward to convert between explicit and recursive sequence definitions: Arithmetic: Recursive: t 1 = 3, t n = t n-1 + 4, n > 1 → 3, 7, 11, …. (d = 4) Geometric: Explicit: t n = 3(2) n (t 1 = 6, r = 2) Some sequences can only be defined recursively; e.g., The Fibonacci Sequence: t 1 = 1, t 2 = 1, t n = t n-2 + t n-1, n > 2 Explicit vs. Recursive Definitions to Explicit: t n = t 1 + (n – 1)d = 3 + (n – 1)(4) t n = 4n – 1 to Recursive: t 1 = 6, t n = 2·t n-1, n > 1 initial condition recursion formula

6 Recursive definitions are – important tools in modeling – easier to set up since they reflect what is directly observed – widely used in computer programming. EXAMPLE: The population of a certain country is currently 8.5 million and grows as a result of two conditions: – The annual growth rate for those currently living in the country is 2% – The net migration is 50,000 people into the country every year Give a recursive definition for the population in n years. P 0 = 8.5 X 10 6, P n = P n-1 (1 +.02) + 50,000, n > 0 What will the population be in 5 years from now? P 1 = (8.5 X 10 6 )(1.02) + 50,000 = 8.720 X 10 6 P 2 = (8.720 X 10 6 )(1.02) + 50,000 = 8.944 X 10 6 P 3 = (8.944 X 10 6 )(1.02) + 50,000 = 9.173 X 10 6 P 4 = (9.173 X 10 6 )(1.02) + 50,000 = 9.407 X 10 6 P 5 = (9.407 X 10 6 )(1.02) + 50,000 = 9.645 X 10 6 Recursive Definitions Luckily we did not ask for 20 years out!

7 Function Iteration combines function composition with the concept of recursion It involves composing a function with itself repeatedly: (f o f)(x) = f(f(x)), (f o f o f)(x) = f(f(f(x))), etc. Examples: 1. Find first three iterates, x 1, x 2, and x 3 of f(x) = 3x + 1 for an initial value, x 0 = 5. 2. Find first three iterates, x 1, x 2, and x 3 of f(x) = x 2 + 3 for an initial value, x 0 = 2. Special Topic: Function Iteration f(5) = 3·5 + 1 = 16; f(16) = 3·16 + 1 = 49; f(49) = 3·49 + 1 = 148 x o x 1 x 2 x 3 f(2) = 2 2 + 3 = 7; f(7) = 7 2 + 3 = 52; f(52) = 52 2 + 3 = 2707 x o x 1 x 2 x 3


Download ppt "Chapter 13: Sequences & Series L13.2 Recursive Definitions + Function Iteration."

Similar presentations


Ads by Google