How do i simplify this in terms of n?

\(\displaystyle

\sum_{i=0}^{n-1}{2^{i} (n-i)}

\)

Cheers!

\(\displaystyle \sum_{i=0}^{n-1}{2^{i} (n-i)}=\frac{1}{2}\sum_{i=1}^{n}2^{i}+\frac{n}{2}\sum_{i=1}^{n}2^{i}-\frac{1}{2}\sum_{i=1}^{n}i2^{i}\)

Try using the partial sum for a geometric series formula.

\(\displaystyle S_{n}=a_{n}\left(\frac{1-r^{n}}{1-r}\right)\), where

r is the common ratio and a is the first term.

So, from the first one we have \(\displaystyle \frac{1-2^{n}}{1-2}=2^{n}-1\)

The second one is the same only multiplied by n. Giving \(\displaystyle n(2^{n}-1)\)

The third only can be found by differentiating the partial sum formula.

\(\displaystyle \sum_{i=1}^{n}x^{i}=\frac{x(1-x^{n})}{1-x}\)

\(\displaystyle \frac{d}{dx}\left[\sum_{i=1}^{n}x^{i}\right]=\sum_{i=1}^{n}ix^{i-1}=\frac{(nx-n-1)x^{n}+1}{(x-1)^{2}}\)

\(\displaystyle \sum_{i=1}^{n}ix^{i}=\frac{x((nx-x-1)x^{n}+1)}{(x-1)^{2}}\)

Sub in x=2 and we get \(\displaystyle 2(2^{n}(n-1)+1)\).

Don't forget to divide by 2 because of the 1/2.

\(\displaystyle \frac{1}{2}\sum_{i=1}^{n}i2^{i}=(n-1)2^{n}+1\)

Add this with the other two sums and we get:

\(\displaystyle 2^{n}-1+n(2^{n}-1)-((n-1)2^{n}+1)=\boxed{2^{n+1}-n-2}\)

Just one way to go about it. Remember, you can play around with the geometric series formulas by differentiating, integrating, and so on, and get away with a lot.