This preview shows pages 1–3. Sign up to view the full content.
14
Recurrence Relations
14.1
Recursion
•
general idea:
something is defned in terms oF a simpler version oF itselF
the simplest case(s) are defned explicitly
•
they have already seen recursively defned sequences
e.g.
t
1
=3
,t
n
=2
t
n

1
iF
n>
1
±ibonacci sequence:
t
1
=1
2
n
=
t
n

1
+
t
n

2
iF
2
•
recursion is an extremely important idea in computer science
they will be seeing lots oF it in APS105
many diﬀerent applications
an example: a recursive algorithm For counting the number oF digits in a positive integer
14.2
Recurrence relations
•
in this course, we will Focus on one Form oF recursion — the
recurrence relation
•
defnition oF a recurrence relation
an equation that expresses the
n
th term oF a sequence,
t
n
, in terms oF one or more oF the
preceding terms
the
initial conditions
oF a recurrence relation give specifc values oF one or more oF
t
1
2
,...
•
relate defnition to general Form oF recursion
•
to
solve
a recurrence relation is to fnd an explicit (nonrecursive) expression For
t
n
why might we want to have an explicit expression?
explain
•
generally, problem oF fnding a solution to a recurrence relation is not easy
•
sometimes not possible
14.3
Solving recurrence relations using patterns
•
fnd frst Few terms
•
look For a pattern
•
try to prove correctness using mathematical induction
•
an example
u
n
=
u
n

1
+3
,n>
0
u
0
14.4
Classifying recurrence relations
•
it turns out that classiFying recurrence relations is useFul because
solution methods are known For some categories (
cf.
integration)
•
frst order
f
n
f
n

1
second order
g
n
=
g
n

1
+
g
n

2
third order
h
n
=
h
n

3
+5
31
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document•
linear
c
n
=
c
n

1
+2
nonlinear
d
n
=
d
2
n

1
•
homogeneous
s
n
=
s
2
n

1
+
s
n

2
nonhomogeneous
t
n
=
t
n

1
+3
•
This is the end of the preview. Sign up
to
access the rest of the document.
 Fall '06
 Carter
 Recursion

Click to edit the document details