0% found this document useful (0 votes)
27 views101 pages

Asymptotic Notations

The document discusses asymptotic notations, which are mathematical representations for frequency counts in algorithms, including Big Oh (O), Omega (Ω), Theta (Ɵ), Little Oh (o), and Little Omega (ω). It provides definitions and examples of how to determine the O notation for various functions, illustrating the process with specific functions like f(n) = 3n + 2 and f(n) = 4n^3 + 2n + 3. The document emphasizes the importance of establishing upper bounds for algorithm performance in terms of computational time.

Uploaded by

romana salim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views101 pages

Asymptotic Notations

The document discusses asymptotic notations, which are mathematical representations for frequency counts in algorithms, including Big Oh (O), Omega (Ω), Theta (Ɵ), Little Oh (o), and Little Omega (ω). It provides definitions and examples of how to determine the O notation for various functions, illustrating the process with specific functions like f(n) = 3n + 2 and f(n) = 4n^3 + 2n + 3. The document emphasizes the importance of establishing upper bounds for algorithm performance in terms of computational time.

Uploaded by

romana salim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 101

Asymptotic Notations

Video Link: https://www.youtube.com/playlist?list=PLpqGPi6G3Jf2iLXbXlrz7gykHUNyGbzQK

CS KTU Lectures
Asymptotic Notations
• It is the mathematical notations to represent
frequency count.
• 5 types of asymptotic notations
• Big Oh (O)
• Omega (Ω)
• Theta (Ɵ)
• Little Oh (o)
• Little Omega (ω)

CS KTU Lectures
Big Oh (O) Notation
Definition:
The function f(n) = O(g(n)) iff there exists 2
positive constants c and n0 such that
0 ≤ f(n) ≤ c g(n) for all n ≥ n0

CS KTU Lectures
Big Oh (O) Notation
• It is the measure of longest amount of time
taken by an algorithm(Worst case).
• It is asymptotically tight upper bound
• O(1) : Computational time is constant
• O(n) : Computational time is linear
• O(n2) : Computational time is quadratic
• O(n3) : Computational time is cubic
• O(2n) : Computational time is exponential

CS KTU Lectures
Find the O notation of the following function
f(n) = 3n + 2

CS KTU Lectures
Find the O notation of the following function
f(n) = 3n + 2

0 ≤ f(n)≤ c g(n) for all n≥n0

CS KTU Lectures
Find the O notation of the following function
f(n) = 3n + 2

0 ≤ f(n)≤ c g(n) for all n≥n0

Here f(n)= 3n + 2 g(n)=n c=4

CS KTU Lectures
Find the O notation of the following function
f(n) = 3n + 2

0 ≤ f(n)≤ c g(n) for all n≥n0

Here f(n)= 3n + 2 g(n)=n c=4

3n + 2 ≤ 4 n for all n≥n0

CS KTU Lectures
Find the O notation of the following function
3n + 2 ≤ 4 n

If n=1, LHS=5 , RHS=4, False

CS KTU Lectures
Find the O notation of the following function
3n + 2 ≤ 4 n

If n=1, LHS=5 , RHS=4, False


If n=2, LHS=8 , RHS=8, True

CS KTU Lectures
Find the O notation of the following function
3n + 2 ≤ 4 n

If n=1, LHS=5 , RHS=4, False


If n=2, LHS=8 , RHS=8, True
If n=3, LHS=11 , RHS=12, True

CS KTU Lectures
Find the O notation of the following function
3n + 2 ≤ 4 n

If n=1, LHS=5 , RHS=4, False


If n=2, LHS=8 , RHS=8, True
If n=3, LHS=11 , RHS=12, True
If n=4, LHS=14 , RHS=16, True

CS KTU Lectures
Find the O notation of the following function
3n + 2 ≤ 4 n

If n=1, LHS=5 , RHS=4, False


If n=2, LHS=8 , RHS=8, True
If n=3, LHS=11 , RHS=12, True
If n=4, LHS=14 , RHS=16, True

The above equation is True when n ≥ 2


Therefore n0=2

CS KTU Lectures
Find the O notation of the following function
f(n) = 3n + 2

0 ≤ f(n)≤ c g(n) for all n≥n0

Here f(n)= 3n + 2 g(n)=n c=4 n0=2

3n + 2 ≤ 4 n for all n≥2

CS KTU Lectures
Find the O notation of the following function
f(n) = 3n + 2

0 ≤ f(n)≤ c g(n) for all n≥n0

Here f(n)= 3n + 2 g(n)=n c=4 n0=2

3n + 2 ≤ 4 n for all n≥2

Therefore f(n)= O(g(n))

CS KTU Lectures
Find the O notation of the following function
f(n) = 3n + 2

0 ≤ f(n)≤ c g(n) for all n≥n0

Here f(n)= 3n + 2 g(n)=n c=4 n0=2

3n + 2 ≤ 4 n for all n≥2

Therefore f(n)= O(g(n))

3n + 2= O(n)
CS KTU Lectures
Find the O notation of the following function
f(n) = 4n3 + 2n + 3

CS KTU Lectures
Find the O notation of the following function
f(n) = 4n3 + 2n + 3

0 ≤ f(n)≤ c g(n) for all n≥n0

CS KTU Lectures
Find the O notation of the following function
f(n) = 4n3 + 2n + 3

0 ≤ f(n)≤ c g(n) for all n≥n0

Here f(n)= 4n3 + 2n + 3 g(n)= n3 c=5

CS KTU Lectures
Find the O notation of the following function
f(n) = 4n3 + 2n + 3

0 ≤ f(n)≤ c g(n) for all n≥n0

Here f(n)= 4n3 + 2n + 3 g(n)= n3 c=5

4n3 + 2n + 3 ≤ 5 n3 for all n≥n0

CS KTU Lectures
Find the O notation of the following function
4n3 + 2n + 3 ≤ 5 n3

If n=1, LHS=9 , RHS=5, False

CS KTU Lectures
Find the O notation of the following function
4n3 + 2n + 3 ≤ 5 n3

If n=1, LHS=9 , RHS=5, False


If n=2, LHS=39 , RHS=40, True

CS KTU Lectures
Find the O notation of the following function
4n3 + 2n + 3 ≤ 5 n3

If n=1, LHS=9 , RHS=5, False


If n=2, LHS=39 , RHS=40, True
If n=3, LHS=117 , RHS=135, True

CS KTU Lectures
Find the O notation of the following function
4n3 + 2n + 3 ≤ 5 n3

If n=1, LHS=9 , RHS=5, False


If n=2, LHS=39 , RHS=40, True
If n=3, LHS=117 , RHS=135, True
If n=4, LHS=267 , RHS=320, True

CS KTU Lectures
Find the O notation of the following function
4n3 + 2n + 3 ≤ 5 n3

If n=1, LHS=9 , RHS=5, False


If n=2, LHS=39 , RHS=40, True
If n=3, LHS=117 , RHS=135, True
If n=4, LHS=267 , RHS=320, True

The above equation is True when n ≥ 2


Therefore n0=2

CS KTU Lectures
Find the O notation of the following function
f(n) = 4n3 + 2n + 3

0 ≤ f(n)≤ c g(n) for all n≥n0

Here f(n)= 4n3 + 2n + 3 g(n)= n3 c=5 n0=2

4n3 + 2n + 3 ≤ 5 n3 for all n≥2

CS KTU Lectures
Find the O notation of the following function
f(n) = 4n3 + 2n + 3

0 ≤ f(n)≤ c g(n) for all n≥n0

Here f(n)= 4n3 + 2n + 3 g(n)= n3 c=5 n0=2

4n3 + 2n + 3 ≤ 5 n3 for all n≥2

Therefore f(n)= O(g(n))

CS KTU Lectures
Find the O notation of the following function
f(n) = 4n3 + 2n + 3

0 ≤ f(n)≤ c g(n) for all n≥n0

Here f(n)= 4n3 + 2n + 3 g(n)= n3 c=5 n0=2

4n3 + 2n + 3 ≤ 5 n3 for all n≥2

Therefore f(n)= O(g(n))

4n3 + 2n + 3= O(n3)
CS KTU Lectures
Find the O notation of the following function
f(n) = 2n+1

CS KTU Lectures
Find the O notation of the following function
f(n) = 2n+1

0 ≤ f(n)≤ c g(n) for all n≥n0

CS KTU Lectures
Find the O notation of the following function
f(n) = 2n+1

0 ≤ f(n)≤ c g(n) for all n≥n0

Here f(n)= 2n+1 g(n)= 2n c=2

CS KTU Lectures
Find the O notation of the following function
f(n) = 2n+1

0 ≤ f(n)≤ c g(n) for all n≥n0

Here f(n)= 2n+1 g(n)= 2n c=2

2n+1 ≤ 2 2n for all n≥n0

CS KTU Lectures
Find the O notation of the following function
2n+1 ≤ 2 2n

If n=1, LHS=4 , RHS=4, True

CS KTU Lectures
Find the O notation of the following function
2n+1 ≤ 2 2n

If n=1, LHS=4 , RHS=4, True


If n=2, LHS=8 , RHS=8, True

CS KTU Lectures
Find the O notation of the following function
2n+1 ≤ 2 2n

If n=1, LHS=4 , RHS=4, True


If n=2, LHS=8 , RHS=8, True
If n=3, LHS=16 , RHS=16, True

CS KTU Lectures
Find the O notation of the following function
2n+1 ≤ 2 2n

If n=1, LHS=4 , RHS=4, True


If n=2, LHS=8 , RHS=8, True
If n=3, LHS=16 , RHS=16, True

The above equation is True when n ≥ 1


Therefore n0=1

CS KTU Lectures
Find the O notation of the following function
f(n) = 2n+1

0 ≤ f(n)≤ c g(n) for all n≥n0

Here f(n)= 2n+1 g(n)= 2n c=2 n0=1

2n+1 ≤ 2 2n for all n≥1

CS KTU Lectures
Find the O notation of the following function
f(n) = 2n+1

0 ≤ f(n)≤ c g(n) for all n≥n0

Here f(n)= 2n+1 g(n)= 2n c=2 n0=1

2n+1 ≤ 2 2n for all n≥1

Therefore f(n) = O(g(n))

CS KTU Lectures
Find the O notation of the following function
f(n) = 2n+1

0 ≤ f(n)≤ c g(n) for all n≥n0

Here f(n)= 2n+1 g(n)= 2n c=2 n0=1

2n+1 ≤ 2 2n for all n≥1

Therefore f(n) = O(g(n))

2n+1 = O(2 n
)
CS KTU Lectures
Find the O notation of the following function
f(n) = 2n + 6n2 + 3n

CS KTU Lectures
Find the O notation of the following function
f(n) = 2n + 6n2 + 3n

0 ≤ f(n)≤ c g(n) for all n≥n0

CS KTU Lectures
Find the O notation of the following function
f(n) = 2n + 6n2 + 3n

0 ≤ f(n)≤ c g(n) for all n≥n0

Here f(n)= 2n + 6n2 + 3n g(n)= 2n c=7

CS KTU Lectures
Find the O notation of the following function
f(n) = 2n + 6n2 + 3n

0 ≤ f(n)≤ c g(n) for all n≥n0

Here f(n)= 2n + 6n2 + 3n g(n)= 2n c=7 n0=5

2n + 6n2 + 3n ≤ 7 2n for all n≥5

CS KTU Lectures
Find the O notation of the following function
f(n) = 2n + 6n2 + 3n

0 ≤ f(n)≤ c g(n) for all n≥n0

Here f(n)= 2n + 6n2 + 3n g(n)= 2n c=7 n0=5

2n + 6n2 + 3n ≤ 7 2n for all n≥5

Therefore f(n) = O(g(n))

CS KTU Lectures
Find the O notation of the following function
f(n) = 2n + 6n2 + 3n

0 ≤ f(n)≤ c g(n) for all n≥n0

Here f(n)= 2n + 6n2 + 3n g(n)= 2n c=7 n0=5

2n + 6n2 + 3n ≤ 7 2n for all n≥5

Therefore f(n) = O(g(n))

2n + 6n2 + 3n = O(2n)
CS KTU Lectures
Is 22n = O(2n)?

CS KTU Lectures
Is 22n = O(2n)?

0 ≤ 22n ≤ c 2n for n ≥ n0

CS KTU Lectures
Is 22n = O(2n)?

0 ≤ 22n ≤ c 2n for n ≥ n0

2n 2n ≤ c 2 n

CS KTU Lectures
Is 22n = O(2n)?

0 ≤ 22n ≤ c 2n for n ≥ n0

2n 2n ≤ c 2 n
2n ≤ c

CS KTU Lectures
Is 22n = O(2n)?

0 ≤ 22n ≤ c 2n for n ≥ n0

2n 2n ≤ c 2 n
2n ≤ c for n ≥ n0

CS KTU Lectures
Is 22n = O(2n)?

0 ≤ 22n ≤ c 2n for n ≥ n0

2n 2n ≤ c 2 n
2n ≤ c for n ≥ n0

There is no value for c and n0 that can make


this true.

Therefore 22n != O(2n)


CS KTU Lectures
Is 2n+1 = O(2n)?

CS KTU Lectures
Is 2n+1 = O(2n)?

0 ≤ 2n+1 ≤ c 2n for n ≥ n0

CS KTU Lectures
Is 2n+1 = O(2n)?

0 ≤ 2n+1 ≤ c 2n for n ≥ n0

2x2n ≤ c 2n

CS KTU Lectures
Is 2n+1 = O(2n)?

0 ≤ 2n+1 ≤ c 2n for n ≥ n0

2x2n ≤ c 2n

2 ≤c

CS KTU Lectures
Is 2n+1 = O(2n)?

0 ≤ 2n+1 ≤ c 2n for n ≥ n0

2x2n ≤ c 2n

2 ≤c

2n+1 ≤ c 2n is True if c=2 and n≥1.

Therefore 2n+1 = O(2n)


CS KTU Lectures
Is 2n+1 = O(2n)?

0 ≤ 2n+1 ≤ c 2n for n ≥ n0

2x2n ≤ c 2n

2 ≤c

2n+1 ≤ c 2n is True if c=2 and n≥1.

Therefore 2n+1 = O(2n)


CS KTU Lectures
Omega (Ω) Notation
Definition:
The function f(n) = Ω (g(n)) iff there exists 2
positive constant c and n0 such that
f(n) ≥ c g(n) ≥ 0 for all n ≥ n0

CS KTU Lectures
Omega (Ω) Notation
• It is the measure of smallest amount of time
taken by an algorithm(Best case)
• It is asymptotically tight lower bound

CS KTU Lectures
Find the Ω notation of the following function
f(n) = 27 n2 + 16n + 25

CS KTU Lectures
Find the Ω notation of the following function
f(n) = 27 n2 + 16n + 25

f(n) ≥ c g(n) ≥ 0 for all n ≥ n0

CS KTU Lectures
Find the Ω notation of the following function
f(n) = 27 n2 + 16n + 25

f(n) ≥ c g(n) ≥ 0 for all n ≥ n0

Here f(n) = 27 n2 + 16n + 25 g(n)= n2 c=27

CS KTU Lectures
Find the Ω notation of the following function
f(n) = 27 n2 + 16n + 25

f(n) ≥ c g(n) ≥ 0 for all n ≥ n0

Here f(n) = 27 n2 + 16n + 25 g(n)= n2 c=27

27 n2 + 16n + 25 ≥ 27 n2 for all n ≥ n0

CS KTU Lectures
Find the Ω notation of the following function
27 n2 + 16n + 25 ≥ 27 n2

CS KTU Lectures
Find the Ω notation of the following function
27 n2 + 16n + 25 ≥ 27 n2

If n=1: LHS=68 RHS=27 True

CS KTU Lectures
Find the Ω notation of the following function
27 n2 + 16n + 25 ≥ 27 n2

If n=1: LHS=68 RHS=27 True


If n=2: LHS=165 RHS=108 True

CS KTU Lectures
Find the Ω notation of the following function
27 n2 + 16n + 25 ≥ 27 n2

If n=1: LHS=68 RHS=27 True


If n=2: LHS=165 RHS=108 True

This equation is true if n ≥ 1


Therefore n0 = 1

CS KTU Lectures
Find the Ω notation of the following function
f(n) = 27 n2 + 16n + 25

f(n) ≥ c g(n) ≥ 0 for all n ≥ n0

Here f(n) = 27 n2 + 16n + 25 g(n)= n2 c=27 n0=1

27 n2 + 16n + 25 ≥ 27 n2 for all n ≥ 1

CS KTU Lectures
Find the Ω notation of the following function
f(n) = 27 n2 + 16n + 25

f(n) ≥ c g(n) ≥ 0 for all n ≥ n0

Here f(n) = 27 n2 + 16n + 25 g(n)= n2 c=27 n0=1

27 n2 + 16n + 25 ≥ 27 n2 for all n ≥ 1

Therefore f(n) = Ω(g(n))

CS KTU Lectures
Find the Ω notation of the following function
f(n) = 27 n2 + 16n + 25

f(n) ≥ c g(n) ≥ 0 for all n ≥ n0

Here f(n) = 27 n2 + 16n + 25 g(n)= n2 c=27 n0=1

27 n2 + 16n + 25 ≥ 27 n2 for all n ≥ 1

Therefore f(n) = Ω(g(n))


27 n2 + 16n +CS25KTU= Lectures
Ω(n2)
Find the Ω notation of the following function
f(n) = 3n + 6n2 + 3n

CS KTU Lectures
Find the Ω notation of the following function
f(n) = 3n + 6n2 + 3n

f(n) ≥ c g(n) ≥ 0 for all n ≥ n0

CS KTU Lectures
Find the Ω notation of the following function
f(n) = 3n + 6n2 + 3n

f(n) ≥ c g(n) ≥ 0 for all n ≥ n0

Here f(n) = 3n + 6n2 + 3n g(n)= 3n c=1

CS KTU Lectures
Find the Ω notation of the following function
f(n) = 3n + 6n2 + 3n

f(n) ≥ c g(n) ≥ 0 for all n ≥ n0

Here f(n) = 3n + 6n2 + 3n g(n)= 3n c=1

3n + 6n2 + 3n ≥ 1 x 3n for all n ≥ n0

CS KTU Lectures
Find the Ω notation of the following function
3n + 6n2 + 3n ≥ 1 x 3n

CS KTU Lectures
Find the Ω notation of the following function
3n + 6n2 + 3n ≥ 1 x 3n

If n=1: LHS=12 RHS=3 True

CS KTU Lectures
Find the Ω notation of the following function
3n + 6n2 + 3n ≥ 1 x 3n

If n=1: LHS=12 RHS=3 True


If n=2: LHS=39 RHS=9 True

CS KTU Lectures
Find the Ω notation of the following function
3n + 6n2 + 3n ≥ 1 x 3n

If n=1: LHS=12 RHS=3 True


If n=2: LHS=39 RHS=9 True

This equation is true if n ≥ 1


Therefore n0 = 1

CS KTU Lectures
Find the Ω notation of the following function
f(n) = 3n + 6n2 + 3n

f(n) ≥ c g(n) ≥ 0 for all n ≥ n0

Here f(n) = 3n + 6n2 + 3n g(n)= 3n c=1 n0=1

3n + 6n2 + 3n ≥ 1 x 3n for all n ≥ 1

CS KTU Lectures
Find the Ω notation of the following function
f(n) = 3n + 6n2 + 3n

f(n) ≥ c g(n) ≥ 0 for all n ≥ n0

Here f(n) = 3n + 6n2 + 3n g(n)= 3n c=1 n0=1

3n + 6n2 + 3n ≥ 1 x 3n for all n ≥ 1

Therefore f(n) = Ω(g(n))

CS KTU Lectures
Find the Ω notation of the following function
f(n) = 3n + 6n2 + 3n

f(n) ≥ c g(n) ≥ 0 for all n ≥ n0

Here f(n) = 3n + 6n2 + 3n g(n)= 3n c=1 n0=1

3n + 6n2 + 3n ≥ 1 x 3n for all n ≥ 1

Therefore f(n) = Ω(g(n))

3n + 6n2 + 3n = Ω(3n)
CS KTU Lectures
Theta (Ɵ) Notation
Definition:
The function f(n) = Ɵ (g(n)) iff there exists 3
positive constants c1, c2 and n0 such that
0 ≤ c1 g(n) ≤ f(n) ≤ c2 g(n) for all n ≥ n0

CS KTU Lectures
Theta (Ɵ) Notation
• It is the measure of average amount of time
taken by an algorithm(Average case)

CS KTU Lectures
Find the Ɵ notation of the following function
f(n) = 3n + 2

CS KTU Lectures
Find the Ɵ notation of the following function
f(n) = 3n + 2
0 ≤ c1 g(n) ≤ f(n) ≤ c2 g(n) for all n ≥ n0

CS KTU Lectures
Find the Ɵ notation of the following function
f(n) = 3n + 2
0 ≤ c1 g(n) ≤ f(n) ≤ c2 g(n) for all n ≥ n0

c1 g(n) ≤ f(n) for all n ≥ n0

CS KTU Lectures
Find the Ɵ notation of the following function
f(n) = 3n + 2
0 ≤ c1 g(n) ≤ f(n) ≤ c2 g(n) for all n ≥ n0

c1 g(n) ≤ f(n) for all n ≥ n0


Here f(n) = 3n + 2 g(n)= n c1 =3 n0 =1
3 n ≤ 3n + 2 for all n ≥ 1

CS KTU Lectures
Find the Ɵ notation of the following function
f(n) = 3n + 2
0 ≤ c1 g(n) ≤ f(n) ≤ c2 g(n) for all n ≥ n0

c1 g(n) ≤ f(n) for all n ≥ n0


Here f(n) = 3n + 2 g(n)= n c1 =3 n0 =1
3 n ≤ 3n + 2 for all n ≥ 1

f(n) ≤ c2 g(n) for all n ≥ n0

CS KTU Lectures
Find the Ɵ notation of the following function
f(n) = 3n + 2
0 ≤ c1 g(n) ≤ f(n) ≤ c2 g(n) for all n ≥ n0

c1 g(n) ≤ f(n) for all n ≥ n0


Here f(n) = 3n + 2 g(n)= n c1 =3 n0 =1
3 n ≤ 3n + 2 for all n ≥ 1

f(n) ≤ c2 g(n) for all n ≥ n0


Here f(n) = 3n + 2 g(n)= n c2 =4 n0 =2
3n + 2 ≤ 4 n for all n ≥ 2

CS KTU Lectures
Find the Ɵ notation of the following function
f(n) = 3n + 2
0 ≤ c1 g(n) ≤ f(n) ≤ c2 g(n) for all n ≥ n0

c1 g(n) ≤ f(n) for all n ≥ n0


Here f(n) = 3n + 2 g(n)= n c1 =3 n0 =1
3 n ≤ 3n + 2 for all n ≥ 1

f(n) ≤ c2 g(n) for all n ≥ n0


Here f(n) = 3n + 2 g(n)= n c2 =4 n0 =2
3n + 2 ≤ 4 n for all n ≥ 2

3 n ≤ 3n + 2 ≤ 4 n for all n ≥ 2 c1 =3 c2 =4 n0 =2
CS KTU Lectures
Find the Ɵ notation of the following function
f(n) = 3n + 2
0 ≤ c1 g(n) ≤ f(n) ≤ c2 g(n) for all n ≥ n0

c1 g(n) ≤ f(n) for all n ≥ n0


Here f(n) = 3n + 2 g(n)= n c1 =3 n0 =1
3 n ≤ 3n + 2 for all n ≥ 1

f(n) ≤ c2 g(n) for all n ≥ n0


Here f(n) = 3n + 2 g(n)= n c2 =4 n0 =2
3n + 2 ≤ 4 n for all n ≥ 2

3 n ≤ 3n + 2 ≤ 4 n for all n ≥ 2 c1 =3 c2 =4 n0 =2
CS KTU Lectures
Find the Ɵ notation of the following function
f(n) = 3 x 2n + 4n2 + 5n + 2

CS KTU Lectures
Find the Ɵ notation of the following function
f(n) = 3 x 2n + 4n2 + 5n + 2
0 ≤ c1 g(n) ≤ f(n) ≤ c2 g(n) for all n ≥ n0

CS KTU Lectures
Find the Ɵ notation of the following function
f(n) = 3 x 2n + 4n2 + 5n + 2
0 ≤ c1 g(n) ≤ f(n) ≤ c2 g(n) for all n ≥ n0

c1 g(n) ≤ f(n) for all n ≥ n0

CS KTU Lectures
Find the Ɵ notation of the following function
f(n) = 3 x 2n + 4n2 + 5n + 2
0 ≤ c1 g(n) ≤ f(n) ≤ c2 g(n) for all n ≥ n0

c1 g(n) ≤ f(n) for all n ≥ n0


Here f(n) = 3 x 2n + 4n2 + 5n + 2 g(n)= 2n c1 =3 n0 =1
3x2n ≤ 3 x 2n + 4n2 + 5n + 2 for all n ≥ 1

CS KTU Lectures
Find the Ɵ notation of the following function
f(n) = 3 x 2n + 4n2 + 5n + 2
0 ≤ c1 g(n) ≤ f(n) ≤ c2 g(n) for all n ≥ n0

c1 g(n) ≤ f(n) for all n ≥ n0


Here f(n) = 3 x 2n + 4n2 + 5n + 2 g(n)= 2n c1 =3 n0 =1
3x2n ≤ 3 x 2n + 4n2 + 5n + 2 for all n ≥ 1

f(n) ≤ c2 g(n) for all n ≥ n0

CS KTU Lectures
Find the Ɵ notation of the following function
f(n) = 3 x 2n + 4n2 + 5n + 2
0 ≤ c1 g(n) ≤ f(n) ≤ c2 g(n) for all n ≥ n0

c1 g(n) ≤ f(n) for all n ≥ n0


Here f(n) = 3 x 2n + 4n2 + 5n + 2 g(n)= 2n c1 =3 n0 =1
3x2n ≤ 3 x 2n + 4n2 + 5n + 2 for all n ≥ 1

f(n) ≤ c2 g(n) for all n ≥ n0


Here f(n) = 3 x 2n + 4n2 + 5n + 2 g(n)= 2n c2 =10 n0 =1
3 x 2n + 4n2 + 5n + 2 ≤ 10x 2n for all n ≥ 1

CS KTU Lectures
Find the Ɵ notation of the following function
f(n) = 3 x 2n + 4n2 + 5n + 2
0 ≤ c1 g(n) ≤ f(n) ≤ c2 g(n) for all n ≥ n0

c1 g(n) ≤ f(n) for all n ≥ n0


Here f(n) = 3 x 2n + 4n2 + 5n + 2 g(n)= 2n c1 =3 n0 =1
3x2n ≤ 3 x 2n + 4n2 + 5n + 2 for all n ≥ 1

f(n) ≤ c2 g(n) for all n ≥ n0


Here f(n) = 3 x 2n + 4n2 + 5n + 2 g(n)= 2n c2 =10 n0 =1
3 x 2n + 4n2 + 5n + 2 ≤ 10x 2n for all n ≥ 1

3x2n ≤ 3 x 2n + 4n2 + 5n + 2 ≤ 10x 2n for all n ≥ 1 c1 =3 c2 =10 n0 =1

CS KTU Lectures
Find the Ɵ notation of the following function
f(n) = 3 x 2n + 4n2 + 5n + 2
0 ≤ c1 g(n) ≤ f(n) ≤ c2 g(n) for all n ≥ n0

c1 g(n) ≤ f(n) for all n ≥ n0


Here f(n) = 3 x 2n + 4n2 + 5n + 2 g(n)= 2n c1 =3 n0 =1
3x2n ≤ 3 x 2n + 4n2 + 5n + 2 for all n ≥ 1

f(n) ≤ c2 g(n) for all n ≥ n0


Here f(n) = 3 x 2n + 4n2 + 5n + 2 g(n)= 2n c2 =10 n0 =1
3 x 2n + 4n2 + 5n + 2 ≤ 10x 2n for all n ≥ 1

3x2n ≤ 3 x 2n + 4n2 + 5n + 2 ≤ 10x 2n for all n ≥ 1 c1 =3 c2 =10 n0 =1

Therefore  Lectures
f(n) = Ɵ(g(n))CS KTU 3 x 2n + 4n2 + 5n + 2 = Ɵ(2n )
Little oh (o) Notation
Definition:
The function f(n) = o(g(n)) iff for any positive
constant c>0, there exists a constant n0>0 such
that 0 ≤ f(n) < c g(n) for all n ≥ n0

It is asymptotically loose upper bound

g(n) becomes arbitrarily large relative to f(n) as n


approaches infinity
CS KTU Lectures
Little Omega (ω)
Definition:
The function f(n) = ω(g(n)) iff for any positive
constant c>0, there exists a constant n 0>0 such
that f(n) > c g(n) ≥ 0 for all n ≥ n0

It is asymptotically loose lower bound

f(n) becomes arbitrarily large relative to g(n) as


n approaches infinity
CS KTU Lectures

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy