SlideShare a Scribd company logo
Introduction to Algorithms
(3rd edition)
by Cormen, Leiserson, Rivest & Stein
Chapter 3: Growth of Functions
(slides enhanced by N. Adlai A. DePano)
Overview
 Order of growth of functions provides a
simple characterization of efficiency
 Allows for comparison of relative
performance between alternative
algorithms
 Concerned with asymptotic efficiency of
algorithms
 Best asymptotic efficiency usually is best
choice except for smaller inputs
 Several standard methods to simplify
asymptotic analysis of algorithms
Asymptotic Notation
 Applies to functions whose domains are the
set of natural numbers:
N = {0,1,2,…}
 If time resource T(n) is being analyzed, the
function’s range is usually the set of non-
negative real numbers:
T(n)  R+
 If space resource S(n) is being analyzed, the
function’s range is usually also the set of
natural numbers:
S(n)  N
Asymptotic Notation
 Depending on the textbook,
asymptotic categories may be
expressed in terms of --
a. set membership (our textbook):
functions belong to a family of functions
that exhibit some property; or
b. function property (other textbooks):
functions exhibit the property
 Caveat: we will formally use (a) and
informally use (b)
The Θ-Notation
f
c1 ⋅ g
n0
c2 ⋅ g
Θ(g(n)) = { f(n) : ∃c1, c2 > 0, n0 > 0 s.t. ∀n ≥ n0:
c1 · g(n) ≤ f(n) ≤ c2 ⋅ g(n) }
The Ω-Notation
Ω(g(n)) = { f(n) : ∃c > 0, n0 > 0 s.t. ∀n ≥ n0: f(n) ≥ c ⋅ g(n) }
f
c ⋅ g
n0
The O-Notation
f
c ⋅ g
n0
O(g(n)) = { f(n) : ∃c > 0, n0 > 0 s.t. ∀n ≥ n0: f(n) ≤ c ⋅ g(n) }
The o-Notation
o(g(n)) = { f(n) : ∀c > 0 ∃n0 > 0 s.t. ∀n ≥ n0: f(n) ≤ c ⋅ g(n) }
f
c1 ⋅ g
n1
c2 ⋅ g
c3 ⋅ g
n2 n3
The ω-Notation
f
c1 ⋅ g
n1
c2 ⋅ g
c3 ⋅ g
n2
n3
ω(g(n)) = { f(n) : ∀c > 0 ∃n0 > 0 s.t. ∀n ≥ n0: f(n) ≥ c ⋅ g(n) }
 f(n) = O(g(n)) and
g(n) = O(h(n)) ⇒ f(n) = O(h(n))
 f(n) = Ω(g(n)) and
g(n) = Ω(h(n)) ⇒ f(n) = Ω(h(n))
 f(n) = Θ(g(n)) and
g(n) = Θ(h(n)) ⇒ f(n) = Θ(h(n))
 f(n) = O(f(n))
f(n) = Ω(f(n))
f(n) = Θ(f(n))
Comparison of Functions
Reflexivity
Transitivity
 f (n) = Θ(g(n))  g(n) = Θ(f (n))
 f (n) = O(g(n))  g(n) = Ω(f (n))
 f (n) = o(g(n))  g(n) = ω(f (n))
 f (n) = O(g(n)) and
f (n) = Ω(g(n))  f (n) = Θ(g(n))
Comparison of Functions
Transpose
Symmetry
Symmetry
Theorem 3.1
Standard Notation and
Common Functions
 Monotonicity
A function f(n) is monotonically
increasing if m  n implies f(m)  f(n) .
A function f(n) is monotonically
decreasing if m  n implies f(m)  f(n) .
A function f(n) is strictly increasing
if m < n implies f(m) < f(n) .
A function f(n) is strictly decreasing
if m < n implies f(m) > f(n) .
Standard Notation and
Common Functions
 Floors and ceilings
For any real number x, the greatest integer
less than or equal to x is denoted by x.
For any real number x, the least integer
greater than or equal to x is denoted by
x.
For all real numbers x,
x1 < x  x  x < x+1.
Both functions are monotonically
increasing.
Standard Notation and
Common Functions
 Exponentials
For all n and a1, the function an is the exponential
function with base a and is monotonically
increasing.
 Logarithms
Textbook adopts the following convention
lg n = log2n (binary logarithm),
ln n = logen (natural logarithm),
lgk n = (lg n)k (exponentiation),
lg lg n = lg(lg n) (composition),
lg n + k = (lg n)+k (precedence of lg).
Standard Notation and
Common Functions
 Factorials
For all n the function n! or “n factorial” is
given by
n! = n  (n1)  (n  2)  (n  3)  …  2  1
It can be established that
n! = o(nn)
n! = (2n)
lg(n!) = (nlgn)
 Functional iteration
The notation f (i)(n) represents the function f(n)
iteratively applied i times to an initial value of n,
or, recursively
f (i)(n) = n if i=0
f (i)(n) = f(f (i1)(n)) if i>0
Example:
If f (n) = 2n
then f (2)(n) = f (2n) = 2(2n) = 22n
then f (3)(n) = f (f (2)(n)) = 2(22n) = 23n
then f (i)(n) = 2in
Standard Notation and
Common Functions
 Iterated logarithmic function
The notation lg* n which reads “log star of n” is
defined as
lg* n = min {i0 : lg(i) n  1
Example:
lg* 2 = 1
lg* 4 = 2
lg* 16 = 3
lg* 65536 = 4
lg* 265536 = 5
Standard Notation and
Common Functions
 Asymptotic analysis studies how the
values of functions compare as their
arguments grow without bounds.
 Ignores constants and the behavior of
the function for small arguments.
 Acceptable because all algorithms are
fast for small inputs and growth of
running time is more important than
constant factors.
Things to Remember
 Ignoring the usually unimportant details,
we obtain a representation that succinctly
describes the growth of a function as
its argument grows and thus allows us to
make comparisons between algorithms in
terms of their efficiency.
Things to Remember
Tips to Help Remember
 May be helpful to make the following
“analogies” (remember, we are comparing
rates of growth of functions)
Ad

More Related Content

What's hot (20)

LINEAR BOUNDED AUTOMATA (LBA).pptx
LINEAR BOUNDED AUTOMATA (LBA).pptxLINEAR BOUNDED AUTOMATA (LBA).pptx
LINEAR BOUNDED AUTOMATA (LBA).pptx
AkhilJoseph63
 
Shortest path algorithm
Shortest  path algorithmShortest  path algorithm
Shortest path algorithm
Subrata Kumer Paul
 
Master method
Master method Master method
Master method
Rajendran
 
Ai 8 puzzle problem
Ai 8 puzzle problemAi 8 puzzle problem
Ai 8 puzzle problem
Sanad Bhowmik
 
NP completeness
NP completenessNP completeness
NP completeness
Amrinder Arora
 
Hill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligenceHill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligence
sandeep54552
 
P, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardP, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-Hard
Animesh Chaturvedi
 
8 QUEENS PROBLEM.pptx
8 QUEENS PROBLEM.pptx8 QUEENS PROBLEM.pptx
8 QUEENS PROBLEM.pptx
sunidhi740916
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
Ehtisham Ali
 
Np cooks theorem
Np cooks theoremNp cooks theorem
Np cooks theorem
Narayana Galla
 
Recursion tree method
Recursion tree methodRecursion tree method
Recursion tree method
Rajendran
 
Matrix chain multiplication
Matrix chain multiplicationMatrix chain multiplication
Matrix chain multiplication
Respa Peter
 
Bellman Ford's Algorithm
Bellman Ford's AlgorithmBellman Ford's Algorithm
Bellman Ford's Algorithm
Tanmay Baranwal
 
Design and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptxDesign and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptx
Syed Zaid Irshad
 
8 queen problem
8 queen problem8 queen problem
8 queen problem
NagajothiN1
 
Dijkstra's Algorithm
Dijkstra's AlgorithmDijkstra's Algorithm
Dijkstra's Algorithm
ArijitDhali
 
Floyd Warshall Algorithm
Floyd Warshall AlgorithmFloyd Warshall Algorithm
Floyd Warshall Algorithm
InteX Research Lab
 
Sets and disjoint sets union123
Sets and disjoint sets union123Sets and disjoint sets union123
Sets and disjoint sets union123
Ankita Goyal
 
Breadth first search and depth first search
Breadth first search and  depth first searchBreadth first search and  depth first search
Breadth first search and depth first search
Hossain Md Shakhawat
 
Dinive conquer algorithm
Dinive conquer algorithmDinive conquer algorithm
Dinive conquer algorithm
Mohd Arif
 
LINEAR BOUNDED AUTOMATA (LBA).pptx
LINEAR BOUNDED AUTOMATA (LBA).pptxLINEAR BOUNDED AUTOMATA (LBA).pptx
LINEAR BOUNDED AUTOMATA (LBA).pptx
AkhilJoseph63
 
Master method
Master method Master method
Master method
Rajendran
 
Hill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligenceHill climbing algorithm in artificial intelligence
Hill climbing algorithm in artificial intelligence
sandeep54552
 
P, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardP, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-Hard
Animesh Chaturvedi
 
8 QUEENS PROBLEM.pptx
8 QUEENS PROBLEM.pptx8 QUEENS PROBLEM.pptx
8 QUEENS PROBLEM.pptx
sunidhi740916
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
Ehtisham Ali
 
Recursion tree method
Recursion tree methodRecursion tree method
Recursion tree method
Rajendran
 
Matrix chain multiplication
Matrix chain multiplicationMatrix chain multiplication
Matrix chain multiplication
Respa Peter
 
Bellman Ford's Algorithm
Bellman Ford's AlgorithmBellman Ford's Algorithm
Bellman Ford's Algorithm
Tanmay Baranwal
 
Design and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptxDesign and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptx
Syed Zaid Irshad
 
Dijkstra's Algorithm
Dijkstra's AlgorithmDijkstra's Algorithm
Dijkstra's Algorithm
ArijitDhali
 
Sets and disjoint sets union123
Sets and disjoint sets union123Sets and disjoint sets union123
Sets and disjoint sets union123
Ankita Goyal
 
Breadth first search and depth first search
Breadth first search and  depth first searchBreadth first search and  depth first search
Breadth first search and depth first search
Hossain Md Shakhawat
 
Dinive conquer algorithm
Dinive conquer algorithmDinive conquer algorithm
Dinive conquer algorithm
Mohd Arif
 

Similar to Lecture 4 - Growth of Functions (1).ppt (20)

Lecture 3(a) Asymptotic-analysis.pdf
Lecture 3(a) Asymptotic-analysis.pdfLecture 3(a) Asymptotic-analysis.pdf
Lecture 3(a) Asymptotic-analysis.pdf
ShaistaRiaz4
 
Clase3 Notacion
Clase3 NotacionClase3 Notacion
Clase3 Notacion
luzenith_g
 
Complete Book Lectures maths theory helpful for kids.ppt
Complete Book Lectures maths theory helpful for kids.pptComplete Book Lectures maths theory helpful for kids.ppt
Complete Book Lectures maths theory helpful for kids.ppt
AishaAnwar16
 
02 asymp
02 asymp02 asymp
02 asymp
aparnabk7
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
Nikhil Sharma
 
Asymptotic Notation and Complexity
Asymptotic Notation and ComplexityAsymptotic Notation and Complexity
Asymptotic Notation and Complexity
Rajandeep Gill
 
ASYMTOTIC NOTATION ON DATA STRUCTURE AND ALGORITHM
ASYMTOTIC NOTATION ON DATA STRUCTURE AND ALGORITHMASYMTOTIC NOTATION ON DATA STRUCTURE AND ALGORITHM
ASYMTOTIC NOTATION ON DATA STRUCTURE AND ALGORITHM
sd1898691
 
02-asymp.ppt YJTYJTYFHYTYHFHTFTHFHTFTHFTHTHFT
02-asymp.ppt YJTYJTYFHYTYHFHTFTHFHTFTHFTHTHFT02-asymp.ppt YJTYJTYFHYTYHFHTFTHFHTFTHFTHTHFT
02-asymp.ppt YJTYJTYFHYTYHFHTFTHFHTFTHFTHTHFT
UDITAROYMUSICLOVER
 
Quantitative norm convergence of some ergodic averages
Quantitative norm convergence of some ergodic averagesQuantitative norm convergence of some ergodic averages
Quantitative norm convergence of some ergodic averages
VjekoslavKovac1
 
DSA Asymptotic Notations and Functions.ppt
DSA Asymptotic Notations and Functions.pptDSA Asymptotic Notations and Functions.ppt
DSA Asymptotic Notations and Functions.ppt
AdharshKumarSingh
 
Lecture3(b).pdf
Lecture3(b).pdfLecture3(b).pdf
Lecture3(b).pdf
ShaistaRiaz4
 
Time Series Analysis
Time Series AnalysisTime Series Analysis
Time Series Analysis
Amit Ghosh
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
Protap Mondal
 
02 CS316_algorithms_Asymptotic_Notations(2).pdf
02 CS316_algorithms_Asymptotic_Notations(2).pdf02 CS316_algorithms_Asymptotic_Notations(2).pdf
02 CS316_algorithms_Asymptotic_Notations(2).pdf
yahiaf3k
 
DAA_LECT_2.pdf
DAA_LECT_2.pdfDAA_LECT_2.pdf
DAA_LECT_2.pdf
AryanSaini69
 
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
 
lecture 3
lecture 3lecture 3
lecture 3
sajinsc
 
Design and analysis of algorithm ppt ppt
Design and analysis of algorithm ppt pptDesign and analysis of algorithm ppt ppt
Design and analysis of algorithm ppt ppt
srushtiivp
 
Unit-1 DAA_Notes.pdf
Unit-1 DAA_Notes.pdfUnit-1 DAA_Notes.pdf
Unit-1 DAA_Notes.pdf
AmayJaiswal4
 
asymptoticnotations-111102093214-phpapp01 (1).pdf
asymptoticnotations-111102093214-phpapp01 (1).pdfasymptoticnotations-111102093214-phpapp01 (1).pdf
asymptoticnotations-111102093214-phpapp01 (1).pdf
UDITAROYMUSICLOVER
 
Lecture 3(a) Asymptotic-analysis.pdf
Lecture 3(a) Asymptotic-analysis.pdfLecture 3(a) Asymptotic-analysis.pdf
Lecture 3(a) Asymptotic-analysis.pdf
ShaistaRiaz4
 
Clase3 Notacion
Clase3 NotacionClase3 Notacion
Clase3 Notacion
luzenith_g
 
Complete Book Lectures maths theory helpful for kids.ppt
Complete Book Lectures maths theory helpful for kids.pptComplete Book Lectures maths theory helpful for kids.ppt
Complete Book Lectures maths theory helpful for kids.ppt
AishaAnwar16
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
Nikhil Sharma
 
Asymptotic Notation and Complexity
Asymptotic Notation and ComplexityAsymptotic Notation and Complexity
Asymptotic Notation and Complexity
Rajandeep Gill
 
ASYMTOTIC NOTATION ON DATA STRUCTURE AND ALGORITHM
ASYMTOTIC NOTATION ON DATA STRUCTURE AND ALGORITHMASYMTOTIC NOTATION ON DATA STRUCTURE AND ALGORITHM
ASYMTOTIC NOTATION ON DATA STRUCTURE AND ALGORITHM
sd1898691
 
02-asymp.ppt YJTYJTYFHYTYHFHTFTHFHTFTHFTHTHFT
02-asymp.ppt YJTYJTYFHYTYHFHTFTHFHTFTHFTHTHFT02-asymp.ppt YJTYJTYFHYTYHFHTFTHFHTFTHFTHTHFT
02-asymp.ppt YJTYJTYFHYTYHFHTFTHFHTFTHFTHTHFT
UDITAROYMUSICLOVER
 
Quantitative norm convergence of some ergodic averages
Quantitative norm convergence of some ergodic averagesQuantitative norm convergence of some ergodic averages
Quantitative norm convergence of some ergodic averages
VjekoslavKovac1
 
DSA Asymptotic Notations and Functions.ppt
DSA Asymptotic Notations and Functions.pptDSA Asymptotic Notations and Functions.ppt
DSA Asymptotic Notations and Functions.ppt
AdharshKumarSingh
 
Time Series Analysis
Time Series AnalysisTime Series Analysis
Time Series Analysis
Amit Ghosh
 
02 CS316_algorithms_Asymptotic_Notations(2).pdf
02 CS316_algorithms_Asymptotic_Notations(2).pdf02 CS316_algorithms_Asymptotic_Notations(2).pdf
02 CS316_algorithms_Asymptotic_Notations(2).pdf
yahiaf3k
 
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
 
lecture 3
lecture 3lecture 3
lecture 3
sajinsc
 
Design and analysis of algorithm ppt ppt
Design and analysis of algorithm ppt pptDesign and analysis of algorithm ppt ppt
Design and analysis of algorithm ppt ppt
srushtiivp
 
Unit-1 DAA_Notes.pdf
Unit-1 DAA_Notes.pdfUnit-1 DAA_Notes.pdf
Unit-1 DAA_Notes.pdf
AmayJaiswal4
 
asymptoticnotations-111102093214-phpapp01 (1).pdf
asymptoticnotations-111102093214-phpapp01 (1).pdfasymptoticnotations-111102093214-phpapp01 (1).pdf
asymptoticnotations-111102093214-phpapp01 (1).pdf
UDITAROYMUSICLOVER
 
Ad

More from ZohairMughal1 (6)

HCI Lecture # 2 (2).pptx
HCI Lecture # 2 (2).pptxHCI Lecture # 2 (2).pptx
HCI Lecture # 2 (2).pptx
ZohairMughal1
 
OS Thr schd.ppt
OS Thr schd.pptOS Thr schd.ppt
OS Thr schd.ppt
ZohairMughal1
 
SE 09 (test design techs).pptx
SE 09 (test design techs).pptxSE 09 (test design techs).pptx
SE 09 (test design techs).pptx
ZohairMughal1
 
Lecture # 8 (HCI).pptx
Lecture # 8 (HCI).pptxLecture # 8 (HCI).pptx
Lecture # 8 (HCI).pptx
ZohairMughal1
 
Lecture 4 - Growth of Functions.ppt
Lecture 4 - Growth of Functions.pptLecture 4 - Growth of Functions.ppt
Lecture 4 - Growth of Functions.ppt
ZohairMughal1
 
Khilafat-o-Malookeyat-Syed-Abul-Ala-Maududi-Urdu.pdf
Khilafat-o-Malookeyat-Syed-Abul-Ala-Maududi-Urdu.pdfKhilafat-o-Malookeyat-Syed-Abul-Ala-Maududi-Urdu.pdf
Khilafat-o-Malookeyat-Syed-Abul-Ala-Maududi-Urdu.pdf
ZohairMughal1
 
HCI Lecture # 2 (2).pptx
HCI Lecture # 2 (2).pptxHCI Lecture # 2 (2).pptx
HCI Lecture # 2 (2).pptx
ZohairMughal1
 
SE 09 (test design techs).pptx
SE 09 (test design techs).pptxSE 09 (test design techs).pptx
SE 09 (test design techs).pptx
ZohairMughal1
 
Lecture # 8 (HCI).pptx
Lecture # 8 (HCI).pptxLecture # 8 (HCI).pptx
Lecture # 8 (HCI).pptx
ZohairMughal1
 
Lecture 4 - Growth of Functions.ppt
Lecture 4 - Growth of Functions.pptLecture 4 - Growth of Functions.ppt
Lecture 4 - Growth of Functions.ppt
ZohairMughal1
 
Khilafat-o-Malookeyat-Syed-Abul-Ala-Maududi-Urdu.pdf
Khilafat-o-Malookeyat-Syed-Abul-Ala-Maududi-Urdu.pdfKhilafat-o-Malookeyat-Syed-Abul-Ala-Maududi-Urdu.pdf
Khilafat-o-Malookeyat-Syed-Abul-Ala-Maududi-Urdu.pdf
ZohairMughal1
 
Ad

Recently uploaded (20)

Vannin Healthcare Greencube Electronic Health Record -Modules and Features.pdf
Vannin Healthcare Greencube Electronic Health Record -Modules and Features.pdfVannin Healthcare Greencube Electronic Health Record -Modules and Features.pdf
Vannin Healthcare Greencube Electronic Health Record -Modules and Features.pdf
ovanveen
 
Understanding Root Canal Treatment A Quick Guide.pptx
Understanding Root Canal Treatment A Quick Guide.pptxUnderstanding Root Canal Treatment A Quick Guide.pptx
Understanding Root Canal Treatment A Quick Guide.pptx
Dr. Nimit Garg
 
The Business Conference and IT Resilience Summit Abu Dhabi, UAE - Sunil Mehta
The Business Conference and IT Resilience Summit Abu Dhabi, UAE - Sunil MehtaThe Business Conference and IT Resilience Summit Abu Dhabi, UAE - Sunil Mehta
The Business Conference and IT Resilience Summit Abu Dhabi, UAE - Sunil Mehta
Continuity and Resilience
 
Fillip Kosorukov - Passionate About Trading
Fillip Kosorukov - Passionate About TradingFillip Kosorukov - Passionate About Trading
Fillip Kosorukov - Passionate About Trading
Fillip Kosorukov
 
How to Integrate Telehealth Into Existing Workflows for Maximum Impact (1).pdf
How to Integrate Telehealth Into Existing Workflows for Maximum Impact (1).pdfHow to Integrate Telehealth Into Existing Workflows for Maximum Impact (1).pdf
How to Integrate Telehealth Into Existing Workflows for Maximum Impact (1).pdf
sundramvozo
 
How Security Guards Can Enhance Gated Community Safety.pdf
How Security Guards Can Enhance Gated Community Safety.pdfHow Security Guards Can Enhance Gated Community Safety.pdf
How Security Guards Can Enhance Gated Community Safety.pdf
Stateguard Protective Services
 
Eric Hannelius - A Serial Entrepreneur
Eric  Hannelius  -  A Serial EntrepreneurEric  Hannelius  -  A Serial Entrepreneur
Eric Hannelius - A Serial Entrepreneur
Eric Hannelius
 
The Business Conference and IT Resilience Summit Abu Dhabi, UAE - AWS
The Business Conference and IT Resilience Summit Abu Dhabi, UAE - AWSThe Business Conference and IT Resilience Summit Abu Dhabi, UAE - AWS
The Business Conference and IT Resilience Summit Abu Dhabi, UAE - AWS
Continuity and Resilience
 
Enhancing Agility and Efficiency in the Metals & Mining Sector BMGI India's S...
Enhancing Agility and Efficiency in the Metals & Mining Sector BMGI India's S...Enhancing Agility and Efficiency in the Metals & Mining Sector BMGI India's S...
Enhancing Agility and Efficiency in the Metals & Mining Sector BMGI India's S...
Naresh Raisinghani
 
Vision Document and Business Plan of RVNL
Vision Document and Business Plan of RVNLVision Document and Business Plan of RVNL
Vision Document and Business Plan of RVNL
Rajesh Prasad
 
Event Report - Informatica World 2025 - Off to be the System of Record for AI
Event Report - Informatica World 2025 - Off to be the System of Record for AIEvent Report - Informatica World 2025 - Off to be the System of Record for AI
Event Report - Informatica World 2025 - Off to be the System of Record for AI
Holger Mueller
 
Glass Communities SSE, All Versions .pdf
Glass Communities SSE, All Versions .pdfGlass Communities SSE, All Versions .pdf
Glass Communities SSE, All Versions .pdf
Brij Consulting, LLC
 
AI in the Innovation Process: CTO Spring Forum 2025
AI in the Innovation Process: CTO Spring Forum 2025AI in the Innovation Process: CTO Spring Forum 2025
AI in the Innovation Process: CTO Spring Forum 2025
MIPLM
 
IQVIA Analytics Presentation - Final Reviewed_1.0.pptx
IQVIA Analytics Presentation - Final Reviewed_1.0.pptxIQVIA Analytics Presentation - Final Reviewed_1.0.pptx
IQVIA Analytics Presentation - Final Reviewed_1.0.pptx
kcyclopediakerala
 
Stephane Marchand: Leading Hawaii’s Movement Toward Regenerative Development
Stephane Marchand: Leading Hawaii’s Movement Toward Regenerative DevelopmentStephane Marchand: Leading Hawaii’s Movement Toward Regenerative Development
Stephane Marchand: Leading Hawaii’s Movement Toward Regenerative Development
Stephane Marchand
 
CTG - 1Q2025 Business Update - website.pdf
CTG - 1Q2025 Business Update - website.pdfCTG - 1Q2025 Business Update - website.pdf
CTG - 1Q2025 Business Update - website.pdf
HcTrSoros
 
Leadership Presentation Management Activity.pdf
Leadership Presentation Management Activity.pdfLeadership Presentation Management Activity.pdf
Leadership Presentation Management Activity.pdf
HeshamFandy1
 
Outsourcing Finance and accounting services
Outsourcing Finance and accounting servicesOutsourcing Finance and accounting services
Outsourcing Finance and accounting services
Intellgus
 
Introduction of E-commerce in ICT applications
Introduction of E-commerce in  ICT applicationsIntroduction of E-commerce in  ICT applications
Introduction of E-commerce in ICT applications
hammadakram562
 
Green Corporate Minimalist Infographic Presentation Collection.pptx
Green Corporate Minimalist Infographic Presentation Collection.pptxGreen Corporate Minimalist Infographic Presentation Collection.pptx
Green Corporate Minimalist Infographic Presentation Collection.pptx
BhavadharaniR
 
Vannin Healthcare Greencube Electronic Health Record -Modules and Features.pdf
Vannin Healthcare Greencube Electronic Health Record -Modules and Features.pdfVannin Healthcare Greencube Electronic Health Record -Modules and Features.pdf
Vannin Healthcare Greencube Electronic Health Record -Modules and Features.pdf
ovanveen
 
Understanding Root Canal Treatment A Quick Guide.pptx
Understanding Root Canal Treatment A Quick Guide.pptxUnderstanding Root Canal Treatment A Quick Guide.pptx
Understanding Root Canal Treatment A Quick Guide.pptx
Dr. Nimit Garg
 
The Business Conference and IT Resilience Summit Abu Dhabi, UAE - Sunil Mehta
The Business Conference and IT Resilience Summit Abu Dhabi, UAE - Sunil MehtaThe Business Conference and IT Resilience Summit Abu Dhabi, UAE - Sunil Mehta
The Business Conference and IT Resilience Summit Abu Dhabi, UAE - Sunil Mehta
Continuity and Resilience
 
Fillip Kosorukov - Passionate About Trading
Fillip Kosorukov - Passionate About TradingFillip Kosorukov - Passionate About Trading
Fillip Kosorukov - Passionate About Trading
Fillip Kosorukov
 
How to Integrate Telehealth Into Existing Workflows for Maximum Impact (1).pdf
How to Integrate Telehealth Into Existing Workflows for Maximum Impact (1).pdfHow to Integrate Telehealth Into Existing Workflows for Maximum Impact (1).pdf
How to Integrate Telehealth Into Existing Workflows for Maximum Impact (1).pdf
sundramvozo
 
How Security Guards Can Enhance Gated Community Safety.pdf
How Security Guards Can Enhance Gated Community Safety.pdfHow Security Guards Can Enhance Gated Community Safety.pdf
How Security Guards Can Enhance Gated Community Safety.pdf
Stateguard Protective Services
 
Eric Hannelius - A Serial Entrepreneur
Eric  Hannelius  -  A Serial EntrepreneurEric  Hannelius  -  A Serial Entrepreneur
Eric Hannelius - A Serial Entrepreneur
Eric Hannelius
 
The Business Conference and IT Resilience Summit Abu Dhabi, UAE - AWS
The Business Conference and IT Resilience Summit Abu Dhabi, UAE - AWSThe Business Conference and IT Resilience Summit Abu Dhabi, UAE - AWS
The Business Conference and IT Resilience Summit Abu Dhabi, UAE - AWS
Continuity and Resilience
 
Enhancing Agility and Efficiency in the Metals & Mining Sector BMGI India's S...
Enhancing Agility and Efficiency in the Metals & Mining Sector BMGI India's S...Enhancing Agility and Efficiency in the Metals & Mining Sector BMGI India's S...
Enhancing Agility and Efficiency in the Metals & Mining Sector BMGI India's S...
Naresh Raisinghani
 
Vision Document and Business Plan of RVNL
Vision Document and Business Plan of RVNLVision Document and Business Plan of RVNL
Vision Document and Business Plan of RVNL
Rajesh Prasad
 
Event Report - Informatica World 2025 - Off to be the System of Record for AI
Event Report - Informatica World 2025 - Off to be the System of Record for AIEvent Report - Informatica World 2025 - Off to be the System of Record for AI
Event Report - Informatica World 2025 - Off to be the System of Record for AI
Holger Mueller
 
Glass Communities SSE, All Versions .pdf
Glass Communities SSE, All Versions .pdfGlass Communities SSE, All Versions .pdf
Glass Communities SSE, All Versions .pdf
Brij Consulting, LLC
 
AI in the Innovation Process: CTO Spring Forum 2025
AI in the Innovation Process: CTO Spring Forum 2025AI in the Innovation Process: CTO Spring Forum 2025
AI in the Innovation Process: CTO Spring Forum 2025
MIPLM
 
IQVIA Analytics Presentation - Final Reviewed_1.0.pptx
IQVIA Analytics Presentation - Final Reviewed_1.0.pptxIQVIA Analytics Presentation - Final Reviewed_1.0.pptx
IQVIA Analytics Presentation - Final Reviewed_1.0.pptx
kcyclopediakerala
 
Stephane Marchand: Leading Hawaii’s Movement Toward Regenerative Development
Stephane Marchand: Leading Hawaii’s Movement Toward Regenerative DevelopmentStephane Marchand: Leading Hawaii’s Movement Toward Regenerative Development
Stephane Marchand: Leading Hawaii’s Movement Toward Regenerative Development
Stephane Marchand
 
CTG - 1Q2025 Business Update - website.pdf
CTG - 1Q2025 Business Update - website.pdfCTG - 1Q2025 Business Update - website.pdf
CTG - 1Q2025 Business Update - website.pdf
HcTrSoros
 
Leadership Presentation Management Activity.pdf
Leadership Presentation Management Activity.pdfLeadership Presentation Management Activity.pdf
Leadership Presentation Management Activity.pdf
HeshamFandy1
 
Outsourcing Finance and accounting services
Outsourcing Finance and accounting servicesOutsourcing Finance and accounting services
Outsourcing Finance and accounting services
Intellgus
 
Introduction of E-commerce in ICT applications
Introduction of E-commerce in  ICT applicationsIntroduction of E-commerce in  ICT applications
Introduction of E-commerce in ICT applications
hammadakram562
 
Green Corporate Minimalist Infographic Presentation Collection.pptx
Green Corporate Minimalist Infographic Presentation Collection.pptxGreen Corporate Minimalist Infographic Presentation Collection.pptx
Green Corporate Minimalist Infographic Presentation Collection.pptx
BhavadharaniR
 

Lecture 4 - Growth of Functions (1).ppt

  • 1. Introduction to Algorithms (3rd edition) by Cormen, Leiserson, Rivest & Stein Chapter 3: Growth of Functions (slides enhanced by N. Adlai A. DePano)
  • 2. Overview  Order of growth of functions provides a simple characterization of efficiency  Allows for comparison of relative performance between alternative algorithms  Concerned with asymptotic efficiency of algorithms  Best asymptotic efficiency usually is best choice except for smaller inputs  Several standard methods to simplify asymptotic analysis of algorithms
  • 3. Asymptotic Notation  Applies to functions whose domains are the set of natural numbers: N = {0,1,2,…}  If time resource T(n) is being analyzed, the function’s range is usually the set of non- negative real numbers: T(n)  R+  If space resource S(n) is being analyzed, the function’s range is usually also the set of natural numbers: S(n)  N
  • 4. Asymptotic Notation  Depending on the textbook, asymptotic categories may be expressed in terms of -- a. set membership (our textbook): functions belong to a family of functions that exhibit some property; or b. function property (other textbooks): functions exhibit the property  Caveat: we will formally use (a) and informally use (b)
  • 5. The Θ-Notation f c1 ⋅ g n0 c2 ⋅ g Θ(g(n)) = { f(n) : ∃c1, c2 > 0, n0 > 0 s.t. ∀n ≥ n0: c1 · g(n) ≤ f(n) ≤ c2 ⋅ g(n) }
  • 6. The Ω-Notation Ω(g(n)) = { f(n) : ∃c > 0, n0 > 0 s.t. ∀n ≥ n0: f(n) ≥ c ⋅ g(n) } f c ⋅ g n0
  • 7. The O-Notation f c ⋅ g n0 O(g(n)) = { f(n) : ∃c > 0, n0 > 0 s.t. ∀n ≥ n0: f(n) ≤ c ⋅ g(n) }
  • 8. The o-Notation o(g(n)) = { f(n) : ∀c > 0 ∃n0 > 0 s.t. ∀n ≥ n0: f(n) ≤ c ⋅ g(n) } f c1 ⋅ g n1 c2 ⋅ g c3 ⋅ g n2 n3
  • 9. The ω-Notation f c1 ⋅ g n1 c2 ⋅ g c3 ⋅ g n2 n3 ω(g(n)) = { f(n) : ∀c > 0 ∃n0 > 0 s.t. ∀n ≥ n0: f(n) ≥ c ⋅ g(n) }
  • 10.  f(n) = O(g(n)) and g(n) = O(h(n)) ⇒ f(n) = O(h(n))  f(n) = Ω(g(n)) and g(n) = Ω(h(n)) ⇒ f(n) = Ω(h(n))  f(n) = Θ(g(n)) and g(n) = Θ(h(n)) ⇒ f(n) = Θ(h(n))  f(n) = O(f(n)) f(n) = Ω(f(n)) f(n) = Θ(f(n)) Comparison of Functions Reflexivity Transitivity
  • 11.  f (n) = Θ(g(n))  g(n) = Θ(f (n))  f (n) = O(g(n))  g(n) = Ω(f (n))  f (n) = o(g(n))  g(n) = ω(f (n))  f (n) = O(g(n)) and f (n) = Ω(g(n))  f (n) = Θ(g(n)) Comparison of Functions Transpose Symmetry Symmetry Theorem 3.1
  • 12. Standard Notation and Common Functions  Monotonicity A function f(n) is monotonically increasing if m  n implies f(m)  f(n) . A function f(n) is monotonically decreasing if m  n implies f(m)  f(n) . A function f(n) is strictly increasing if m < n implies f(m) < f(n) . A function f(n) is strictly decreasing if m < n implies f(m) > f(n) .
  • 13. Standard Notation and Common Functions  Floors and ceilings For any real number x, the greatest integer less than or equal to x is denoted by x. For any real number x, the least integer greater than or equal to x is denoted by x. For all real numbers x, x1 < x  x  x < x+1. Both functions are monotonically increasing.
  • 14. Standard Notation and Common Functions  Exponentials For all n and a1, the function an is the exponential function with base a and is monotonically increasing.  Logarithms Textbook adopts the following convention lg n = log2n (binary logarithm), ln n = logen (natural logarithm), lgk n = (lg n)k (exponentiation), lg lg n = lg(lg n) (composition), lg n + k = (lg n)+k (precedence of lg).
  • 15. Standard Notation and Common Functions  Factorials For all n the function n! or “n factorial” is given by n! = n  (n1)  (n  2)  (n  3)  …  2  1 It can be established that n! = o(nn) n! = (2n) lg(n!) = (nlgn)
  • 16.  Functional iteration The notation f (i)(n) represents the function f(n) iteratively applied i times to an initial value of n, or, recursively f (i)(n) = n if i=0 f (i)(n) = f(f (i1)(n)) if i>0 Example: If f (n) = 2n then f (2)(n) = f (2n) = 2(2n) = 22n then f (3)(n) = f (f (2)(n)) = 2(22n) = 23n then f (i)(n) = 2in Standard Notation and Common Functions
  • 17.  Iterated logarithmic function The notation lg* n which reads “log star of n” is defined as lg* n = min {i0 : lg(i) n  1 Example: lg* 2 = 1 lg* 4 = 2 lg* 16 = 3 lg* 65536 = 4 lg* 265536 = 5 Standard Notation and Common Functions
  • 18.  Asymptotic analysis studies how the values of functions compare as their arguments grow without bounds.  Ignores constants and the behavior of the function for small arguments.  Acceptable because all algorithms are fast for small inputs and growth of running time is more important than constant factors. Things to Remember
  • 19.  Ignoring the usually unimportant details, we obtain a representation that succinctly describes the growth of a function as its argument grows and thus allows us to make comparisons between algorithms in terms of their efficiency. Things to Remember
  • 20. Tips to Help Remember  May be helpful to make the following “analogies” (remember, we are comparing rates of growth of functions)
  翻译: