SlideShare a Scribd company logo
Data Structure and
Algorithms-Searching
Techniques
Prepared By,
S.Sajini
AP/CSE
MATHEMATICAL NOTATIONS, ASYMPTOTIC
NOTATION - BIG O , OMEGA, THETA
MATHEMATICAL FUNCTIONS
1. FLOOR AND CEILING FUNCTIONS:
Floor Function: the greatest integer that
is less than or equal to x
Ceiling Function: the least integer that is
greater than or equal to x
Notation
2. Remainder function : Modular arithmetic
Let x be any integer and let M be a positive integer.
Then x ( mod M)
Eg:
13 (mod 5) =3
3. Integer and Absolute Value functions
INT (x) converts x into an integer by deleting the fractional part of the number
ABS (x) or |x| gives the greater of x or -x
Eg:
INT(3.14) =3
|15| = 15
|-0.33| = 0.33
4. Summation Symbol: sums
Summation symbol : Σ
This symbol (called Sigma) means "sum up"
5. Factorial Function
The factorial function (symbol: !) says to multiply all whole numbers from our
chosen number down to 1.
n! = 1.2.3…. (n-2).(n-1)
E.g: 2! = 1.2 = 2
6. Permutations
A permutation of a set of n elements is an arrangement
of the elements in a given order .
E.g: Permutations of the elements a, b and c arbe
abc, acb, bac, bca, cab, cba
7. Exponents and Logarithms
Exponents are also called Powers or Indices.
Example: 53 = 5 × 5 × 5 = 125
Logarithm of any positive number x to the base b, written as
logb(x)
=> y= logb(x)
=> by = x
Asymptotic Notation– Big, Omega , Theta
Asymptotic Notations refers to computing the running time of any
operation in mathematical units of computation.
• Ο Notation (Big)
• Ω Notation (Omega)
• θ Notation (Theta)
• Big Oh Notation, Ο
• It measures the worst case time complexity or longest amount of time an
algorithm can possibly take to complete.
O(g(n)) = { f(n): there exist positive constants c and n0 such that
0 <= f(n) <= cg(n) for all n >= n0}
Big O Notation
• Big-O notation, where the "O" stands for "order of", is concerned
with what happens for very large values of n.
• For example, if a sorting algorithm performs n2 operations to sort
just n elements, then that algorithm would be described as an O(n2)
algorithm.
• When expressing complexity using Big O notation, constant
multipliers are ignored. So a O(4n) algorithm is equivalent to O(n),
which is how it should be written.
Big O Notation
• If f(n) and g(n) are functions defined on positive integer
number n, then
f(n) = O(g(n))
• That is, f of n is big O of g of n if and only if there exists
positive constants c and n, such that
f (n) ≤ cg(n)
• This means that for large amounts of data, f(n) will grow no
more than a constant factor than g(n). Hence, g provides an
upper bound.
• Ω Notation:
• Ω notation provides an asymptotic lower bound
Omega Notation
• Omega notation provides a tight lower bound for f(n). This means
that the function can never do better than the specified value but it
may do worse.
• Ω notation is simply written as, f(n) ∈ Ω(g(n)), where n is the
problem size and Ω(g(n)) = {h(n): ∃ positive constants c > 0, n0 such
that 0 ≤ cg(n) ≤ h(n), ∀ n ≥ n0}.
• Examples of functions in Ω(n2) include: n2, n2.9, n3 + n, 540n2 + 10
• Examples of functions not in Ω(n3) include: n, n2.9, n2
•Θ Notation:
Θ((g(n)) = {f(n): there exist positive constants c1, c2 and n0 such that
0 <= c1*g(n) <= f(n) <= c2*g(n) for all n >= n0}
Theta Notation
• Theta notation provides an asymptotically tight bound for f(n).
• Θ notation is simply written as, f(n) ∈ Θ(g(n)), where n is the
problem size and Θ(g(n)) = {h(n): ∃ positive constants c1, c2 and n0
such that 0 ≤ c1g(n) ≤ h(n) ≤ c2g(n), ∀ n ≥ n0}.
• Hence, we can say that Θ(g(n)) comprises a set of all the functions
h(n) that are between c1g(n) and c2g(n) for all values of n ≥ n0.
• To summarize,
 The best case in Θ notation is not used.
 Worst case Θ describes asymptotic bounds for worst case
combination of input values.
 If we simply write Θ, it means same as worst case Θ.
Categories of Algorithms
• Constant time algorithms have running time complexity
given as O(1)
• Linear time algorithms have running time complexity
given as O(n)
• Logarithmic time algorithms have running time
complexity given as O(log n)
• Polynomial time algorithms have running time complexity
given as O(nk) where k>1
• Exponential time algorithms have running time
complexity given as O(2n)
n O(1) O(log n) O(n) O(n log n) O(n2) O(n3)
1 1 1 1 1 1 1
2 1 1 2 2 4 8
4 1 2 4 8 16 64
8 1 3 8 24 64 512
16 1 4 16 64 256 4,096

More Related Content

What's hot

Stressen's matrix multiplication
Stressen's matrix multiplicationStressen's matrix multiplication
Stressen's matrix multiplicationKumar
 
Linear programming in computational geometry
Linear programming in computational geometryLinear programming in computational geometry
Linear programming in computational geometryhsubhashis
 
Problem reduction AND OR GRAPH & AO* algorithm.ppt
Problem reduction AND OR GRAPH & AO* algorithm.pptProblem reduction AND OR GRAPH & AO* algorithm.ppt
Problem reduction AND OR GRAPH & AO* algorithm.pptarunsingh660
 
Quaternionic Modular Symbols in Sage
Quaternionic Modular Symbols in SageQuaternionic Modular Symbols in Sage
Quaternionic Modular Symbols in Sagemmasdeu
 
Directed Acyclic Graph
Directed Acyclic Graph Directed Acyclic Graph
Directed Acyclic Graph AJAL A J
 
Rabin Karp Algorithm
Rabin Karp AlgorithmRabin Karp Algorithm
Rabin Karp AlgorithmKiran K
 
hospital management
hospital managementhospital management
hospital managementguestbcbbb5c
 
Functions for Grade 10
Functions for Grade 10Functions for Grade 10
Functions for Grade 10Boipelo Radebe
 
Write a program to draw a cubic Bezier curve.
Write a program to draw a cubic Bezier curve. Write a program to draw a cubic Bezier curve.
Write a program to draw a cubic Bezier curve. Shobhit Saxena
 
Introduction to Logarithm
Introduction to LogarithmIntroduction to Logarithm
Introduction to LogarithmFellowBuddy.com
 
Data Algorithms And Analysis
Data Algorithms And AnalysisData Algorithms And Analysis
Data Algorithms And Analysisgarishma bhatia
 

What's hot (20)

Stressen's matrix multiplication
Stressen's matrix multiplicationStressen's matrix multiplication
Stressen's matrix multiplication
 
LLSF_for_Imperial
LLSF_for_ImperialLLSF_for_Imperial
LLSF_for_Imperial
 
Information security Seminar #7
Information security Seminar #7Information security Seminar #7
Information security Seminar #7
 
Linear programming in computational geometry
Linear programming in computational geometryLinear programming in computational geometry
Linear programming in computational geometry
 
Problem reduction AND OR GRAPH & AO* algorithm.ppt
Problem reduction AND OR GRAPH & AO* algorithm.pptProblem reduction AND OR GRAPH & AO* algorithm.ppt
Problem reduction AND OR GRAPH & AO* algorithm.ppt
 
Algorithms DM
Algorithms DMAlgorithms DM
Algorithms DM
 
Quaternionic Modular Symbols in Sage
Quaternionic Modular Symbols in SageQuaternionic Modular Symbols in Sage
Quaternionic Modular Symbols in Sage
 
Directed Acyclic Graph
Directed Acyclic Graph Directed Acyclic Graph
Directed Acyclic Graph
 
Chapter 22 Finite Field
Chapter 22 Finite FieldChapter 22 Finite Field
Chapter 22 Finite Field
 
Rabin Karp Algorithm
Rabin Karp AlgorithmRabin Karp Algorithm
Rabin Karp Algorithm
 
hospital management
hospital managementhospital management
hospital management
 
Functions for Grade 10
Functions for Grade 10Functions for Grade 10
Functions for Grade 10
 
Matlab file
Matlab file Matlab file
Matlab file
 
Arrays
ArraysArrays
Arrays
 
Write a program to draw a cubic Bezier curve.
Write a program to draw a cubic Bezier curve. Write a program to draw a cubic Bezier curve.
Write a program to draw a cubic Bezier curve.
 
Introduction to Logarithm
Introduction to LogarithmIntroduction to Logarithm
Introduction to Logarithm
 
Lecture 1 python arithmetic (ewurc)
Lecture 1 python arithmetic (ewurc)Lecture 1 python arithmetic (ewurc)
Lecture 1 python arithmetic (ewurc)
 
Day 2a examples
Day 2a examplesDay 2a examples
Day 2a examples
 
Data Algorithms And Analysis
Data Algorithms And AnalysisData Algorithms And Analysis
Data Algorithms And Analysis
 
Core 3 Functions 2
Core 3 Functions 2Core 3 Functions 2
Core 3 Functions 2
 

Similar to Asymptotic notation

Unit-1 DAA_Notes.pdf
Unit-1 DAA_Notes.pdfUnit-1 DAA_Notes.pdf
Unit-1 DAA_Notes.pdfAmayJaiswal4
 
Lec03 04-time complexity
Lec03 04-time complexityLec03 04-time complexity
Lec03 04-time complexityAbbas Ali
 
Lecture 3(a) Asymptotic-analysis.pdf
Lecture 3(a) Asymptotic-analysis.pdfLecture 3(a) Asymptotic-analysis.pdf
Lecture 3(a) Asymptotic-analysis.pdfShaistaRiaz4
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notationsEhtisham Ali
 
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
 
Analysis Of Algorithms I
Analysis Of Algorithms IAnalysis Of Algorithms I
Analysis Of Algorithms ISri Prasanna
 
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 pptsrushtiivp
 
how to calclute time complexity of algortihm
how to calclute time complexity of algortihmhow to calclute time complexity of algortihm
how to calclute time complexity of algortihmSajid Marwat
 
Asymptotic Notation and Complexity
Asymptotic Notation and ComplexityAsymptotic Notation and Complexity
Asymptotic Notation and ComplexityRajandeep Gill
 
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 NotesSreedhar Chowdam
 
Algorithm And analysis Lecture 03& 04-time complexity.
 Algorithm And analysis Lecture 03& 04-time complexity. Algorithm And analysis Lecture 03& 04-time complexity.
Algorithm And analysis Lecture 03& 04-time complexity.Tariq Khan
 
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
 
Lecture 2 data structures and algorithms
Lecture 2 data structures and algorithmsLecture 2 data structures and algorithms
Lecture 2 data structures and algorithmsAakash deep Singhal
 
Data Structure & Algorithms - Mathematical
Data Structure & Algorithms - MathematicalData Structure & Algorithms - Mathematical
Data Structure & Algorithms - Mathematicalbabuk110
 

Similar to Asymptotic notation (20)

Unit-1 DAA_Notes.pdf
Unit-1 DAA_Notes.pdfUnit-1 DAA_Notes.pdf
Unit-1 DAA_Notes.pdf
 
Lec03 04-time complexity
Lec03 04-time complexityLec03 04-time complexity
Lec03 04-time complexity
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
 
big_oh
big_ohbig_oh
big_oh
 
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
 
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...
 
Analysis Of Algorithms I
Analysis Of Algorithms IAnalysis Of Algorithms I
Analysis Of Algorithms I
 
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
 
how to calclute time complexity of algortihm
how to calclute time complexity of algortihmhow to calclute time complexity of algortihm
how to calclute time complexity of algortihm
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
 
Time complexity.ppt
Time complexity.pptTime complexity.ppt
Time complexity.ppt
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
 
Asymptotic Notation and Complexity
Asymptotic Notation and ComplexityAsymptotic Notation and Complexity
Asymptotic Notation and Complexity
 
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
 
Algorithm And analysis Lecture 03& 04-time complexity.
 Algorithm And analysis Lecture 03& 04-time complexity. Algorithm And analysis Lecture 03& 04-time complexity.
Algorithm And analysis Lecture 03& 04-time complexity.
 
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..
 
Time complexity
Time complexityTime complexity
Time complexity
 
Lecture 2 data structures and algorithms
Lecture 2 data structures and algorithmsLecture 2 data structures and algorithms
Lecture 2 data structures and algorithms
 
Data Structure & Algorithms - Mathematical
Data Structure & Algorithms - MathematicalData Structure & Algorithms - Mathematical
Data Structure & Algorithms - Mathematical
 

More from sajinis3

Rice Theorem.pptx
Rice Theorem.pptxRice Theorem.pptx
Rice Theorem.pptxsajinis3
 
Examples of undecidable problems and problems.pptx
Examples of undecidable problems and problems.pptxExamples of undecidable problems and problems.pptx
Examples of undecidable problems and problems.pptxsajinis3
 
Decidable problems.pptx
Decidable problems.pptxDecidable problems.pptx
Decidable problems.pptxsajinis3
 
Undecidability Basic definitions.pptx
Undecidability Basic definitions.pptxUndecidability Basic definitions.pptx
Undecidability Basic definitions.pptxsajinis3
 
PPS-POINTERS.pptx
PPS-POINTERS.pptxPPS-POINTERS.pptx
PPS-POINTERS.pptxsajinis3
 
Circular linked list
Circular linked list Circular linked list
Circular linked list sajinis3
 
Dsa – data structure and algorithms sorting
Dsa – data structure and algorithms  sortingDsa – data structure and algorithms  sorting
Dsa – data structure and algorithms sortingsajinis3
 
Dsa – data structure and algorithms searching
Dsa – data structure and algorithms   searchingDsa – data structure and algorithms   searching
Dsa – data structure and algorithms searchingsajinis3
 

More from sajinis3 (8)

Rice Theorem.pptx
Rice Theorem.pptxRice Theorem.pptx
Rice Theorem.pptx
 
Examples of undecidable problems and problems.pptx
Examples of undecidable problems and problems.pptxExamples of undecidable problems and problems.pptx
Examples of undecidable problems and problems.pptx
 
Decidable problems.pptx
Decidable problems.pptxDecidable problems.pptx
Decidable problems.pptx
 
Undecidability Basic definitions.pptx
Undecidability Basic definitions.pptxUndecidability Basic definitions.pptx
Undecidability Basic definitions.pptx
 
PPS-POINTERS.pptx
PPS-POINTERS.pptxPPS-POINTERS.pptx
PPS-POINTERS.pptx
 
Circular linked list
Circular linked list Circular linked list
Circular linked list
 
Dsa – data structure and algorithms sorting
Dsa – data structure and algorithms  sortingDsa – data structure and algorithms  sorting
Dsa – data structure and algorithms sorting
 
Dsa – data structure and algorithms searching
Dsa – data structure and algorithms   searchingDsa – data structure and algorithms   searching
Dsa – data structure and algorithms searching
 

Recently uploaded

Introduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical EngineeringC Sai Kiran
 
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdf
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdfRESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdf
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdfKamal Acharya
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxR&R Consult
 
RS Khurmi Machine Design Clutch and Brake Exercise Numerical Solutions
RS Khurmi Machine Design Clutch and Brake Exercise Numerical SolutionsRS Khurmi Machine Design Clutch and Brake Exercise Numerical Solutions
RS Khurmi Machine Design Clutch and Brake Exercise Numerical SolutionsAtif Razi
 
fundamentals of drawing and isometric and orthographic projection
fundamentals of drawing and isometric and orthographic projectionfundamentals of drawing and isometric and orthographic projection
fundamentals of drawing and isometric and orthographic projectionjeevanprasad8
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industriesMuhammadTufail242431
 
Construction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptxConstruction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptxwendy cai
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.PrashantGoswami42
 
Natalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in KrakówNatalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in Krakówbim.edu.pl
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdfKamal Acharya
 
ENERGY STORAGE DEVICES INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES  INTRODUCTION UNIT-IENERGY STORAGE DEVICES  INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES INTRODUCTION UNIT-IVigneshvaranMech
 
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...Amil baba
 
fluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answerfluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answerapareshmondalnita
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdfAhmedHussein950959
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdfKamal Acharya
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationRobbie Edward Sayers
 
IT-601 Lecture Notes-UNIT-2.pdf Data Analysis
IT-601 Lecture Notes-UNIT-2.pdf Data AnalysisIT-601 Lecture Notes-UNIT-2.pdf Data Analysis
IT-601 Lecture Notes-UNIT-2.pdf Data AnalysisDr. Radhey Shyam
 
Online resume builder management system project report.pdf
Online resume builder management system project report.pdfOnline resume builder management system project report.pdf
Online resume builder management system project report.pdfKamal Acharya
 
2024 DevOps Pro Europe - Growing at the edge
2024 DevOps Pro Europe - Growing at the edge2024 DevOps Pro Europe - Growing at the edge
2024 DevOps Pro Europe - Growing at the edgePaco Orozco
 
Arduino based vehicle speed tracker project
Arduino based vehicle speed tracker projectArduino based vehicle speed tracker project
Arduino based vehicle speed tracker projectRased Khan
 

Recently uploaded (20)

Introduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
 
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdf
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdfRESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdf
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.pdf
 
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxCFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptx
 
RS Khurmi Machine Design Clutch and Brake Exercise Numerical Solutions
RS Khurmi Machine Design Clutch and Brake Exercise Numerical SolutionsRS Khurmi Machine Design Clutch and Brake Exercise Numerical Solutions
RS Khurmi Machine Design Clutch and Brake Exercise Numerical Solutions
 
fundamentals of drawing and isometric and orthographic projection
fundamentals of drawing and isometric and orthographic projectionfundamentals of drawing and isometric and orthographic projection
fundamentals of drawing and isometric and orthographic projection
 
Halogenation process of chemical process industries
Halogenation process of chemical process industriesHalogenation process of chemical process industries
Halogenation process of chemical process industries
 
Construction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptxConstruction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptx
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
 
Natalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in KrakówNatalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in Kraków
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
 
ENERGY STORAGE DEVICES INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES  INTRODUCTION UNIT-IENERGY STORAGE DEVICES  INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES INTRODUCTION UNIT-I
 
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
NO1 Pandit Amil Baba In Bahawalpur, Sargodha, Sialkot, Sheikhupura, Rahim Yar...
 
fluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answerfluid mechanics gate notes . gate all pyqs answer
fluid mechanics gate notes . gate all pyqs answer
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
 
HYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generationHYDROPOWER - Hydroelectric power generation
HYDROPOWER - Hydroelectric power generation
 
IT-601 Lecture Notes-UNIT-2.pdf Data Analysis
IT-601 Lecture Notes-UNIT-2.pdf Data AnalysisIT-601 Lecture Notes-UNIT-2.pdf Data Analysis
IT-601 Lecture Notes-UNIT-2.pdf Data Analysis
 
Online resume builder management system project report.pdf
Online resume builder management system project report.pdfOnline resume builder management system project report.pdf
Online resume builder management system project report.pdf
 
2024 DevOps Pro Europe - Growing at the edge
2024 DevOps Pro Europe - Growing at the edge2024 DevOps Pro Europe - Growing at the edge
2024 DevOps Pro Europe - Growing at the edge
 
Arduino based vehicle speed tracker project
Arduino based vehicle speed tracker projectArduino based vehicle speed tracker project
Arduino based vehicle speed tracker project
 

Asymptotic notation

  • 2. MATHEMATICAL NOTATIONS, ASYMPTOTIC NOTATION - BIG O , OMEGA, THETA MATHEMATICAL FUNCTIONS
  • 3. 1. FLOOR AND CEILING FUNCTIONS: Floor Function: the greatest integer that is less than or equal to x Ceiling Function: the least integer that is greater than or equal to x Notation
  • 4. 2. Remainder function : Modular arithmetic Let x be any integer and let M be a positive integer. Then x ( mod M) Eg: 13 (mod 5) =3 3. Integer and Absolute Value functions INT (x) converts x into an integer by deleting the fractional part of the number ABS (x) or |x| gives the greater of x or -x Eg: INT(3.14) =3 |15| = 15 |-0.33| = 0.33
  • 5. 4. Summation Symbol: sums Summation symbol : Σ This symbol (called Sigma) means "sum up" 5. Factorial Function The factorial function (symbol: !) says to multiply all whole numbers from our chosen number down to 1. n! = 1.2.3…. (n-2).(n-1) E.g: 2! = 1.2 = 2
  • 6. 6. Permutations A permutation of a set of n elements is an arrangement of the elements in a given order . E.g: Permutations of the elements a, b and c arbe abc, acb, bac, bca, cab, cba 7. Exponents and Logarithms Exponents are also called Powers or Indices. Example: 53 = 5 × 5 × 5 = 125 Logarithm of any positive number x to the base b, written as logb(x) => y= logb(x) => by = x
  • 7. Asymptotic Notation– Big, Omega , Theta Asymptotic Notations refers to computing the running time of any operation in mathematical units of computation. • Ο Notation (Big) • Ω Notation (Omega) • θ Notation (Theta)
  • 8. • Big Oh Notation, Ο • It measures the worst case time complexity or longest amount of time an algorithm can possibly take to complete. O(g(n)) = { f(n): there exist positive constants c and n0 such that 0 <= f(n) <= cg(n) for all n >= n0}
  • 9. Big O Notation • Big-O notation, where the "O" stands for "order of", is concerned with what happens for very large values of n. • For example, if a sorting algorithm performs n2 operations to sort just n elements, then that algorithm would be described as an O(n2) algorithm. • When expressing complexity using Big O notation, constant multipliers are ignored. So a O(4n) algorithm is equivalent to O(n), which is how it should be written.
  • 10. Big O Notation • If f(n) and g(n) are functions defined on positive integer number n, then f(n) = O(g(n)) • That is, f of n is big O of g of n if and only if there exists positive constants c and n, such that f (n) ≤ cg(n) • This means that for large amounts of data, f(n) will grow no more than a constant factor than g(n). Hence, g provides an upper bound.
  • 11. • Ω Notation: • Ω notation provides an asymptotic lower bound
  • 12. Omega Notation • Omega notation provides a tight lower bound for f(n). This means that the function can never do better than the specified value but it may do worse. • Ω notation is simply written as, f(n) ∈ Ω(g(n)), where n is the problem size and Ω(g(n)) = {h(n): ∃ positive constants c > 0, n0 such that 0 ≤ cg(n) ≤ h(n), ∀ n ≥ n0}. • Examples of functions in Ω(n2) include: n2, n2.9, n3 + n, 540n2 + 10 • Examples of functions not in Ω(n3) include: n, n2.9, n2
  • 13. •Θ Notation: Θ((g(n)) = {f(n): there exist positive constants c1, c2 and n0 such that 0 <= c1*g(n) <= f(n) <= c2*g(n) for all n >= n0}
  • 14. Theta Notation • Theta notation provides an asymptotically tight bound for f(n). • Θ notation is simply written as, f(n) ∈ Θ(g(n)), where n is the problem size and Θ(g(n)) = {h(n): ∃ positive constants c1, c2 and n0 such that 0 ≤ c1g(n) ≤ h(n) ≤ c2g(n), ∀ n ≥ n0}. • Hence, we can say that Θ(g(n)) comprises a set of all the functions h(n) that are between c1g(n) and c2g(n) for all values of n ≥ n0. • To summarize,  The best case in Θ notation is not used.  Worst case Θ describes asymptotic bounds for worst case combination of input values.  If we simply write Θ, it means same as worst case Θ.
  • 15. Categories of Algorithms • Constant time algorithms have running time complexity given as O(1) • Linear time algorithms have running time complexity given as O(n) • Logarithmic time algorithms have running time complexity given as O(log n) • Polynomial time algorithms have running time complexity given as O(nk) where k>1 • Exponential time algorithms have running time complexity given as O(2n) n O(1) O(log n) O(n) O(n log n) O(n2) O(n3) 1 1 1 1 1 1 1 2 1 1 2 2 4 8 4 1 2 4 8 16 64 8 1 3 8 24 64 512 16 1 4 16 64 256 4,096