Recursive Functions,
Iterates,
and Finite Differences
By: Jeffrey Bivin
Lake Zurich High School
[email protected]
Last Updated: May 21, 2008
Recursive Function
A recursive function is a function whose
domain is the set of nonnegative integers
and is made up of two parts –
1. Start
2. Definition
Jeff Bivin -- LZHS
Example 1
a1 = 5
an = an-1 + 10
n=2 n=3 n=4
a2 = a(2-1) + 10 a3 = a (3-1) + 10 a4 = a(4-1) + 10
a2 = a1 + 10 a3 = a2 + 10 a4 = a3 + 10
a2 = 5 + 10 a3 = 15 + 10 a4 = 25 + 10
a2 = 15 a3 = 25 a4 = 35
Jeff Bivin -- LZHS
Example 2
f(1) = 3
f(n) = 5•f(n-1) + 2
n=2 n=3 n=4
f(2) = 5•f(2-1) + 2 f(3) = 5•f(3-1) + 2 f(4) = 5•f(4-1) + 2
f(2) = 5•f(1) + 2 f(3) = 5•f(2) + 2 f(4) = 5•f(3) + 2
f(2) = 5•3 + 2 f(3) = 5•17 + 2 f(4) = 5•87 + 2
f(2) = 17 f(3) = 87 f(4) = 437
Jeff Bivin -- LZHS
Example 3
f(1) = 1
f(2) = 1
f(n) = f(n-1) + f(n-2)
f(3) = f(3-1) + f(3-2) = f(2) + f(1) = 1 + 1 = 2
f(4) = f(4-1) + f(4-2) = f(3) + f(2) = 2 + 1 = 3
f(5) = f(5-1) + f(5-2) = f(4) + f(3) = 3 + 2 = 5
f(6) = f(6-1) + f(6-2) = f(5) + f(4) = 5 + 3 = 8
Jeff Bivin -- LZHS
Write a recursive rule
for the sequence
4, 12, 36, 108, 324, . . .
Is it Arithmetic or Geometric?
What is the pattern? multiply by 3
What is the start? a1 = 4
What is the definition? an = 3·an-1
Write a recursive rule
for the sequence
7, 12, 17, 22, 27, . . .
Is it Arithmetic or Geometric?
What is the pattern? add 5
What is the start? a1 = 7
What is the definition? an = an-1 + 5
Write a recursive rule
for the sequence
3, 4, 7, 11, 18, 29, 47, . . .
Is it Arithmetic or Geometric? neither
What is the pattern? 3+4 = 7, 4 + 7 = 11, 7 + 11 = 18
What is the start? a1 = 3
a2 = 4
What is the definition? an = an-2 + an-1
Find the first three iterates of the
function for the given initial value.
f(x) = 5x + 3, x0 = 2
x1 = f(x0) = f(2) = 5(2) + 3 = 13
x2 = f(x1) = f(13) = 5(13) + 3 = 68
x3 = f(x2) = f(68) = 5(68) + 3 = 343
Determine the degree
of the function
4, 7, 10, 13, 16, 19, 22, 25, 28
1st difference 3, 3, 3, 3, 3, 3, 3, 3
Jeff Bivin -- LZHS
Now, write the linear model
f(1) f(2)
4, 7, 10, 13, 16, 19, 22, 25, 28
(1, 4) m 74
2 1 3
1 3
(2, 7) y 4 3( x 1)
y 4 3x 3
y 3x 1
Jeff Bivin -- LZHS
Determine the degree
of the function
-1, 0, 5, 14, 27, 44, 65, 90, 119
1st difference 1, 5, 9, 13, 17, 21, 25, 29
2nd difference 4, 4, 4, 4, 4, 4, 4
Jeff Bivin -- LZHS
Now write the quadratic model
f(1) f(2) f(3)
-1, 0, 5, 14, 27, 44, 65, 90, 119
f (n) an bn c
2
f (1) a(1) b(1) c
2
a b c 1
f (2) a(2) b(2) c 4a 2b c 0
2
f (3) a (3) b(3) c 9a 3b c 5
2
Jeff Bivin -- LZHS
Now write the quadratic model
f(1) f(2) f(3)
-1, 0, 5, 14, 27, 44, 65, 90, 119
f (n) an bn c
2
f (1)1 a
1 (1)1
2
b1(1) a=c2 a b c 1
f (2)4 a2(2)1
RREF
2
0b(2)b= c-5 4a 2b c 0
f (3)9 a3(3)12
5b(3)c= c2 9a 3b c 5
f (n) 2n 5n 2
2
Jeff Bivin -- LZHS
Determine the degree
of the function
1, 10, 47, 130, 277, 506, 835, 1282, 1865
9, 37, 83, 147, 229, 329, 447,
1st difference
583
28, 46, 64, 82, 100, 118,
2nd difference 136
18, 18, 18, 18,
3 difference
rd
18, 18
Jeff Bivin -- LZHS
Now write the quadratic model
f(1) f(2) f(3) f(4)
1, 10, 47, 130, 277, 506, 835, 1282, 1865
f (n) an 3 bn 2 cn d
f (1) a (1) 3 b(1) 2 c(1) d a b c d 1
f (2) a (2) 3 b(2) 2 c(2) d 8a 4b 2c d 10
f (3) a(3) 3 b(3) 2 c(3) d 27a 9b 3c d 47
f ( 4) a (4) 3 b( 4) 2 c( 4) d 64a 16b 4c d 130
Jeff Bivin -- LZHS
Now write the quadratic model
f(1) f(2) f(3) f(4)
1, 10, 47, 130, 277, 506, 835, 1282, 1865
f (n) an 3 bn 2 cn d
f (1) a(11) 3 1b(1)12 1c(1)1 d a b c d 1
83 4 22 1 10
f (2) a (2) b(2) c(2) d 8a 4b 2c d 10
RREF 3
f (3) a(3 27 47d 27a 9b 3c d 47
) b9(3) 2 3 c1(3)
3
f ( 4) a (464
) 16
b( 4) 4 1c( 4130
2
) d 64a 16b 4c d 130
a = 3 b = -4 c = 0 d = 2 f (n) 3n 4n 2
3 2
Jeff Bivin -- LZHS