Skip to main content
Logo image

Section Recursive functions

[provisional cross-reference: WORK-IN-PROGRESS]
We often use subscript notation when the function is a recursive function, where we rely on knowing previous values in order to compute the next value, as in the example below. Example: Suppose \(a_{n+1} = 3a_{n} + 2\) and \(a_0 = 3.\)
  1. Find the value of \(a_1.\)
    Answer.
    \(a\)\(n+1,\)\(a\)\(n\)\(a\)\(n=0,\)\(a_0 = 3.\)\(a\)\(n = 1\)
    \begin{align*} a_1 \amp = 3a_0 + 2\\ \amp = 3\cdot 3 + 2\\ \amp = 11. \end{align*}
  2. Find the value of \(a_4.\)
    Answer.
    \(n = 3,\)
    \begin{equation*} a_{4} = 3a_{3} + 2. \end{equation*}
    \(a_3\text{...}\)\(a_3\)\(a_2\text{...}\)\(a_1\)
    \begin{align*} a_2 \amp = 3a_1 + 2\\ \amp = 3\cdot 11 + 2\\ \amp = 35\\ \amp\\ a_3 \amp = 3a_2 + 2\\ \amp = 3\cdot 35 + 2\\ \amp = 107\\ \amp\\ a_4 \amp = 3a_3 + 2\\ \amp = 3\cdot 107 + 2\\ \amp = 323. \end{align*}
The bottom line with recursive functions is that if we know \(a_0,\) we can find \(a_1,\) and then we can find \(a_2,\) and so on. But if we want to know \(a_{17},\) for example, we need to know ALL of the previous \(a\)-values \(a_0, a_1, a_2, \ldots , a_{16}\text{.}\)
Answer.
Now you try:
Given the definition of a recursive function in subscript notation, find the value of the given term.
  1. If \(a_{n+1} = a_n - 2\) and \(a_0 = 16,\) evaluate \(a_3.\)
    Solution.
    \begin{align*} n = 0: a_1 \amp = a_0 - 2\\ \amp = 16 - 2\\ \amp = 14\\ \amp\\ n = 1: a_2 \amp = a_1 - 2\\ \amp = 14 - 2\\ \amp = 12\\ \amp\\ n = 2: a_3 \amp = a_2 - 2\\ \amp = 12 - 2\\ \amp = 10 \end{align*}
    Answer.
    \begin{equation*} a_3 = 10 \end{equation*}
  2. If \(y_{n+1} = \sin(y_n)\) and \(y_0 = 0,\) evaluate \(y_4.\)
    Solution.
    \begin{align*} n = 0: y_1 \amp = \sin(y_0)\\ \amp = \sin(0)\\ \amp = 0\\ \amp\\ n = 1: y_2 \amp = \sin(y_1)\\ \amp = \sin(0)\\ \amp = 0\\ \amp\\ n = 2: y_3 \amp = \sin(y_2)\\ \amp = \sin(0)\\ \amp = 0\\ \amp\\ n = 3: y_4 \amp = \sin(y_3)\\ \amp = \sin(0)\\ \amp = 0 \end{align*}
    Answer.
    \begin{equation*} y_4 = 0 \end{equation*}
  3. If \(x_{n+1} = x_n^2 - x_n\) and \(x_0 = 5,\) evaluate \(x_2.\)
    Solution.
    \begin{align*} n = 0: x_1 \amp = x_0^2 - x_0\\ \amp = 5^2 - 5\\ \amp = 20\\ \amp\\ n = 1: x_2 \amp = x_1^2 - x_1\\ \amp = 20^2 - 20\\ \amp = 380 \end{align*}
    Answer.
    \begin{equation*} x_2 = 380 \end{equation*}
You have attempted of activities on this page.