SlideShare a Scribd company logo
A A nalisis de lgoritmos Informacion tomada del libro de Cormen.
OUTLINE ,[object Object],[object Object],[object Object]
ASYMPTOTIC NOTATION
Asymptotically  N o Negative Functions f(n)  is asymptotically no negative if there exist  n 0    N  such that for every  n    n 0 , 0     f(n) n 0 f
Theta      ( g(n) )  = {   f  : N   R *  | (    c 1 , c 2     R   + )   (    n 0   N) (    n    n 0 )  ( 0   c 1  g(n)    f(n)    c 2  g(n) )   } c 1      lim  f(n)      c 2 n     g(n )   n 0 g c 1 g f c 2 g
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Example Lets show that We have to find  c 1 , c 2  and   n 0   such that
For all  n     n 0 , Dividing by  n 2  yields We have that  3/n  is a decreasing sequence  3, 3/2, 1, 3/4, 3/5, 3/6, 3/7… and then  1/2 - 3/n  is increasing sequence  -5/2, -1, -1/2, -1/4, -1/10, 0, 1/14 that is upper bounded by  1/2 .
The right hand inequality can be made to hold for  n     1  by choosing  c 2     1/2 . Likewise the left hand inequality can be made to hold for  n     7  by choosing  c 1     1/14 .
Thus by choosing  c 1  =  1/14 ,  c 2  =  1/2  and  n 0  =7 then we can verify that
Big  O   O (g(n))   = { f : N   R *  | (    c  R  + ) (  n 0  N) (  n   n 0 ) (  0     f(n)     cg(n)  ) } lim  f(n)     c n     g(n)   n 0 g cg f
[object Object],[object Object],[object Object],[object Object],[object Object]
Example Lets show that We have to find  c   and   n 0   such that
For all  n     n 0 , Dividing by  n   yields The inequality can be made to hold for  n     1  by choosing  c      a+b .  Thus by choosing  c   =  a+b  and  n 0  =1 then we can verify that
n 0 =1 a+b b a
Big Omega      ( g(n) )  = {   f : N   R *  | (    c  R  + ) (  n 0  N) (    n   n 0 ) (  0    cg(n)     f(n)   )   } c      lim  f(n)  n     g(n)   n 0 g f cg
[object Object],[object Object],[object Object],[object Object],[object Object]
Little  o o   (g(n))  =  {  f  : N   R *  | (  c   R  + ) (  n 0  N) (    n   n 0 ) (  0     f(n) < cg (n)  )  } lim  f(n)  = 0 n     g(n)  “ o(g(n))  functions that grow slower than  g  ”   g f
[object Object],[object Object],[object Object]
n 2 n Examples Lets show that We only have to show
Lets show that We have 3n n
Little Omega      ( g(n) )  =  {   f  : N   R *  | (  c  R  + ) (  n 0  N) (    n   n 0 ) (  0     c g(n) < f(n ) )  } lim  f(n)  =     n     g(n)   “    (g(n))  functions that grow faster than  g  ” f g
[object Object],[object Object],[object Object]
Analogy with the comparison of two real numbers Asymptotic   Real Notation numbers f(n)    O(g(n))    f     g f(n)     (g(n))    f     g f(n)     (g(n))    f =  g f(n)    o(g(n))    f <  g f(n)     (g(n))    f >  g Trichotomy does not hold
Not all functions are asymptotically comparable Example f(n)=n g(n)=n (1+sin n) (1+sin(n))    [0,2]
[object Object],[object Object],[object Object],[object Object],   (f(n))=O(f(n))      (f(n))  Properties
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],o (f(n))        (f(n)) =  
Examples ,[object Object],[object Object],[object Object],[object Object],[object Object]
Examples ,[object Object],[object Object],[object Object],[object Object],[object Object]
Examples ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Asymptotic notation two variables O(g(m, n))= {  f: N   N     R *  | (    c   R  + )(    m 0  , n 0    N)   (    n    n 0 ) (    m    m 0 )   (f(m, n)     c g(m, n))  }
COMMON FUNCTIONS
Monotonicity ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Floors and Ceilings ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],-1 0 1  x  -2 2  x  x
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Modular arithmetic For every integer  a  and any possible positive integer  n, a mod n  is the   remainder   of  ( or  residue )  of the quotient  a/n a mod n = a -   a  / n    n.
congruency  or equivalence mod  n If ( a mod n) =  ( b mod n)  we write  a     b  ( mod n)  and we say that  a  is  equivalent  to  b  modulo  n  or that a  is  congruent  to  b  modulo  n. In other words  a     b  ( mod n)  if  a  and  b  have the same remainder when divided by  n . Also  a     b  ( mod n)  if and only if  n  is a divisor of  b-a.
0 1 2 3 -4 -3 -2 -1 -8 -7 -6 -5 -12 -11 -10 -9         12 13 14 15 8 9 10 11 4 5 6 7     Example     (mod 4)    (mod n)   defines a equivalence  relation in   Z  and produces a  partitioned set called  Z n =   Z /n  = {0,1,2,…, n -1} in which can be defined  arithmetic operations a+b (mod n)  a*b (mod n)   [0] [1] [2] [3] Z /4 = {[0],[1],[2],[3]} = {0,1,2,3} 4+1 ( mod  4) = 1 5*2 ( mod  4) = 2
Polynomials Given a no negative integer  d,  a  polynomial  in n of degree d  is a function  p(n)  of the form: Where  a 1  , a 2  , …,   a d  are the  coefficients   and  a d     0.
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Exponentials ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object]
Logarithms ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object]
A function  f(n)   is  polylogaritmically bounded  if  f(n)= O ( lg k  n)  for some constant  k. We have the following relation between polynomials  and polylogarithms: then   lg k  n = o ( n k  )
Factorials Definition   (no recursive)     (recursive) Weak upper bound  n!    n n
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object]
Functional iteration Given a function  f  ( n ) the i-th functional iteration of  f  is  defined as : with  I  the identity function. For a particular  n , we have,
Examples: f(n) = 2n  then f(n) = n 2   then
f(n) = n n   then
Iterated logarithm ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
In general k

More Related Content

What's hot

Signal Processing Introduction using Fourier Transforms
Signal Processing Introduction using Fourier TransformsSignal Processing Introduction using Fourier Transforms
Signal Processing Introduction using Fourier Transforms
Arvind Devaraj
 
Numerical analysis convexity, concavity
Numerical analysis  convexity, concavityNumerical analysis  convexity, concavity
Numerical analysis convexity, concavity
SHAMJITH KM
 
Solving trignometric equations
Solving trignometric equationsSolving trignometric equations
Solving trignometric equations
Tarun Gehlot
 

What's hot (20)

Dericavion e integracion de funciones
Dericavion e integracion de funcionesDericavion e integracion de funciones
Dericavion e integracion de funciones
 
Fourier series
Fourier seriesFourier series
Fourier series
 
Fourier series 1
Fourier series 1Fourier series 1
Fourier series 1
 
senior seminar
senior seminarsenior seminar
senior seminar
 
Fourier series
Fourier seriesFourier series
Fourier series
 
Introduction to Fourier transform and signal analysis
Introduction to Fourier transform and signal analysisIntroduction to Fourier transform and signal analysis
Introduction to Fourier transform and signal analysis
 
Fourier series of odd functions with period 2 l
Fourier series of odd functions with period 2 lFourier series of odd functions with period 2 l
Fourier series of odd functions with period 2 l
 
Desktop
DesktopDesktop
Desktop
 
Topic: Fourier Series ( Periodic Function to change of interval)
Topic: Fourier Series ( Periodic Function to  change of interval)Topic: Fourier Series ( Periodic Function to  change of interval)
Topic: Fourier Series ( Periodic Function to change of interval)
 
residue
residueresidue
residue
 
Chapter 2 (maths 3)
Chapter 2 (maths 3)Chapter 2 (maths 3)
Chapter 2 (maths 3)
 
Chapter 5 (maths 3)
Chapter 5 (maths 3)Chapter 5 (maths 3)
Chapter 5 (maths 3)
 
03 convexfunctions
03 convexfunctions03 convexfunctions
03 convexfunctions
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
 
Signal Processing Introduction using Fourier Transforms
Signal Processing Introduction using Fourier TransformsSignal Processing Introduction using Fourier Transforms
Signal Processing Introduction using Fourier Transforms
 
Numerical analysis convexity, concavity
Numerical analysis  convexity, concavityNumerical analysis  convexity, concavity
Numerical analysis convexity, concavity
 
Chapter 4 (maths 3)
Chapter 4 (maths 3)Chapter 4 (maths 3)
Chapter 4 (maths 3)
 
Solving trignometric equations
Solving trignometric equationsSolving trignometric equations
Solving trignometric equations
 
Directional derivative and gradient
Directional derivative and gradientDirectional derivative and gradient
Directional derivative and gradient
 
AEM Fourier series
 AEM Fourier series AEM Fourier series
AEM Fourier series
 

Viewers also liked (10)

Skiena algorithm 2007 lecture02 asymptotic notation
Skiena algorithm 2007 lecture02 asymptotic notationSkiena algorithm 2007 lecture02 asymptotic notation
Skiena algorithm 2007 lecture02 asymptotic notation
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
 
Lec2 Algorth
Lec2 AlgorthLec2 Algorth
Lec2 Algorth
 
02 asymp
02 asymp02 asymp
02 asymp
 
02 asymptotic-notation-and-recurrences
02 asymptotic-notation-and-recurrences02 asymptotic-notation-and-recurrences
02 asymptotic-notation-and-recurrences
 
Lecture1
Lecture1Lecture1
Lecture1
 
Analysis of algorithn class 3
Analysis of algorithn class 3Analysis of algorithn class 3
Analysis of algorithn class 3
 
Introduction to Algorithms and Asymptotic Notation
Introduction to Algorithms and Asymptotic NotationIntroduction to Algorithms and Asymptotic Notation
Introduction to Algorithms and Asymptotic Notation
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
 
Asymptotic Notation and Data Structures
Asymptotic Notation and Data StructuresAsymptotic Notation and Data Structures
Asymptotic Notation and Data Structures
 

Similar to Clase3 Notacion

Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
Nikhil Sharma
 
Lecture 4 - Growth of Functions (1).ppt
Lecture 4 - Growth of Functions (1).pptLecture 4 - Growth of Functions (1).ppt
Lecture 4 - Growth of Functions (1).ppt
ZohairMughal1
 
Last+minute+revision(+Final)+(1) (1).pptx
Last+minute+revision(+Final)+(1) (1).pptxLast+minute+revision(+Final)+(1) (1).pptx
Last+minute+revision(+Final)+(1) (1).pptx
AryanMishra860130
 
lecture 3
lecture 3lecture 3
lecture 3
sajinsc
 

Similar to Clase3 Notacion (20)

Lecture 3(a) Asymptotic-analysis.pdf
Lecture 3(a) Asymptotic-analysis.pdfLecture 3(a) Asymptotic-analysis.pdf
Lecture 3(a) Asymptotic-analysis.pdf
 
Lecture3(b).pdf
Lecture3(b).pdfLecture3(b).pdf
Lecture3(b).pdf
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
 
Lecture 4 - Growth of Functions.ppt
Lecture 4 - Growth of Functions.pptLecture 4 - Growth of Functions.ppt
Lecture 4 - Growth of Functions.ppt
 
Lecture 4 - Growth of Functions (1).ppt
Lecture 4 - Growth of Functions (1).pptLecture 4 - Growth of Functions (1).ppt
Lecture 4 - Growth of Functions (1).ppt
 
Asymtotic Appoach.ppt
Asymtotic Appoach.pptAsymtotic Appoach.ppt
Asymtotic Appoach.ppt
 
DAA_LECT_2.pdf
DAA_LECT_2.pdfDAA_LECT_2.pdf
DAA_LECT_2.pdf
 
02-asymp.ppt
02-asymp.ppt02-asymp.ppt
02-asymp.ppt
 
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
 
Time complexity
Time complexityTime complexity
Time complexity
 
big_oh
big_ohbig_oh
big_oh
 
Last+minute+revision(+Final)+(1) (1).pptx
Last+minute+revision(+Final)+(1) (1).pptxLast+minute+revision(+Final)+(1) (1).pptx
Last+minute+revision(+Final)+(1) (1).pptx
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
 
Asymptotic notation
Asymptotic notationAsymptotic notation
Asymptotic notation
 
Group theory notes
Group theory notesGroup theory notes
Group theory notes
 
Number theory lecture (part 1)
Number theory lecture (part 1)Number theory lecture (part 1)
Number theory lecture (part 1)
 
lecture 3
lecture 3lecture 3
lecture 3
 
2-AnalysisOfAlgs.ppt
2-AnalysisOfAlgs.ppt2-AnalysisOfAlgs.ppt
2-AnalysisOfAlgs.ppt
 
CMSC 56 | Lecture 8: Growth of Functions
CMSC 56 | Lecture 8: Growth of FunctionsCMSC 56 | Lecture 8: Growth of Functions
CMSC 56 | Lecture 8: Growth of Functions
 
Sparse Representation of Multivariate Extremes with Applications to Anomaly R...
Sparse Representation of Multivariate Extremes with Applications to Anomaly R...Sparse Representation of Multivariate Extremes with Applications to Anomaly R...
Sparse Representation of Multivariate Extremes with Applications to Anomaly R...
 

More from luzenith_g

Carácterísticas técnicas de las wikis
Carácterísticas técnicas de las wikisCarácterísticas técnicas de las wikis
Carácterísticas técnicas de las wikis
luzenith_g
 
Ejercicios Ada
Ejercicios AdaEjercicios Ada
Ejercicios Ada
luzenith_g
 
Ejercicios Ada
Ejercicios AdaEjercicios Ada
Ejercicios Ada
luzenith_g
 
Proyecto Unal2009 2
Proyecto Unal2009 2Proyecto Unal2009 2
Proyecto Unal2009 2
luzenith_g
 
Taller3 Programacion Ii
Taller3 Programacion IiTaller3 Programacion Ii
Taller3 Programacion Ii
luzenith_g
 
Algoritmos Voraces (Greedy)
Algoritmos Voraces (Greedy)Algoritmos Voraces (Greedy)
Algoritmos Voraces (Greedy)
luzenith_g
 
Algoritmos Greedy
Algoritmos GreedyAlgoritmos Greedy
Algoritmos Greedy
luzenith_g
 
DSS:Conceptos, metodologias y Tecnologias
DSS:Conceptos, metodologias y TecnologiasDSS:Conceptos, metodologias y Tecnologias
DSS:Conceptos, metodologias y Tecnologias
luzenith_g
 

More from luzenith_g (20)

Formacion y crecimiento
Formacion y crecimientoFormacion y crecimiento
Formacion y crecimiento
 
Formacion y crecimiento
Formacion y crecimientoFormacion y crecimiento
Formacion y crecimiento
 
Carácterísticas técnicas de las wikis
Carácterísticas técnicas de las wikisCarácterísticas técnicas de las wikis
Carácterísticas técnicas de las wikis
 
Web 2 0
Web 2 0Web 2 0
Web 2 0
 
Alg1
Alg1Alg1
Alg1
 
Ejercicios Ada
Ejercicios AdaEjercicios Ada
Ejercicios Ada
 
Ejercicios Ada
Ejercicios AdaEjercicios Ada
Ejercicios Ada
 
Proyecto Unal2009 2
Proyecto Unal2009 2Proyecto Unal2009 2
Proyecto Unal2009 2
 
Taller3 Programacion Ii
Taller3 Programacion IiTaller3 Programacion Ii
Taller3 Programacion Ii
 
Algoritmos Voraces (Greedy)
Algoritmos Voraces (Greedy)Algoritmos Voraces (Greedy)
Algoritmos Voraces (Greedy)
 
Algoritmos Greedy
Algoritmos GreedyAlgoritmos Greedy
Algoritmos Greedy
 
Resumen
ResumenResumen
Resumen
 
Analisis Clase2
Analisis  Clase2Analisis  Clase2
Analisis Clase2
 
Introducción al Análisis y diseño de algoritmos
Introducción al Análisis y diseño de algoritmosIntroducción al Análisis y diseño de algoritmos
Introducción al Análisis y diseño de algoritmos
 
Como construir un DSS
Como construir un DSSComo construir un DSS
Como construir un DSS
 
Mergesort
MergesortMergesort
Mergesort
 
State Space Search(2)
State Space Search(2)State Space Search(2)
State Space Search(2)
 
DSS:Conceptos, metodologias y Tecnologias
DSS:Conceptos, metodologias y TecnologiasDSS:Conceptos, metodologias y Tecnologias
DSS:Conceptos, metodologias y Tecnologias
 
Soporte a las Decisiones Computarizado
Soporte a las Decisiones ComputarizadoSoporte a las Decisiones Computarizado
Soporte a las Decisiones Computarizado
 
Decision Support Systems
Decision Support SystemsDecision Support Systems
Decision Support Systems
 

Recently uploaded

The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 

Recently uploaded (20)

Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxJose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
B.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdfB.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdf
 
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.pptBasic_QTL_Marker-assisted_Selection_Sourabh.ppt
Basic_QTL_Marker-assisted_Selection_Sourabh.ppt
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Salient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptxSalient features of Environment protection Act 1986.pptx
Salient features of Environment protection Act 1986.pptx
 
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptxMatatag-Curriculum and the 21st Century Skills Presentation.pptx
Matatag-Curriculum and the 21st Century Skills Presentation.pptx
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 

Clase3 Notacion

  • 1. A A nalisis de lgoritmos Informacion tomada del libro de Cormen.
  • 2.
  • 4. Asymptotically N o Negative Functions f(n) is asymptotically no negative if there exist n 0  N such that for every n  n 0 , 0  f(n) n 0 f
  • 5. Theta   ( g(n) ) = { f : N  R * | (  c 1 , c 2  R + ) (  n 0  N) (  n  n 0 ) ( 0  c 1 g(n)  f(n)  c 2 g(n) ) } c 1  lim f(n)  c 2 n  g(n ) n 0 g c 1 g f c 2 g
  • 6.
  • 7. Example Lets show that We have to find c 1 , c 2 and n 0 such that
  • 8. For all n  n 0 , Dividing by n 2 yields We have that 3/n is a decreasing sequence 3, 3/2, 1, 3/4, 3/5, 3/6, 3/7… and then 1/2 - 3/n is increasing sequence -5/2, -1, -1/2, -1/4, -1/10, 0, 1/14 that is upper bounded by 1/2 .
  • 9. The right hand inequality can be made to hold for n  1 by choosing c 2  1/2 . Likewise the left hand inequality can be made to hold for n  7 by choosing c 1  1/14 .
  • 10. Thus by choosing c 1 = 1/14 , c 2 = 1/2 and n 0 =7 then we can verify that
  • 11. Big O O (g(n)) = { f : N  R * | (  c  R + ) (  n 0  N) (  n  n 0 ) ( 0  f(n)  cg(n) ) } lim f(n)  c n  g(n) n 0 g cg f
  • 12.
  • 13. Example Lets show that We have to find c and n 0 such that
  • 14. For all n  n 0 , Dividing by n yields The inequality can be made to hold for n  1 by choosing c  a+b . Thus by choosing c = a+b and n 0 =1 then we can verify that
  • 15. n 0 =1 a+b b a
  • 16. Big Omega   ( g(n) ) = { f : N  R * | (  c  R + ) (  n 0  N) (  n  n 0 ) ( 0  cg(n)  f(n) ) } c  lim f(n) n  g(n) n 0 g f cg
  • 17.
  • 18. Little o o (g(n)) = { f : N  R * | (  c  R + ) (  n 0  N) (  n  n 0 ) ( 0  f(n) < cg (n) ) } lim f(n) = 0 n  g(n) “ o(g(n)) functions that grow slower than g ” g f
  • 19.
  • 20. n 2 n Examples Lets show that We only have to show
  • 21. Lets show that We have 3n n
  • 22. Little Omega   ( g(n) ) = { f : N  R * | (  c  R + ) (  n 0  N) (  n  n 0 ) ( 0  c g(n) < f(n ) ) } lim f(n) =  n  g(n) “  (g(n)) functions that grow faster than g ” f g
  • 23.
  • 24. Analogy with the comparison of two real numbers Asymptotic Real Notation numbers f(n)  O(g(n)) f  g f(n)   (g(n)) f  g f(n)   (g(n)) f = g f(n)  o(g(n)) f < g f(n)   (g(n)) f > g Trichotomy does not hold
  • 25. Not all functions are asymptotically comparable Example f(n)=n g(n)=n (1+sin n) (1+sin(n))  [0,2]
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33. Asymptotic notation two variables O(g(m, n))= { f: N  N  R * | (  c  R + )(  m 0 , n 0  N) (  n  n 0 ) (  m  m 0 ) (f(m, n)  c g(m, n)) }
  • 35.
  • 36.
  • 37.
  • 38. Modular arithmetic For every integer a and any possible positive integer n, a mod n is the remainder of ( or residue ) of the quotient a/n a mod n = a -  a / n  n.
  • 39. congruency or equivalence mod n If ( a mod n) = ( b mod n) we write a  b ( mod n) and we say that a is equivalent to b modulo n or that a is congruent to b modulo n. In other words a  b ( mod n) if a and b have the same remainder when divided by n . Also a  b ( mod n) if and only if n is a divisor of b-a.
  • 40. 0 1 2 3 -4 -3 -2 -1 -8 -7 -6 -5 -12 -11 -10 -9         12 13 14 15 8 9 10 11 4 5 6 7     Example  (mod 4)  (mod n) defines a equivalence relation in Z and produces a partitioned set called Z n = Z /n = {0,1,2,…, n -1} in which can be defined arithmetic operations a+b (mod n) a*b (mod n) [0] [1] [2] [3] Z /4 = {[0],[1],[2],[3]} = {0,1,2,3} 4+1 ( mod 4) = 1 5*2 ( mod 4) = 2
  • 41. Polynomials Given a no negative integer d, a polynomial in n of degree d is a function p(n) of the form: Where a 1 , a 2 , …, a d are the coefficients and a d  0.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49. A function f(n) is polylogaritmically bounded if f(n)= O ( lg k n) for some constant k. We have the following relation between polynomials and polylogarithms: then lg k n = o ( n k )
  • 50. Factorials Definition (no recursive) (recursive) Weak upper bound n!  n n
  • 51.
  • 52.
  • 53. Functional iteration Given a function f ( n ) the i-th functional iteration of f is defined as : with I the identity function. For a particular n , we have,
  • 54. Examples: f(n) = 2n then f(n) = n 2 then
  • 55. f(n) = n n then
  • 56.