I'm studying recurrence relations and am given:
$T(n) = 2 \cdot T(n-1) - 1$
with an initial condition that $T(1) = 3$.
I worked through the first few recurrences:
$T(n-1) = 2^2 \cdot T(n-2) - 2 - 1$
$T(n-2) = 2^3 \cdot T(n-3) - 2^2 - 2 - 1$
and so forth, and came the conclusion that the pattern
$2^k \cdot T(n-k) - 2^{k-1} - 2^{k-2} - ... 2 - 1$
represents this relation. Since we have T(1) = 3, there must be some $n$ and $k$ such that $n-k = 1$, so $k= n - 1$. Substituting:
$2^{n-1} \cdot T(1) - 2^{n-2} - 2^{n-3} - ... 2 - 1$
but T(1) = 3, so...
$2^{n-1} \cdot 3 - 2^{n-2} - 2^{n-3} - ... 2 - 1$
Factoring out a $-1$ I have something that looks for all the world like a geometric progression:
$2^{n-1} \cdot 3 - (1 + 2 + ... + 2^{n-3} + 2^{n-2})$
However, I'm convinced my progression is missing a term, namely $2^{n-1}$. It's outside the progression, being multiplied by three. In my notes, my instructor simplified the progression to:
$\frac{2^{n-1} - 1}{2 - 1}$
I'm confused about where $n-1$ in the exponent of the geometric progression simplification is coming from. I eventually solve the recurrence relation as :
$3 \cdot 2^{n-1} - 2^{n-1} + 1 = 2^n + 1$
Is my understanding of the simplification of the geometric progression correct?