This preview shows page 1. Sign up to view the full content.
Unformatted text preview: Introduction to Algorithms Massachusetts Institute of Technology Professors Erik Demaine and Shafi Goldwasser February 3, 2004 6.046J/18.410J Handout 3 Problem Set 1
This problem set is due in recitation on Friday, February 13. Reading: Chapters 1, 2.1-2.3, 3, 4, 28.2, 30.1, Akra-Bazzi Handout There are five problems. Each problem is to be done on a separate sheet (or sheets) of paper. Mark the top of each sheet with your name, the course number, the problem number, your recitation section, the date, and the names of any students with whom you collaborated. You will often be called upon to "give an algorithm" to solve a certain problem. Giving an algorithm entails: 1. A description of the algorithm in English and, if helpful, pseudocode. 2. A proof (or argument) of the correctness of the algorithm. 3. An analysis of the running time of the algorithm. It is also suggested that you include at least one worked example or diagram to show more precisely how your algorithm works. Remember, your goal is to communicate. Graders will be instructed to take off points for convoluted and obtuse descriptions. If you cannot solve a problem, give a brief summary of any partial results. Problem 1-1. Asymptotic Notation Decide whether these statements are True or False. You must justify all your answers to receive full credit. (b) (c) (d) (e) Problem 1-2. More Asymptotic Notation aU SXXXSU SQ bV`YWWWVTR Rank the following functions by increasing order of growth; that is, find an arrangement of the functions satisfying , , ..., . Partition your list into aU ! hQ Tbd03c#g 7 A C$B6 A BP % f ! U U ! Q Td03c#V ed03cBE 4 ! &%$" I3 H ' F "%)GED 7 4 ! @&986%53 2% 1&0)(% ' ! &%$#" (a) 2 Handout 3: Problem Set 1 Problem 1-3. Recurrence Relations Solve the following recurrences. Give a bound for each problem. If you are unable to find a bound, provide as tight upper ( or ) and lower ( or ) bounds as you can find. Justify your answers. You may assume that . Problem 1-4. Divide and Conquer Multiplication (c) Show that two -bit integers can be multiplied in operates on at most a constant number of -bit values. steps, where each step Give a algorithm which, given a set of real numbers and another real number , determines whether or not there exists two elements in whose sum is exactly . W W q q W Problem 1-5. Finding a Pair that Sums to (b) Give a divide-and-conquer algorithm for multiplying two polynomials of degree-bound that runs in time . gi%dgh`fed c F a g Y F V c F W `Xba Y F W `XV (a) Show how to multiply two linear polynomials multiplications. (Hint: One of the multiplications is f 1)(& 3! 0 f 1)(pBA 0 & $BA D (f) D (e) D (d) F f H U P F C f "H F F P D (c) F H D (b) F G I H D I D R 9 G TU IG TSQ DR3 9 IG D @ A D E D D (a) and using only three .) A A B62% ! $ 0 & 1)(3 C " 2$ U 9 ' aa bQ Q f 0 & 1)(' 9 7 8 #!" D D ! A " B 2%$ 50 61)(& @ A % equivalence classes such that and are in the same class if and only if . 4 " # 0 1)(& a ...
View Full Document
- Spring '04