Could someone please help understand how this can be simplified? I don't understand how to solve/isolate the rightmost summation.
$$\sum_{i=1}^n \sum_{j=i}^n 1$$
Could someone please help understand how this can be simplified? I don't understand how to solve/isolate the rightmost summation.
$$\sum_{i=1}^n \sum_{j=i}^n 1$$
$$\begin{align} \sum_{i=1}^n \sum_{j=i}^n 1 &\stackrel{1.}= \sum_{i=1}^n (n+1-i) \\ &\stackrel{3.}= (n+1)\sum_{i=1}^n 1 - \sum_{i=1}^n i \\ &\stackrel{1., 2.}= (n+1)n - n(n+1)/2 \\ &\stackrel{3.}= n(n+1)/2 \end{align}$$
where
$\sum_{i=a}^b 1 = b-a+1$ provided $b\geqslant a$, i.e. there are $b-a+1$ integers in the set $\{a, a+1, ..., b\}$.
$\sum_{i=1}^n i = n(n+1)/2$ are triangular numbers.
Distributive law.
\begin{eqnarray} \sum_{j=i}^{n}1&=&\underbrace{1+1+\cdots+1}_{n-i+1\text{ times}}\\ &=&n-i+1\\ \sum_{i=1}^{n}\sum_{j=i}^{n}1&=&\sum_{i=1}^{n}n-i+1\\ &=&n(n+1)-\sum_{i=1}^{n}i\\ &=&n(n+1)-\dfrac{n(n+1)}{2}\\ &=&\dfrac{n(n+1)}{2} \end{eqnarray}