0

$$a_n=3a_{n-1}+1; a_0=1$$

The book has the answer as: $$\frac{3^{n+1}-1}{2}$$

However, I have the answer as: $$\frac{3^{n}-1}{2}$$

Based on:

enter image description here

Which one is correct?

Using backwards substitution iteration, the end of this will be $$3^{n-1}a_0+3^{n-2}+3^{n-3}+...+3+1$$

which is $$=3^{n-1}+3^{n-2}+3^{n-3}+...+3+1=\sum_{i=0}^{n-1}3^i$$

Which according to the theorem should be $$\frac{3^{(n-1)+1}-1}{(3-1)}=\frac{3^{n}-1}{2}$$

user5826
  • 12,524

5 Answers5

1

First note that "backwards substitution" is not a great way to solve this sort of thing, there are much better methods which I assume you will learn at some stage in your course.

However if you want to do it this way you can, only your working is not accurate. Try this: $$\eqalign{a_n &=3a_{n-1}+1\cr &=3(3a_{n-2}+1)+1\cr &=3^2a_{n-2}+3+1\cr &=\cdots\cr &=3^ka_{n-k}+3^{k-1}+\cdots+3+1\cr &=\cdots\cr &=3^na_0+3^{n-1}+3^{n-2}+\cdots+3+1\cr &=3^n+3^{n-1}+3^{n-2}+\cdots+3+1\cr &=\frac{3^{n+1}-1}{2}\ .\cr}$$ The third last line is where you went wrong, you stopped one step too soon.

David
  • 84,708
  • 9
  • 96
  • 166
  • I think the the first term on the third to the last line should be $3^{n-1}$ since that line would be $a_1$ – user5826 Apr 16 '14 at 00:15
  • You could do that, but it would be $3^{n-1}a_1$, not $3^{n-1}a_0$ as in your answer. Then you could go one step further by substituting $a_1=3a_0+1$. – David Apr 16 '14 at 00:18
  • Is there a name to the better method? – user5826 Apr 16 '14 at 00:20
  • The problem is called a non-homogeneous recurrence relation. If you use the search box you will find many references to it on MSE, here and here for example. – David Apr 16 '14 at 00:24
  • I don't understand why we have $3^n$ if we are making $n-1$ substitutions. – user5826 Apr 16 '14 at 00:33
  • We are making $n$ substitutions. Suggestion: write out the whole procedure to get from $a_3$ down to $a_0$. You will see that you have to make three substitutions, not two, and the answer will involve $3^3a_0$, not $3^2a_0$. – David Apr 16 '14 at 00:36
  • I made two substitutions. We subbed $a_2$ to express $a_n$ in terms of $a_1$, then we subbed $a_1$ to express $a_n$ in terms of $a_0$. – user5826 Apr 16 '14 at 00:55
  • But first you substituted $a_3=3a_2+1$ to get $a_3$ in terms of $a_2$. This is a substitution even though it's given. (Perhaps it would be better to use a different word, maybe "reduction" instead of "substitution".) And in any case, when you did the algebra, what did you get at the end, $3^2a_0$ or $3^3a_0$? – David Apr 16 '14 at 00:59
  • thats right. $3^3a_0+3^2+3+1$ – user5826 Apr 16 '14 at 01:05
  • Exactly! If you substitute $n=3$ in your original answer you get $3^2a_0+3+1$, which as you can see is not correct. – David Apr 16 '14 at 01:08
1

Write $b_n= a_n +\alpha$ and find $\alpha$ such that the recurrence reduces to $b_{n+1}=3b_n$. You'll find that $\alpha=1/2$ works. Then of course $b_n=3^nb_0=3^n(a_0+\alpha)$ and $a_n=b_n-\alpha=3^na_0+(3^n-1)\alpha$.

lhf
  • 221,500
0

Your answer is incorrect, since it fails for $n=0$.

user141421
  • 2,566
0

According to yours $$a_0=0$$ so the book's is correct.

  • there is another example in another section similar to this but instead the example says $H_n=2H_{n-1}+1$. The answer was $2^n-1$. I don't get it. – user5826 Apr 16 '14 at 00:07
  • @Lanfranco Then probably they had $H_0=0$. It all depends on the initial condition (don't worry it messes me up all the time two). –  Apr 16 '14 at 00:08
  • initial condition was $H_1=1$ – user5826 Apr 16 '14 at 00:11
  • @Lanfranco That is roughly the same. If $H_1=1$ then we could say that $H_0=(H_1-1)/2=0/2=0$. The point is that the initial condition is what determines the "loose constants" in the closed formula for any recurrence. –  Apr 16 '14 at 00:33
0

Ok your answer is correct, but you have the formula for the $(n-1)$-term, if you need the formula for the $n$-term, then note that, according to recurrence

$$a_n=3a_{n-1}+1$$

You have that $$a_{n-1}=\frac{3^n-1}{2}$$ then: $$a_n=3\cdot\frac{3^n-1}{2}+1=\frac{3^{n+1}-1}{2}$$

God bless