Consider the following program segment, where i, j, k, n, and counter arc integer variables and the value of n (a positive integer) is set prior to this segment.
We shall determine, in two different ways, the number of times the statement
counter := counter + 1
is executed. (This is also the value of counter after execution of the program segment.) From the result in Example 1.39, we know that the statement is executed times. For a fixed value of i, the for loops involving j and k result in executions of the counter increment statement. Consequently, Use this result to obtain a summation formula for
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.