
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Asymptotic notation
Put these functions in order so that if f (n) ∈ O(g(n)) (i.e. f (n) is Big-Oh of g(n)), then f (n) appears before g(n) in the list. Group together functions that have the same asymptotic order of growth (i.e. f (n) ∈ Θg(n)).
n^2 , n log n, n^3 + log n,
n, n^2 + 2n log n,
log log n, 17 log n, 10 n
(^32) , n^5 − n^4 + 2n,
5 n^2 log log n, 3 n^2 + n^3 log n, n + 6 log n
Solution: Here is the list, where I have grouped together the functions having the same asymptotic order of growth (there’s only one such pair):
log log n, 17 log n,
n, n + 6 log n, n log n,
10 n
(^32) , {n^2 , n^2 + 2n log n}, 5 n^2 log log n,
n^3 + log n, 3 n^2 + n^3 log n, n^5 − n^4 + 2n
Essentially, most of these can be demonstrated using the fact that log n ≤ n for all n ≥ 1, and hence, log log n ≤ log n (for all n ≥ 2, why the change to n ≥ 2 ??). Also, we know that log n ≤
n for all n ≥ 1. If you know any calculus, this is easy to prove. First show that limn→∞ logn^ n = 0 using L’Hˆopital’s Rule. This means that log n is Little-Oh of n, and, as mentioned in class, this implies that log n is Big-Oh of n. (I basically said that you an assume
the fact that log n is Big-Oh of n, and that log n is Big-Oh of n
1 k (^) for all
k ≥ 1.) We can easily make statements like 2n log n ≤ 2 n^2 ≤ 2 n^2 log log n for large enough n. Similarly, n^3 log n ≤ n^4 ≤ n^5 − n^4 for “large enough” n. These statements can be more formally proved. Recall also that n
3 (^2) = n · n
1 (^2) = n ·
n.