How to prove this property?

77 Views Asked by At

I tried generalising algorithms such as "some number x is quadrupled, and then 6 is added". What's the value of x after n iterations of the algorithm?

So I was able to express this algorithm as a linear equation $f(x)=4x+6$ then using composition of function I generalized this to find value of x after n iterations: $f^n(x)=4^nx+2(4^n-1)$. I was able to do the same for the "some number x is doubled and then 3 is added" and I got for $f^n(x)=2^n+3(2n-1)$. so by inputting $n$, I get any term of the algorithm.

To find the nth term of the algorithm, using these two generalizations I wanted to generalize the "some number $x$ is multiplied by $a$ and then $b$ is added" as:

$$f^n(x)=a^nx+{b*\frac{a^n-1}{r-1}}\tag{1}$$ where $r$ is a common ratio of the sequence and $\frac{a^n-1}{r-1}$ is the sum of the geometric sequence that arises when I was rewriting those two first algorithms as an equation.

As I was able to prove the first two equations by mathematical induction I got stuck on (1)

The question is how do I prove the (1) property for any algorithm that can be defined as $f(x)=ax+b$ from the algorithm "some number is is multiplied by $a$ and then $b$ is added

1

There are 1 best solutions below

3
On

Let's assume $$f^n(x)=:a_n=b\cdot\sum_{k=0}^na^k=b\cdot\frac{1-a^{n+1}}{1-a}$$ then $$a\cdot a_n+b=a\cdot b\cdot\sum_{k=0}^na^k+b=b\cdot\sum_{k=0}^na^{k+1}+b=b\cdot\sum_{k=0}^{n+1}a^k=a_{n+1}$$ as you claimed.