503MidtermExamSolF06Mod08

503MidtermExamSolF06Mod08 - UML CS 91.503 Midterm Exam...

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

View Full Document Right Arrow Icon
UML CS 91.503 Midterm Exam Fall, 2006 1 of 14 MIDTERM EXAM SOLUTIONS (updated 10/16/2008) (with scaling) Maximum Score = 100 Minimum Score = 33 Average Score = 66.8 (unscaled = 63.4) StDev = 19.6 1 : (5 points) Asymptotic Growth of Functions (a) (1 point) List the 4 functions below in nondecreasing asymptotic order of growth: 3 lg 2 2 2 1 lg lg lg )! 2 ( ! n n n n n n 2 n 1) 3 lg 2 1 n )! 2 ! ( n n lg lg 2 n n n n 2 2 lg 3) 4) 2) smallest largest EXPLANATION: First, () 3 1 3 2 / 1 lg 3 1 n n = = lg 2 1 3 n n = , which goes to 0 has n goes to . This is the smallest of the four functions because the others increase as n increases. Next, we simplify ). ( ) 1 ( 2 n n n Θ )! 2 ( ! n n = 0 n n 2 2 2 2 This belongs second in the ordering because we can pick c = 1 and n 0 =4 so that , for any function , and . Finally, with c = 1 and n 0 =4. Note that some other c , n 0 pairs also work; we only need to find one pair. ) ( ) ( n n f Θ ) lg lg ( ) ( n n n f Ο ) lg ( ) ( n n n f Ο ) lg ( lg lg 2 2 2 n n n n Ο Ω Θ Ο Ω 3 lg 4 3 2 2 2 2 1 2 1 ) ( 4) )! 2 ( ! ) ( 3) ) lg ( ) ( 2) ) lg lg ( ) ( ) 1 n n f n n n f n n n f n n n f Circle TRUE or FALSE for each statement below & briefly justify your choice by either proving that the statement must be TRUE based on facts (1)-(4) above, or by providing a counterexample. b) (1 point) TRUE FALSE )) ( ( ) ( 2 1 n f n f Ο
Background image of page 1

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

View Full DocumentRight Arrow Icon
UML CS 91.503 Midterm Exam Fall, 2006 2 of 14 Counterexample : and . These choices satisfy statements (1)&(2). in this case because is asymptotically larger than . That is, there does not exist any choice of c and n 0 such that 3 1 ) ( n n f = 2 2 ) ( n n f = )) ( ( ) ( 2 1 n f n f Ο 3 n 2 n 0 2 1 ), ( ) ( n n n cf n f . c) (1 point) TRUE FALSE ) ( n 3 f )) ( ( 4 n f Ω Counterexample : and . These choices satisfy statements (3)&(4). in this case because is asymptotically smaller than . That is, there does not exist any choice of c and n 0 such that 2 3 ) ( n n f = 3 4 ) ( n n f = )) ( ( ) ( 4 3 n f n f Ω 2 n 3 n 0 ), ( ) ( n n n cf n f . 4 3 )) ( ( 1 n f Ο d) (1 point) TRUE FALSE ) ( 3 n f Proof : From the solution to (a) we know that and therefore . From statement (1) we have which implies by transpose symmetry. Applying transitivity yields . ) ( 2 3 n (n) f Θ lg ( 2 3 n (n) f Ο ) lg lg ( ) ( 2 1 n n n f Ω )) ( ( lg lg 1 2 n f n n Ο )) ( ( ) ( 1 3 n f n f Ο ) ( n ) lg n e) (1 point) TRUE FALSE )) ( ( 4 n f Ω 1 f Counterexample : and . These choices satisfy statements (1)&(4). in this case because n is asymptotically smaller than n . That is, there does not exist any choice of c and n 0 such that 3 1 ) ( n n f = 4 4 ) ( n n f = )) ( ( ) ( 4 1 n f n f Ω 3 4 0 1 ) ( n n n f 4 ), ( n cf n 3 . n ) ( 2 n f n 2 2 lg ) ( 1 n f ) ( n f n lg lg 2 )! 2 ( n ) ( 4 n f ! n 3 lg 2 1 n
Background image of page 2
UML CS 91.503 Midterm Exam Fall, 2006 3 of 14 2: (5 points) Recurrence Find a tight upper and lower bound on the closed-form solution for the following recurrence: n n n T n T 2 4 lg 2 64 ) ( + = ) ( n g )) ( ( ) ( n g n Θ n n n f 2 4 lg ) ( = 6 64 log log 2 n n n a b = = ) ( ) ( ) (log = a b n O n f ) ( ) ( 6 n n Θ Mystery k sum ) , 1 ( i RANDOM m j to 1 for 1 do + sum sum sum where
Background image of page 3

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

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/13/2012 for the course CS 91.503 taught by Professor Staff during the Spring '11 term at UMass Lowell.

Page1 / 14

503MidtermExamSolF06Mod08 - UML CS 91.503 Midterm Exam...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online