Question: Big - O notation. We have learnt big - O notation to Big - O notation. We have learnt big - O notation to compare

Big-O notation. We have learnt big-O notation to Big-O notation. We have learnt big-O notation to compare the growth rates of func-
tions, this exercise helps you to better understand its definition and properties.
(a)(12 points) Suppose n is the input size, we have the following commonly seen
functions in complexity analysis: f1(n)=1,f2(n)=logn,f3(n)=n,f4(n)=
nlogn,f5(n)=n2,f6(n)=2n,f7(n)=n!. Intuitively, the growth rate of the func-
tions satisfy 1=O(logn),logn=O(n),n=O(nlogn),nlogn=O(n2),n2=O(2n),2n=O(n!)f,g:NR+O(f(n)+g(n))=O(max{f(n),g(n)})max{f(n),g(n)}f(n)+g(n)2*max{f(n),g(n)}O(n2+nlogn+n)=O(n2)1!. Prove this is true.
[Hint: You are expected to prove the following asymptotics by using the definition
of big-O notation: 1=O(logn),logn=O(n),n=O(nlogn),nlogn=O(n2),n2=
O(2n),2n=O(n!). Note: Chap 3.2of our textbook provides some math facts in
case you need.]
Answer: my answer to the question.
(b)(8 points) Let f,g:NR+, prove that O(f(n)+g(n))=O(max{f(n),g(n)}).
[Hint: The key is max{f(n),g(n)}f(n)+g(n)2*max{f(n),g(n)}. Note:
Proving this will help you to understand why we can leave out the insignificant parts
in big-O notation and only keep the dominate part, e.g.,O(n2+nlogn+n)=O(n2).]
Answer:compare the growth rates of func-
tions, this exercise helps you to better understand its definition and properties.
(a)(12 points) Suppose n is the input size, we have the following commonly seen functions in complexity analysis: f1(n)=1, f2(n)= log n, f3(n)= n, f4(n)= n log n, f5(n)= n2, f6(n)=2n, f7(n)= n!. Intuitively, the growth rate of the func- tionssatisfy1
 Big-O notation. We have learnt big-O notation to Big-O notation. We

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!