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?
The left sides of your second and third equations should be $T(n)$, not what you have written. Under "Factoring out a $-1$" it would be better to end with $2^{n-3}+2^{n-2}$ to maintain the pattern of the exponents increasing by $1$. Your progression does end with $2^{n-2}$. That is why the numerator of the sum has $2^{n-1}$. If you look at the formula for the sum of a finite geometric progression, the exponent is $1$ more than the highest term: $$1+r+r^2+\ldots +r^k=\frac {r^{k+1}-1}{r-1}$$ When you add $1$ to $n-2$ you get $n-1$ so your teacher's sum of the progression is correct. Your final answer is also correct.