1

How to calculate $\sum^{n-1}_{i=0}(n-i)$?

$\sum^{n-1}_{i=0}(n-i)=n-\sum^{n-1}_{i=0}i=n-\sum^{n}_{i=1}(i-1)=2n-\frac{n(n+1)}{2}$

I am sure my steps are wrong. Could someone show me how to correct the procedure?

CoolKid
  • 2,738

2 Answers2

6

Your first step is wrong:

$$\sum_{i=0}^{n-1}(n-i)=\sum_{i=0}^{n-1}n-\sum_{i=0}^{n-1}i\;,$$

and

$$\sum_{i=0}^{n-1}n=n^2\;,$$

not $n$: it’s the sum of $n$ copies of $n$.

A slicker calculation is to substitute $j=n-i$ and notice that as $i$ runs from $0$ up through $n-1$, $j$ runs from $n$ down through $1$. Since the order in which we add the terms doesn’t matter,

$$\sum_{i=0}^{n-1}(n-i)=\sum_{j=1}^nj=\frac{n(n+1)}2\;.$$

Brian M. Scott
  • 616,228
2

You have mistake in your first equation: $\sum_{0}^{n-1}{n} = n^{2}$, so you've got : $$n^{2} - \frac{n(n-1)}{2} = \frac{n(n+1)}{2}$$

openspace
  • 6,470