I'd like to use Mathematica to verify the solution to a recurrence equation. I have the following equation:
$Q_{k+1} = Q_k + \alpha(r_{k+1} - Q_k)$.
I also have a derivation showing how to obtain a solution for any $k$:
$Q_k = Q_{k-1} + \alpha(r_k - Q_{-1})$
$\ \ \ \ = \alpha r_k + (1 - \alpha)Q_{k-1}$
$\ \ \ \ = \alpha r_k + (1 - \alpha)\alpha r_{k-1} + (1 - \alpha)^2Q_{k-2}$
$\ \ \ \ = (1 - \alpha)^kQ_0 + \sum_{i=1}^k\alpha (1 - \alpha)^{k-i}r_i$,
where $Q_0$ is some arbitrary constant. However, when I use RSolve
, I get a different answer.
RSolve[Q[k] == Q[k - 1] + \[Alpha] (Subscript[r, k] - Q[k - 1]), Q[k], k]
gives me the solution:
$(1 - \alpha)^{k-1}\mathbb{c}_1+(1-\alpha)^{-1+k}\sum_{K[1]=0}^{-1+k}(1-\alpha)^{-K[1]}\alpha r_{1+K[1]}.$
This is close but not exactly what I want. So what am I missing here?