Sie sind auf Seite 1von 22

Discrete Mathematics. Chapter 8.

Recursive Relations
Dr. Loredana Lanzani

Dr. Lanzani

8.1 8.3

Test 3.

Test 3: Tuesday, November 17

Check course website for Test 3 topics ad review problem list.

Additional help: Enhanced Learning Center http://elc.uark.edu/ Gregson Hall (Garden Level) M F: 8:00am 5:00pm.

Dr. Lanzani

8.1 8.3

Chapter 8: Recursively dened sequences.

Chapter 8 overviev:

Review sequences and Recursive Sequences; learn techniques to Resolve recursive sequences.

Dr. Lanzani

8.1 8.3

8.1: Introduction.
Recall from Chapter 4: Example: dene a sequence S = {a1 , a2 , a3 , . . .} as follows. Set a1 = 2 ; Prove by induction: an = 2 5n1 n 1 (2) am = 5am1 m Z+ , m 2 . (1)

(1) and (2) are dierent formulas for the same sequence. Back in Chapter 4, we agreed that (2) is a better formula than (1) because it takes fewer calculations to compute values of the sequences using (2) than it would take using (1): formula (2) is faster than (1). Formula (1) is an example of a recurrence relation for the given sequence; identity (2) is the resolved formula for the same sequence.
Dr. Lanzani 8.1 8.3

8.1: Recurrence Relations.


Denition: given a sequence S = {a1 , a2 , a3 , . . .}, a Recurrence Relation for S is a formula that expresses the value of an S in terms of certain predecessors of an the Recurrence Relation (RR), and some given initial conditions (IC). Example: Compute the rst eight values of the sequence: {b1 , b2 , . . .} given by the following recurrence relation and initial conditions:

b0 = 0 ; b1 = 1; bk = bk 1 + bk 2 k Z, k 2. This is the celebrated Fibonacci Sequence, or Fibonacci numbers. In his lifetime, Leonardo di Pisa (1175-1250; Fibonacci = Son of Bonaccio ) was a merchant who enjoyed playing with numbers; today he is acknowledged as the greatest European mathematician of the Middle Ages. Fibonacci came up with this numerical sequence when trying to model (predict) the reproductive growth of a pair of rabbits, read page 464 in the textbook. In fact, Fibonacci numbers are a common occurrence in the natural world.
Dr. Lanzani 8.1 8.3

8.1:

Fibonacci numbers: b0 = 0; b1 = 1; bk = bk 1 + bk 2 .

Solution: b0 = 0 (by given (IC)); b1 = 1 (by given (IC)); b2 = 1 (by (RR) and (IC)); b3 = 2 (previous steps and (RR)); b4 = 3 (prev. steps and (RR)). b5 = 5 (prev. steps and (RR)); b6 = 8 (prev. steps and (RR)); b7 = 13(prev. steps and (RR)). Answer: The rst eight Fibonacci numbers: {0, 1, 1, 2, 3, 5, 8, 13}. Note: sometimes the rst initial condition for the Fibonacci sequence is given as b0 = 1. The resulting sequence diers from the one above just by the rst element: {1, 1, 2, 3, 5, 8, 13, ...}
Dr. Lanzani 8.1 8.3

Fibonacci numbers in nature.


Fibonacci Spiral:
800px-Fibonacci_spiral.svg.png 800!495 pixels 11/11/08 5:48 PM

Dr. Lanzani

8.1 8.3

Fibonacci numbers in nature.


400px-NautilusCutawayLogarithmicSpiral.jpg 400!302 pixels

Fibonacci Spiral:

Dr. Lanzani

8.1 8.3

Fibonacci numbers in nature.


The Nautilus up close and personal:
nautilus2.jpg 347!321 pixels

Dr. Lanzani

8.1 8.3

Fibonacci numbers in nature.


Eat your vegetables.... (your Mom was right):
romanesque.jpg 504!480 pixels

11/11/

Dr. Lanzani

8.1 8.3

8.3. Resolving a RR.

The problem with Recurrence Relations is that calculating ak takes k -many computations: when k is large this takes a lot of time. Its much better to have a formula for ak that depends only on k , as we had in the example from Chapter 4: ak = 2 5k 1 (vs. ak = 5ak 1 ): we call such formula a resolved formula for the given sequence.

Dr. Lanzani

8.1 8.3

Question: Answer:

When can a recurrence relation be expressed by a resolved formula? For instance, in the following situation:

Denition: a Second Order Linear Homogeneous Recurrence Relation with Constant Coecients (SOLHRRCC) is a Recurrence Relation of the following type: ak = A ak 1 + B ak 2 , k k0

Second Order: only last two predecessors appear in (RR); Homogeneous: ak 1 and ak 2 have same power; Linear: (RR) is linear in ak 1 and ak 2 2 (e.g. ak 1 ak 2 ; ak 1 ; sin ak 2 etc... are not allowed; Constant Coecients: A and B are given constants and B = 0 (Second Order).

Dr. Lanzani

8.1 8.3

Example:

Decide whether SOLHRRC. Explain.

ak = 3ak 1 + 2ak 2 . Yes. (A = 3; B = 2). bk = bk 1 + bk 2 + bk 3 . No. (not SO: bk 3 ). 1 3 ck = ck 1 ck 2 . Yes. (A = 1/2, B = 3/7). 2 7 2 2 dk = dk + d k 2 . No. (not L: dk 1 ). 1 ek = ek 1 + ek 1 ek 2 . No. (not L: ek 1 ek 2 ). fk = 3fk 2 . Yes. (A = 0, B = 3). gk = 2gk 1 + 1. No. (not H: 1 = 1 (gk 2 )0 ). hk = hk 1 + hk 2 . Yes (A = 1, B = 1) does this (RR) look familiar? Its the (RR) of the Fibonacci numbers!
k

k 1

+ (k 1)

k 2 .

No (not CC: B = k 1).

Dr. Lanzani

8.1 8.3

8.3: Characteristic Equation for SOLHRRCC.


Denition: given a SOLHRRCC: ak = A ak 1 + B ak 2 , that is:

ak A ak 1 B ak 2 = 0 the characteristic equation of the (RR) is: t 2 At B = 0 This is a quadratic equation. Example: the Characteristic equation of the Fibonacci numbers: bk = bk 1 + bk 2 , is: t2 t 1 = 0
8.1 8.3

Dr. Lanzani

8.3. Characteristic Equation: t 2 At B = 0.


we know from algebra that the characteristic equation will always have two solutions (roots): t1 , t2 , and these are given by the quadratic formula (or by factorization): A A2 + 4B t 1 ,2 = 2 We distinguish two cases: Case 1: If A2 + 4B = 0 then t1 = t2 and we have two distinct roots (this includes the case: A2 + 4B < 0 which produces complex conjugate roots); Case 2: if A2 + 4B = 0 then t1 = A/2 = t2 and we have two coincident roots. In this case we write: t0 for the common value of t1 and t2 . Example: the characteristic equation of the Fibonacci numbers: t 2 t 1 = 0 has two distinct roots: t1 ,2 = 1 5 2
Dr. Lanzani 8.1 8.3

8.3. Case 1: Distinct roots.

Theorem 8.3.3. Given a SOHLRRCC: bk = A bk 1 + B bk 2 with initial conditions b0 and b1 ,

suppose the characteristic equation: t 2 At B = 0 has two distinct roots t1 = t2 . Then, bk has the following resolved formula:
k k bk = C t1 + D t2 ,

k k0

where C and D are two constants that are computed by imposing the initial conditions.

Dr. Lanzani

8.1 8.3

Thm. 8.3.3:

k k + D t2 t1 = t2 bk = C t1

Example: Find a resolved formula for the following (RR). Explain. bk = 5bk 1 6bk 2 , Solution: Relation is a SOHLRRCC t2 (A = 5, B = 6); Charact. Eqn. is: 5t + 6 = 0; roots are: t1,2 = 5 25 24 /2 = (5 1)/2 , i.e. t1 = 3, t2 = 2 By Thm. 8.3.3., resolved formula is: bk = C 3k + D 2k , k 0. compute C and D by imposing Initial Conditions:
b0 = 0 b1 = 1 0 = C 30 + D 20 = C + D C + D = 0; 1 = C 31 + D 21 = 3C + 2D 3C + 2D = 1;

b0 = 0, b1 = 1

Solve system for C and D : C + D = 0 C = 1; D = 1. 3C 2C = 1 Answer: bk = 3k 2k ,


8.1 8.3

D = C k 0

Dr. Lanzani

Thm. 8.3.3:
Solution:

k k + D t2 t1 = t2 bk = C t1

Example: Find a resolved formula for the Fibonacci numbers. bk = bk 1 + bk 2 , Charact. Eqn. is: t1 , 2 t2 b0 = 0, b1 = 1 (def. Fibonacci #s); (A = 1, B = 1);

Relation is a SOHLRRCC

t 1 = 0; roots are: = 1 1 + 4 /2 = (1 5)/2


k

By Thm. 8.3.3., resolved formula is: k 1+ 5 1 5 + D bk = C 2 2

k 0

compute C and D by imposing Initial Conditions:

b0 = 0 0 = C [(1 + 5)/2]0 + D [(1 5)/2]0 = C + D = C; C + D = 0 D 1 1 b1 = 1 1 = C [(1 5)/2] + 5)/2] + D [(1 1 = (C + D ) = 0 + 2C 5/2 D ) + 5/2(C C = 1/ 5; D = 1/ 5.
Dr. Lanzani 8.1 8.3

8.3: Resolved formula for Fibonacci numbers


bk = bk 1 + bk 2 , k 2;
k

b0 = 0, b1 = 1 1 5 2
k

1 1+ 5 bk = 2 5

, k 0

Golden Ratio: its the constant: = (1 +

5)/2.

is the positive root of the equation: x = 1 + 1/x .


k +

lim bk +1 /bk =

Golden Rectangle: a rectangle whose sides a and b are in the proportion of the golden ratio (i.e. a/b = ).
Dr. Lanzani 8.1 8.3

Leonardo da Vincis Vitruvian Man (1487):

Ratio of total height to navels height of Vitruvian Man is close to .


Dr. Lanzani 8.1 8.3

8.3. Resolving SOHLRRCC: ak = Aak 1 + Bak 2 .


Case 2: characteristic equation of recurrence relation: t 2 At B = 0 has two coincident roots: t1 = t2 , that is A A2 4B t1 , 2 = with A2 4B = 0, 2 and we write: t0 for the common value of the two roots.
Resolved formula:
k k ak = C t0 + D k t0

the two constants C and D are computed by imposing the initial conditions.

Dr. Lanzani

8.1 8.3

Example: Find a resolved formula for the following (RR). Explain. bk = 4bk 1 4bk 2 , Solution: Relation is a SOHLRRCC Charact. Eqn. is: (A = 4, B = 4); roots are: t 2 4t + 4 = 0 = (t 2)2 ; b0 = 1, b1 = 3

t1 = t2 = 2, i.e. t0 = 2. By Case 2, , resolved formula is: bk = C 2k + D k 2k , k 0. compute C and D by imposing Initial Conditions:
b0 = 1 1 = C 20 + D 0 20 = C C = 1; b1 = 3 (and, C = 1) 3 = 1 21 + D 1 21 = 2 + 2D 2 + 2D = 3 D = 1/2;

Answer:

bk = 2k +

1 k 2k = 2k + k 2k 1 , 2

k 0

Dr. Lanzani

8.1 8.3

Das könnte Ihnen auch gefallen