SUNY Geneseo Department of Computer Science


Solution to Problem Set 8 (Master Theorem)

CSci 240, Spring 2007

Prof. Doug Baldwin

Find asymptotic closed forms for each of the following recurrence relations.

Recurrence 1

Use the Master Theorem, noting that a = 8, b = 2, and g(n) = n. log28 = 3, so g(n) = O( nlogba - ε ) for ε = 2. Therefore the closed form is T(n) = Θ( nlogba ) =  Θ( nlog28 ) = Θ( n3 ).

Recurrence 2

Use the Master Theorem, noting that a = 9, b = 3, and g(n) = n2. log39 = 2, so g(n) = Θ( nlogba ). Therefore the closed form is T(n) = Θ( nlog39 logn ) =  Θ( n2 logn )

Recurrence 3

Use the Master Theorem, noting that a = 3, b = 2, and g(n) = n2. log23 ≈ 1.58, so g(n) = Ω( nlogba + ε ) for ε ≈ 0.42. Furthermore, a g(n/b) = 3 (n/2)2 = 3/4 n2c g(n) = c n2 for any c ≥ 3/4. Therefore the closed form is T(n) = Θ( g(n) ) =  Θ( n2 ).

Recurrence 4

Use the Master Theorem, with a = 2, b = 4, and g(n) = 2. log42 = 0.5, so g(n) = O( nlogba - ε ) = O( n0.5 - ε ) for ε = 0.5. Therefore the closed form is T(n) = Θ( nlogba ) =  Θ( nlog42 ) = Θ( n0.5 ) = Θ( √n ).