Menu

(Solved) : 1 20 Marks Consider Following Program Segment Sum 0 1 N J 1 N Note Loop Starts 1 Sum Sum 1 Q35962302 . . .

1. [20 marks] Consider the following program segment: sum:- 0 for i:-1 to n for j := i+1 to n Note this loop starts at i+ 1 n

1. [20 marks] Consider the following program segment: sum:- 0 for i:-1 to n for j := i+1 to n Note this loop starts at i+ 1 not sum := sum + 1 a) Express the final value of sum using summation notation and simplify. Hint: sum-2qsb dzeg. Determine a, b, c, d, e, f, and g]. b) Prove using mathematical induction that sum- =n(2-1). Show transcribed image text

Expert Answer


Answer to 1 20 Marks Consider Following Program Segment Sum 0 1 N J 1 N Note Loop Starts 1 Sum Sum 1 Q35962302 . . .

OR