Question: Problem 1. (10 marks) The problems here are about using induction to prove the correctness of recur- sively defined algorithms. Refer to week 02 slides

 Problem 1. (10 marks) The problems here are about using inductionto prove the correctness of recur- sively defined algorithms. Refer to "week02 slides" on eClass. a. (5 marks) Example #3 describes a solution

Problem 1. (10 marks) The problems here are about using induction to prove the correctness of recur- sively defined algorithms. Refer to "week 02 slides" on eClass. a. (5 marks) Example #3 describes a solution to the problem of a person climbing a staircase of n stair. Now we change the problem to: Each step she takes can be either a regular-size step that climbs 1 stair or a big-size step that climbs 2 stairs, or a super-size step that climbs 3 stairs; the question is in how many different ways can she climbs the while set of n steps. Give an algorithm (in pseudocode) and prove its correctness. b. (5 marks) In Example #4, an algorithm is provided for the problem of Towers of Hanoi. Prove by induction that the algorithm is correct. Note: You must clearly label the base case and the induction step in your proof. You must justify your reasoning steps, in particular, how induction hypothesis is applied. Problem 1. (10 marks) The problems here are about using induction to prove the correctness of recur- sively defined algorithms. Refer to "week 02 slides" on eClass. a. (5 marks) Example #3 describes a solution to the problem of a person climbing a staircase of n stair. Now we change the problem to: Each step she takes can be either a regular-size step that climbs 1 stair or a big-size step that climbs 2 stairs, or a super-size step that climbs 3 stairs; the question is in how many different ways can she climbs the while set of n steps. Give an algorithm (in pseudocode) and prove its correctness. b. (5 marks) In Example #4, an algorithm is provided for the problem of Towers of Hanoi. Prove by induction that the algorithm is correct. Note: You must clearly label the base case and the induction step in your proof. You must justify your reasoning steps, in particular, how induction hypothesis is applied

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!