title: Finding the incrementer and the Total Cost of a code?
body: <p>This was a quiz last week. I thought the answer of the question below is Line:3 . However, the Instructor told me that Line 4 is better. I still don't get why? and leads to another question, how do I know my best increment ? </p>
  
  <p><img src="https://i.stack.imgur.com/WJuCG.png" alt="enter image description here"></p>
  
  <p>The second question I would like to ask, <strong>How to represent the cost of the running code below using Summations?</strong> I've searched a lot and all I find was finding the complexity of a code which is not related to this.</p>
  
  <p>I hope you guys clear everything to me.</p>