Algorithms and Data Structures (INF1, Autumn'05)
Exercise Set 3
In all exercises assume that n ranges over natural numbers
and that all the functions are nonnegative.
Exercise 1:
Exercise 2.1 from Algorithms and Data Structures:
Design, Correctness and Analysis by Jeffrey H. Kingston.
Exercise 2 (hand-in):
Solve the following recurrence equation.
T(1) = 7
T(n) = 2 + T(n-1) n>1
Prove that your solution is correct.
Exercise 3:
Solve the following reccurrence equation.
T(0) = 1
T(n) = n.T(n-1) n>1
Prove that your solution is correct.
Exercise 4:
Exercise 2.5 from Algorithms and Data Structures:
Design, Correctness and Analysis by Jeffrey H. Kingston.
Solve the reccurrence equation (you may assume that n = 2k).
Prove that your solution is correct.
Exercise 5:
Exercise 2.11 from Algorithms and Data Structures:
Design, Correctness and Analysis by Jeffrey H. Kingston.
Exercise 6:
Prove that
- a) n+4 in O(n)
- b) 3.n5 + 2.n3 is O(n5)
- c) n7 is O(2n)
- d) n2.log n = Ω(2.n2)
- e) 5.n2 + 2.n + 4 = Θ(n2)
Exercise 7:
Give a simplified big-O notation for the following running times:
- T(n)=20.n2
- T(n)=10.n3 + 6.n
- T(n)=2n + n1691
- T(n)=1000.n + n2
- T(n)= log5(3.n4)
Exercise 8:
It is true that 2n = Θ(3n)?
Exercise 9:
Prove that if f(n)=O(g(n)) and g(n)=O(h(n)) then also
f(n)=O(h(n)).