Question: 20: Let S(n) be a statement parameterized by a positive integer n. Consider a proof that uses strong induction to prove that for all n24,

 20: Let S(n) be a statement parameterized by a positive integer

20: Let S(n) be a statement parameterized by a positive integer n. Consider a proof that uses strong induction to prove that for all n24, S(n) is true. The base case proves that S(4), S(5), S(6), S(7), and S(8) are all true. Select the correct expressions to complete the statement of what is assumed and proven in the inductive step Suppose that for k2(A?), S0) is true for every j in the range 4 through k. Then we will show that a. (A): 4 (B?) is true b. (A): 4 8.7 Loop invariants 21: The loop below computes the product of two integers: While jcn) prod:-prodm End-while The pre-condition and post-condition for the loop are Pre-condition: m and n are non-negative integers. j0 and prod0. Post-condition: prod-m n What is the correct loop condition? a. j is an integer such thatj n, and prodn b. is an integer such that j n, and prod-n c. j is an integer such thatjs n, and prod m j d. is an integer such that j n, and prod-m j 22: Let ji and sum, be the values of j and sum before an iteration of the block below. Let j2 and sum2 be the values of j and sum after the iteration. While (jsn) sum sum Page 5 of 9 Hw-6 +1 End-while Which equation is correct? a. sum,-sum (j)2 b. sum2 sum ( c. sum2 sum(j1-1) d. sum: sumi + +? 20: Let S(n) be a statement parameterized by a positive integer n. Consider a proof that uses strong induction to prove that for all n24, S(n) is true. The base case proves that S(4), S(5), S(6), S(7), and S(8) are all true. Select the correct expressions to complete the statement of what is assumed and proven in the inductive step Suppose that for k2(A?), S0) is true for every j in the range 4 through k. Then we will show that a. (A): 4 (B?) is true b. (A): 4 8.7 Loop invariants 21: The loop below computes the product of two integers: While jcn) prod:-prodm End-while The pre-condition and post-condition for the loop are Pre-condition: m and n are non-negative integers. j0 and prod0. Post-condition: prod-m n What is the correct loop condition? a. j is an integer such thatj n, and prodn b. is an integer such that j n, and prod-n c. j is an integer such thatjs n, and prod m j d. is an integer such that j n, and prod-m j 22: Let ji and sum, be the values of j and sum before an iteration of the block below. Let j2 and sum2 be the values of j and sum after the iteration. While (jsn) sum sum Page 5 of 9 Hw-6 +1 End-while Which equation is correct? a. sum,-sum (j)2 b. sum2 sum ( c. sum2 sum(j1-1) d. sum: sumi + +

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!