SlideShare a Scribd company logo
Asymptotic Analysis-2
Topics
 Asymptotic notation using Limits
 Definitions of O, Ω,Ө, o,ω notations
 Analysis of Summations
Asymptotic Analysis
Using Limits
 Use of basic definition for determining the asymptotic behavior is often awkward. It
involves ad hoc approach or some kind of manipulation to prove algebraic relations.
 Calculus provides an alternative method for the analysis. It depends on evaluating
the following limit.
f(n)
lim = c
n→∞ g(n)
where f(n) is a growth function for an algorithm and g(n) is a standard function
 Depending upon the value c , the relation between f(n) and g(n) can be expressed in terms
of asymptotic notations. In most cases it is easier to use limits, compared to basic method, to
determine asymptotic behavior of growth functions.
 It will be seen that the Calculus notation n→ ∞ is equivalent to the algebraic condition
for all n ≥ n0 . Either of these conditions implies large input
O-Notation Using Limit
Definition
If f(n) is running time of an algorithm and g(n) is some standard growth function such
that
f(n)
lim —— = c , where c is a positive constant such that 0 ≤ c < ∞
n → ∞ g(n)
then f(n) = O ( g(n) )
 Note that infinity is excluded from the range of permissible values for the constant c
O-Notation
Examples
Example(1): 3n2 + 5n+ 20 = O(n2)
lim
n → ∞
3n2 + 5n + 20
n2
=3+ 5 / n +20 / n2
= 3+0+0 =3 ( positive constant)
Therefore, 3n2 + 5n+ 20 = O(n2)
Example(2): 10n2 + 25n+ 7 = O(n3)
lim
n → ∞
10n2 + 25n + 7
n3
=10 / n+ 25 / n2 + 7 / n3
=0+0+0 = 0
Therefore, 10n2 + 25n+ 7 = O(n3)
O-Notation
Examples
Example(3): lg n = O(n)
lim
n → ∞
lg n
n
= ∞ / ∞ ( Need to apply the L’ Hopital Rule )
In order to compute differential of lg n we first convert binary logarithm to natural logarithm.
Converting lg n (binary log ) to ln( n) ( natural log) , by the using formula lg n = ln n / ln 2
lim
lg n
= (ln n) (Converting to natural log)
n → ∞ n (ln 2) n
lim
n → ∞
1
ln 2. n
( Differentiating numerator and denominator)
= 0 ( Evaluating limits)
Therefore, lg n = O(n)
O-Notation
Examples
Example(4): n2 = O(2n)
lim
n → ∞
n2
=∞ / ∞ ( Need to apply the L’ Hopital Rule )
2n
Since d ( 2n ) = ln 2 . 2n, ( Calculus rule for differentiating the exponential functions)
dn
lim 2n (Differentiating numerator and denominator )
n → ∞ ln 2 2n
= ∞ / ∞ (Need again to apply the L’Hopital rule)
lim
n → ∞
2
(ln2)2. 2n
(Again differentiating numerator and denominator )
= 0 (Evaluating the limits )
Therefore, n2 = O(2n)
Ω-Notation Using Limit
Definition
If f(n) is running time of an algorithm and g(n) is some standard growth function such
that
f(n)
lim —— = c , where c is a constant, such that 0 < c ≤ ∞
n → ∞ g(n)
then f(n) = Ω( g(n) ).
 Note that zero value for the constant c is excluded from the permissible range, but
infinity is included.
Example(1): 7n2 + 12n+8= Ω(n2)
Ω-Notation
Examples
lim
n → ∞
7n2 + 14n + 8
n2
= 7+ 14 / n +8 / n2
= 7 + 0 + 0
=7 (Non-zero constant)
Therefore, 7n2 + 14n+ 8 = Ω(n2)
Example(2): 10n3 + 5n+ 2 = Ω(n2)
lim
n → ∞
10n3 + 5n + 2
n2
=10 n+ 5 / n + 2 / n2
= ∞ + 0 + 0
= ∞
Therefore, 10n3 + 5n+ 2 = Ω (n2)
Ө-Notation Using Limit
Definition
If f(n) is running time of an algorithm and g(n) is some standard growth function such
that
f(n)
lim —— = c , where c is a constant, such that 0 < c < ∞
n → ∞ g(n)
then f(n) = Ө ( g(n) ).
 Note that zero value and infinity are excluded from the permissible values for the
range of constant c
Θ-Notation
Examples
Example(1): 45n3 - 3n2 - 5n+ 20 = θ(n3)
lim
n → ∞
45n3 -3n2 - 5n + 20
n3
= 45-3 / n -5 / n2 +20/n3
= 45 - 0 – 0 + 0
=45 (non-zero constant)
Therefore, 45n3 - 3n2 - 5n+ 20 = θ(n3)
Example(2): n lg n + n + n2 = θ(n2)
lim
n → ∞
n lg n + n + n2
n2
= lg n / n +1/n +1
= 0 +0 + 1
=1 (non-zero constant)
Thus, n lg n + n + n2 = θ(n2)
Θ-Notation
Examples
Example(3): 45n3 - 3n2 - 5n+ 20 ≠ θ(n4)
lim
n → ∞
45n3 -3n2 - 5n + 20
n4
= 45 / n - 3 / n2 - 5 / n3 + 20 / n4
= 0 - 0 - 0 + 0
= 0 (zero is excluded from the permissible range for Ө-notation)
Therefore, 45n3 - 3n2 - 5n+ 20 ≠ θ(n3)
Example(4): n lg n + n ≠ θ(n2)
lim
n → ∞
n lg n + n
n2
= lg n / n + 1/n ( Using the L’Hopital Rule to evaluate the limit of lgn /n)
= 0 +0
=0
Thus, n lg n + n ≠ θ(n2)
o-Notation Using Limit
Definition
If f(n) is running time and g(n) is some standard growth function such that
f(n)
lim —— = 0 ( zero )
n → ∞ g(n)
then f(n) = o( g(n) ) (Read f (n) is small-oh of g(n))
 o( g(n) ) is referred to as the loose upper bound for f(n)
o-Notation
Examples
Example(1): 5n+ 20 = o(n2)
lim
n → ∞
5n + 20
n2
= 5 / n + 20 / n2
= 0 + 0
Therefore, 5n+ 20 = o(n2)
Example(2): 10n2 + 25n+ 7 = o(n3)
lim
n → ∞
10n2 + 25n + 7
n3
=10 / n+ 25 / n2 + 7 / n3
= 0+0+0
=0
Therefore, 10n2 + 25n + 7 = o(n3)
o-Notation
Examples
Example(3): lg n = o (n)
lim lg n
=
∞ ( Need to use L’Hopital Rule)
n → ∞ n ∞
lim ln n
( Converting to natural log ,lg n = log2 n =log e n / loge 2 )
n → ∞ n ln 2
lim 1
( Differentiating numerator and denominator )
n → ∞ n ln2
= 0
Therefore, lg n = o (n)
ω-Notation
Definition
If f(n) is running time and g(n) is some standard growth function such that
f(n)
lim —— = ∞
n → ∞ g(n)
then f(n) = ω(g(n)) (Read f(n) is small-omega of g(n))
 ω(g(n)) is referred to as the loose lower bound for f(n)
ω-Notation
Examples
Example(1): 5n3+ 20n2+n+10 = ω(n2)
lim
n → ∞
5n3 + 20n2+n+10
n2
=5n +20 + 1/ n+10 / n2
= ∞ + 20 + 0+ 0
= ∞
Therefore, by definition, 5n3+ 20n2+n+10 = ω(n2)
Example(2): 10n2 + 25n+ 7 = ω(n)
lim
n → ∞
10n2 + 25n + 7
n
= n+ 25 + 7 / n
= ∞ +25 + 0
= ∞
Therefore, 10n2 + 25n+ 7 = ω(n)
ω-Notation
Examples
Example(3): n! =ω(2n)
lim
n → ∞
n!
= ∞ / ∞ (Need to use the LHpoital Rule
2n
The function n! cannot be differentiated directly. We first use Stirling’s approximation:
lim
n! = √ 2πn ( n /e ) n for large n
n!
n → ∞
=
2n
√ 2πn ( n / e ) n
2n
= √ 2πn ( n /2 e ) n
= ∞
Thus, n! = ω( 2n )
Asymptotic Notation
Summary
Let f(n) be time complexity and g(n) standard function, such that lim
n→∞
f(n)
——— = α
g(n)
Table below summarizes the asymptotic behavior of f(n) in terms of g(n)
Notation Using Basic Definition Using Limits Asymptotic Bound
f(n)=O( g(n) ) f(n) ≤ c.g(n) for some c>0, and n ≥ n0 0 < α < ∞ upper tight
f(n)=o( g(n) ) f(n) <c.g(n) for all c>0, and n ≥ n0 α = 0 upper loose
f(n)=Ω( g(n) ) f(n) ≥ c.g(n) for some c>0 and n ≥ n0 0 < α ≤ ∞ lower tight
f(n)=ω( g(n) ) f(n) > c.g(n) for all c>0 and n ≥ n0 α = ∞ lower loose
f(n)=θ( g(n) ) c1.g ≤ f(n) ≤ c2.g(n) for some c1>0, c2>0
and n ≥ n0
0 < α < ∞ tight
Asymptotic Set Notations
Definitions
 The asymptotic notation can also be expressed in Set notations by using the limits
f(n)
 Let f(n) be time complexity and g(n) standard function, such that lim ——— = c
where c is zero, positive constant or infinity.
n→∞ g(n)
 The set notations for the asymptotic behavior is are defined as follows
(i) O(g(n) ) = { f(n): 0 ≤ c < ∞ }
(ii) Ω( g(n) ) = { f(n) : 0 < c ≤ ∞ }
(iii) Ө( g(n) ) = { f(n): 0 < c < ∞ }
(iv) o( g(n) ) = { f(n): c = 0 }
(v) ω( g(n) ) = { f(n): c = ∞ }
Asymptotic Set Notations
Examples
Example (1): Let f(n)O ( g(n) ), f(n)  Ω( f(n) ) . Then
O(g(n) ) = { f(n): 0 ≤ c < ∞ } (definition of O-notation)
Ω( g(n) ) = { f(n) : 0 < c ≤ ∞ } (definition of Ω-notation )
O(g(n) ) ∩ Ω ( g(n) ) = { f(n) : 0 < c < ∞ } ( Performing Set intersection operation )
= Ө (g(n)) (definition of Ө-notation }
Thus, O(g(n) ) ∩ Ω ( g(n) ) = Ө (g(n))
Example (2):Suppose f(n) o(g(n)), and f(n)ω(g(n)). Then
o(g(n)) = { f(n): c = 0 } (definition of o-notation)
Ω(g(n))= { f(n): c = ∞ } (definition of ω-notation)
Therefore, o(g(n)) ∩ ω( g(n)) =φ ( Empty set )
Analysis of Summations
Arithmetic Summation
Asymptotic Behavior
 The sum of first of n terms of arithmetic series is :
1 + 2 + 3………..+n = n(n+1)/2
Let f(n)= n(n+1)/2
and g(n)= n2
f(n)
lim
n(n+1)/2 n2 /2 + n/2
= = = 1 /2 + 1/2n =1/2 + 0=1/2
n→∞ g(n) n2 n2
 Since the limit is non-zero and finite it follows
f(n) = θ( g(n)) = θ(n2)
Or, 1 + 2 + ………..+ n = θ(n2)
Geometric Summation
Asymptotic Behavior
 The asymptotic behavior of geometric series
1 +r + r2+……..+rn
depends on geometric ratio r. Three cases need to be considered
Case r > 1: It can be shown that sum f(n) of first n terms is as follows
rn+1 - 1
f(n) = 1 +r + r2+……..+rn = —————
r - 1
Case r = 1: This is trivial
f(n)= 1 + 1 + 1+ ……+1 = n =Ө(n)
Case r < 1: It can be shown that
2 n
1 - rn+1
f(n) = 1 +r + r +……..+r = —————
1 - r
 The asymptotic behavior in first case and third case is explored by computing limits.
Geometric Summation
Case r > 1
2 n
rn+1 - 1
Let f(n) = 1 +r + r
Let g(n)= rn
+……..+r = —————
r - 1
Consider, the limit
lim
n→∞
f(n)
g(n)
rn+1 - 1
=
(r - 1).rn
r - 1/rn
=
(r - 1)
Since r>1 , 1/rn →0 as n→ ∞
lim
n→∞
f(n)
g(n)
=
r
(r - 1)
>0, since r > 1
Therefore, f(n) = θ(rn) for r>1
Or, 1 +r + r2+……..+rn = θ(rn) for r > 1
Geometric Summation
Case r < 1
2 n
rn+1 - 1
Consider 1 +r + r +……..+r = —————
r - 1
Let g(n)=c where c is some positive constant
Taking the limit
lim
f(n) rn+1 - 1
=
1- rn+1
=
n→∞ g(n) (r - 1).c (1- r )c
Since r<1 , rn+1 →0 as n→ ∞
lim
n→∞
f(n)
g(n)
=
1
(1 - r). c
>0, since r < 1
Therefore, f(n)= θ(g(n))=θ(c) = θ(1) for r <1
Or, 1 +r + r2+……..+rn
=θ(1) for r <1
Geometric Summation
Asymptotic Behavior
From the preceding analysis it follows that the asymptotic behavior of geometric summation is
S(n) =1+r+r2+.........+ rn =
Ө(rn) when r>1
Ө(1) when r<1
 When r <1, the largest term in the geometric summation would be 1 ( the first term) , and
S(n) =Ө(1) . On the other hand if r>1, the largest term would be rn ( the last term), and
S(n)=Ө(rn) In the light of this observation it can said that asymptotic behavior of geometric
summation is determined by the largest term i.e S(n)=Ө (largest term).
Example(1): The geometric series
1+21+ 22 +….+ 2n
has geometric ratio r=2>1 ,
Thus, 1+21+ 22 +….+ 2n =Ө(2n) , ► Ө(largest term)
Example(2): The geometric series
1+(2/3)1+ (2/3)2 +….+ (2/3)n
has geometric ratio r=2/3 <1 ,
Thus, 1+(2/3)1+ (2/3)2 +….+ (2/3)n =Ө(1) , ►Ө(largest term)
Logarithm Summation
Asymptotic Behavior
The logarithmic series has the summation
lg(1)+lg(2)+ lg(3)+….. +lg(n)
Let f(n) = lg(2)+ lg(3)+….+.lg(n) = lg(2.3……..n) = lg( n!)
and g(n) = n lg n
lim
n→∞
f(n)
g(n) =
lg n!
n lg n =
lg ( √(2πn)(n/e)n )
n lg n
(Using Stirling’s approximation)
Now, lg ( √(2πn)(n/e)n ) = (1+lg π + lg n)/2 + n lg n - n lg e , therefore
lim lg ( √(2πn)(n/e)n ) = ( 1+lg π + lg n ) /(2 nlg n) + 1 - lg e / lg n = (0+ 1- 0)=1
n→∞ n lg n
Since limit is non-zero and finite, it follows
f(n)= θ(g(n))
Or, lg(1)+lg(2)+ lg(3)+….. +lg(n) = θ(n lg n) …
Harmonic Summation
Asymptotic Behavior
The sum of first n terms of Harmonic series is
1+ 1/2 + 1/3+…..+1/n
Let f(n) = 1+ 1/2 + 1/3+…..+1/n
and g(n) = lg n
lim
n→∞
f(n)
g(n)
1+1/2+1/3+ …..+1/n
=
lg n
It can be shown that 1+ 1/2+ 1/3+…+1/n = lg (n) + γ + 1/2n – 1/12n2+..where γ ≈ 0.5772
lim
n→∞
f(n)
g(n)
lg n + γ + 1/2n – 1/12n2 +…
=
lg n
= 1+0+0-0+0+…=1
Since limit is finite and non-zero, it follows
f(n) = θ( g(n))
Or, 1+ 1/2 + 1/3+…..+1/n = θ (lg n )

More Related Content

Similar to Lecture3(b).pdf

asymptotic notations i
asymptotic notations iasymptotic notations i
asymptotic notations i
Ali mahmood
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
mustafa sarac
 
02 asymptotic notations
02 asymptotic notations02 asymptotic notations
02 asymptotic notations
TarikuDabala1
 
Asymtotic Appoach.ppt
Asymtotic Appoach.pptAsymtotic Appoach.ppt
Asymtotic Appoach.ppt
SherylArulini1
 
02-asymp.ppt
02-asymp.ppt02-asymp.ppt
02-asymp.ppt
AnikGhosh44
 
Time complexity
Time complexityTime complexity
Time complexity
LAKSHMITHARUN PONNAM
 
Asymptotic Notation and Complexity
Asymptotic Notation and ComplexityAsymptotic Notation and Complexity
Asymptotic Notation and Complexity
Rajandeep Gill
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notationsNikhil Sharma
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
Saranya Natarajan
 
Lecture 4 - Growth of Functions.ppt
Lecture 4 - Growth of Functions.pptLecture 4 - Growth of Functions.ppt
Lecture 4 - Growth of Functions.ppt
ZohairMughal1
 
Lecture 4 - Growth of Functions (1).ppt
Lecture 4 - Growth of Functions (1).pptLecture 4 - Growth of Functions (1).ppt
Lecture 4 - Growth of Functions (1).ppt
ZohairMughal1
 
2-AnalysisOfAlgs.ppt
2-AnalysisOfAlgs.ppt2-AnalysisOfAlgs.ppt
2-AnalysisOfAlgs.ppt
TahseenEjaz3
 
Dr hasany 2467_16649_1_lec-2-zabist
Dr hasany 2467_16649_1_lec-2-zabistDr hasany 2467_16649_1_lec-2-zabist
Dr hasany 2467_16649_1_lec-2-zabist
Gatewayggg Testeru
 
2_Asymptotic notations.pptx
2_Asymptotic notations.pptx2_Asymptotic notations.pptx
2_Asymptotic notations.pptx
dattakumar4
 
CMSC 56 | Lecture 8: Growth of Functions
CMSC 56 | Lecture 8: Growth of FunctionsCMSC 56 | Lecture 8: Growth of Functions
CMSC 56 | Lecture 8: Growth of Functions
allyn joy calcaben
 
Unit-1 DAA_Notes.pdf
Unit-1 DAA_Notes.pdfUnit-1 DAA_Notes.pdf
Unit-1 DAA_Notes.pdf
AmayJaiswal4
 
DAA_LECT_2.pdf
DAA_LECT_2.pdfDAA_LECT_2.pdf
DAA_LECT_2.pdf
AryanSaini69
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
sohelranasweet
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
sajinis3
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithms
S.Shayan Daneshvar
 

Similar to Lecture3(b).pdf (20)

asymptotic notations i
asymptotic notations iasymptotic notations i
asymptotic notations i
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
 
02 asymptotic notations
02 asymptotic notations02 asymptotic notations
02 asymptotic notations
 
Asymtotic Appoach.ppt
Asymtotic Appoach.pptAsymtotic Appoach.ppt
Asymtotic Appoach.ppt
 
02-asymp.ppt
02-asymp.ppt02-asymp.ppt
02-asymp.ppt
 
Time complexity
Time complexityTime complexity
Time complexity
 
Asymptotic Notation and Complexity
Asymptotic Notation and ComplexityAsymptotic Notation and Complexity
Asymptotic Notation and Complexity
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
 
Lecture 4 - Growth of Functions.ppt
Lecture 4 - Growth of Functions.pptLecture 4 - Growth of Functions.ppt
Lecture 4 - Growth of Functions.ppt
 
Lecture 4 - Growth of Functions (1).ppt
Lecture 4 - Growth of Functions (1).pptLecture 4 - Growth of Functions (1).ppt
Lecture 4 - Growth of Functions (1).ppt
 
2-AnalysisOfAlgs.ppt
2-AnalysisOfAlgs.ppt2-AnalysisOfAlgs.ppt
2-AnalysisOfAlgs.ppt
 
Dr hasany 2467_16649_1_lec-2-zabist
Dr hasany 2467_16649_1_lec-2-zabistDr hasany 2467_16649_1_lec-2-zabist
Dr hasany 2467_16649_1_lec-2-zabist
 
2_Asymptotic notations.pptx
2_Asymptotic notations.pptx2_Asymptotic notations.pptx
2_Asymptotic notations.pptx
 
CMSC 56 | Lecture 8: Growth of Functions
CMSC 56 | Lecture 8: Growth of FunctionsCMSC 56 | Lecture 8: Growth of Functions
CMSC 56 | Lecture 8: Growth of Functions
 
Unit-1 DAA_Notes.pdf
Unit-1 DAA_Notes.pdfUnit-1 DAA_Notes.pdf
Unit-1 DAA_Notes.pdf
 
DAA_LECT_2.pdf
DAA_LECT_2.pdfDAA_LECT_2.pdf
DAA_LECT_2.pdf
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithms
 

More from ShaistaRiaz4

Algorithms Analysis.pdf
Algorithms Analysis.pdfAlgorithms Analysis.pdf
Algorithms Analysis.pdf
ShaistaRiaz4
 
Case Study(Analysis of Algorithm.pdf
Case Study(Analysis of Algorithm.pdfCase Study(Analysis of Algorithm.pdf
Case Study(Analysis of Algorithm.pdf
ShaistaRiaz4
 
02_Computer-Evolution(1).ppt
02_Computer-Evolution(1).ppt02_Computer-Evolution(1).ppt
02_Computer-Evolution(1).ppt
ShaistaRiaz4
 
01_Introduction.ppt
01_Introduction.ppt01_Introduction.ppt
01_Introduction.ppt
ShaistaRiaz4
 
Algo_Lecture01.pptx
Algo_Lecture01.pptxAlgo_Lecture01.pptx
Algo_Lecture01.pptx
ShaistaRiaz4
 
02_Computer-Evolution(1).ppt
02_Computer-Evolution(1).ppt02_Computer-Evolution(1).ppt
02_Computer-Evolution(1).ppt
ShaistaRiaz4
 
01_Introduction.ppt
01_Introduction.ppt01_Introduction.ppt
01_Introduction.ppt
ShaistaRiaz4
 
Bisma Zahid (1)-1.pdf
Bisma Zahid (1)-1.pdfBisma Zahid (1)-1.pdf
Bisma Zahid (1)-1.pdf
ShaistaRiaz4
 
MNS Lecture 1.pptx
MNS Lecture 1.pptxMNS Lecture 1.pptx
MNS Lecture 1.pptx
ShaistaRiaz4
 
Plan (2).pptx
Plan (2).pptxPlan (2).pptx
Plan (2).pptx
ShaistaRiaz4
 
Lecture+9+-+Dynamic+Programming+I.pdf
Lecture+9+-+Dynamic+Programming+I.pdfLecture+9+-+Dynamic+Programming+I.pdf
Lecture+9+-+Dynamic+Programming+I.pdf
ShaistaRiaz4
 
oppositional-defiant-disorder495.pptx
oppositional-defiant-disorder495.pptxoppositional-defiant-disorder495.pptx
oppositional-defiant-disorder495.pptx
ShaistaRiaz4
 
Development Education.pptx
Development Education.pptxDevelopment Education.pptx
Development Education.pptx
ShaistaRiaz4
 
WISC-IV Introduction Handout.ppt
WISC-IV Introduction Handout.pptWISC-IV Introduction Handout.ppt
WISC-IV Introduction Handout.ppt
ShaistaRiaz4
 
Summary and Evaluation of the Book.pptx
Summary and Evaluation of the Book.pptxSummary and Evaluation of the Book.pptx
Summary and Evaluation of the Book.pptx
ShaistaRiaz4
 
MH&PSS for L&NFBED 7-8 April 2020.ppt
MH&PSS for L&NFBED 7-8 April 2020.pptMH&PSS for L&NFBED 7-8 April 2020.ppt
MH&PSS for L&NFBED 7-8 April 2020.ppt
ShaistaRiaz4
 
Intro_to_Literature_2012-2013-1.ppt
Intro_to_Literature_2012-2013-1.pptIntro_to_Literature_2012-2013-1.ppt
Intro_to_Literature_2012-2013-1.ppt
ShaistaRiaz4
 
Coping strategies-Farzana Razi.ppt
Coping strategies-Farzana Razi.pptCoping strategies-Farzana Razi.ppt
Coping strategies-Farzana Razi.ppt
ShaistaRiaz4
 
Intellectual_development.ppt
Intellectual_development.pptIntellectual_development.ppt
Intellectual_development.ppt
ShaistaRiaz4
 
Integrating Technology Models.pptx
Integrating Technology Models.pptxIntegrating Technology Models.pptx
Integrating Technology Models.pptx
ShaistaRiaz4
 

More from ShaistaRiaz4 (20)

Algorithms Analysis.pdf
Algorithms Analysis.pdfAlgorithms Analysis.pdf
Algorithms Analysis.pdf
 
Case Study(Analysis of Algorithm.pdf
Case Study(Analysis of Algorithm.pdfCase Study(Analysis of Algorithm.pdf
Case Study(Analysis of Algorithm.pdf
 
02_Computer-Evolution(1).ppt
02_Computer-Evolution(1).ppt02_Computer-Evolution(1).ppt
02_Computer-Evolution(1).ppt
 
01_Introduction.ppt
01_Introduction.ppt01_Introduction.ppt
01_Introduction.ppt
 
Algo_Lecture01.pptx
Algo_Lecture01.pptxAlgo_Lecture01.pptx
Algo_Lecture01.pptx
 
02_Computer-Evolution(1).ppt
02_Computer-Evolution(1).ppt02_Computer-Evolution(1).ppt
02_Computer-Evolution(1).ppt
 
01_Introduction.ppt
01_Introduction.ppt01_Introduction.ppt
01_Introduction.ppt
 
Bisma Zahid (1)-1.pdf
Bisma Zahid (1)-1.pdfBisma Zahid (1)-1.pdf
Bisma Zahid (1)-1.pdf
 
MNS Lecture 1.pptx
MNS Lecture 1.pptxMNS Lecture 1.pptx
MNS Lecture 1.pptx
 
Plan (2).pptx
Plan (2).pptxPlan (2).pptx
Plan (2).pptx
 
Lecture+9+-+Dynamic+Programming+I.pdf
Lecture+9+-+Dynamic+Programming+I.pdfLecture+9+-+Dynamic+Programming+I.pdf
Lecture+9+-+Dynamic+Programming+I.pdf
 
oppositional-defiant-disorder495.pptx
oppositional-defiant-disorder495.pptxoppositional-defiant-disorder495.pptx
oppositional-defiant-disorder495.pptx
 
Development Education.pptx
Development Education.pptxDevelopment Education.pptx
Development Education.pptx
 
WISC-IV Introduction Handout.ppt
WISC-IV Introduction Handout.pptWISC-IV Introduction Handout.ppt
WISC-IV Introduction Handout.ppt
 
Summary and Evaluation of the Book.pptx
Summary and Evaluation of the Book.pptxSummary and Evaluation of the Book.pptx
Summary and Evaluation of the Book.pptx
 
MH&PSS for L&NFBED 7-8 April 2020.ppt
MH&PSS for L&NFBED 7-8 April 2020.pptMH&PSS for L&NFBED 7-8 April 2020.ppt
MH&PSS for L&NFBED 7-8 April 2020.ppt
 
Intro_to_Literature_2012-2013-1.ppt
Intro_to_Literature_2012-2013-1.pptIntro_to_Literature_2012-2013-1.ppt
Intro_to_Literature_2012-2013-1.ppt
 
Coping strategies-Farzana Razi.ppt
Coping strategies-Farzana Razi.pptCoping strategies-Farzana Razi.ppt
Coping strategies-Farzana Razi.ppt
 
Intellectual_development.ppt
Intellectual_development.pptIntellectual_development.ppt
Intellectual_development.ppt
 
Integrating Technology Models.pptx
Integrating Technology Models.pptxIntegrating Technology Models.pptx
Integrating Technology Models.pptx
 

Recently uploaded

Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 

Recently uploaded (20)

Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 

Lecture3(b).pdf

  • 2. Topics  Asymptotic notation using Limits  Definitions of O, Ω,Ө, o,ω notations  Analysis of Summations
  • 3. Asymptotic Analysis Using Limits  Use of basic definition for determining the asymptotic behavior is often awkward. It involves ad hoc approach or some kind of manipulation to prove algebraic relations.  Calculus provides an alternative method for the analysis. It depends on evaluating the following limit. f(n) lim = c n→∞ g(n) where f(n) is a growth function for an algorithm and g(n) is a standard function  Depending upon the value c , the relation between f(n) and g(n) can be expressed in terms of asymptotic notations. In most cases it is easier to use limits, compared to basic method, to determine asymptotic behavior of growth functions.  It will be seen that the Calculus notation n→ ∞ is equivalent to the algebraic condition for all n ≥ n0 . Either of these conditions implies large input
  • 4. O-Notation Using Limit Definition If f(n) is running time of an algorithm and g(n) is some standard growth function such that f(n) lim —— = c , where c is a positive constant such that 0 ≤ c < ∞ n → ∞ g(n) then f(n) = O ( g(n) )  Note that infinity is excluded from the range of permissible values for the constant c
  • 5. O-Notation Examples Example(1): 3n2 + 5n+ 20 = O(n2) lim n → ∞ 3n2 + 5n + 20 n2 =3+ 5 / n +20 / n2 = 3+0+0 =3 ( positive constant) Therefore, 3n2 + 5n+ 20 = O(n2) Example(2): 10n2 + 25n+ 7 = O(n3) lim n → ∞ 10n2 + 25n + 7 n3 =10 / n+ 25 / n2 + 7 / n3 =0+0+0 = 0 Therefore, 10n2 + 25n+ 7 = O(n3)
  • 6. O-Notation Examples Example(3): lg n = O(n) lim n → ∞ lg n n = ∞ / ∞ ( Need to apply the L’ Hopital Rule ) In order to compute differential of lg n we first convert binary logarithm to natural logarithm. Converting lg n (binary log ) to ln( n) ( natural log) , by the using formula lg n = ln n / ln 2 lim lg n = (ln n) (Converting to natural log) n → ∞ n (ln 2) n lim n → ∞ 1 ln 2. n ( Differentiating numerator and denominator) = 0 ( Evaluating limits) Therefore, lg n = O(n)
  • 7. O-Notation Examples Example(4): n2 = O(2n) lim n → ∞ n2 =∞ / ∞ ( Need to apply the L’ Hopital Rule ) 2n Since d ( 2n ) = ln 2 . 2n, ( Calculus rule for differentiating the exponential functions) dn lim 2n (Differentiating numerator and denominator ) n → ∞ ln 2 2n = ∞ / ∞ (Need again to apply the L’Hopital rule) lim n → ∞ 2 (ln2)2. 2n (Again differentiating numerator and denominator ) = 0 (Evaluating the limits ) Therefore, n2 = O(2n)
  • 8. Ω-Notation Using Limit Definition If f(n) is running time of an algorithm and g(n) is some standard growth function such that f(n) lim —— = c , where c is a constant, such that 0 < c ≤ ∞ n → ∞ g(n) then f(n) = Ω( g(n) ).  Note that zero value for the constant c is excluded from the permissible range, but infinity is included.
  • 9. Example(1): 7n2 + 12n+8= Ω(n2) Ω-Notation Examples lim n → ∞ 7n2 + 14n + 8 n2 = 7+ 14 / n +8 / n2 = 7 + 0 + 0 =7 (Non-zero constant) Therefore, 7n2 + 14n+ 8 = Ω(n2) Example(2): 10n3 + 5n+ 2 = Ω(n2) lim n → ∞ 10n3 + 5n + 2 n2 =10 n+ 5 / n + 2 / n2 = ∞ + 0 + 0 = ∞ Therefore, 10n3 + 5n+ 2 = Ω (n2)
  • 10. Ө-Notation Using Limit Definition If f(n) is running time of an algorithm and g(n) is some standard growth function such that f(n) lim —— = c , where c is a constant, such that 0 < c < ∞ n → ∞ g(n) then f(n) = Ө ( g(n) ).  Note that zero value and infinity are excluded from the permissible values for the range of constant c
  • 11. Θ-Notation Examples Example(1): 45n3 - 3n2 - 5n+ 20 = θ(n3) lim n → ∞ 45n3 -3n2 - 5n + 20 n3 = 45-3 / n -5 / n2 +20/n3 = 45 - 0 – 0 + 0 =45 (non-zero constant) Therefore, 45n3 - 3n2 - 5n+ 20 = θ(n3) Example(2): n lg n + n + n2 = θ(n2) lim n → ∞ n lg n + n + n2 n2 = lg n / n +1/n +1 = 0 +0 + 1 =1 (non-zero constant) Thus, n lg n + n + n2 = θ(n2)
  • 12. Θ-Notation Examples Example(3): 45n3 - 3n2 - 5n+ 20 ≠ θ(n4) lim n → ∞ 45n3 -3n2 - 5n + 20 n4 = 45 / n - 3 / n2 - 5 / n3 + 20 / n4 = 0 - 0 - 0 + 0 = 0 (zero is excluded from the permissible range for Ө-notation) Therefore, 45n3 - 3n2 - 5n+ 20 ≠ θ(n3) Example(4): n lg n + n ≠ θ(n2) lim n → ∞ n lg n + n n2 = lg n / n + 1/n ( Using the L’Hopital Rule to evaluate the limit of lgn /n) = 0 +0 =0 Thus, n lg n + n ≠ θ(n2)
  • 13. o-Notation Using Limit Definition If f(n) is running time and g(n) is some standard growth function such that f(n) lim —— = 0 ( zero ) n → ∞ g(n) then f(n) = o( g(n) ) (Read f (n) is small-oh of g(n))  o( g(n) ) is referred to as the loose upper bound for f(n)
  • 14. o-Notation Examples Example(1): 5n+ 20 = o(n2) lim n → ∞ 5n + 20 n2 = 5 / n + 20 / n2 = 0 + 0 Therefore, 5n+ 20 = o(n2) Example(2): 10n2 + 25n+ 7 = o(n3) lim n → ∞ 10n2 + 25n + 7 n3 =10 / n+ 25 / n2 + 7 / n3 = 0+0+0 =0 Therefore, 10n2 + 25n + 7 = o(n3)
  • 15. o-Notation Examples Example(3): lg n = o (n) lim lg n = ∞ ( Need to use L’Hopital Rule) n → ∞ n ∞ lim ln n ( Converting to natural log ,lg n = log2 n =log e n / loge 2 ) n → ∞ n ln 2 lim 1 ( Differentiating numerator and denominator ) n → ∞ n ln2 = 0 Therefore, lg n = o (n)
  • 16. ω-Notation Definition If f(n) is running time and g(n) is some standard growth function such that f(n) lim —— = ∞ n → ∞ g(n) then f(n) = ω(g(n)) (Read f(n) is small-omega of g(n))  ω(g(n)) is referred to as the loose lower bound for f(n)
  • 17. ω-Notation Examples Example(1): 5n3+ 20n2+n+10 = ω(n2) lim n → ∞ 5n3 + 20n2+n+10 n2 =5n +20 + 1/ n+10 / n2 = ∞ + 20 + 0+ 0 = ∞ Therefore, by definition, 5n3+ 20n2+n+10 = ω(n2) Example(2): 10n2 + 25n+ 7 = ω(n) lim n → ∞ 10n2 + 25n + 7 n = n+ 25 + 7 / n = ∞ +25 + 0 = ∞ Therefore, 10n2 + 25n+ 7 = ω(n)
  • 18. ω-Notation Examples Example(3): n! =ω(2n) lim n → ∞ n! = ∞ / ∞ (Need to use the LHpoital Rule 2n The function n! cannot be differentiated directly. We first use Stirling’s approximation: lim n! = √ 2πn ( n /e ) n for large n n! n → ∞ = 2n √ 2πn ( n / e ) n 2n = √ 2πn ( n /2 e ) n = ∞ Thus, n! = ω( 2n )
  • 19. Asymptotic Notation Summary Let f(n) be time complexity and g(n) standard function, such that lim n→∞ f(n) ——— = α g(n) Table below summarizes the asymptotic behavior of f(n) in terms of g(n) Notation Using Basic Definition Using Limits Asymptotic Bound f(n)=O( g(n) ) f(n) ≤ c.g(n) for some c>0, and n ≥ n0 0 < α < ∞ upper tight f(n)=o( g(n) ) f(n) <c.g(n) for all c>0, and n ≥ n0 α = 0 upper loose f(n)=Ω( g(n) ) f(n) ≥ c.g(n) for some c>0 and n ≥ n0 0 < α ≤ ∞ lower tight f(n)=ω( g(n) ) f(n) > c.g(n) for all c>0 and n ≥ n0 α = ∞ lower loose f(n)=θ( g(n) ) c1.g ≤ f(n) ≤ c2.g(n) for some c1>0, c2>0 and n ≥ n0 0 < α < ∞ tight
  • 20. Asymptotic Set Notations Definitions  The asymptotic notation can also be expressed in Set notations by using the limits f(n)  Let f(n) be time complexity and g(n) standard function, such that lim ——— = c where c is zero, positive constant or infinity. n→∞ g(n)  The set notations for the asymptotic behavior is are defined as follows (i) O(g(n) ) = { f(n): 0 ≤ c < ∞ } (ii) Ω( g(n) ) = { f(n) : 0 < c ≤ ∞ } (iii) Ө( g(n) ) = { f(n): 0 < c < ∞ } (iv) o( g(n) ) = { f(n): c = 0 } (v) ω( g(n) ) = { f(n): c = ∞ }
  • 21. Asymptotic Set Notations Examples Example (1): Let f(n)O ( g(n) ), f(n)  Ω( f(n) ) . Then O(g(n) ) = { f(n): 0 ≤ c < ∞ } (definition of O-notation) Ω( g(n) ) = { f(n) : 0 < c ≤ ∞ } (definition of Ω-notation ) O(g(n) ) ∩ Ω ( g(n) ) = { f(n) : 0 < c < ∞ } ( Performing Set intersection operation ) = Ө (g(n)) (definition of Ө-notation } Thus, O(g(n) ) ∩ Ω ( g(n) ) = Ө (g(n)) Example (2):Suppose f(n) o(g(n)), and f(n)ω(g(n)). Then o(g(n)) = { f(n): c = 0 } (definition of o-notation) Ω(g(n))= { f(n): c = ∞ } (definition of ω-notation) Therefore, o(g(n)) ∩ ω( g(n)) =φ ( Empty set )
  • 23. Arithmetic Summation Asymptotic Behavior  The sum of first of n terms of arithmetic series is : 1 + 2 + 3………..+n = n(n+1)/2 Let f(n)= n(n+1)/2 and g(n)= n2 f(n) lim n(n+1)/2 n2 /2 + n/2 = = = 1 /2 + 1/2n =1/2 + 0=1/2 n→∞ g(n) n2 n2  Since the limit is non-zero and finite it follows f(n) = θ( g(n)) = θ(n2) Or, 1 + 2 + ………..+ n = θ(n2)
  • 24. Geometric Summation Asymptotic Behavior  The asymptotic behavior of geometric series 1 +r + r2+……..+rn depends on geometric ratio r. Three cases need to be considered Case r > 1: It can be shown that sum f(n) of first n terms is as follows rn+1 - 1 f(n) = 1 +r + r2+……..+rn = ————— r - 1 Case r = 1: This is trivial f(n)= 1 + 1 + 1+ ……+1 = n =Ө(n) Case r < 1: It can be shown that 2 n 1 - rn+1 f(n) = 1 +r + r +……..+r = ————— 1 - r  The asymptotic behavior in first case and third case is explored by computing limits.
  • 25. Geometric Summation Case r > 1 2 n rn+1 - 1 Let f(n) = 1 +r + r Let g(n)= rn +……..+r = ————— r - 1 Consider, the limit lim n→∞ f(n) g(n) rn+1 - 1 = (r - 1).rn r - 1/rn = (r - 1) Since r>1 , 1/rn →0 as n→ ∞ lim n→∞ f(n) g(n) = r (r - 1) >0, since r > 1 Therefore, f(n) = θ(rn) for r>1 Or, 1 +r + r2+……..+rn = θ(rn) for r > 1
  • 26. Geometric Summation Case r < 1 2 n rn+1 - 1 Consider 1 +r + r +……..+r = ————— r - 1 Let g(n)=c where c is some positive constant Taking the limit lim f(n) rn+1 - 1 = 1- rn+1 = n→∞ g(n) (r - 1).c (1- r )c Since r<1 , rn+1 →0 as n→ ∞ lim n→∞ f(n) g(n) = 1 (1 - r). c >0, since r < 1 Therefore, f(n)= θ(g(n))=θ(c) = θ(1) for r <1 Or, 1 +r + r2+……..+rn =θ(1) for r <1
  • 27. Geometric Summation Asymptotic Behavior From the preceding analysis it follows that the asymptotic behavior of geometric summation is S(n) =1+r+r2+.........+ rn = Ө(rn) when r>1 Ө(1) when r<1  When r <1, the largest term in the geometric summation would be 1 ( the first term) , and S(n) =Ө(1) . On the other hand if r>1, the largest term would be rn ( the last term), and S(n)=Ө(rn) In the light of this observation it can said that asymptotic behavior of geometric summation is determined by the largest term i.e S(n)=Ө (largest term). Example(1): The geometric series 1+21+ 22 +….+ 2n has geometric ratio r=2>1 , Thus, 1+21+ 22 +….+ 2n =Ө(2n) , ► Ө(largest term) Example(2): The geometric series 1+(2/3)1+ (2/3)2 +….+ (2/3)n has geometric ratio r=2/3 <1 , Thus, 1+(2/3)1+ (2/3)2 +….+ (2/3)n =Ө(1) , ►Ө(largest term)
  • 28. Logarithm Summation Asymptotic Behavior The logarithmic series has the summation lg(1)+lg(2)+ lg(3)+….. +lg(n) Let f(n) = lg(2)+ lg(3)+….+.lg(n) = lg(2.3……..n) = lg( n!) and g(n) = n lg n lim n→∞ f(n) g(n) = lg n! n lg n = lg ( √(2πn)(n/e)n ) n lg n (Using Stirling’s approximation) Now, lg ( √(2πn)(n/e)n ) = (1+lg π + lg n)/2 + n lg n - n lg e , therefore lim lg ( √(2πn)(n/e)n ) = ( 1+lg π + lg n ) /(2 nlg n) + 1 - lg e / lg n = (0+ 1- 0)=1 n→∞ n lg n Since limit is non-zero and finite, it follows f(n)= θ(g(n)) Or, lg(1)+lg(2)+ lg(3)+….. +lg(n) = θ(n lg n) …
  • 29. Harmonic Summation Asymptotic Behavior The sum of first n terms of Harmonic series is 1+ 1/2 + 1/3+…..+1/n Let f(n) = 1+ 1/2 + 1/3+…..+1/n and g(n) = lg n lim n→∞ f(n) g(n) 1+1/2+1/3+ …..+1/n = lg n It can be shown that 1+ 1/2+ 1/3+…+1/n = lg (n) + γ + 1/2n – 1/12n2+..where γ ≈ 0.5772 lim n→∞ f(n) g(n) lg n + γ + 1/2n – 1/12n2 +… = lg n = 1+0+0-0+0+…=1 Since limit is finite and non-zero, it follows f(n) = θ( g(n)) Or, 1+ 1/2 + 1/3+…..+1/n = θ (lg n )