Give a recursive definition with initial condition...how did they get the answer?

3.5k Views Asked by At

The function $f (n) = 5n + 2, n = 1, 2, 3, \ldots $

Im sure its a simple problem, but im really confused...how did they get the answer ? could someone explain

$f (n) = f (n - 1) + 5, f (1) = 7$

thank you

2

There are 2 best solutions below

0
On BEST ANSWER

Since it's recursive, it makes sense for $f(n)$ to be somehow related to $f(n-1)$. Of course, you need to start somewhere, so you might as well define $f(1)$.

Note that the original function satisfies $f(1) = 7$, and that when $n$ increases by $1$, we add $5$ to the function.

That is: $f(n+1) = 5(n+1) + 2 = 5n + 5 + 2 = (5n + 2) + 5 = f(n) + 5$.

Now replace $n+1$ above with $n$.

0
On

To get $f(n)$ from $f(n-1)$ you add $5$. So the function must have the form $f(n) = 5n+c$, where $c$ is some constant to be determined. Since you know $f(1)$, you can figure out $c$.

In particular, $f(1) = 5+c = 7$, so $c=2$. Hence the function is $f(n) = 5n +2$.