# Complexity Analysis : Asymptotic Analysis

• View
93

0

Tags:

• #### order terms

Embed Size (px)

DESCRIPTION

Complexity Analysis : Asymptotic Analysis. Nattee Niparnan. Recall. What is the measurement of algorithm? How to compare two algorithms? Definition of Asymptotic Notation. Today Topic. Finding the asymptotic upper bound of the algorithm. Interesting Topics of Upper Bound. Rule of thumb! - PowerPoint PPT Presentation

### Text of Complexity Analysis : Asymptotic Analysis

Complexity Analysis : Asymptotic Analysis

Complexity Analysis : Asymptotic AnalysisNattee Niparnan1RecallWhat is the measurement of algorithm?How to compare two algorithms?Definition of Asymptotic Notation2Today TopicFinding the asymptotic upper bound of the algorithm3Interesting Topics of Upper BoundRule of thumb!We neglectLower order terms from additionE.g. n3+n2 = O(n3)ConstantE.g. 3n3 = O(n3)Remember that we use = instead of (more correctly) 4Why Discard Constant?From the definitionWe can use any constant

E.g. 3n = O(n)BecauseWhen we let c >= 3, the condition is satisfied5Why Discard Lower Order Term?Considerf(n) = n3+n2 g(n) = n3If f(n) = O(g(n))Then, for some c and n0c * g(n)-f(n) > 0Definitely, just use any c >1

6Why Discard Lower Order Term?Try c = 1.1

Does 0.1n3-n2 > 0 ? It is when 0.1n > 1E.g., n > 10

1.1 * g(n)-f(n) = 0.1n3-n20.1n3-n2 > 00.1n3 > n20.1n3/n2 > 10.1n > 17Lower Order only?In fact,Its only the dominant term that count

Which one is dominating term?The one that grow faster

Why?Eventually, it is g*(n)/f*(n)If g(n) grows faster, g(n)/f*(n) > some constantE.g, lim g(n)/f*(n) infinityThe non-dominant termThe dominant term8What dominating what?nanb (a > b)n log n nn2 log nn log2 ncnncLog n1nlog nLeft side dominates9Putting into PracticeWhat is the asymptotic class of

0.5n3+N4-5(n-3)(n-5)+n3log8n+25+n1.5

(n-5)(n2+3)+log(n20)

20n5+58n4+15n3.2*3n210Putting into PracticeWhat is the asymptotic class of

0.5n3+N4-5(n-3)(n-5)+n3log8n+25+n1.5

(n-5)(n2+3)+log(n20)

20n5+58n4+15n3.2*3n2O(n4)O(n3)O(n5.4)11Asymptotic Notation from Program FlowSequenceConditionsLoopsRecursive Call12SequenceBlock ABlock Bf (n)g (n)f(n) + g(n) =

O(max (f(n),g(n))13ExampleBlock ABlock BO(n)O(n2)O(n2)14ExampleBlock ABlock B(n)O(n2)O(n2)15ExampleBlock ABlock B(n)(n2)(n2)16ExampleBlock ABlock BO(n2)(n2)(n2)17ConditionBlock ABlock Bf (n)g (n)O(max (f(n),g(n))18Loopsfor (i = 1;i ##### CS221: Algorithms and Data Structures Lecture #1 Complexity Theory and Asymptotic Analysis Steve Wolfman 2014W1 1
Documents ##### Fall 2010Parallel Processing, Fundamental ConceptsSlide 2 3.1 Asymptotic Complexity Fig. 3.1 Graphical representation of the notions of asymptotic complexity
Documents ##### A Fistful of Dollars: Formalizing Asymptotic Complexity agueneau/publis/gueneau-chargueraud-pottier-coq...A Fistful of Dollars: Formalizing Asymptotic Complexity Claims via Deductive
Documents ##### Lecture 2: Asymptotic Analysis of Algorithms - eecs.yorku.ca ?? Algorithm Complexity vs Problem Complexity . ... The Risks Digest ( ... structures have ``average-case'' expected running
Documents ##### Parallel Program Issues - Rochester Institute of · PDF file 3/21/2006  · Asymptotic Notations for Algorithm Analysis • Asymptotic analysis of computing time (computational) complexity
Documents ##### Chapter 11 Analysis of Algorithms. Chapter Scope Efficiency goals The concept of algorithm analysis Big-Oh notation The concept of asymptotic complexity
Documents ##### Algorithm Analysis 1 Problem Solving Space Complexity Time Complexity Classifying Functions by Their Asymptotic Growth
Documents ##### Review 1 Algorithm Analysis Problem Solving Space Complexity Time Complexity Classifying Functions by Their Asymptotic Growth
Documents ##### 1 ©2008 DEEDS Group Introduction to Computer Science 2 - SS 08 Asymptotic Complexity Introduction in Computer Science 2 Asymptotic Complexity DEEDS Group
Documents ##### Analysis of Algorithms, 91 - uml. wang/quals/Fall04Algorithms.pdf · PDF fileUML CS Algorithms Qualifying Exam Fall, 2004 ... correctness justification; 3) asymptotic complexity analysis
Documents ##### Introduction to Complexity Analysis Motivation Average, Best, and Worst Case Complexity Analysis Asymptotic Analysis
Documents ##### - I ALGORITHM ANALYSIS Algorithm analysis – Time space tradeoff – Asymptotic notations – Conditional asymptotic notation – Removing condition from the conditional asymptotic
Documents Documents