Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1.
2.
3.
Sequence
Recursively defined sequence
Finding an explicit formula for
recurrence relation
Learning Outcomes
Preamble
Sequences
2,4,6,8,
for i 1
ai = 2i (explicit formula)
-1,1,-1,1,
for i 1
bi = (-1)i
For
1<=i<=6
ci = i+5
Examples of recursively
sequence
Famous recurrences
Arithmetic sequences: ak = ak-1 + d
e.g. 1,4,7,10,13,
geometric sequences: ak = ark-1
e.g. 1,3,9,27,
Factorial: f(n) = n . f(n-1)
Fibonacci numbers: fk = fk-1+fk-2
1,1,2,3,5,8,
Tower of Hanoi problem
Tower of Hanoi
10
11
12
Application of recurrence
13
Some examples
Let a0,a1,a2, be the sequence defined recursively as follows: For
all integers k1,
(1) ak = ak-1+2
(2) a0 = 1
Use iteration to guess an explicit formula for the sequence.
a0=1
a1=a0+2
a2=a1+2=(1+2)+2 = 1+2.2
a3=a2+2=(1+2.2)+2 = 1+3.2
a4=a3+2=(1+3.2)+2 = 1+4.3
.
Guess: an=1+n.2=1+2n
The above sequence is an arithmetic sequence.
15
Geometric Sequence
Let r be a fixed nonzero constant, and suppose a sequence
a0,a1,a2, is defined as follows:
ak = rak-1 for all integers k 1
a0 = a
Use iteration to guess an explicit formula for the sequence
a0=a
a1=ra0=ra
a2=ra1=r(ra)=r2a
a3=ra2=r(r2a)=r3a
Guess: an=rna = arn for all integers n0
The above sequence is geometric sequence and r is a common
ratio.
16
17
mn = 2n 1. (exponential order)
To move 1 disk takes 1 second
m64 = 264 1 = 1.844674 * 1019 seconds
= 5.84542 * 1011 years
= 584.5 billion years.
18
Terminology
ak = Aak-1 + Bak-2
Second order: ak contains the two previous
terms
Linear: ak-1 and ak-2 appear in separate terms
and to the first power
Homogeneous: total degree of each term is
the same (no constant term)
Constant coefficients: A and B are fixed real
numbers
20
Examples
21
Characteristic equation
a = Aak-1 + Bak-2 for k>=2 .. (1)
Suppose that sequence 1, t, t2, t3, satisfies relation (1) where t is
a nonzero real number.
General term for the sequence an=tn.
Hence, ak-1=tk-1 and ak-2= tk-2
Substitute ak-1 and ak-2 into relation (1)
tk = Atk-1 + Btk-2
Divide the equation by tk-2:
t2 = At + B or t2 At B = 0
This equation is called the characteristic equation of the
relation.
Recurrence relation (1) is satisfied by the sequence 1,t,t2,t3, iff t
satisfies the characteristic equation.
k
22
23
Linear combination of
sequences
Lemma
If r0,r1,r2,,rn,.. and s0,s1,s2,,sn, are sequences that
satisfy the same second-order linear homogeneous
recurrence relation with c.c., and if C and D are any
numbers, then the sequence a0,a1,a2,
defined by the formula
an = C.rn + D.sn for all integer n>=0
also satisfies the same recurrence relation.
C and D can be calculated using initial conditions.
24
25
26
27
28
Quadratic equation
ax2 + bx + c = 0
x = [-b +- (b2 4.a.c)]/(2.a)
29
30
31
32
Single-Root Case
Example
A sequence b0, b1, b2, satisfies the rec. relation
bk = 4bk-1 4bk-2 for k>=2 with initial conditions b0=1
and b1=3.
Find explicit formula for the sequence.
Solution: A=4 and B=-4
Charac eq: t2 4t +4 =0
(t-2)2=0. t=2.
Seq: 1,2,22, , 2n,..
0,2,2.22,3.23,,n.2n,
Explicit formula: bn = C.rn + D.nrn
= C.2n + D.n2n
34
Example
bn = C.2n + D.n2n
b0 = 1 = C.20 + D.0.20 = C
b1 = 3 = C.2 + D.2
3 = 1.2 + 2D
Hence D = .
Therefore bn = 2n + (1/2).n.2n
= 2n (1+ n/2) for integer n>=0.
Sequence: 1,3,8,20,
35
Question
?????
36
Summary
37
THANK YOU
38