404_HW3_F11 - 3. (25 points) Use substitution/induction to...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
UML CS Analysis of Algorithms 91.404 (section 201) Fall, 2011 1 of 1 Homework Set #3 Assigned: Wednesday, 9/21 Due: Wednesday, 9/28 (start of lecture) This assignment covers textbook material in Chapters 1-4. Note: Refer to course web site for homework policies. Please attach signed honor statement. In problems 1-3, we solve the following recurrence in several different ways. Our goal is to find a tight upper and lower bound on the closed-form solution for this recurrence: > + = 1 1 1 2 49 7 ) ( lg 4 1 n n n T n T n That is, find a function ) ( n g such that )) ( ( ) ( n g n T Θ . For simplicity you may assume that n is of the form n = 49 k for some positive integer k . 1. (20 points) Can the Master Theorem, as described on p. 93-106 of our textbook, be used to solve this recurrence? Why or why not? If so, solve it. 2. (25 points) Use a recursion tree to find a closed-form solution to the recurrence above.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 3. (25 points) Use substitution/induction to prove the correctness of your answer to Problem (2) above. Be sure to justify both the O and parts of the statement. 4. (30 points) Consider the pseudocode below: ) ( n Mystery 1 // Input: n = 4 k for some positive integer k 2 if 1 n 3 return 4 for i = 1 to n 5 for j = 1 to n 6 for k = 1 to n 7 print Values of i , j , k = , i , j , k 8 ) 4 / ( n Mystery The goal of this problem is to find tight upper and lower bounds on the best, average and worst-case running time of ) ( n Mystery as a function of the input n . a) (15 points) Formulate a recurrence for the running time of ) ( n Mystery as a function of the input n . Explain why this recurrence describes the best, average and worst-case running time of ) ( n Mystery . b) (15 points) Find a closed form solution to your recurrence from part (a) above....
View Full Document

Ask a homework question - tutors are online