# Difference equation

1. Oct 12, 2005

### Benny

Hi, I've been working on a difference equation and I just can't get the answer. Can someone checking my working?
$$w_{n + 1} = 2w_n + 1$$
w_1 = 2w_0 + 1
w_2 = 2w_1 + 1 = 2(2w_0 + 1) + 1 = 2^2w_0 + 1 + 2^1
$$\Rightarrow w_n = 2^n w_0 + \sum\limits_{i = 0}^{n - 1} {2^i } = 2^n w_0 + \sum\limits_{i = 0}^n {2^i } - 2^n = 2^n w_0 + \frac{{1 - 2^{n + 1} }}{{1 - 2}} - 2^n$$

$$w_n = 2^n w_0 ' + 2^{n + 1} - 1 - 2^n = 2^n \left( {w_0 ' - 1} \right) + 2^{n + 1} - 1$$...I have written w_0 with a dash so as to enable me to get a 'nicer' looking answer. It is a little ambiguous but hopefully people understand what I've done. I've simply taken 2^n as a common factor of two of the terms so that I get 2^n multipled by something. In the next line I replace that 'thing' by w_0.

$$w_n = 2^n w_0 + 2^{n + 1} - 1$$

Where I have used a primed w_0 so that I could get an answer which resembles the book's. The book's answer is the same as mine except where I have a negative one, it has a negative two. I don't know where I'm going wrong. Can someone help me out?

Last edited: Oct 12, 2005
2. Oct 12, 2005

### arildno

Your answer is incorrect, since your formula predicts $$w_{0}=2^{0}w_{0}+2-1=w_{0}+1$$
Similarly $$w_{1}=2w_{0}+2^{2}-1=2w_{0}+3$$

You have correctly found:
$$w_{n}=2^{n}w_{0}+2^{n+1}-1-2^{n}$$
Rewrite this as follows:
$$2^{n}w_{0}+2^{n+1}-1-2^{n}=w_{0}2^{n}+2^{n}(2-1)-1=w_{0}2^{n}+2^{n}-1=2^{n}(w_{0}+1)-1$$

3. Oct 12, 2005

### Benny

Thanks for the help but I still don't understand how the book got $$w_n = 2^{n + 1} - 2 + 2^n v_0$$ (I've typed the answer exactly as it is given with the v_0 and not the w_0). Is my corrected answer(the one you included in your reply) somehow equivalent to the book's answer? Or is it possble to get 'different' general solutions depending on the solution procedure?

Last edited: Oct 12, 2005
4. Oct 12, 2005

### arildno

Your difference equation says that $$w_{1}=2w_{0}+1$$
but their formula says: $$w_{1}=2^{2}-2+2w_{0}=2+2w_{0}$$