SlideShare a Scribd company logo
1 of 15
Prepared by-
Shaishav Shah(170120116094)
Guided by – Prof. Bhumi Shah
Gandhinagar Institute of Technology
SUBJECT - ADA(2150703 )
Asymptotic Notations
Asymptotic Notations
Asymptotic Notations
• Execution time of an algorithm depends on the
instruction set, processor speed, disk I/O speed, etc.
• Hence, we estimate the efficiency of an algorithm
asymptotically.
• Time function of an algorithm is represented by T(n),
where n is the input size.
Types of asymptotic notations used to
represent the complexity of an
algorithm
• Following asymptotic notations are used to calculate
the running time complexity of an algorithm.
– O − Big Oh
– Ω − Big omega
– θ − Big theta
– o − Little Oh
– ω − Little omega
O: Asymptotic Upper Bound
• ‘O’ (Big Oh) is the most commonly used notation.
• A function f(n) can be represented is the order
of g(n) that is O(g(n)), if there exists a value of
positive integer n as n0 and a positive constant c such
that −
f(n) ⩽ c.g(n) for n > n0 in all case
• Hence, function g(n) is an upper bound for
function f(n), as g(n) grows faster than f(n).
Example
Let us consider a given function,
f(n)=4.n3+10.n2+5.n+1f(n)=4.n3+10.n2+5.n+1
Considering g(n)=n3,
f(n)⩽5.g(n) for all the values of n>2
Hence, the complexity of f(n) can be represented
as O(g(n)), i.e. O(n3).
Ω: Asymptotic Lower Bound
• We say that f(n)=Ω(g(n)) when there exists
constant c that f(n)⩾c.g(n)for all sufficiently large
value of n.
• Here n is a positive integer.
• It means function g is a lower bound for function f;
after a certain value of n, f will never go below g.
Example
Let us consider a given function,
f(n)=4.n3+10.n2+5.n+1.
Considering g(n)=n3g(n)=n3, f(n)⩾4.g(n) for all
the values of n>0.
Hence, the complexity of f(n) can be
represented as Ω(g(n)), i.e. Ω(n3).
θ: Asymptotic Tight Bound
• We say that f(n)=θ(g(n)) when there exist
constants c1 and c2 that c1.g(n)⩽f(n)⩽c2.g(n) for all
sufficiently large value of n.
• Here n is a positive integer.
• This means function g is a tight bound for function f.
Example
Let us consider a given function,
f(n)=4.n3+10.n2+5.n+1
Considering g(n)=n3, 4.g(n)⩽f(n)⩽5.g(n) for all
the large values of n.
Hence, the complexity of f(n) can be
represented as θ(g(n)), i.e. θ(n3).
O - Notation
• The asymptotic upper bound provided by O-
notation may or may not be asymptotically tight.
• The bound 2.n2=O(n2) is asymptotically tight, but the
bound 2.n=O(n2) is not.
• We use o-notation to denote an upper bound that is not
asymptotically tight.
• We formally define o(g(n)) (little-oh of g of n) as the
set f(n) = o(g(n)) for any positive constant c>0 and there
exists a value n0>0, such that 0⩽f(n)⩽c.g(n).
• Intuitively, in the o-notation, the function f(n) becomes
insignificant relative to g(n) as n approaches infinity; that
is,
limn→∞(f(n)/g(n))=0
Example
• Let us consider the same function,
f(n)=4.n3+10.n2+5.n+1
• Considering g(n)=n4,
limn→∞(4.n3+10.n2+5.n+1/n4)=0
• Hence, the complexity of f(n) can be represented
as o(g(n)), i.e. o(n4).
ω – Notation
• We use ω-notation to denote a lower bound that is
not asymptotically tight.
• Formally, however, we define ω(g(n)) (little-omega of
g of n) as the set f(n) = ω(g(n)) for any positive
constant C > 0 and there exists a value n0>0, such
that 0⩽c.g(n)<f(n).
• For example, n2/2=ω(n), but n2/2≠ω(n2). The
relation f(n)=ω(g(n))implies that the following limit
exists
limn→∞(f(n)/g(n))=∞
• That is, f(n) becomes arbitrarily large relative
to g(n) as n approaches infinity.
Example
Let us consider same function, f(n)=4.n3+10.n2+5.n+1
Considering g(n)=n2,
limn→∞(4.n3+10.n2+5.n+1/n2)=∞
Hence, the complexity of f(n) can be represented
as o(g(n)), i.e. ω(n2).
Thank You

More Related Content

What's hot

Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
Ehtisham Ali
 
2009-1 중간고사문제(초고주파공학)
2009-1 중간고사문제(초고주파공학)2009-1 중간고사문제(초고주파공학)
2009-1 중간고사문제(초고주파공학)
Yong Heui Cho
 
Time complexity (linear search vs binary search)
Time complexity (linear search vs binary search)Time complexity (linear search vs binary search)
Time complexity (linear search vs binary search)
Kumar
 

What's hot (20)

Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic Notations
 
asymptotic notations i
asymptotic notations iasymptotic notations i
asymptotic notations i
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
 
Polar Plot
Polar PlotPolar Plot
Polar Plot
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
 
Basics & asymptotic notations
Basics & asymptotic notationsBasics & asymptotic notations
Basics & asymptotic notations
 
Asymptotic analysis
Asymptotic analysisAsymptotic analysis
Asymptotic analysis
 
Asymptotic Notation and Complexity
Asymptotic Notation and ComplexityAsymptotic Notation and Complexity
Asymptotic Notation and Complexity
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
 
Nyquist Stability Criterion
Nyquist  Stability CriterionNyquist  Stability Criterion
Nyquist Stability Criterion
 
Applied Calculus: Physical Meanings/Applications of Derivatives
Applied Calculus: Physical Meanings/Applications of DerivativesApplied Calculus: Physical Meanings/Applications of Derivatives
Applied Calculus: Physical Meanings/Applications of Derivatives
 
Algorithum Analysis
Algorithum AnalysisAlgorithum Analysis
Algorithum Analysis
 
Time complexity
Time complexityTime complexity
Time complexity
 
Nyquist plot
Nyquist plotNyquist plot
Nyquist plot
 
2009-1 중간고사문제(초고주파공학)
2009-1 중간고사문제(초고주파공학)2009-1 중간고사문제(초고주파공학)
2009-1 중간고사문제(초고주파공학)
 
Sol37
Sol37Sol37
Sol37
 
Asymptotic notation ada
Asymptotic notation adaAsymptotic notation ada
Asymptotic notation ada
 
Time complexity (linear search vs binary search)
Time complexity (linear search vs binary search)Time complexity (linear search vs binary search)
Time complexity (linear search vs binary search)
 
02 asymp
02 asymp02 asymp
02 asymp
 
Nyquist stability criterion
Nyquist stability criterionNyquist stability criterion
Nyquist stability criterion
 

Similar to Asymptotic notations ada

DS Unit-1.pptx very easy to understand..
DS Unit-1.pptx very easy to understand..DS Unit-1.pptx very easy to understand..
DS Unit-1.pptx very easy to understand..
KarthikeyaLanka1
 
Design and analysis of algorithms.pptx
Design and analysis of algorithms.pptxDesign and analysis of algorithms.pptx
Design and analysis of algorithms.pptx
SURBHI SAROHA
 
asymptotic analysis and insertion sort analysis
asymptotic analysis and insertion sort analysisasymptotic analysis and insertion sort analysis
asymptotic analysis and insertion sort analysis
Anindita Kundu
 
Lec03 04-time complexity
Lec03 04-time complexityLec03 04-time complexity
Lec03 04-time complexity
Abbas Ali
 
19. algorithms and-complexity
19. algorithms and-complexity19. algorithms and-complexity
19. algorithms and-complexity
ashishtinku
 

Similar to Asymptotic notations ada (20)

Lecture 3(a) Asymptotic-analysis.pdf
Lecture 3(a) Asymptotic-analysis.pdfLecture 3(a) Asymptotic-analysis.pdf
Lecture 3(a) Asymptotic-analysis.pdf
 
Introducction to Algorithm
Introducction to AlgorithmIntroducction to Algorithm
Introducction to Algorithm
 
Asymptotics 140510003721-phpapp02
Asymptotics 140510003721-phpapp02Asymptotics 140510003721-phpapp02
Asymptotics 140510003721-phpapp02
 
Asymptotic Notations.pptx
Asymptotic Notations.pptxAsymptotic Notations.pptx
Asymptotic Notations.pptx
 
DAA_LECT_2.pdf
DAA_LECT_2.pdfDAA_LECT_2.pdf
DAA_LECT_2.pdf
 
Unit-1 DAA_Notes.pdf
Unit-1 DAA_Notes.pdfUnit-1 DAA_Notes.pdf
Unit-1 DAA_Notes.pdf
 
Weekends with Competitive Programming
Weekends with Competitive ProgrammingWeekends with Competitive Programming
Weekends with Competitive Programming
 
Anlysis and design of algorithms part 1
Anlysis and design of algorithms part 1Anlysis and design of algorithms part 1
Anlysis and design of algorithms part 1
 
Asymptotic Analysis.ppt
Asymptotic Analysis.pptAsymptotic Analysis.ppt
Asymptotic Analysis.ppt
 
Design and Analysis of Algorithms Lecture Notes
Design and Analysis of Algorithms Lecture NotesDesign and Analysis of Algorithms Lecture Notes
Design and Analysis of Algorithms Lecture Notes
 
DS Unit-1.pptx very easy to understand..
DS Unit-1.pptx very easy to understand..DS Unit-1.pptx very easy to understand..
DS Unit-1.pptx very easy to understand..
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithms
 
big_oh
big_ohbig_oh
big_oh
 
Algorithm Analysis
Algorithm AnalysisAlgorithm Analysis
Algorithm Analysis
 
Design and analysis of algorithms.pptx
Design and analysis of algorithms.pptxDesign and analysis of algorithms.pptx
Design and analysis of algorithms.pptx
 
asymptotic analysis and insertion sort analysis
asymptotic analysis and insertion sort analysisasymptotic analysis and insertion sort analysis
asymptotic analysis and insertion sort analysis
 
Lec03 04-time complexity
Lec03 04-time complexityLec03 04-time complexity
Lec03 04-time complexity
 
Asymptoptic notations
Asymptoptic notationsAsymptoptic notations
Asymptoptic notations
 
19. algorithms and-complexity
19. algorithms and-complexity19. algorithms and-complexity
19. algorithms and-complexity
 
1_Asymptotic_Notation_pptx.pptx
1_Asymptotic_Notation_pptx.pptx1_Asymptotic_Notation_pptx.pptx
1_Asymptotic_Notation_pptx.pptx
 

More from ShaishavShah8

More from ShaishavShah8 (19)

Diffie hellman key algorithm
Diffie hellman key algorithmDiffie hellman key algorithm
Diffie hellman key algorithm
 
Constructor oopj
Constructor oopjConstructor oopj
Constructor oopj
 
Clipping computer graphics
Clipping  computer graphicsClipping  computer graphics
Clipping computer graphics
 
Classification of debuggers sp
Classification of debuggers spClassification of debuggers sp
Classification of debuggers sp
 
Parallel and perspective projection in 3 d cg
Parallel and perspective projection in 3 d cgParallel and perspective projection in 3 d cg
Parallel and perspective projection in 3 d cg
 
Arrays in java oopj
Arrays in java oopjArrays in java oopj
Arrays in java oopj
 
Classical cyphers python programming
Classical cyphers python programmingClassical cyphers python programming
Classical cyphers python programming
 
Logics for non monotonic reasoning-ai
Logics for non monotonic reasoning-aiLogics for non monotonic reasoning-ai
Logics for non monotonic reasoning-ai
 
Rdd transformations bda
Rdd transformations bdaRdd transformations bda
Rdd transformations bda
 
Introduction to data warehouse dmbi
Introduction to data warehouse dmbiIntroduction to data warehouse dmbi
Introduction to data warehouse dmbi
 
Lan, wan, man mcwc
Lan, wan, man mcwcLan, wan, man mcwc
Lan, wan, man mcwc
 
Introduction to xml, uses of xml wt
Introduction to xml, uses of xml wtIntroduction to xml, uses of xml wt
Introduction to xml, uses of xml wt
 
Agile process se
Agile process seAgile process se
Agile process se
 
Applications of huffman coding dcdr
Applications of huffman coding dcdrApplications of huffman coding dcdr
Applications of huffman coding dcdr
 
Cookie management using jsp a java
Cookie management using jsp  a javaCookie management using jsp  a java
Cookie management using jsp a java
 
Login control .net
Login control .netLogin control .net
Login control .net
 
Rdd transformations
Rdd transformationsRdd transformations
Rdd transformations
 
LAN, WAN, MAN
LAN, WAN, MANLAN, WAN, MAN
LAN, WAN, MAN
 
Introduction to data warehouse
Introduction to data warehouseIntroduction to data warehouse
Introduction to data warehouse
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 

Asymptotic notations ada

  • 1. Prepared by- Shaishav Shah(170120116094) Guided by – Prof. Bhumi Shah Gandhinagar Institute of Technology SUBJECT - ADA(2150703 ) Asymptotic Notations
  • 3. Asymptotic Notations • Execution time of an algorithm depends on the instruction set, processor speed, disk I/O speed, etc. • Hence, we estimate the efficiency of an algorithm asymptotically. • Time function of an algorithm is represented by T(n), where n is the input size.
  • 4. Types of asymptotic notations used to represent the complexity of an algorithm • Following asymptotic notations are used to calculate the running time complexity of an algorithm. – O − Big Oh – Ω − Big omega – θ − Big theta – o − Little Oh – ω − Little omega
  • 5. O: Asymptotic Upper Bound • ‘O’ (Big Oh) is the most commonly used notation. • A function f(n) can be represented is the order of g(n) that is O(g(n)), if there exists a value of positive integer n as n0 and a positive constant c such that − f(n) ⩽ c.g(n) for n > n0 in all case • Hence, function g(n) is an upper bound for function f(n), as g(n) grows faster than f(n).
  • 6. Example Let us consider a given function, f(n)=4.n3+10.n2+5.n+1f(n)=4.n3+10.n2+5.n+1 Considering g(n)=n3, f(n)⩽5.g(n) for all the values of n>2 Hence, the complexity of f(n) can be represented as O(g(n)), i.e. O(n3).
  • 7. Ω: Asymptotic Lower Bound • We say that f(n)=Ω(g(n)) when there exists constant c that f(n)⩾c.g(n)for all sufficiently large value of n. • Here n is a positive integer. • It means function g is a lower bound for function f; after a certain value of n, f will never go below g.
  • 8. Example Let us consider a given function, f(n)=4.n3+10.n2+5.n+1. Considering g(n)=n3g(n)=n3, f(n)⩾4.g(n) for all the values of n>0. Hence, the complexity of f(n) can be represented as Ω(g(n)), i.e. Ω(n3).
  • 9. θ: Asymptotic Tight Bound • We say that f(n)=θ(g(n)) when there exist constants c1 and c2 that c1.g(n)⩽f(n)⩽c2.g(n) for all sufficiently large value of n. • Here n is a positive integer. • This means function g is a tight bound for function f.
  • 10. Example Let us consider a given function, f(n)=4.n3+10.n2+5.n+1 Considering g(n)=n3, 4.g(n)⩽f(n)⩽5.g(n) for all the large values of n. Hence, the complexity of f(n) can be represented as θ(g(n)), i.e. θ(n3).
  • 11. O - Notation • The asymptotic upper bound provided by O- notation may or may not be asymptotically tight. • The bound 2.n2=O(n2) is asymptotically tight, but the bound 2.n=O(n2) is not. • We use o-notation to denote an upper bound that is not asymptotically tight. • We formally define o(g(n)) (little-oh of g of n) as the set f(n) = o(g(n)) for any positive constant c>0 and there exists a value n0>0, such that 0⩽f(n)⩽c.g(n). • Intuitively, in the o-notation, the function f(n) becomes insignificant relative to g(n) as n approaches infinity; that is, limn→∞(f(n)/g(n))=0
  • 12. Example • Let us consider the same function, f(n)=4.n3+10.n2+5.n+1 • Considering g(n)=n4, limn→∞(4.n3+10.n2+5.n+1/n4)=0 • Hence, the complexity of f(n) can be represented as o(g(n)), i.e. o(n4).
  • 13. ω – Notation • We use ω-notation to denote a lower bound that is not asymptotically tight. • Formally, however, we define ω(g(n)) (little-omega of g of n) as the set f(n) = ω(g(n)) for any positive constant C > 0 and there exists a value n0>0, such that 0⩽c.g(n)<f(n). • For example, n2/2=ω(n), but n2/2≠ω(n2). The relation f(n)=ω(g(n))implies that the following limit exists limn→∞(f(n)/g(n))=∞ • That is, f(n) becomes arbitrarily large relative to g(n) as n approaches infinity.
  • 14. Example Let us consider same function, f(n)=4.n3+10.n2+5.n+1 Considering g(n)=n2, limn→∞(4.n3+10.n2+5.n+1/n2)=∞ Hence, the complexity of f(n) can be represented as o(g(n)), i.e. ω(n2).