1 of 21

10.1 The First-Order Linear Recurrence Relation

312706017 林軒浩

2 of 21

Recurrence Relation

  • Like Fibonacci and Lucas numbers result at level n+1 depend on these at level n and n-1
  • Investigate function a(n), preferably written as an (n≥0)
  • an depend on some of the prior terms an-1, an-2, …, a1, a0
  • Also called difference equations

3 of 21

  • 5, 15, 45, 135, …

Geometric progression

  • Infinite sequence of number
  • Common ratio 3
  • If a0, a1, a2 is a geometric progression, then a1/a0 = a2/a1=…=an+1/an = r, the common ratio

5, 15, 45, 135, …

an+1 = 3an n≥0 a0=5

7,21,63,189

an+1 = 3an n≥0 a0=7

4 of 21

an+1 = dan , n≥0, d is constant

  • Since an+1 depends only on its immediate predecessor, the relation is said to be of first order
  • This is a first-order linear homogeneous recurrence relation with constant coefficients
  • The general form: an+1 = dan n≥0 , where d is a constant
  • Boundary conditions: a0 = A , where A is a constant

5 of 21

  • an+1 = 3an n≥0 a0=5

a0 = 5

a1 = 3a0 = 3(5)

a2 = 3a1 = 3(3a0) = 32(5)

a3 = 3a2 = 3(32(5)) = 33(5)

  • The unique solution : an = 5(3n) for each n ≥0 , there is no dependence on prior terms of the sequence

6 of 21

  • The unique solution of the recurrence relation

an+1 = dan , where n≥0, d is a constant , a0=A

is given by

an = Adn, n≥0

7 of 21

  • EXAMPLE 10.2

A bank pays 6% interest on saving, compounding the interest monthly. If Bonnie deposits $1000 on the first day of May , how much will this deposit be worth a year later?

The annual interest rate is 6%, so the month rate is 6%/12 = 0.5% = 0.005

  • pn+1 = 1.005pn 11 ≥ n ≥ 0 , p0=1000

​

  • The solution : pn = p0(1.005)n = $1000(1.005)n
  • $1000(1.005)12 = $1061.68

8 of 21

  • EXAMPLE 10.3 : compositions
  • (1’)-(4’) : increasing the last summand by 1
  • (1’’)-(4’’) : obtained from the composition of 3 by appending “+1” to each of the corresponding composition

9 of 21

  • Let an count the number of compositions of n

an+1 = 2an n≥1 a1=1

  • However, to apply the formula ,we let bn = an+1

bn+1 = 2bn n≥0 b0=1

​

So bn = b0(2n) = 2n, and an = bn-1 = 2n-1,n ≥ 1

10 of 21

  • The recurrence relation an+1 – dan = 0 is called linear
  • In a linear relation there are no product such as anan-1, which appear in the nonlinear recurrence relation an+1 - anan-1 = 0
  • However, a nonlinear recurrence relation can be transformed into linear one by suitable algebraic substitution

11 of 21

  • EXAMPLE 10.4

Find a12 if an+12 = 5 an2, where an > 0, n ≥ 0 , a0=2

 

12 of 21

  • The general first-order linear recurrence relation with coefficients has the form an+1 + can = f(n) n ≥0, c is a constant and f(n) is a function on the set N of nonnegative integers.

​

  • When f(n) = 0 : homogeneous
  • Otherwise :nonhomogeneous

13 of 21

  • EXAMPLE 10.6

In example 9.6 we sought the generating function for the sequence 0 , 2 , 6 , 12 , 20 , 30 , 42,…, and the solution is an = n2 + n

  • Here a0 = 0, a1 = 2, a2 = 6, a3 = 12, a4 = 20, a5 = 30, a6 = 42

a1 – a0 = 2 a3 - a2 = 6 a5 - a4 = 10

a2 – a1 = 4 a4 - a3 = 8 a6 - a5 = 12

  • The calculations suggest the recurrence relation:

an – an-1 = 2n, n ≥1, a0 = 0

14 of 21

  • EXAMPLE 10.6

a1 – a0 = 2

a2 – a1 = 4

a3 - a2 = 6

…

an – an-1 = 2n

  • an – a0 = 2 + 4 + 6 +…+2n = 2(1+2+3+…+n) = 2[n(n+1)/2] = n2+n
  • Since a0 = 0, it follows that an = n2+n

15 of 21

  • EXAMPLE 10.8 The Euclidean Algorithm

333 = 3(84) + 81 0<81<84

84 = 1(81) + 3 0<3<81

81 = 27(3) + 0

  • Since 3 is the last nonzero remainder, the Euclidean algorithm tells us that gcd(333,84) = 3. However, the calculations imply that

​

  • gcd(333,84) = gcd(84,81) = gcd(81,3) = 3
  • Also observe that

81 = 333 mod 84 and 3 = 84 mod 81

  • Therefore if follows that

gcd(333,84) = gcd(84,333 mod 84) = gcd(333 mod 84,84 mod (333 mod 84))

16 of 21

  • EXAMPLE 10.8 The Euclidean Algorithm
  • These results suggest the following recursive method for computing gcd(a,b) ,where a , b ∈Z+
  • Having the input a , b ∈Z+

(Step 1): If b|a (or a mod b = 0), gcd(a,b) = b

(Step 2): If b !| a , then perform the following tasks in the order specified

i) Set a = b

ii)Set b = a mod b, where the value of a for this assignment is the old value of a

iii)Return to step(1)

17 of 21

  • EXAMPLE 10.8 The Euclidean Algorithm

18 of 21

Thank you

for listening

19 of 21

20 of 21

21 of 21