0

I got such recurrence equation which I cannot solve, I tried with mathematical induction, but I've got information, that this one is not linear and cannot be solve like that. And really have no idea how to do it.

$ \begin{cases} T(1)=1 \\ T(n)=2T(n-1)-4 \end{cases}$

Aaron Maroja
  • 17,571

3 Answers3

1

Compute the first terms of the sequence: $$1 \qquad -2 \qquad -8 \qquad -20 \qquad -44 \dots$$ And then look at the difference between next terms, getting $$3 \qquad 6 \qquad 12 \qquad 24 \qquad \dots$$

This sequence has a very familiar pattern, since you can see that every term is the double of the previous term.

So that the $n$-th terms should be

$$T(n)=1- (3+6+12+ \dots 3 \cdot 2^{n-2}) = 1-3(2^{n-1}-1) = 4 - 3\cdot2^{n-1}$$

After conjectured this, the last thing to do is to check that this is the correct solution: so plug it into the recursive definition of $T(n)$ and check that everything works.

Crostul
  • 36,738
  • 4
  • 36
  • 72
  • Must be isn't really right. It would be better to say that these numerical data very strongly suggest the conjecture that your closed form is correct; properly speaking, it still needs to be proved, e.g., by induction. – Brian M. Scott Feb 20 '15 at 09:19
0

You can use the substitution method:

$$T(n)=2T(n-1) -4 \\ = 2(2T(n-2)-4)-4 \\ = 4T(n-2)-8 \\ = 2(4T(n-3)-4)-8\\ = 8T(n-3)-12\\ = \ ...\\ = 2^kT(n-k)-4k \ \ \ (\mbox{for} \ n\ge k \ge 1) $$

If we set $k=n$, we get: $$T(n)= 2^nT(n-n)-4n = 2^n\overbrace{T(0)}^{1}-4n = 2^n-4n$$

Note: I assumed $T(0)=1$. If you are not allowed to assume that, you can't just set $k=n$.

0

The recurrence can be rewritten as:

$$ T(n) = 2\,T(n-1)-4 \quad\iff\quad T(n)-4=2\cdot\big(T(n-1)-4\big) $$

It follows that $\,T(n)-4\,$ is a geometric progression with common ratio $\,2\,$, so:

$$ T(n)-4 \;=\; 2^{n-1} \cdot\big(T(1) - 4\big) \;=\; -3 \cdot 2^{n-1} $$

dxiv
  • 76,497