Asymptotic Notation - Design and Analysis - Study Notes, Study notes of Digital Systems Design

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

2011/2012

Uploaded on 11/03/2012

ankitay
ankitay 🇮🇳

4.4

(50)

106 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Lecture No.6
Asymptotic Notation
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
4n2,
• (8n2 + 2n - 3),
• (n2/5 + n - 10 log n)
• n(n - 3)
are all asymptotically equivalent. As n becomes large, the dominant (fastest growing)
term is some constant times n2.
Consider the function
f(n) = 8n2 + 2n – 3
Our informal rule of keeping the largest term and ignoring the constant suggests that
f(n) Θ(n2). Let’s see why this bears out formally. We need to show two things for
f(n) = 8n2 + 2n – 3
Lower bound f(n) = 8n2 + 2n - 3 grows asymptotically at least as fast as n2,
Upper bound f(n) grows no faster asymptotically than n2,
Lower bound: f(n) grows asymptotically at least as fast as n2. For this, need to show that
there exist positive constants c1 and n0, such that f(n) c1n2 for all n n0. Consider the
reasoning
f(n) = 8n2 + 2n - 3 _ 8n2 - 3 = 7n2 + (n2 - 3) 7n2
Thus c1 = 7. We implicitly assumed that 2n 0 and n2 - 3 0 these are not true for all n
but if n 3, then both are true. So select n0 3. We then have f(n) c1 n2 for all
n n0.
Docsity.com
pf2

Partial preview of the text

Download Asymptotic Notation - Design and Analysis - Study Notes and more Study notes Digital Systems Design in PDF only on Docsity!

Lecture No.

Asymptotic Notation

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

  • 4n^2 ,
  • (8n^2 + 2n - 3),
  • (n 2 /5 + √n - 10 log n)
  • n(n - 3)

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

  • 2n – 3

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

  • 3 ≥ 0 these are not true for all n

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.

Docsity.com

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.

Docsity.com