For question 1, please clearly state the assumption. For question 2, you need to give a loop invariant and prove algorithm is correct using the given loop invariant. A few common mistakes are as follows. (1) No loop invariant. (2) Incorrect loop invariants: a. "n>0" It won't guarantee that the output is correct when the loop terminates. b. "i>0" It has the same problem as "n>0". c. "i=i+n" It does not show the exact value of i. d. "i<=sum of 1..n" It won't guarantee that the output is correct when the loop terminates. e. "i=sum of 1..k at the kth iteration" The algorithm adds the integers backwards. f. "i=sum of n ... (n-k+1) before the kth iteration" This assertion correctly maintains i's value, but the loop invariant also needs to maintain n's value. (3) The loop invariant is given, but there is no proof using the loop invariant. (Some students prove that the loop invariant is correct, which is not what the question asks for.) (4) Use mathematical induction to prove the correctness of the algorithm in terms of different input n. (It is not a proof using loop invariant. And you need to prove for one arbitrary n, the algorithm is correct at each iteration and eventually outputs the correct i.) (5) Prove using a given n.