SlideShare a Scribd company logo
Asymptotic Notation
Running time of an algorithm, order of growth
Worst case
Running time of an algorith increases with the size of the input in the limit as the size
of the input increases without bound.
Big-theta notation
g(n) is an asymptotically tight bound of f(n)
Example
n >= 1, c2 >= 1/2
n >= 7, c1 <= 1/14
choose c1 = 1/14, c2 = ½, n0 = 7.
O-notation
Asymptotic upper bound
f(n) = O(g(n)) some constant multiple of g(n) is an asymptotic upper bound of f(n),
no claim about how tight an upper bound is.
Example
The running time is O(n
2
) means there is a function f(n) that is O(n
2
) such that for
any value of n, no matter what particular input of size n is chosen, the running time of
that input is bounded from above by the value f(n).
Big-Omega notation
Asymptotic lowerbound
Theorem
When we say that the running time (no modifier) of an algorithm is Ω(g(n)), we
mean that no matter what particular input of size n is chosen for each value of n,
the running time on that input is at least a constant times g(n), for sufficiently
large n
Interpretation
not specifying all lower-terms exactly
“No matter how the anonymous functions are chosen on the left of the equal sign,
there is a way to choose the anonymous functions on the right of the equal sign to
make the equation valid.”
for any function f (n) ∈ Θ(n), there is some function g(n) ∈Θ (n
2
)
such that 2n
2
+ f (n) = g(n) for all n.
In other words, the right-hand side of an equation provides a coarser level of detail
than the left-hand side.
o-notation
w-notation
Properties
analogy to comparison of two real numbers, a, b.
Standard notation
Floor and ceiling,
for any real x
for any integer n
Modular arithmetic
if (a mod n) = (b mod n), we write
a is equivalent to b, modulo n. in other words, a and b have the same remainder when
divided by n. Or n is a divisor of b – a.
Polynomials
Exponentials
For all real constants a and b such that a > 1
we can conclude that
Thus, any exponential function with a base strictly greater than 1 grows faster than
any polynomial function.
when
we have the approximation
Logarithms
for all real a > 0, b > 0, c > 0 and n
where logarithm bases are not 1.
Changing the base of a logarithm from one constant to another only changes the value
of the logarithm by a constant factor, and so we shall often use the notation “lg n”
when we don’t care about constant factors.
polylogarithmic bound
for any constant a > 0. Thus, any positive polynomial function grows faster than
any polylogarithmic function.
Factorials
n >= 0
A weak upper bound on the factorial function is n! ≤ n
n
, since each of the n
terms in the factorial product is at most n. Stirling’s approximation,
gives a tighter upper and lower bounds.
Function iteration
Iterated logarithm function
reads “log star of n”
The iterated logarithm is a very slowly growing function:
Be sure to distinguish lg
(i)
n (the logarithm function applied I times in succession,
starting with argument n) from lg
i
n (the logarithm of n raised to the ith power).
Fibonacci numbers
Homework
Rank the following functions by order of growth

More Related Content

What's hot

Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic Notations
Rishabh Soni
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
Nikhil Sharma
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
Saranya Natarajan
 
Introducction to Algorithm
Introducction to AlgorithmIntroducction to Algorithm
Introducction to Algorithm
Rajamanickam Gomathijayam
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
Dr Shashikant Athawale
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
mustafa sarac
 
asymptotic notations i
asymptotic notations iasymptotic notations i
asymptotic notations i
Ali mahmood
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
Lovely Professional University
 
Asymptotic notation ada
Asymptotic notation adaAsymptotic notation ada
Asymptotic notation ada
ravinlaheri2
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
Ehtisham Ali
 
Formal Languages and Automata Theory unit 3
Formal Languages and Automata Theory unit 3Formal Languages and Automata Theory unit 3
Formal Languages and Automata Theory unit 3
Srimatre K
 
Algorithm Analysis
Algorithm AnalysisAlgorithm Analysis
Algorithm Analysis
Megha V
 
Asymptoptic notations
Asymptoptic notationsAsymptoptic notations
Asymptoptic notations
Alisha Jindal
 
Reconstruction
ReconstructionReconstruction
Reconstruction
COMSATS Abbottabad
 
formal definitions in theory of computation
formal definitions in theory of computationformal definitions in theory of computation
formal definitions in theory of computation
kanikkk
 
Asymptotic Analysis in Data Structure using C
Asymptotic Analysis in Data Structure using CAsymptotic Analysis in Data Structure using C
Asymptotic Analysis in Data Structure using C
Meghaj Mallick
 
Econ501a l11
Econ501a l11Econ501a l11
Econ501a l11
nazirali423
 
Automata Theory - Turing machine
Automata Theory - Turing machineAutomata Theory - Turing machine
Automata Theory - Turing machine
Akila Krishnamoorthy
 
Asymptotic Notation and Complexity
Asymptotic Notation and ComplexityAsymptotic Notation and Complexity
Asymptotic Notation and Complexity
Rajandeep Gill
 
C++ Programming Club-Lecture 3
C++ Programming Club-Lecture 3C++ Programming Club-Lecture 3
C++ Programming Club-Lecture 3
Ammara Javed
 

What's hot (20)

Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic Notations
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
 
Introducction to Algorithm
Introducction to AlgorithmIntroducction to Algorithm
Introducction to Algorithm
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
 
asymptotic notations i
asymptotic notations iasymptotic notations i
asymptotic notations i
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
 
Asymptotic notation ada
Asymptotic notation adaAsymptotic notation ada
Asymptotic notation ada
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
 
Formal Languages and Automata Theory unit 3
Formal Languages and Automata Theory unit 3Formal Languages and Automata Theory unit 3
Formal Languages and Automata Theory unit 3
 
Algorithm Analysis
Algorithm AnalysisAlgorithm Analysis
Algorithm Analysis
 
Asymptoptic notations
Asymptoptic notationsAsymptoptic notations
Asymptoptic notations
 
Reconstruction
ReconstructionReconstruction
Reconstruction
 
formal definitions in theory of computation
formal definitions in theory of computationformal definitions in theory of computation
formal definitions in theory of computation
 
Asymptotic Analysis in Data Structure using C
Asymptotic Analysis in Data Structure using CAsymptotic Analysis in Data Structure using C
Asymptotic Analysis in Data Structure using C
 
Econ501a l11
Econ501a l11Econ501a l11
Econ501a l11
 
Automata Theory - Turing machine
Automata Theory - Turing machineAutomata Theory - Turing machine
Automata Theory - Turing machine
 
Asymptotic Notation and Complexity
Asymptotic Notation and ComplexityAsymptotic Notation and Complexity
Asymptotic Notation and Complexity
 
C++ Programming Club-Lecture 3
C++ Programming Club-Lecture 3C++ Programming Club-Lecture 3
C++ Programming Club-Lecture 3
 

Similar to Asymptotic

Weekends with Competitive Programming
Weekends with Competitive ProgrammingWeekends with Competitive Programming
Weekends with Competitive Programming
NiharikaSingh839269
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithms
S.Shayan Daneshvar
 
Lecture 3(a) Asymptotic-analysis.pdf
Lecture 3(a) Asymptotic-analysis.pdfLecture 3(a) Asymptotic-analysis.pdf
Lecture 3(a) Asymptotic-analysis.pdf
ShaistaRiaz4
 
Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic Notations
NagendraK18
 
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
Deepak John
 
DAA_LECT_2.pdf
DAA_LECT_2.pdfDAA_LECT_2.pdf
DAA_LECT_2.pdf
AryanSaini69
 
big_oh
big_ohbig_oh
Lecture 2 data structures and algorithms
Lecture 2 data structures and algorithmsLecture 2 data structures and algorithms
Lecture 2 data structures and algorithms
Aakash deep Singhal
 
The bog oh notation
The bog oh notationThe bog oh notation
The bog oh notation
Rajesh K Shukla
 
1.algorithms
1.algorithms1.algorithms
1.algorithms
Chandan Singh
 
02 asymp
02 asymp02 asymp
02 asymp
aparnabk7
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
sajinis3
 
02-asymp.ppt
02-asymp.ppt02-asymp.ppt
02-asymp.ppt
AnikGhosh44
 
Asymtotic Appoach.ppt
Asymtotic Appoach.pptAsymtotic Appoach.ppt
Asymtotic Appoach.ppt
SherylArulini1
 
Lec03 04-time complexity
Lec03 04-time complexityLec03 04-time complexity
Lec03 04-time complexity
Abbas Ali
 
Analysis Of Algorithms I
Analysis Of Algorithms IAnalysis Of Algorithms I
Analysis Of Algorithms I
Sri Prasanna
 
Time and space complexity
Time and space complexityTime and space complexity
Time and space complexity
Ankit Katiyar
 
Asymptotics 140510003721-phpapp02
Asymptotics 140510003721-phpapp02Asymptotics 140510003721-phpapp02
Asymptotics 140510003721-phpapp02
mansab MIRZA
 
Asymptotic Notations.pptx
Asymptotic Notations.pptxAsymptotic Notations.pptx
Asymptotic Notations.pptx
SunilWork1
 
Algorithms required for data structures(basics like Arrays, Stacks ,Linked Li...
Algorithms required for data structures(basics like Arrays, Stacks ,Linked Li...Algorithms required for data structures(basics like Arrays, Stacks ,Linked Li...
Algorithms required for data structures(basics like Arrays, Stacks ,Linked Li...
DebiPrasadSen
 

Similar to Asymptotic (20)

Weekends with Competitive Programming
Weekends with Competitive ProgrammingWeekends with Competitive Programming
Weekends with Competitive Programming
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithms
 
Lecture 3(a) Asymptotic-analysis.pdf
Lecture 3(a) Asymptotic-analysis.pdfLecture 3(a) Asymptotic-analysis.pdf
Lecture 3(a) Asymptotic-analysis.pdf
 
Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic Notations
 
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
 
DAA_LECT_2.pdf
DAA_LECT_2.pdfDAA_LECT_2.pdf
DAA_LECT_2.pdf
 
big_oh
big_ohbig_oh
big_oh
 
Lecture 2 data structures and algorithms
Lecture 2 data structures and algorithmsLecture 2 data structures and algorithms
Lecture 2 data structures and algorithms
 
The bog oh notation
The bog oh notationThe bog oh notation
The bog oh notation
 
1.algorithms
1.algorithms1.algorithms
1.algorithms
 
02 asymp
02 asymp02 asymp
02 asymp
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
 
02-asymp.ppt
02-asymp.ppt02-asymp.ppt
02-asymp.ppt
 
Asymtotic Appoach.ppt
Asymtotic Appoach.pptAsymtotic Appoach.ppt
Asymtotic Appoach.ppt
 
Lec03 04-time complexity
Lec03 04-time complexityLec03 04-time complexity
Lec03 04-time complexity
 
Analysis Of Algorithms I
Analysis Of Algorithms IAnalysis Of Algorithms I
Analysis Of Algorithms I
 
Time and space complexity
Time and space complexityTime and space complexity
Time and space complexity
 
Asymptotics 140510003721-phpapp02
Asymptotics 140510003721-phpapp02Asymptotics 140510003721-phpapp02
Asymptotics 140510003721-phpapp02
 
Asymptotic Notations.pptx
Asymptotic Notations.pptxAsymptotic Notations.pptx
Asymptotic Notations.pptx
 
Algorithms required for data structures(basics like Arrays, Stacks ,Linked Li...
Algorithms required for data structures(basics like Arrays, Stacks ,Linked Li...Algorithms required for data structures(basics like Arrays, Stacks ,Linked Li...
Algorithms required for data structures(basics like Arrays, Stacks ,Linked Li...
 

Recently uploaded

বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
Nguyen Thanh Tu Collection
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
Jyoti Chand
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
Katrina Pritchard
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
HajraNaeem15
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
TechSoup
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
EduSkills OECD
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 

Recently uploaded (20)

বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 
BBR 2024 Summer Sessions Interview Training
BBR  2024 Summer Sessions Interview TrainingBBR  2024 Summer Sessions Interview Training
BBR 2024 Summer Sessions Interview Training
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 

Asymptotic

  • 1. Asymptotic Notation Running time of an algorithm, order of growth Worst case Running time of an algorith increases with the size of the input in the limit as the size of the input increases without bound. Big-theta notation g(n) is an asymptotically tight bound of f(n) Example
  • 2. n >= 1, c2 >= 1/2 n >= 7, c1 <= 1/14 choose c1 = 1/14, c2 = ½, n0 = 7. O-notation Asymptotic upper bound f(n) = O(g(n)) some constant multiple of g(n) is an asymptotic upper bound of f(n), no claim about how tight an upper bound is. Example The running time is O(n 2 ) means there is a function f(n) that is O(n 2 ) such that for any value of n, no matter what particular input of size n is chosen, the running time of that input is bounded from above by the value f(n).
  • 3. Big-Omega notation Asymptotic lowerbound Theorem When we say that the running time (no modifier) of an algorithm is Ω(g(n)), we mean that no matter what particular input of size n is chosen for each value of n, the running time on that input is at least a constant times g(n), for sufficiently large n Interpretation not specifying all lower-terms exactly
  • 4. “No matter how the anonymous functions are chosen on the left of the equal sign, there is a way to choose the anonymous functions on the right of the equal sign to make the equation valid.” for any function f (n) ∈ Θ(n), there is some function g(n) ∈Θ (n 2 ) such that 2n 2 + f (n) = g(n) for all n. In other words, the right-hand side of an equation provides a coarser level of detail than the left-hand side. o-notation w-notation
  • 5. Properties analogy to comparison of two real numbers, a, b.
  • 6. Standard notation Floor and ceiling, for any real x for any integer n Modular arithmetic if (a mod n) = (b mod n), we write a is equivalent to b, modulo n. in other words, a and b have the same remainder when divided by n. Or n is a divisor of b – a. Polynomials Exponentials For all real constants a and b such that a > 1
  • 7. we can conclude that Thus, any exponential function with a base strictly greater than 1 grows faster than any polynomial function. when we have the approximation Logarithms for all real a > 0, b > 0, c > 0 and n
  • 8. where logarithm bases are not 1. Changing the base of a logarithm from one constant to another only changes the value of the logarithm by a constant factor, and so we shall often use the notation “lg n” when we don’t care about constant factors. polylogarithmic bound for any constant a > 0. Thus, any positive polynomial function grows faster than any polylogarithmic function.
  • 9. Factorials n >= 0 A weak upper bound on the factorial function is n! ≤ n n , since each of the n terms in the factorial product is at most n. Stirling’s approximation, gives a tighter upper and lower bounds. Function iteration Iterated logarithm function reads “log star of n” The iterated logarithm is a very slowly growing function:
  • 10. Be sure to distinguish lg (i) n (the logarithm function applied I times in succession, starting with argument n) from lg i n (the logarithm of n raised to the ith power). Fibonacci numbers
  • 11. Homework Rank the following functions by order of growth