1

I am trying to understand summations by solving some example problems, but I could not understand how is the second to last line being expanded? I would really appreciate if you could explain me how is it being expanded.

\begin{align} &\sum_{i=1}^{n-1}\sum_{j=i+1}^{n}\sum_{k=1}^{j}1 =\\ &\sum_{i=1}^{n-1}\sum_{j=i+1}^{n}j =\\ &\sum_{i=1}^{n-1}\left(\sum_{j=1}^{n}j - \sum_{j=1}^{i}j\right) =\\ &\sum_{i=1}^{n-1}\left(\frac{n(n+1)}{2} - \frac{i(i+1)}{2}\right) =\\ &\frac{1}{2}\sum_{i=1}^{n-1}n^2+n-i^2-i =\\ &\frac{1}{2}\left((n-1)n^2 + (n-1)n - \left(\frac{n(n+1)(2n+1)}{6} - n^2\right) - \left(\frac{n(n+1)}{2} - n\right)\right) =\\ &f(n) = \frac{n(n(n+1))}{2} - \frac{n(n+1)(2n+1)}{12} - \frac{n(n+1)}{4} \end{align}

N. F. Taussig
  • 76,571
  • Which steps more specifically? Are you comfortable with the idea that if you add three copies of $1$ together that you get a result of $3$? How about if you add $10$ copies of $1$ to itself, what would that result be? If you add $j$ copies of $1$ to itself? – JMoravitz Jan 18 '22 at 18:36
  • The sum from index $1$ to $n-1$ is the sum from index $1$ to $n$ minus the $n$th term. Then they use Faulhaber's formula to evaluate the sum of first and second powers of first $n$ integers. – Golden_Ratio Jan 18 '22 at 18:38
  • In the second last line why n^2 and n is being subtracted from the from the expansion of i^2 and i. – foragerDev Jan 18 '22 at 18:38
  • Now... how about if you add $n$ copies of $2$ together? Or if you add $n$ copies of $10$ together? Or $n$ copies of $j$ together? What gets more interesting perhaps is when what is being added is not constant. For that, you should read more about 'triangle sums' or 'pyramidal sums' etc... – JMoravitz Jan 18 '22 at 18:39
  • "Why $n^2$ and $n$ is being subtracted from the from the expansion of $i^2$ and $i$" Presumably because the formula they are citing/using was written specifically where the upper bound was $n$ and not $n-1$ and instead of rewriting the formula they just subtracted the last term. – JMoravitz Jan 18 '22 at 18:40
  • @JMoravitz thanks for the suggestion, I am pretty new to Mathematics. for sure I will give a read to these topics. – foragerDev Jan 18 '22 at 18:41
  • Incidentally, a simpler derivation, starting from the second line, is: \begin{multline} \sum_{i=1}^{n-1}\sum_{j=i+1}^{n}j = \sum_{j=2}^n\left(j\sum_{i=1}^{j-1}1\right) = \sum_{j=2}^nj(j - 1) \ = \frac13\sum_{j=2}^n[(j + 1)j(j - 1) - j(j - 1)(j - 2)] = \frac{n(n^2 - 1)}3. \end{multline} – Calum Gilhooley Jan 18 '22 at 19:36
  • Here's another derivation that doesn't require much calculation. I'll denote the number of elements of a finite set $S$ by $#S.$ \begin{multline} \sum_{i=1}^{n-1}\sum_{j=i+1}^{n}\sum_{k=1}^{j}1 = \sum_{i=1}^{n-1}\sum_{j=i+1}^{n}\left(n - \sum_{k=j+1}^{n}1\right) \ = n \times #{{i, j} : 1 \leqslant i < j \leqslant n} - #{{i, j, k} : 1 \leqslant i < j < k \leqslant n} \ = n\binom{n}2 - \binom{n}3 = \frac{n(n - 1)(3n - (n - 2))}6 = \frac{n(n^2 - 1)}3. \end{multline} – Calum Gilhooley Jan 18 '22 at 23:45

2 Answers2

1

I take it that what has to be explained is this (I've introduced parentheses on the left hand side for clarity): \begin{multline*} \sum_{i=1}^{n-1}\left(n^2 + n - i^2 - i\right) = \\ (n-1)n^2 + (n-1)n - \left(\frac{n(n+1)(2n+1)}6 - n^2\right) - \left(\frac{n(n+1)}2 - n\right). \end{multline*} This equation results from adding together the following four identities: \begin{align*} \sum_{i=1}^{n-1}n^2 & = (n - 1)n^2, \\ \sum_{i=1}^{n-1}n & = (n - 1)n, \\ \sum_{i=1}^{n-1}i^2 & = \sum_{i=1}^ni^2 - n^2 \\ & = \frac{n(n+1)(2n+1)}6 - n^2, \\ \sum_{i=1}^{n-1}i & = \sum_{i=1}^ni - n \\ & = \frac{n(n+1)}2 - n. \end{align*} Lines 4 and 6 follow, of course, from the familiar identities: \begin{align*} \sum_{i=1}^ni^2 & = \frac{n(n+1)(2n+1)}6, \\ \sum_{i=1}^ni & = \frac{n(n+1)}2. \end{align*} I don't know why it was done this way! It seems to me that it would have been simpler just to write: \begin{align*} \sum_{i=1}^{n-1}i^2 & = \frac{(n-1)n(2n-1)}6, \\ \sum_{i=1}^{n-1}i & = \frac{(n-1)n}2. \end{align*} (Also, in the comments, I've suggested two ways to arrive at the final answer with less calculation.)

  • 1
    I suppose it's just a kind of trick, to get rid of an $n^2$ term and an $n$ term; but if one is going to be tricky about it, there are less laborious ways of evaluating the sum (as I've shown). – Calum Gilhooley Jan 19 '22 at 19:26
  • So to change from n-1 to n, we have to subtract the same term from the f(n)? What does this difference mean? – foragerDev Jan 19 '22 at 19:32
  • 1
    You've lost me, I'm afraid! The notation $f(n),$ as I understand it, merely denotes the final (but unsimplified) expression for the sum. (It doesn't play any part in the argument, and could be omitted without loss.) I don't know what you mean about "changing" from $n-1$ to $n.$ There is a sum of $n-1$ terms, and a sum of $n$ terms, which differ, of course, by a single term ($n^2$ or $n,$ as the case may be). The calculation is done in an odd way (not one I would ever have chosen, anyway), apparently just to be able to use these $n^2$ and $n$ terms to simplify just one part of the expression. – Calum Gilhooley Jan 19 '22 at 19:44
0

Starting from line 4 of the displayed equation, we have $$\sum_{i=1}^{n-1}\frac{n(n+1)}{2}=(n-1)\frac{n(n+1)}{2}$$ because there are $n-1$ equal terms. Also, $$\sum_{i=1}^{n-1}\frac{i(i+1)}{2}=\sum_{i=1}^{n-1}\left(\frac{i(i+1)(i+2)}{6}-\frac{(i-1)i(i+1)}{6}\right)$$ is a telescoping sum, hence equal to $$\frac{(n-1)n(n+1)-0}6.$$ Therefore, the whole sum is equal to $$ \frac{(n - 1)n(n + 1)}2 - \frac{(n - 1)n(n + 1)}6 = \frac{(n - 1)n(n + 1)}3. $$


The "weird" decomposition above comes in fact from a general property of the raising factorials: e.g.

$$i(i+1)(i+2)(i+3)(i+4)-(i-1)i(i+1)(i+2)(i+3)=5i(i+1)(i+2)(i+3).$$

  • The denominator of the final expression should be $3,$ shouldn't it? – Calum Gilhooley Jan 18 '22 at 19:42
  • @CalumGilhooley: mh, no, why ? –  Jan 18 '22 at 20:26
  • If you're claiming that the value of the sum in the question is $\frac{(n-1)n(n+1)}6$ (your answer isn't clearly enough worded for me to be sure that that's what you're claiming), then try taking $n = 2$ and see if it's right. – Calum Gilhooley Jan 18 '22 at 21:23
  • @CalumGilhooley: as far as I know, $1=1$. My wording says that the value of the sum ... is such ... –  Jan 19 '22 at 10:38
  • @CalumGilhooley: please expand the sum to show how you obtain $2$. –  Jan 19 '22 at 14:02
  • Certainly: $$ \sum_{i=1}^1\sum_{j=i+1}^2\sum_{k=1}^{j}1 = \sum_{j=2}^2\sum_{k=1}^{j}1 = \sum_{k=1}^21 = 2. $$ – Calum Gilhooley Jan 19 '22 at 14:51
  • @CalumGilhooley: that's the global sum, nowhere mentioned in my answer. Compare to the OP's expansion. –  Jan 19 '22 at 17:27
  • To save time, I'll edit your answer. If you don't like my edit, you can revert it, so no harm is done. – Calum Gilhooley Jan 19 '22 at 17:33
  • @CalumGilhooley: I'll leave it as is, but notice that my answer was completely self contained, merely saying $a=b$ and $c=d$, where $a$ and $c$ appeared in the OP. –  Jan 19 '22 at 18:35