functions, this exercise helps you to better understand its definition and properties. (a) 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) = n^2, f6(n) = 2^n, f7(n) = n!, f8(n) = n^n. Intuitively, the growth rate of the functions satisfy 1 < log n < n < n log n < n^2 < 2^n < n! < n^n. Prove this is true. [Hint: You are expected to prove the following asymptotics by using the definition of big-O notation: 1 = O(log n), log n = O(n), n = O(n log n), n log n = O(n^2), n^2 = O(2^n), 2^n = O(n!), n! = O(n^n). Note: Chap 3.2 of our textbook provides some math facts in case you need.]
1. Big-O notation. We have learnt big-O notation to compare the growth rates of functions, this exercise helps you to better understand its definition and properties.
(a) 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) = n^2, f6(n) = 2^n, f7(n) = n!, f8(n) = n^n. Intuitively, the growth rate of the functions satisfy 1 < log n < n < n log n < n^2 < 2^n < n! < n^n. Prove
this is true.
[Hint: You are expected to prove the following asymptotics by using the definition of big-O notation: 1 = O(log n), log n = O(n), n = O(n log n), n log n = O(n^2), n^2 = O(2^n), 2^n = O(n!), n! = O(n^n). Note: Chap 3.2 of our textbook provides some math facts in case you need.]
The question has been answered in step2
Step by step
Solved in 2 steps