<s>[INST] Find the closed-form for $\sum_{i=0}^n(-1)^i(\frac{1}{2})^i$ I start with simplifying:
$$\sum_{i=0}^n(-1)^i(\frac{1}{2})^i=\sum_{i=0}^n(-\frac{1}{2})^i$$
then:
$$S = 1 + (-\frac{1}{2}) + (-\frac{1}{2})^2 + ... +(-\frac{1}{2})^n$$
$$(-\frac{1}{2})S = (-\frac{1}{2}) + (-\frac{1}{2})^2 + ... +(-\frac{1}{2})^n+(-\frac{1}{2})^{n+1}$$
$$(-\frac{1}{2}-1)S = (-\frac{1}{2})^{n+1} - 1$$
am I on the right track?
 [/INST] Here's another approach using the formula for finite geometric series
\begin{align*}
  \sum_{i=0}^nx^n=\frac{1-x^{n+1}}{1-x}\tag{1}
  \end{align*}

We obtain
  \begin{align*}
  \sum_{i=0}^n(-1)^i\left(\frac{1}{2}\right)^i&=\sum_{i=0}^n\left(-\frac{1}{2}\right)^i\\
&=\frac{1-\left(-\frac{1}{2}\right)^{n+1}}{1-\left(-\frac{1}{2}\right)}\\
&=\frac{2}{3}\left(1-\left(-\frac{1}{2}\right)^{n+1}\right)
  \end{align*}

</s>