2

I'd like to know how to find a general term for this recurrence:

$$a_{n+1}=a_n+(b-a_n)\cdot x, \text{where b, x are positive constants}$$

Background:

Linear interpolation equation for a starting point $a$ and ending point $b$ looks like this: $f(x)=(b-a)\cdot x$. I assume $x \in [0, 1]$. So for $x=1$ we are at the point $b$.

It is used in computer graphics to move things around :) Very often the parameters of the function are swaped, $x$ becomes constant and $a$ is taken from the previous iteration of a recursion. It gives an effect of homographic-function-like approaching to $b$ (there is a horizontal asymptote in $b$).

I want to find an exact solution for $a_n$. If I'm correct the relation is a following recurrence:

$$a_{n+1}=a_{n}+(b-a_n)\cdot x$$

I'm curious about the method to get the solution. Wolfram alpha gave me $$a(n)=c_1(1-x)^{n-1}-b(1-x)^n+b$$

rtybase
  • 16,907
LukeN
  • 53
  • 1
  • 6
  • 1
    Note that $a_n = -qa_{n-1} + kq$. This is a linear, nonhomogenous recurrence relation, for which there are general methods to solve it. Some are done in this video - https://www.youtube.com/watch?v=EfF_XSEX1Sk. If you would like more specific help, you should edit your OP to include the relevant details - including context, what you know, your attempts at the problem, and what exactly is giving you trouble. (MSE dislikes being used as a site where people just expect us to give solutions to your homework and as posted this question looks exactly like that kind of scenario.) – PrincessEev Mar 09 '19 at 09:59
  • Okay, thank you for your tip. I'm writing the context right now. – LukeN Mar 09 '19 at 10:00
  • Try this here $$a_n=c_1 (-q)^{n-1}+\frac{k q \left(1-(-q)^n\right)}{q+1}$$ – Dr. Sonnhard Graubner Mar 09 '19 at 10:02
  • 3
    @Dr.SonnhardGraubner The solution doesn't help if the OP wants to know how to get there. – Toby Mak Mar 09 '19 at 10:13
  • @EeveeTrainer is it a valid question now? ;) – LukeN Mar 09 '19 at 10:43
  • 1
    Seems alright. At least it seems to sufficiently establish from the context that you're not exactly familiar with solving recurrence relations. I maintain that the video I linked would still be a good resource for the general method though, or whatever results you can dig up for solving (non)homogenous linear recurrences (might be a bit of a trawl if you're not familiar with them and depending on how much you need to learn). If I'm feeling up to it (and remember) and no one else has, I might present a write-up specific to this example tomorrow, but for now it's 5 AM for me so I should sleep :p – PrincessEev Mar 09 '19 at 10:49
  • Basically, you want to learn how to solve things like $a_{n+1} = ca_n + d$, where $c,d$ are constants, as Eevee Trainer has pointed out. By the way, do you know the geometric series formula? – Minus One-Twelfth Mar 09 '19 at 10:53

2 Answers2

1

This is equivalent to $$a_{n+1}=(1-x)a_{n}+b\cdot x$$ which can be solved using characteristic polynomials. In fact, you can use this ready-to-use result for $$a_{n+1}=pa_n+q$$ where $p=(1-x)$ and $q=bx$. The result is $$a_n=A+B\cdot p^n=A+B\cdot (1-x)^n$$ where $A,B$ are some constants depending on $a_0$. Further in that link $$a_n=-\frac{q}{p-1}+\left(a_1+\frac{q}{p-1}\right)p^{n-1}=\\ \frac{bx}{x}+\left(a_1-\frac{bx}{x}\right)(1-x)^{n-1}= \color{red}{b+\left(a_1-b\right)(1-x)^{n-1}}=\\ b+\left((1-x)a_0+bx-b\right)(1-x)^{n-1}=\color{red}{b+\left(a_0-b\right)(1-x)^n}=\\ a_0(1-x)(1-x)^{n-1}-b(1-x)^n+b$$ where $c_1=a_0(1-x)$-constant. I don't know how Wolfram alpha decides on these constants.

rtybase
  • 16,907
0

This is a so-called arithmetico-geometric sequence.

Notice that

$$a_{n+1}-b=a_n-b+(b-a_n)x=(1-x)(a_n-b).$$

Then by induction,

$$a_n-b=(1-x)^n(a_0-b),$$

or

$$a_n=(1-x)^n(a_0-b)+b.$$

Except when $x=1$, $a_n$ tends to $b$.