

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Asymptotic Notation, Lower bound, Upper bound, Asymptotic Notation Example, Plots of the three functions, Positive constants, Asymptotically equivalent, Omega are the key points in this study notes.
Typology: Study notes
1 / 2
This page cannot be seen from the preview
Don't miss anything!


You may be asking that we continue to use the notation Θ() but have never defined it. Let’s remedy this now. Given any function g(n), we define Θ(g(n)) to be a set of functions that asymptotically equivalent to g(n). Formally:
This is written as “f(n) ∈ Θ(g(n))” That is, f(n) and g(n) are asymptotically equivalent. This means that they have essentially the same growth rates for large n. For example, functions like
are all asymptotically equivalent. As n becomes large, the dominant (fastest growing)
term is some constant times n^2. Consider the function
f(n) = 8n 2
Our informal rule of keeping the largest term and ignoring the constant suggests that f(n) ∈ Θ(n^2 ). Let’s see why this bears out formally. We need to show two things for
f(n) = 8n^2 + 2n – 3
Lower bound f(n) = 8n^2 + 2n - 3 grows asymptotically at least as fast as n^2 ,
Upper bound f(n) grows no faster asymptotically than n^2 ,
Lower bound : f(n) grows asymptotically at least as fast as n^2. For this, need to show that
there exist positive constants c 1 and n 0 , such that f(n) ≥ c 1 n 2 for all n ≥ n 0. Consider the reasoning f(n) = 8n^2 + 2n - 3 _ 8n^2 - 3 = 7n^2 + (n^2 - 3) ≥ 7n^2
Thus c 1 = 7. We implicitly assumed that 2n ≥ 0 and n 2
but if n ≥ √ 3 , then both are true. So select n 0 ≥ √ 3. We then have f(n) ≥ c 1 n 2 for all
n ≥ n 0.
Upper bound : f(n) grows asymptotically no faster than n^2. For this, we need to show
that there exist positive constants c 2 and n 0 , such that f(n) ≤ c 2 n^2 for all n ≥ n 0. Consider the reasoning
f(n) = 8n^2 + 2n - 3 ≤ 8n^2 + 2n ≤ 8n^2 + 2n^2 = 10n^2
Thus c 2 = 10. We implicitly made the assumption that 2n ≤ 2n^2. This is not true for all n
but it is true for all n ≥ 1 So select n 0 ≥ 1. We thus have f(n) ≤ c 2 n^2 for all n ≥ n 0. From lower bound we have n 0 ≥ √3.
From upper bound we have n 0 ≥ 1. Combining the two, we let n 0 be the larger of the
two: n 0 ≥ √ 3. In conclusion, if we let c 1 = 7, c 2 = 10 and n 0 ≥ √ 3 , we have
7n^2 ≤ 8n^2 + 2n - 3 ≤ 10n^2 for all n ≥ √ 3
We have thus established
0 ≤ c 1 g(n) ≤ f(n) ≤ c 2 g(n) for all n ≥ n 0
Here are plots of the three functions. Notice the bounds.
0
2e+104e+10 Figure 2.1: Asymptotic Notation Example
We have established that f(n) ∈ n 2
. Let’s show why f(n) is not in some other asymptotic class. First, let’s show that f(n) ∉ Θ(n). Show that f(n) ∉ Θ(n). If this were true, we would have had to satisfy both the upper and lower bounds. The lower bound is satisfied because f(n) = 8n^2 + 2n - 3 does grow at least as fast asymptotically as n. But the upper
bound is false. Upper bounds requires that there exist positive constants c 2 and n 0 such
that f(n) ≤ c 2 n for all n ≥ n 0.