Solving Recurrence Relations - Discrete Mathematical Structures - Lecture Slides, Slides of Discrete Mathematics

During the study of discrete mathematics, I found this course very informative and applicable.The main points in these lecture slides are:Solving Recurrence Relations, Recursion, Explicit Formula, Demonstrate Pattern, Method of Iteration, Recursion by Iteration, Successive Terms, Arithmetic Sequence, Geometric Sequence, Formula Simplification

Typology: Slides

2012/2013

Uploaded on 04/27/2013

ashwini
ashwini 🇮🇳

4.5

(18)

167 documents

1 / 13

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Chapter 8
Recursion
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download Solving Recurrence Relations - Discrete Mathematical Structures - Lecture Slides and more Slides Discrete Mathematics in PDF only on Docsity!

Chapter 8

Recursion

Solving Recurrence Relations by

Iteration

Recursion by Iteration

  • Method of Iteration
    • most basic method for finding explicit formula
    • given a sequence a 0 , a 1 , … defined by a recurrence relation and initial conditions, calculate successive terms until a pattern emerges
    • define a formula based on the pattern

Example

• Finding explicit formula

  • Let a 0 , a 1 , a 2 ,… be the sequence defined as (k≥1):
    1. a (^) k = a (^) k-1+ 2 (recurrence relation)
    2. a 0 = 1 (initial condition)
  • Use iteration to guess formula.
  • Solution
    • a (^) k = a (^) k-1+ 2 k≥1,
    • a 1 = a 0 + 2, a 2 = a 1 + 2, a 3 = a 2 + 2, a 4 = a 3 + 2 …
    • a (^) n = a (^) n-1 + 2

Definition

• Arithmetic Sequence

  • A sequence is called an arithmetic sequence if,

and only if, there is a constant d such that

  • a (^) k = a (^) k-1 + d, k≥1, or
  • a (^) n = a 0 + dn , n≥
  • Arithmetic sequence is a sequence in which the

current term equals the previous term plus a fixed

constant. (Note: illustrated in previous example)

Example

• Arithmetic sequence

  • In a vacuum an object under gravity will fall 9.

meters farther from one second to the next.

  • A skydiver falls 4.9 meters b/n 0 & 1 second, 4.9 +

9.8=14.7 meters b/n 1 & 2 sec, how far will the

skydiver had falling b/n 60 & 61 secs?

  • Solution
    • dk = dk-1 + 9.8 meters, k≥
    • since dk is an arithmetic sequence it can be rewritten as:
    • dn = d 0 + nx(9.8 meters), n≥0 , d 0 = 4.9 meters
    • d 60 = 4.9 + 60(9.8) = 592.9 meters

Example

  • Geometric sequence
    • A bank pays 4% per year of compounded interest, If the initial amount deposited is $100,000, how much will the account be worth in 21 years? In how many years will the account be worth $1,000,000?
    • Solution
      • a (^) n = a 0 rn^ , n≥0, a 0 = $100,000 and r = 1.04 (1 + int rate)
      • a 21 = $100,000 x (1.04)^21 = $227,876.
      • at = $100,000 x (1.04)t^ = $1,000,000, solve for t
      • (1.04)t^ = 1,000,000/100,000 = 10
      • t ln(1.04) = ln(10)
      • t = ln(10) / ln (1.04) = 58.7,
      • hence it would take 58.8 years to compound $100,000 into $1,000,000 at 4% interest rate.

Formula Simplification

• Geometric sequence

  • 1 + r + r^2 + … + rn^ =

• Sum of first n integers

  • 1 + 2 + 3 + … + n =

r n^ +^1 − 1 r − 1

, nZ | n ≥ 0

n n ( + 1 ) 2

, nZ | n ≥ 1

Checking with Mathematical Induction

  • Verifying Tower Hanoi Solution
    • Problem: verify that sequence (m 1 , … , m (^) n) is defined by m (^) k = 2m (^) k-1 + 1, k≥2 and m 1 =1, then m (^) n = 2n^ – 1. - Given: mk = 2mk-1 + 1, k≥2 (recurrence) m 1 =1 (initial) - Show: mn = 2 n^ – 1 - Proof 1. Basis (n=1) m 1 =1 (initial) and m 1 = 2 1 – 1 = 2 – 1 = 1 2. Inductive (k≥1) holds for n=k, then it holds for n=k+ - mk = 2 k^ – 1 (k≥1), show that mk+1 = 2 k+1^ – 1 - mk+1 = 2mk+1-1 + 1 (mk = 2mk-1 + 1, apply k+1+ - = 2mk + 1 (subs in mk = 2 k^ – 1 ) - = 2(2 k^ – 1 ) + 1 = 2k+1^ – 2 + 1 = 2 k+1^ – 1 - hence, left side (mk =2mk-1 + 1) is equal to right side (m (^) k+1 =2 k+1^ – 1)