1

I have been trying to solve this

$f(n) = 2 \cdot f(n-1) - f(n-2) + 2 \cdot k$

and failed , can anybody help ? $n>4$

The values of $ f(1) = a,\,f(2) = b,\, f(3) = c$ and $f(4) =d $

where $ a,b,c,d,k $ are constants

EDIT:

This is an example $ a=1/6 ,b =1/3 ,c =1/3 ,d = 1/2 $

$f(5)$ should be $1$

but by constant difference method I am not getting it

and sorry about this .. there is another piece of information $k = f(2) - f(1)$ (always)

P.S $ a,b,c,d $ can have different values than above .. i.e i need a general solution

  • Is $k$ a fixed integer? Do you know the values of $f(0)$ and $f(1)$? – Rory Daulton Jul 04 '15 at 12:24
  • You'll need to include those values to complete the computation. – Michael Burr Jul 04 '15 at 12:25
  • You need only two consecutive starting values (so $f(3)$ and $f(4)$ are redundant), and you should show the recursion more clearly by writing it $f(n)=2f(n-1)-f(n-2)+2k$. – Rory Daulton Jul 04 '15 at 12:26
  • @RoryDaulton I made the changes – User170496 Jul 04 '15 at 12:29
  • Carry all $f$ parts to the left and you will find it's just a linear difference equation with constant coefficients (degenerate) and a constant particular term. Quite a textbook example. You can also look at it from a different perspective: it's a discrete approximation of a second derivative. – orion Jul 04 '15 at 12:31

3 Answers3

1

From the equation it follows that we have,

$$f(n+1)-3f(n)+3f(n-1)-f(n-2)=0$$

The characteristic equation of the above recurrence is given by, $$x^3-3x^2+3x-1=0$$Therefore, $$f(n)=\alpha+n\beta+n^2\gamma$$

By the problem we have (putting successively $n=1,2,3$),

$$a=\alpha+\beta+\gamma$$$$b=\alpha+2\beta+4\gamma$$$$c=\alpha+3\beta+9\gamma$$ which you can easily solve. For the value of $d$ you just need to check whether the solutions of the above three equations are consistent with $$d=\alpha+4\beta+16\gamma$$

  • I gave an example where In the question where $a = 6 , b= 3 ,c =3 , d= 2$ .. according to your equation i get $/alpha = 12 /beta = -15/2 /gamma = 3/2 $ solving $f(4)$ i get $f(4)=6 $ and for $ f=(5) =12 $ , but for that example $f(4)= 2 $ and $ f(5)=1 $ .. – User170496 Jul 04 '15 at 13:37
  • @ShashankGandham: Your example is not consistent with your problem. If you say that $k$ is a constant (possibly after some $N$), you should get an recursion for all $n\ge N$. In your question it is not even told for which $n$'s $f(n)=2f(n-1)-f(n-2)$. –  Jul 04 '15 at 13:40
  • okay .. I made some changes , sorry for the inconvenience .. It is consistent now .. will you have a look again – User170496 Jul 04 '15 at 13:53
  • In that case I think that we need to find $f(5), f(6)$ and $f(7)$ and solve the corresponding equations. –  Jul 05 '15 at 05:36
0

Let $f(n)-f(n-1)=g(n)$. Then, we have $$g(n)-g(n-1)=2k.$$ Hence, we have $$g(n)=g(2)+2k(n-2),$$ i.e. $$f(n)-f(n-1)=f(2)-f(1)+2k(n-2).$$ Hence, for $n\ge 2$, we have $$\begin{align}f(n)&=f(1)+\sum_{i=2}^n\left(f(2)-f(1)+2k(i-2)\right)\\&=f(1)+(n-1)(f(2)-f(1))+2k\cdot\frac{(n-2)(n-1)}{2}\\&=\color{red}{kn^2+(f(2)-f(1)-3k)n+2f(1)-f(2)+2k}\end{align}$$ Note that this holds for $n=1$.

mathlove
  • 139,939
0

$$f(n+1)-2f(n)+f(n-1)=2k$$ This is a finite difference version of $f''(x)=\text{const}$ which has quadratic solutions. In this case, just write $$f(n)=an^2+bn+c$$ and determine the unknown $a$ coefficient ($b$ and $c$ are determined by the initial conditions).

orion
  • 15,781