MET CS 566 – SUMMER 2003 Homework Assignment 1

advertisement
MET CS 566 – SUMMER 2003
Homework Assignment 1
1. (4 pts) Asymptotic notation (CLRS 1st ed, p.50: 3.1-4)
Is 2n+1 = O(2n) ? Is 22n = O(2n) ?
2. (16 pts) Ordering of common functions by asymptotic growth (CLRS 1st ed, p.58:
sub-problem of 3-3): Rank the following functions by order of growth; i.e. find an
arrangement g1, g2, …, g6, so that g1=  g2), g2=  g3),…, g5=  g6). Indicate
functions of the same order, if any, i.e. indicate any gi=  gj).
n2
n!
n3
lg2n
n*2n
4lgn
3. (10 pts) Recursion tree (CLRS 1st ed, p.72: 4.2-2): Using a recursion tree argue that
the solution to the recurrence
T(n) = T(n/3) + T(2n/3) + cn ,
where c is a constant, is  n*lg n).
Extra Credit: Show that T(n) = (n*lg n). ( lg n = log2 n)
4. (10+5 pts) Recursion tree: (CLRS 1st ed, p.72: 4.2-3). Draw the recursion tree for
T(n) = 4T(n/2) + cn
where c is a constant. Provide a tight asymptotic bound for its solution. Assume
that n is a power of 2 and prove your bound by mathematical induction.
5. (5 pts) Induction: Prove by induction
12 + 32 + 52 + … + (2n – 1)2 = n (2n – 1) (2n + 1)/3
Download