Showing that $\sum_{k=0}^{n-2} (n - 1 - k) = \frac{(n-1)n}{2}$ I'm having trouble understanding the following simple transformation:
$$\sum_{k=0}^{n-2} n-1-k = \frac{(n-1)n}{2}$$
Can you explain it why this holds.
Of course, I know that
$$\sum_{k=0}^{n} k = \frac{n(n+1)}{2}$$
holds.
I appreciate your answer.
 A: \begin{align}
\sum_{k=0}^{n-2}(n-1-k)&= \sum_{k=0}^{n-2}(n-1)-\sum_{k=0}^{n-2}k\\
&=(n-1)^2-\frac{(n-2)(n-1)}{2}\\
&=\frac{(n-1)(2(n-1)-(n-2))}{2}\\
&=\frac{(n-1)(n)}{2}
\end{align}
A: There are twopieces here. Firstly, there is
$$ \sum_{k=0}^{n-2} (n-1) = (n-1)^2.$$
This is just $n-1$ copies of $n-1$, so there's not too much to say. Secondly, there is
$$ \sum_{k=0}^{n-2} -k = - \frac{(n-2)(n-1)}{2},$$
which comes from the sum of the first $n$ integers, as you mention.
Adding these together gives your result. $\diamondsuit$
A: Call $j=n-1-k$. When $k=0$ you have $j=n-1$ and when $k=n-2$ you have $j=1$. So
$\sum_{k=0}^{n-2}(n-1-k)=\sum_{j=1}^{n-1}j=\frac{n(n-1)}{2}$.
A: To compute an average you sum up all the terms and divide by the number of terms. To compute an average when you have numbers that have a common difference,and are thus linear, you average the first term and the last term. From this information we can conclude that the product of the average and the number of terms must be the sum of the numbers you have. 
The first term is $$n-1-0=n-1$$
The last term is $$n-1-(n-2)=1$$
And because $k$ is a constant:
$$n-k-1$$ is linear
The average of a linear function is given by:
$$\frac{F+L}{2}$$
Where $F$ is the first term, and $L$ is the last term.
Thus the average is 
$$\frac{n}{2}$$
There are $n-2+1=n-1$ terms because the amount of integers from $1$ to $n$ is $n$ and we're starting 1 term earlier. 
The sum is the product of the average and the number of terms:
$$\frac{n}{2}•(n-1)=\frac{n(n-1)}{2}$$
A: Here is another way to approach the problem.
First, expand the sum to see how it looks,
$$\sum_{k=0}^{n-2} n-1-k = (n-1) + (n-2)+(n-3)+ ... +3+2+1$$
Which turns out to be a sum from $1$ to $(n-1)$ in reverse order. So the sum can be rewritten as
$$\sum_{k=1}^{n-1} k$$
For which you know the solution by replacing a sum up to $n$ by $n-1$, which gives,
$$\frac{(n-1)n}{2}$$
It is really an 'exploratory' result which user Euler88 obtained by making a change of variable $j = n-1-k$
