Understanding Summation Notation – Sum from j=i to i+k of A[j] – CLRS Problem 8-5

algorithmssummation

I need help understanding the following inequality of summations from Problem 8-5 of Cormen, Leiserson, Rivest, and Stein (2009, p. 207):

$$\frac{\sum_{j=i}^{i+k-1}A[j]}{k}\le\frac{\sum_{j=i+1}^{i+k}A[j]}{k}$$

Kanev (n.d.) seemed to say that this means that every ith element is less than every ith element plus k. If this is true, I don't understand why, although Cormen et al. do seem to indicate this in part of the problem.

My interpretation is that the sum of elements, i through k-1, divided by k is less than or equal to the sum of elements, i+1 through k, divided by k. I first need to establish whether I am interpreting the summation notation correctly before continuing to prove that what Kanev (n.d.) wrote is true. What's tripping me up is the j=i part.

So, what is the difference between the subscript, j=i, and just using the subscript, i, and then using i instead of j for the index?

References:

Cormen, T. H., Leiserson, C. E., Rivest, R. L., & Stein, C. (2009). Introduction to Algorithms (3rd ed.) [ProQuest Ebook Central version]. Retrieved from https://ebookcentral.proquest.com

Kanev, S. (n.d.). Problem 8.5 [Blog post]. Retrieved from https://ita.skanev.com/08/problems/05.html

Best Answer

We have \begin{align*} \sum_{j=i}^{i+k-1}A[j]&=A[i]+A[i+1]+\cdots+A[i+k-1]\\ \sum_{j=i+1}^{i+k}A[j]&=A[i+1]+A[i+2]+\cdots+A[i+k] \end{align*}

and the meaning of the inequality is:

  • The mean values of the sum of $k$ consecutive elements $A[j], j=i,\ldots,i+k-1$ are increasing with increasing $j=1,2,\ldots$.
Related Question