title: Insertion sort analysis and summation notation
body: <p>I am trying to understand the worst case analysis of Insertion sort and I have a problem with the math involved on <a href="http://www.cse.unr.edu/%7Ebebis/CS477/Lect/InsertionSortBubbleSortSelectionSort.ppt" rel="nofollow noreferrer">slide 21 (ppt)</a>.</p>
  <p>I understand the first formula:</p>
  <p><img src="https://i.stack.imgur.com/fK0Ww.png" alt="Σ(j=1 to n) j=n(n+1)/2" /></p>
  <p>But these I'm struggling with:</p>
  <ol>
  <li>Why is there a <code>- 1</code> at the end?<br />
  <img src="https://i.stack.imgur.com/6uN7H.png" alt="Σ(j=2 to n) j=n(n+1)/2-1" /></li>
  <li>Also, I don't understand this one:<br />
  <img src="https://i.stack.imgur.com/qDkRd.png" alt="Σ(j=2 to n)(j-1) = n(n-1)/2" /></li>
  </ol>