{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw8 - CS 173 Discrete Structures Spring 2010 Homework 8...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 173: Discrete Structures, Spring 2010 Homework 8 This homework contains 5 problems worth a total of 46 regular points. It is due on Friday, April 2nd at 4pm. Put your homework in the appropriate dropbox in the Siebel basement. 1. Solving recurrences [10 points] (a) Use unrolling to find a closed form for the following recurrence, for inputs that are powers of 2. Show at least three steps of unrolling, convert to a closed form, and simplify your closed form. p ( n ) = braceleftbigg 4 p ( n 2 ) if n > 1 2 otherwise (b) The function g : Z + Z + is defined below. Find a closed form for g , correctly handling inputs that aren’t powers of three. Show your work and/or provide a brief explanation. However, it is not necessary to show details of unrolling, since it’s very similar to a problem you did for homework 7. g ( n ) = braceleftbigg g ( n 3 ) + 21 if n 3 0 otherwise 2. Recurrence tree [10 points] Consider the following recurrence: T ( n ) = d if n < = 4 T ( n ) = 2 T ( n/ 2) + cn + p otherwise where c , d , and p are constants. Let’s analyze T when the input n is a power of 2.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}