15
Page 1 of 15 Math 3336 Recurrence Relations Definition: A recurrence relation for the sequence { } is an equation that expresses in terms of one or more of the previous terms of the sequence, namely, 0 , 1 ,…, βˆ’1 , for all integers with β‰₯ 0 , where 0 is a nonnegative integer. β€’ A sequence is called a solution of a recurrence relation if its terms satisfy the recurrence relation. β€’ The initial conditions for a sequence specify the terms that precede the first term where the recurrence relation takes effect. Rabbits and the Fibonacci Numbers Example: A young pair of rabbits (one of each gender) is placed on an island. A pair of rabbits does not breed until they are 2 months old. After they are 2 months old, each pair of rabbits produces another pair each month. Find a recurrence relation for the number of pairs of rabbits on the island after n months, assuming that rabbits never die. This is the original problem considered by Leonardo Pisano (Fibonacci) in the thirteenth century.

Math 3336 Recurrence Relations Definition: recurrence ...irina/MATH3336/3336Notes/3336RR_notes.pdfPage 1 of 15. Math 3336 . Recurrence Relations. Definition: A recurrence relation

  • Upload
    others

  • View
    30

  • Download
    0

Embed Size (px)

Citation preview

  • Page 1 of 15

    Math 3336 Recurrence Relations

    Definition: A recurrence relation for the sequence {π‘Žπ‘Žπ‘›π‘›} is an equation that expresses π‘Žπ‘Žπ‘›π‘› in terms of one or more of the previous terms of the sequence, namely, π‘Žπ‘Ž0, π‘Žπ‘Ž1, … ,π‘Žπ‘Žπ‘›π‘›βˆ’1, for all integers 𝑛𝑛 with 𝑛𝑛 β‰₯ 𝑛𝑛0, where 𝑛𝑛0 is a nonnegative integer.

    β€’ A sequence is called a solution of a recurrence relation if its terms satisfy the recurrence relation.

    β€’ The initial conditions for a sequence specify the terms that precede the first term where the recurrence relation takes effect.

    Rabbits and the Fibonacci Numbers

    Example: A young pair of rabbits (one of each gender) is placed on an island. A pair of rabbits does not breed until they are 2 months old. After they are 2 months old, each pair of rabbits produces another pair each month. Find a recurrence relation for the number of pairs of rabbits on the island after n months, assuming that rabbits never die.

    This is the original problem considered by Leonardo Pisano (Fibonacci) in the thirteenth century.

  • Page 2 of 15

    Solution:

  • Page 3 of 15

    The Tower of Hanoi

    In the late nineteenth century, the French mathematician EÉ douard Lucas invented a puzzle consisting of three pegs on a board with disks of different sizes. Initially all of the disks are on the first peg in order of size, with the largest on the bottom.

    Rules: You are allowed to move the disks one at a time from one peg to another as long as a larger disk is never placed on a smaller. oal: Using allowable moves, end up with all the disks on the second peg in order of size with largest on the bottom. Solution:

  • Page 4 of 15

    β€’ There was a myth created with the puzzle. Monks in a tower in Hanoi are transferring 64 gold disks from one peg to another following the rules of the puzzle. They move one disk each day. When the puzzle is finished, the world will end.

    β€’ Using this formula for the 64 gold disks of the myth,

    264 βˆ’1 = 18,446, 744,073, 709,551,615 days are needed to solve the puzzle, which is more than 500 billion years.

    β€’ Reve’s puzzle (proposed in 1907 by Henry Dudeney) is similar but has 4 pegs. There is a well-known unsettled conjecture for the minimum number of moves needed to solve this puzzle.

  • Page 5 of 15

    Counting Bit Strings Example: Find a recurrence relation and give initial conditions for the number of bit strings of length n without two consecutive 0s. How many such bit strings are there of length five? Solution:

  • Page 6 of 15

    Linear Homogeneous Recurrence Relations Definition: A linear homogeneous recurrence relation of degree k with constant coefficients is a recurrence relation of the form a

    n = c

    1a

    nβˆ’1 + c

    2a

    nβˆ’2 + ….. + c

    k a

    nβˆ’k , where c

    1, c

    2, ….,c

    k are

    real numbers, and ck β‰  0

    Examples of Recurrence Relations 1. Pn = (1.11)Pnβˆ’1

    2. 𝑓𝑓𝑛𝑛 = π‘“π‘“π‘›π‘›βˆ’1 + π‘“π‘“π‘›π‘›βˆ’2

    3. π‘Žπ‘Žπ‘›π‘› = π‘Žπ‘Žπ‘›π‘›βˆ’1 + π‘Žπ‘Žπ‘›π‘›βˆ’22

    4. 𝐻𝐻𝑛𝑛 = 2π»π»π‘›π‘›βˆ’1 + 1

    5. 𝑏𝑏𝑛𝑛 = π‘›π‘›π‘π‘π‘›π‘›βˆ’1

    6. 𝑐𝑐𝑛𝑛 = 3π‘π‘π‘›π‘›βˆ’1 + 4π‘π‘π‘›π‘›βˆ’2 + 5π‘π‘π‘›π‘›βˆ’3

  • Page 7 of 15

    Solving Linear Homogeneous Recurrence Relations Solving Linear Homogeneous Recurrence Relations of Degree Two

    Theorem 1: Let 𝑐𝑐1 and 𝑐𝑐2 be real numbers. Suppose that π‘Ÿπ‘Ÿ2 βˆ’ 𝑐𝑐1π‘Ÿπ‘Ÿ βˆ’ 𝑐𝑐2 = 0 has two distinct roots π‘Ÿπ‘Ÿ1 and π‘Ÿπ‘Ÿ2. Then the sequence {π‘Žπ‘Žπ‘›π‘›} is a solution to the recurrence relation π‘Žπ‘Žπ‘›π‘› =𝑐𝑐1π‘Žπ‘Žπ‘›π‘›βˆ’1 + 𝑐𝑐2π‘Žπ‘Žπ‘›π‘›βˆ’2 if and only if π‘Žπ‘Žπ‘›π‘› = 𝛼𝛼1π‘Ÿπ‘Ÿ1𝑛𝑛 + 𝛼𝛼2π‘Ÿπ‘Ÿ2𝑛𝑛 for 𝑛𝑛 = 0,1,2, … , where 𝛼𝛼1 and 𝛼𝛼2 are constants. Example: What is the solution of the recurrence relation π‘Žπ‘Žπ‘›π‘› = π‘Žπ‘Žπ‘›π‘›βˆ’1 + 2π‘Žπ‘Žπ‘›π‘›βˆ’2? Step 1: Write a characteristic equation of a recurrence relation (CERR). If a𝑛𝑛 = 𝑐𝑐1π‘Žπ‘Žπ‘›π‘›βˆ’1 + 𝑐𝑐2π‘Žπ‘Žπ‘›π‘›βˆ’2 + β‹―+ π‘π‘π‘˜π‘˜π‘Žπ‘Žπ‘›π‘›βˆ’π‘˜π‘˜, then

    π‘Ÿπ‘Ÿπ‘˜π‘˜ βˆ’ 𝑐𝑐1π‘Ÿπ‘Ÿπ‘˜π‘˜βˆ’1 βˆ’ 𝑐𝑐2π‘Ÿπ‘Ÿπ‘˜π‘˜βˆ’2 βˆ’ β‹―βˆ’ π‘π‘π‘˜π‘˜βˆ’1π‘Ÿπ‘Ÿ βˆ’ π‘π‘π‘˜π‘˜ = 0 is the characteristic equation of π‘Žπ‘Žπ‘›π‘›. Step 2: Solve CERR Step 3: Write solution in terms of 𝛼𝛼s. Step 4: Find 𝛼𝛼1 and 𝛼𝛼2 from initial conditions.

  • Page 8 of 15

    Step 5: Write the solution. Example: What is the solution of the recurrence relation π‘Žπ‘Žπ‘›π‘› = π‘Žπ‘Žπ‘›π‘›βˆ’1 + 6π‘Žπ‘Žπ‘›π‘›βˆ’2? Step 1: Write a characteristic equation of a recurrence relation (CERR). If a𝑛𝑛 = 𝑐𝑐1π‘Žπ‘Žπ‘›π‘›βˆ’1 + 𝑐𝑐2π‘Žπ‘Žπ‘›π‘›βˆ’2 + β‹―+ π‘π‘π‘˜π‘˜π‘Žπ‘Žπ‘›π‘›βˆ’π‘˜π‘˜, then

    π‘Ÿπ‘Ÿπ‘˜π‘˜ βˆ’ 𝑐𝑐1π‘Ÿπ‘Ÿπ‘˜π‘˜βˆ’1 βˆ’ 𝑐𝑐2π‘Ÿπ‘Ÿπ‘˜π‘˜βˆ’2 βˆ’ β‹―βˆ’ π‘π‘π‘˜π‘˜βˆ’1π‘Ÿπ‘Ÿ βˆ’ π‘π‘π‘˜π‘˜ = 0 is the characteristic equation of π‘Žπ‘Žπ‘›π‘›. Step 2: Solve CERR Step 3: Write solution in terms of 𝛼𝛼s. Step 4: Find 𝛼𝛼1 and 𝛼𝛼2 from initial conditions.

  • Page 9 of 15

    Step 5: Write the solution Example: Find an explicit formula for the Fibonacci numbers. Step 1: Write a characteristic equation of a recurrence relation (CERR). If a𝑛𝑛 = 𝑐𝑐1π‘Žπ‘Žπ‘›π‘›βˆ’1 + 𝑐𝑐2π‘Žπ‘Žπ‘›π‘›βˆ’2 + β‹―+ π‘π‘π‘˜π‘˜π‘Žπ‘Žπ‘›π‘›βˆ’π‘˜π‘˜, then

    π‘Ÿπ‘Ÿπ‘˜π‘˜ βˆ’ 𝑐𝑐1π‘Ÿπ‘Ÿπ‘˜π‘˜βˆ’1 βˆ’ 𝑐𝑐2π‘Ÿπ‘Ÿπ‘˜π‘˜βˆ’2 βˆ’ β‹―βˆ’ π‘π‘π‘˜π‘˜βˆ’1π‘Ÿπ‘Ÿ βˆ’ π‘π‘π‘˜π‘˜ = 0 is the characteristic equation of π‘Žπ‘Žπ‘›π‘›. Step 2: Solve CERR Step 3: Write solution in terms of 𝛼𝛼s. Step 4: Find 𝛼𝛼1 and 𝛼𝛼2 from initial conditions.

  • Page 10 of 15

    Step 5: Write the solution

    Theorem 2: Let 𝑐𝑐1 and 𝑐𝑐2 be real numbers with 𝑐𝑐2 β‰  0 . Suppose that π‘Ÿπ‘Ÿ2 βˆ’ 𝑐𝑐1π‘Ÿπ‘Ÿ βˆ’ 𝑐𝑐2 = 0 has only one root π‘Ÿπ‘Ÿ0. A sequence {π‘Žπ‘Žπ‘›π‘›} is a solution of the recurrence relation π‘Žπ‘Žπ‘›π‘› = 𝑐𝑐1π‘Žπ‘Žπ‘›π‘›βˆ’1 +𝑐𝑐2π‘Žπ‘Žπ‘›π‘›βˆ’2 if and only if π‘Žπ‘Žπ‘›π‘› = 𝛼𝛼1π‘Ÿπ‘Ÿ0𝑛𝑛 + 𝛼𝛼2π‘›π‘›π‘Ÿπ‘Ÿ0𝑛𝑛 for 𝑛𝑛 = 0,1,2, … , where 𝛼𝛼1 and 𝛼𝛼2 are constants.

    Example: What is the solution of the recurrence relation π‘Žπ‘Žπ‘›π‘› = 6π‘Žπ‘Žπ‘›π‘›βˆ’1 βˆ’ 9π‘Žπ‘Žπ‘›π‘›βˆ’2 with initial conditions π‘Žπ‘Ž0 = 1 and π‘Žπ‘Ž1 = 6? Step 1: Write a characteristic equation of a recurrence relation (CERR).

    π‘Ÿπ‘Ÿπ‘˜π‘˜ βˆ’ 𝑐𝑐1π‘Ÿπ‘Ÿπ‘˜π‘˜βˆ’1 βˆ’ 𝑐𝑐2π‘Ÿπ‘Ÿπ‘˜π‘˜βˆ’2 βˆ’ β‹―βˆ’ π‘π‘π‘˜π‘˜βˆ’1π‘Ÿπ‘Ÿ βˆ’ π‘π‘π‘˜π‘˜ = 0 Step 2: Solve CERR Step 3: Write solution in terms of 𝛼𝛼s. Step 4: Find 𝛼𝛼1 and 𝛼𝛼2 from initial conditions.

  • Page 11 of 15

    Step 5: Write the solution Theorem 3: Let 𝑐𝑐1, 𝑐𝑐2, … , π‘π‘π‘˜π‘˜ be real numbers. Suppose that the characteristic equation

    π‘Ÿπ‘Ÿπ‘˜π‘˜ βˆ’ 𝑐𝑐1π‘Ÿπ‘Ÿπ‘˜π‘˜βˆ’1 βˆ’ 𝑐𝑐2π‘Ÿπ‘Ÿπ‘˜π‘˜βˆ’2 βˆ’ β‹―βˆ’ π‘π‘π‘˜π‘˜βˆ’1π‘Ÿπ‘Ÿ βˆ’ π‘π‘π‘˜π‘˜ = 0

    Has k distinct roots π‘Ÿπ‘Ÿ1, π‘Ÿπ‘Ÿ2, … , π‘Ÿπ‘Ÿπ‘˜π‘˜. Then a sequence {π‘Žπ‘Žπ‘›π‘›} is a solution of the recurrence relation π‘Žπ‘Žπ‘›π‘› = 𝑐𝑐1π‘Žπ‘Žπ‘›π‘›βˆ’1 + 𝑐𝑐2π‘Žπ‘Žπ‘›π‘›βˆ’2 + β‹―π‘π‘π‘˜π‘˜π‘Žπ‘Žπ‘›π‘›βˆ’π‘˜π‘˜ if and only if π‘Žπ‘Žπ‘›π‘› = 𝛼𝛼1π‘Ÿπ‘Ÿ0𝑛𝑛 + 𝛼𝛼2π‘Ÿπ‘Ÿ0𝑛𝑛 + β‹―+ π‘Žπ‘Žπ‘˜π‘˜π‘Ÿπ‘Ÿπ‘˜π‘˜π‘›π‘› for 𝑛𝑛 = 0,1,2, … , where 𝛼𝛼1,𝛼𝛼2, … ,π›Όπ›Όπ‘˜π‘˜ are constants.

    Example: Find the solution to the recurrence relation π‘Žπ‘Žπ‘›π‘› = 6π‘Žπ‘Žπ‘›π‘›βˆ’1 βˆ’ 11π‘Žπ‘Žπ‘›π‘›βˆ’2 + 6π‘Žπ‘Žπ‘›π‘›βˆ’3. Step 1: Write a characteristic equation of a recurrence relation (CERR).

    π‘Ÿπ‘Ÿπ‘˜π‘˜ βˆ’ 𝑐𝑐1π‘Ÿπ‘Ÿπ‘˜π‘˜βˆ’1 βˆ’ 𝑐𝑐2π‘Ÿπ‘Ÿπ‘˜π‘˜βˆ’2 βˆ’ β‹―βˆ’ π‘π‘π‘˜π‘˜βˆ’1π‘Ÿπ‘Ÿ βˆ’ π‘π‘π‘˜π‘˜ = 0 Step 2: Solve CERR Step 3: Write solution in terms of 𝛼𝛼s. Step 4: Find 𝛼𝛼1 and 𝛼𝛼2 from initial conditions.

  • Page 12 of 15

    Step 5: Write the solution Theorem 4: Let c1, c2 ,…, ck be real numbers. Suppose that the characteristic equation

    rk – c1r

    kβˆ’1 –⋯ – ck = 0

    has t distinct roots r1, r2, …, rt with multiplicities m1, m2, …, mt, respectively so that mi β‰₯ 1 for i = 0, 1, 2, …,t and m1 + m2 + … + mt = k. Then a sequence {an} is a solution of the recurrence relation

    an = c

    1a

    nβˆ’1 + c

    2a

    nβˆ’2 + ….. + c

    k a

    nβˆ’k

    if and only if

    for n = 0, 1, 2, …, where Ξ±

    i,j are constants for 1≀ i ≀ t and 0≀ j ≀ m

    iβˆ’1.

    Example: Suppose that the roots of the characteristic equation of a linear homogeneous recurrence relation are 2, 2, 2, 5, 5, and 9. What is the form of the general solution?

  • Page 13 of 15

    Example: Find the solution to the recurrence relation π‘Žπ‘Žπ‘›π‘› = βˆ’3π‘Žπ‘Žπ‘›π‘›βˆ’1 βˆ’ 3π‘Žπ‘Žπ‘›π‘›βˆ’2 βˆ’ π‘Žπ‘Žπ‘›π‘›βˆ’3 with initial conditions π‘Žπ‘Ž0 = 1, π‘Žπ‘Ž1 = βˆ’2, and π‘Žπ‘Ž2 = βˆ’1. Step 1: Write a characteristic equation of a recurrence relation (CERR).

    π‘Ÿπ‘Ÿπ‘˜π‘˜ βˆ’ 𝑐𝑐1π‘Ÿπ‘Ÿπ‘˜π‘˜βˆ’1 βˆ’ 𝑐𝑐2π‘Ÿπ‘Ÿπ‘˜π‘˜βˆ’2 βˆ’ β‹―βˆ’ π‘π‘π‘˜π‘˜βˆ’1π‘Ÿπ‘Ÿ βˆ’ π‘π‘π‘˜π‘˜ = 0 Step 2: Solve CERR Step 3: Write solution in terms of 𝛼𝛼s. Step 4: Find 𝛼𝛼𝑠𝑠 from initial conditions.

  • Page 14 of 15

    Step 5: Write the solution

    Linear Nonhomogeneous Recurrence Relations with Constant Coefficients. Definition: A linear nonhomogeneous recurrence relation with constant coefficients is a

    recurrence relation of the form: a

    n = c

    1a

    nβˆ’1 + c

    2a

    nβˆ’2 + ….. + c

    k a

    nβˆ’k + F(n)

    ,

    where c1, c

    2, ….,c

    k are real numbers, and F(n) is a function not identically zero depending

    only on n. The recurrence relation a

    n = c

    1a

    nβˆ’1 + c

    2a

    nβˆ’2 + ….. + c

    k a

    nβˆ’k ,

    is called the associated homogeneous recurrence relation.

    Example: The following are linear nonhomogeneous recurrence relations with constant coefficients:

    an = a

    nβˆ’1 + 2

    n

    ,

    an = a

    nβˆ’1 + a

    nβˆ’2 + n

    2 + n + 1,

    an = 3a

    nβˆ’1 + n3

    n ,

    an = a

    nβˆ’1 + a

    nβˆ’2 + a

    nβˆ’3 + n!

    Theorem 5: If {an

    (p)} is a particular solution of the nonhomogeneous linear recurrence

    relation with constant coefficients

    an = c

    1a

    nβˆ’1 + c

    2a

    nβˆ’2 + β‹― + c

    k a

    nβˆ’k + F(n)

    ,

  • Page 15 of 15

    then every solution is of the form {an

    (p) + a

    n

    (h)}, where {a

    n

    (h)} is a solution of the associated

    homogeneous recurrence relation

    an = c

    1a

    nβˆ’1 + c

    2a

    nβˆ’2 + β‹― + c

    k a

    nβˆ’k .

    Example: Find all solutions of the recurrence relation an = 3anβˆ’1 + 2n.

    What is the solution with a1 = 3?