hw8 - CS 173 Discrete Structures Fall 2010 Homework 8 This...

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

View Full Document Right Arrow Icon
CS 173: Discrete Structures, Fall 2010 Homework 8 This homework contains 3 problems worth a total of 38 regular points. It is due on Friday, October 29 at 4pm. Put your homework in the appropriate dropbox in the Siebel basement. 1. More on recurrences [12 points] (a) (6 points) Derive closed form solutions for the following two recurrences. i. T (0) = 2 and T ( n ) = ( n + 1) T ( n - 1) . ii. T (0) = 1 and T ( n ) = T ( n - 1) + 3( n - 1) 2 + 3( n - 1) + 1 . (b) (6 points) Give a closed form of the following recurrence using a recursion tree. Assume n is a power of 2. i. T (1) = 1 and T ( n ) = 4 T ( n/ 2) + n 3 2. Algorithm analysis [10 points] Consider the following code. Its output is a new array b 1 ,b 2 ,...,b k . (Don’t worry about the details of how this new array is created.) 1. Proc funct( a 1 ,a 2 ,...a n : array of real numbers) 2. k = 1 3. b k = a 1 4. for i = 2 to n 5. c = 0 6. for j = 1 to i - 1 7. c = a j + c 8. if ( a i c ) 9. k = k + 1 10. b k = a i 11. return b 1 ,b 2 ,...,b k (a) (2 points) Give a brief English description of what the function funct computes.
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 ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern