How can I solve a recurrence relation given as $$x(n)=\begin{cases} 2 x(n-1)+1 &n=\text{odd}\\2 x(n-1) & n=\text{even}\end{cases}$$ I know how to solve them individually,$x(n)=a(2^n)$,where $a$=constant (for homogenous part) and $x(n)$=some constant (for non-homogenous part);ie total solution is $$x(n)=a.2^n+b$$ $a$,$b$ constants. But how to combine them together to find an integrated solution? Please help. The solution has been given as:$x(n)=(2/3) 2^n-(1/6)(-1)^n-(1/2)$
Asked
Active
Viewed 76 times
1 Answers
0
The inhomogeneous part is not a constant. The recurrence is
$$x_n - 2 x_{n-1} = \frac{1}{2} [1-(-1)^n]$$
Therefore the inhomogeneous solution $x_n^{(I)}$ is of the form $A + B (-1)^n$. Substitute that into the equation and determine $A$ and $B$.
Ron Gordon
- 138,521
-
@user71067: if this helped you, please accept the solution by clicking on the checkmark below the number of upvotes. – Ron Gordon Apr 05 '13 at 13:58
-
this was very very useful. – user71067 Apr 06 '13 at 02:31