Assignment 5 | ||||||||||||||||||||||||||||||||||
for submission: Tuesday, 03 Sep., 2002, Midnight. | ||||||||||||||||||||||||||||||||||
This assignment contains two parts. Part I is yours basic assignment while Part II is a bonus, and for more enthusiastic students. PART I Q1. Give an example of a positive function f(n) such that f(n) is neither O(n) nor Ω(n) ? Q2. Consider any two positive functions f, and g. Prove that
Q3. Prove that f(n)+o(f(n)) = Θ(f(n)). Q4. Show that
Q5. Show that
Q6. Evaluate the sum
Q7. Prove that lg(n!) = Θ (nlg n) and that n! = O(nn). Q8. Is the function ⌈lg n⌉! polynomially bounded ? Is the function ⌈lg lg n⌉! polynomially bounded ? Q9. Prove that if f(n) < g(n) that is f(n) is O(g(n)) but not Ω(g(n)), then there exists a function h(n) between them, i.e. f(n) < h(n) < g(n) Q10. Deduce the complexity of the following algorithms.
Q11. Rank the following function by their order of growth.
Note lg*n = min {i>=0: lgi n <= 1}.
PART II Correct attempt of this part will be awarded by seven bonus marks and consequently the corresponding grades.Five marks are for Question 1 and two are for Question 2. Any downloading from Internet will be caught and you will lose your marks as a punishment and matter will be reported to SSAC. Q1. Given are two sorted arrays A and B, each containing n integer valued elements. Give an algorithm to find the median (nth smallest) of the 2n elements in union(A,B). Your algorithm should require no more than O(log n) comparisons. Q2. Consider a computational model in which one comparison takes one time unit. Let T(n) be the worst case time of the median-of-3 algorithm for finding the kth smallest of n elements.
How To Submit You have to submit the solutions on paper to the respective TAs of M. Tech CSE(Ist yr.) students. However the students who attempted the PART II and are sure upto a good extent that their solutions are correct, are required to submit their assignment to Mr.Manish Agarwal either by keeping it on his table in the CSE(MTP)lab or by slipping it under the door of room #53 MANAS Hostel. Please make sure:
|