Professional Documents
Culture Documents
Fall 2019
Quiz # 1
2.5 per question for questions 1 to 4: .5 for each correct answer + 0.5 if all
answers for a given question are correct.
1. Complexity of 13 + 23 + 33 + + n3
a. Ω(n3 ) ✓
b. Θ(n4 ) ✓
c. O(n2 ) ✗
d. Ω(n2 ) ✓
2. elog2 n is
a. O(n2 ) ✓
b. O(n) ✗
c. O(2n ) ✓
d. O(log n) ✗
a. O(2n ) ✓
b. O(n log n) ✓
c. O(2log n ) ✗
d. O(n!) ✓
1
5. Solve the following recurrence equation
Express your solution with the simplest expression using the Θ notation.
( − b)2 = 2 + b2 − 2b.
2 − b2 = ( − b)( + b).
It follows:
A1 + A2 B1 + B2 A1 − A2 B1 − B2
C1 = , C2 = , C3 = , C4 = .
2 2 2 2
Clearly, the coefficient of n is not zero, as otherwise tn = constant and then the
recurrence solution is not satisfied unless tn = 0, consequently
tn = Θ(n). (2 points)