Skip to main content

Section 5.2 Recurrence Relation

Subsection 5.2.1 Examples

Problem 5.2.1.

Suppose for \(n\) dimensions there is one more way to construct a Cantor type set than in \(n-1\) dimensions.

  1. Write an expression for the number of Cantor type sets in \(n\) dimensions.

  2. Now suppose that there is only one Cantor type set in one dimension. How many are there in 2,3, and 4 dimensions?

  3. Supposing there is only one Cantor type set in one dimension how many are there in 37 dimensions?

Solution.

\(C_n = C_{n-1} + 1\)

\(C_1 = 1 , C_2 = 2, C_3 =3, C_4 = 4\)

\(C_{37} = 37\)

Problem 5.2.2.

Suppose for some count the number of options at step \(n+1\) is the number of options at step \(n\) plus \((n+1)\text{.}\)

  1. Write an expression for the number of options at step \(n+1\text{.}\)

  2. Now suppose there are 2 options for \(n=1\text{.}\) How many options are there for \(n=2,3,4, 27\text{?}\)

Solution.

We know that the number of options at step (n + 1) is equal to the number of options at step n plus (n + 1). Let m equal the number of options at step n.

By turning words into variables, the expression is \(m + n + 1\text{.}\) Another way to write this is \(a_{n + 1} = a_n + (n + 1)\) where \(a_{n + 1}\) is the number of options at step \(n + 1\) and \(a_n\) is the number of options at step n.

If there are \(2\) options for \(n = 1\text{,}\) then we use the expression above:

\(a_{n + 1} = a_n + (n + 1)\) becomes \(a_2 = 2 + 2 = 4\) when \(n = 1\text{.}\)

Similarly, we plug in \(n = 2\) to find that \(a_3 = 4 + 3 = 7\) since \(a_n = 4\) from the previous line.

We repeat this process to find that \(a_4 = 11\) and \(a_5 = 16\text{.}\) Note that we are simply adding the number of the current step to the number of options at the previous step (please note the difference between "number" and "number of options"). Following the logic, we know that at step 27 we will be adding 27 to the number of options at 26, which is 26 added to the number of options at 25, and so on down to adding 2 to the number of options at step 1.

This result in \(2 + 3 + 4 + \ldots + 25 + 26 + 27\text{.}\) We can plug this into a calculator, or we can use the following expression.

\((\frac{n \cdot (n + 1)}{2}) - 1\text{.}\) Suppose we add 1 to the sum above. We can then pair the first and last numbers (1 and 27, which add to 28), then the second and second-to-last numbers (2 and 26, which add to 28), and so on. When we pair all the numbers we find ourselves with a sum of 28's that is half of 27 digits long. Thus, we divide \(n\) by 2, multiply it by \(n + 1\text{,}\) then subtract 1 to find the result of our original sum.

Problem 5.2.3.

Tom the turkey can walk one step or jump two steps forward.

  1. From which steps can he reach the fifth step?

  2. From which steps can he reach the \(n\)th step?

  3. How many ways can he reach the first step? second step?

  4. Calculate the number of ways he can reach the third, fourth, and fifth steps.

Solution.
  1. From which steps can he reach the fifth step?

    Since Tom can only move in a forward direction whether he walks or jumps, he can reach the fifth step starting from any preceding step with the appropriate sequence of walks and/or jumps.

  2. From which steps can he reach the nth step?

    By the same logic in the preceding question, Tom can reach any number of steps by applying the appropriate sequence of walks and/or jumps.

    If Tom was looking for a way to get to step n in the least amount of moves possible, it would behoove him to adhere to the following relations.

    • If the number of the goal step is even, starting from base step Tom can make

      \begin{equation*} n/2 \end{equation*}

      jumps to that step

    • If the number of the goals step is odd, starting from the base step Tom can reach the step with

      \begin{equation*} (n-1)/2 \end{equation*}

      jumps plus one walk.

  3. How many ways can he reach the first step? Second step?

    Tom can only reach the first step by walking one step from step 0. \(a_1 = 1\)

    Tom can reach the first step by walking two steps, or jumping once. So there are two ways for Tom to reach step 2. \(a_2 = 2\)

  4. Calculate the number of ways he can reach the third, fourth, and fifth steps.

    Let T(n) denote the number of ways to reach the nth step. We can form a relation by \(T(n) = T(n-1) + T(n-2)\text{,}\) where n is the goal step number, \(T_1 = 1\) and \(T_2 = 2\text{.}\)

    Thus,

    • \(\displaystyle T(3) = T(3-1) + T(3-2) = T(2) + T(1) = 2 + 1 = 3\)

    • \(\displaystyle T(4) = T(4-1) + T(4-2) = T(3) + T(2) = 3 + 2 = 5\)

    • \(\displaystyle T(3) = T(5-1) + T(5-2) = T(4) + T(3) = 5 + 3 = 8\)

Problem 5.2.4.

Start with a blank piece of paper. At each step draw one line that intersects each of the previous lines, but no three lines intersect at one point. Find a recurrence relation for the number of regions into which the paper is divided.

Solution.
Lines Sections
1 2
2 4
3 7
4 11
5 16

For every line, we add the amount of current lines and the one added to get the amount of sections on the paper.

The recurrence relation is: \(a_n = a_{n-1} + (n+1)\)

Here is an example of what the page would look like at \(a_3\) which has 3 lines and 7 sections.

Problem 5.2.5.

A ternary sequence is a sequence consisting of the digits 0,1, and 2.

  1. Find a recurrence relation for the number of \(n\) digit, ternary sequences.

  2. Find a recurrence relation for the number of \(n\) digit, ternary sequences where no two, consecutive digits are the same.

  3. Find a recurrence relation for the number of \(n\) digit, ternary sequences that do not contain 00.

  4. Find a recurrence relation for the number of \(n\) digit, ternary sequences that do not contain 012.

Problem 5.2.6.

How many ways can you fill \(n\) parking spaces (in a line) if a car takes one parking space and a truck takes two parking spaces?

Solution.

This problem is solved in the same manner as ProblemĀ 5.2.3. Here, parking a car is equivalent to Tom the Turkey taking one step forward. Parking a truck is equivalent to Tom the Turkey jumping two steps forward. So we again obtain the Fibonnaci sequence, \(p_n = p_{n-1} + p_{n-2}\text{,}\) with initial terms \(p_0 = p_1 = 1\text{.}\)

Subsection 5.2.2 Model

Problem 5.2.7. Solutions to Recurrence Relations.

Consider the recurrence relation \(a_n=a_{n-1}+6a_{n-2}\text{.}\) Suppose for some number \(\alpha_0\) that \(a_{n-2}=\alpha_0^{n-2}\text{,}\) and \(a_{n-1}=\alpha_0^{n-1}\) are solutions to the recurrence relation.

  1. Show that \(\alpha_0^n=\alpha_0^{n-1}+6\alpha_0^{n-2}\) is a solution to the recurrence relation.

  2. Simplify the equation \(\alpha_0^n=\alpha_0^{n-1}+6\alpha_0^{n-2}\) and find all solutions \(\alpha_0\text{.}\)

  3. Let \(\alpha_1\text{,}\) \(\alpha_2, \ldots\) be all solutions to the equation above. Generate the first five terms of \(\alpha_i^n=\alpha_i^{n-1}+6\alpha_i^{n-2}\text{.}\) Check that they satisfy the recurrence relation.

Solution.
  1. Firstly, let's consider the fact that since \(a_{n-2} = b_{0}^{n-2}\text{,}\) \(b_{0}^{n-2} = (a_n - a_{n-1})/6\text{.}\) Also, since \(a_{n-1} = b_{0}^{n-1}\text{,}\) \(b_{0}^{n-1} = a_n - 6a_{n-2}\text{.}\) Thus, by substitution and solving for \(b_{0}^n\) we find that \(b_{0}^n = b_{0}^{n-1} + 6b_{0}^{n-2}\) truly is a solution to the recurrence relation a_n.

  2. Solutions

  3. Consider the fact that we found three solutions for \(b_{0}\text{.}\) We find \(b_{0} = 0\) to be trivial and thus focus on the \(b_{0} = -2\) and \(b_{0} = 3\) solutions.

Problem 5.2.8. Linearity of Solutions.

Consider the recurrence relation \(a_n=a_{n-1}+6a_{n-2}\text{.}\) Let \(\alpha_1\text{,}\) \(\alpha_2, \ldots\) be all solutions to \(\alpha_0^n=\alpha_0^{n-1}+6\alpha_0^{n-2}\text{.}\)

  1. For each \(\alpha_i\) generate the first five terms of the sequence determined by \(2\alpha_i^n\text{.}\) Check that they satisfy the recurrence relation.

  2. Show that if \(k\alpha_0^{n-1}\) and \(k\alpha_0^{n-2}\) satisfy the recurrence relation that \(k\alpha_0^n\) satisfies the recurrence relation.

  3. For any two, non-trivial \(\alpha_i\) generate the first five terms of the sequence determined by \(\alpha_1^n+\alpha_2^n\text{.}\) Check that they satisfy the recurrence relation.

  4. Show that if \(\alpha_1^{n-1}\text{,}\) \(\alpha_1^{n-2}\) and \(\alpha_2^{n-1}\text{,}\) \(\alpha_2^{n-2}\) satisfy the recurrence relation that \(\alpha_1^n+\alpha_2^n\) satisfies the recurrence relation.

Problem 5.2.9. Initial Conditions.

Consider the recurrence relation \(a_n=a_{n-1}+6a_{n-2}\text{.}\) Let \(\alpha_1\text{,}\) \(\alpha_2, \ldots\) be all solutions to \(\alpha_0^n=\alpha_0^{n-1}+6\alpha_0^{n-2}\text{.}\) According to the previous problem \(a_n=A_1\alpha_1^n+A_2\alpha_2^n\) are solutions to the recurrence relation.

  1. If \(a_0=2\) and \(a_1=1\) what are \(A_1\) and \(A_2\text{?}\) Write the first five terms of this sequence.

  2. If \(a_0=1\) and \(a_1=13\) what are \(A_1\) and \(A_2\text{?}\) Write the first five terms of this sequence.

Solution 1.
\begin{equation*} a_n = a_{n-1} + 6a_{n-2} \end{equation*}
\begin{equation*} a^n - a^{n-1} - 6a^{n-2} = 0 \end{equation*}
\begin{equation*} a^{n-2}(a^2 - a - 6) = 0 \end{equation*}

We can factor the polynomial.

\begin{equation*} a^{n-2}(a - 3)(a + 2) = 0 \end{equation*}

The solutions for \(a\) are \(a=0, a=3, a=-2\text{.}\) Since \(a=0\) is a trivial solution, we'll only utilize the latter two.

\begin{align*} a_n & = A_1(\alpha_1)^n + A_2(\alpha_2)^n\\ & = A_1(3^n) + A_2(-2^n) \end{align*}

We'll use the initial conditions provided, \(a_0=2\) and \(a_1=1\text{.}\)

\begin{equation*} 2 = A_1(3^0) + A_2(-2^0) \end{equation*}
\begin{equation*} A_1 = 2 - A_2 \end{equation*}
\begin{equation*} (2 - A_2)(3^1) + A_2(-2^1) = 1 \end{equation*}

Which ultimately results in

\begin{equation*} A_1 = 1 \end{equation*}
\begin{equation*} A_2 = 1 \end{equation*}

The first 5 terms of the sequence are 2, 1, 13, 19, 97.

Now, \(a_0=1\) and \(a_1=13\text{.}\)

\begin{equation*} 1 = A_1(3^0) + A_2(-2^0) \end{equation*}
\begin{equation*} a_1 = 1 - A_2 \end{equation*}
\begin{equation*} (1 - A_2)(3^1) + A_2(-2^1) = 13 \end{equation*}

Which ultimately results in \(a_1 = 3\) \(a_2 = -2\) The first 5 terms of the sequence are 1, 13, 19, 97, 211.

Solution 2.

Recall that the solutions we found in the previous steps were \(\alpha_0=0,\alpha_1=-2,\) and \(\alpha_2=3\text{.}\) We also found that the solutions to the recurrence relation \(\alpha_0^{n}=\alpha_0^{n-1}+6\alpha_0^{n-2}\) are of the form \(A_1\alpha_1^{n}+A_2\alpha_2^{n}=A_1\cdot(-2)^{n}+A_2\cdot(3)^{n}\text{.}\) Now, given some initial conditions, we will attmpt to solve for \(A_1\) and \(A_2\text{.}\)

  1. Suppose that \(a_0=2\) and \(a_1=1\text{.}\) Write the first five terms of this sequence. By substituting \(n=0\) and \(n=1\) and setting them equal to the terms in the hypothesis, we receive:

    \begin{equation*} A_1+A_2=1 \end{equation*}

    and

    \begin{equation*} -2 \cdot A_1+3 \cdot A_2=1 \end{equation*}

    Solving the linear system we receive \(A_1=1\) and \(A_2=1\text{.}\) Thus the terms of the series are generated by the solution \((-2)^{n}+3^{n}\text{.}\) The first five terms of the series are:

    1. \(\displaystyle a_0=(-2)^{0}+3^{0}=2\)

    2. \(\displaystyle a_1=(-2)^{1}+3^{1}=1\)

    3. \(\displaystyle a_2=(-2)^{2}+3^{2}=13\)

    4. \(\displaystyle a_3=(-2)^{3}+3^{3}=19\)

    5. \(\displaystyle a_4=(-2)^{4}+3^{4}=97\)

    6. \(\displaystyle a_5=(-2)^{5}+3^{5}=211\)

  2. Suppose that \(a_0=1\) and \(a_1=13\text{.}\) Write the first five terms of this sequence. By substituting \(n=0\) and \(n=1\) and setting them equal to the terms in the hypothesis, we receive:

    \begin{equation*} A_1+A_2=1 \end{equation*}

    and

    \begin{equation*} -2 \cdot A_1+3 \cdot A_2=13 \end{equation*}

    Solving the linear system we receive \(A_1=-2\) and \(A_2=3\text{.}\) Thus the terms of the series are generated by the solution \(-2 \cdot (-2)^{n}+3 \cdot 3^{n}\text{.}\) The first five terms of the series are:

    1. \(\displaystyle a_0=-2 \cdot (-2)^{0}+3 \cdot 3^{0}=1\)

    2. \(\displaystyle a_1=-2 \cdot (-2)^{1}+3 \cdot 3^{1}=13\)

    3. \(\displaystyle a_2=-2 \cdot (-2)^{2}+3 \cdot 3^{2}=19\)

    4. \(\displaystyle a_3=-2 \cdot (-2)^{3}+3 \cdot 3^{3}=97\)

    5. \(\displaystyle a_4=-2 \cdot (-2)^{4}+3 \cdot 3^{4}=211\)

    6. \(\displaystyle a_5=-2 \cdot (-2)^{5}+3 \cdot 3^{5}=793\)

    The canny observer will note that this is a shift in index of the sequence in the first part of the question. The first term in sequence 1 becomes the 0th term of sequence two, the second term in sequence 1 becomes the first term in sequence 2, and so on.

Subsection 5.2.3 Problems

Problem 5.2.10.

Use the method above to find all solutions to the recurrence relation \(a_n=2a_{n-1}+3a_{n-2}\text{.}\)

Problem 5.2.11.

Use the method above to find all solutions to the recurrence relation \(a_n=a_{n-1}+a_{n-2}\text{.}\)

Solution.

I will preface the solution by observing that the recurrence relation provided generates the well-known Fibonacci sequence 0,1,1,2,3,5,8... We will begin by rewriting \(a_n = a_(n-1) + a_(n-2)\) in powers of n.

\begin{equation*} a^n = a^{n-1} + a^{n-2} \end{equation*}
\begin{equation*} a^n - a^{n-1} - a^{n-2} = 0 \end{equation*}

Now we factor out \(a^(n-2)\text{.}\)

\begin{equation*} a^{n-2}(a^2 - a - 1) = 0 \end{equation*}

The polynomial cannot be factored, so we will employ the quadratic formula.

\begin{equation*} = \frac{-(-1) \pm \sqrt{(-1)^2 - 4(1)(-1)}}{2(1)} \end{equation*}
\begin{equation*} = \frac{1 \pm \sqrt{5}}{2} \end{equation*}

Note that \(\frac{1+\sqrt{5}}{2}\) is the golden ratio.

\begin{equation*} a_n = A_1(\alpha_1)^n + A_2(\alpha_2)^n \end{equation*}
\begin{equation*} = A_1\left(\frac{1+\sqrt{5}}{2}\right)^n + A_2\left(\frac{1-\sqrt{5}}{2}\right)^n \end{equation*}

Since we know that the recurrence relation is the Fibonacci sequence, the expected initial values are \(a_0 = 0\) and \(a_1 = 1\text{.}\) With that information, we can solve for \(A_1\) and \(A_2\text{.}\)

\begin{equation*} a_1\left(\frac{1+\sqrt{5}}{2}\right)^0 + A_2\left(\frac{1-\sqrt{5}}{2}\right)^0 = 0 \end{equation*}
\begin{equation*} a_1 + A_2 = 0 \end{equation*}
\begin{equation*} a_1 = -A_2 \end{equation*}
\begin{equation*} -A_2\left(\frac{1+\sqrt{5}}{2}\right)^1 + A_2\left(\frac{1+\sqrt{5}}{2}\right)^1) = 1 \end{equation*}

Which ultimately results in

\begin{equation*} a_1 = \frac{1}{\sqrt5} \end{equation*}
\begin{equation*} a_2 = -\frac{1}{\sqrt5} \end{equation*}

So a closed form for the original recurrence relation is

\begin{equation*} a_n = \frac{1}{\sqrt{5}}\left(\frac{1+\sqrt{5}}{2}\right)^n - \frac{1}{\sqrt{5}}\left(\frac{1-\sqrt{5}}{2}\right)^n \end{equation*}

Problem 5.2.12.

Use the method above to find all solutions to the recurrence relation \(a_n=6a_{n-1}-9a_{n-2}\text{.}\) Note if a root \(\alpha_0\) is repeated, then use linear combinations of \(\alpha_0^n\text{,}\) \(n\alpha_0^n\text{,}\) \(n^2\alpha_0^n, \ldots\) \(n^r\alpha_0^n\)where the root is repeated \(r\) times.

Problem 5.2.13.

Tom the turkey can walk one step or jump two steps forward. Find a solution to the recurrence relation for this problem.