Notes:
1) No late submissions will be graded.
2) Submit your assignment using the drop box.
3) You must do the assignment by yourself.
4) Submit this assignment only if you have read and understood the policy on academic honesty on the course web page. If you have problems or concerns, please contact the instructor.
problem: Use mathematical induction to prove:
(1/1.2) + (1/2.3) + (1/3.4) + …. + [1/n(n + 1)] = 1 – (1/n+1)
If n is a positive integer.
problem: Use loop invariant to prove that the program for computing the sum of 1 ,…, n is correct.
INPUT: Integer n
OUTPUT: The sum of 1,…,n
S(n)
1. i ← 0
2. while n>0
3. do i ← i + n
4. n ← n-1
5. return(i)