Learning Goal: I’m working on a computer science question and need the explanation and answer to help me learn.
If possible, please complete the Question on word document, and write it clearly.
- State a non-trivial loop invariant (which must include conditions for ii and xx).
- Prove the loop invariant. Be sure that the proof includes the final conditions after the loop has ended.
- Note: a correct proof of an incorrect invariant will still receive partial credit.
- Give the final value of xx in terms of nn.
- Note: (for the sake of readability) the value 2i2i in the code below is 22 to the power of ii.
- Note: or symbol (with ranges) meaning product or sum of terms can be used as part of loop invariant.
Recent Comments