Chapter 1: Homework 1
- (10 points) Exercise 9.2c of Aho, Hopcroft, and Ullman. "Solve" means "guess a solution and prove it is correct using induction." Assume that n is a power of 2.
c) T(n) = 8 T(n/2) + n3
Note the hint:
The solution contains a term cn3log2n
- (10 points) Exercise 9.10c of Aho, Hopcroft, and Ullman.
Find a close-form expression for the sum of 2i, for i=0 up to n. Prove by induction that your expression is correct.
- (5 points)
Sort the following functions into increasing order of magnitude.
- n2
- n log n
- n-1
- n/ log n
- 2log2n
- (15 points) Exercises 8 a, b, c pg. 51 Howowitz, Sahni, Rajasekaran
8. Show that the following inequalities are correct:
- (a) 5n2 - 6n =
(n2)
- (b) n! = O(nn)
- (c) 2n22n + nlogn =
(n22n)
- (10 points) Exercises 9 a, b pg. 52 Howowitz, Sahni, Rajasekaran
9. Show that the following inequalities are incorrect:
- (a) 10n2 + 9 = O(n)
- (b) n2logn =
(n2)
Note that for proving inequalities do not hold, it is not sufficient simply to find specific c's and n's that do not work since I may be able to find a c or n that does. Hence, you need to show that sooner or later any choice of c will have a problem. This is usually done by considering the fact that the statement must be true "for all n, n > n0"
Specifically, that n approaches infinity.