SlideShare a Scribd company logo
1 of 3
Download to read offline
APPENDIX A
Useful Formulas for the
Analysis of Algorithms
This appendix contains a list of useful formulas and rules that are helpful in the
mathematical analysis of algorithms. More advanced material can be found in
[Gra94], [Gre07], [Pur04], and [Sed96].
Properties of Logarithms
All logarithm bases are assumed to be greater than 1 in the formulas below; lg x
denotes the logarithm base 2, ln x denotes the logarithm base e = 2.71828 . . . ;
x, y are arbitrary positive numbers.
1. loga 1 = 0
2. loga a = 1
3. loga xy = y loga x
4. loga xy = loga x + loga y
5. loga
x
y
= loga x − loga y
6. alogb x = xlogb a
7. loga x =
logb x
logb a
= loga b logb x
Combinatorics
1. Number of permutations of an n-element set: P(n) = n!
2. Number of k-combinations of an n-element set: C(n, k) = n!
k!(n − k)!
3. Number of subsets of an n-element set: 2n
475
476 Useful Formulas for the Analysis of Algorithms
Important Summation Formulas
1.
u
i=l
1 = 1 + 1 + . . . + 1
u−l+1 times
= u − l + 1 (l, u are integer limits, l ≤ u);
n
i=1
1 = n
2.
n
i=1
i = 1 + 2 + . . . + n =
n(n + 1)
2
≈
1
2
n2
3.
n
i=1
i2
= 12
+ 22
+ . . . + n2
=
n(n + 1)(2n + 1)
6
≈
1
3
n3
4.
n
i=1
ik
= 1k
+ 2k
+ . . . + nk
≈
1
k + 1
nk+1
5.
n
i=0
ai
= 1 + a + . . . + an
=
an+1
− 1
a − 1
(a = 1);
n
i=0
2i
= 2n+1
− 1
6.
n
i=1
i2i
= 1 . 2 + 2 . 22
+ . . . + n2n
= (n − 1)2n+1
+ 2
7.
n
i=1
1
i
= 1 +
1
2
+ . . . +
1
n
≈ ln n + γ , where γ ≈ 0.5772 . . . (Euler’s constant)
8.
n
i=1
lg i ≈ n lg n
Sum Manipulation Rules
1.
u
i=l
cai = c
u
i=l
ai
2.
u
i=l
(ai ± bi) =
u
i=l
ai ±
u
i=l
bi
3.
u
i=l
ai =
m
i=l
ai +
u
i=m+1
ai, where l ≤ m < u
4.
u
i=l
(ai − ai−1) = au − al−1
Useful Formulas for the Analysis of Algorithms 477
Approximation of a Sum by a Definite Integral
u
l−1
f (x)dx ≤
u
i=l
f (i) ≤
u+1
l
f (x)dx for a nondecreasing f (x)
u+1
l
f (x)dx ≤
u
i=l
f (i) ≤
u
l−1
f (x)dx for a nonincreasing f (x)
Floor and Ceiling Formulas
The floor of a real number x, denoted x , is defined as the greatest integer not
larger than x (e.g., 3.8 = 3, −3.8 = −4, 3 = 3). The ceiling of a real number x,
denoted x , is defined as the smallest integer not smaller than x (e.g., 3.8 = 4,
−3.8 = −3, 3 = 3).
1. x − 1 < x ≤ x ≤ x < x + 1
2. x + n = x + n and x + n = x + n for real x and integer n
3. n/2 + n/2 = n
4. lg(n + 1) = lg n + 1
Miscellaneous
1. n!≈
√
2πn
n
e
n
as n → ∞ (Stirling’s formula)
2. Modular arithmetic (n, m are integers, p is a positive integer)
(n + m) mod p = (n mod p + m mod p) mod p
(nm) mod p = ((n mod p)(m mod p)) mod p

More Related Content

What's hot

Law of exponent Lecture Slide
Law of exponent Lecture SlideLaw of exponent Lecture Slide
Law of exponent Lecture Slide
Gita Pakpahan
 
Los 20 algoritmos matematicos mas importantes de la historia
Los 20 algoritmos matematicos mas importantes de la historiaLos 20 algoritmos matematicos mas importantes de la historia
Los 20 algoritmos matematicos mas importantes de la historia
lyonc357
 
Calculo diferencial
Calculo diferencialCalculo diferencial
Calculo diferencial
Tania Parra
 
Factorising Common Factors
Factorising Common FactorsFactorising Common Factors
Factorising Common Factors
Passy World
 

What's hot (20)

Guía de clase primero bloque 2
Guía de clase primero bloque 2Guía de clase primero bloque 2
Guía de clase primero bloque 2
 
The beauty of mathematics
The beauty of mathematicsThe beauty of mathematics
The beauty of mathematics
 
Math is the mother of all Science
Math is the mother of all ScienceMath is the mother of all Science
Math is the mother of all Science
 
Maths project work - Arithmetic Sequences
Maths project work - Arithmetic SequencesMaths project work - Arithmetic Sequences
Maths project work - Arithmetic Sequences
 
Ppt on real numbers
Ppt on real numbersPpt on real numbers
Ppt on real numbers
 
Progresiones aritmeticas
Progresiones aritmeticasProgresiones aritmeticas
Progresiones aritmeticas
 
History of Calculus
History of CalculusHistory of Calculus
History of Calculus
 
Properties of Rational Numbers
Properties of Rational Numbers Properties of Rational Numbers
Properties of Rational Numbers
 
Index laws ppt
Index laws pptIndex laws ppt
Index laws ppt
 
Law of exponent Lecture Slide
Law of exponent Lecture SlideLaw of exponent Lecture Slide
Law of exponent Lecture Slide
 
Mathematics
MathematicsMathematics
Mathematics
 
sequence and series presentatation
sequence and series presentatationsequence and series presentatation
sequence and series presentatation
 
Sequences and summations
Sequences and summationsSequences and summations
Sequences and summations
 
Los 20 algoritmos matematicos mas importantes de la historia
Los 20 algoritmos matematicos mas importantes de la historiaLos 20 algoritmos matematicos mas importantes de la historia
Los 20 algoritmos matematicos mas importantes de la historia
 
Role of mathematics in modern Technology.pptx
Role of mathematics in modern Technology.pptxRole of mathematics in modern Technology.pptx
Role of mathematics in modern Technology.pptx
 
Pitágoras expo (1)
Pitágoras expo (1)Pitágoras expo (1)
Pitágoras expo (1)
 
Calculo diferencial
Calculo diferencialCalculo diferencial
Calculo diferencial
 
04 real numbers
04   real numbers04   real numbers
04 real numbers
 
Factorising Common Factors
Factorising Common FactorsFactorising Common Factors
Factorising Common Factors
 
Number theory lecture (part 1)
Number theory lecture (part 1)Number theory lecture (part 1)
Number theory lecture (part 1)
 

Similar to Formulas para algoritmos

Paper computer
Paper computerPaper computer
Paper computer
bikram ...
 
Paper computer
Paper computerPaper computer
Paper computer
bikram ...
 
lecture 1
lecture 1lecture 1
lecture 1
sajinsc
 
Chapter 1 review topic in algebra 1
Chapter 1 review topic in algebra 1Chapter 1 review topic in algebra 1
Chapter 1 review topic in algebra 1
jennytuazon01630
 
Indices and logarithms
Indices and logarithmsIndices and logarithms
Indices and logarithms
Awais Khan
 
Data structures notes for college students btech.pptx
Data structures notes for college students btech.pptxData structures notes for college students btech.pptx
Data structures notes for college students btech.pptx
KarthikVijay59
 

Similar to Formulas para algoritmos (20)

Fórmulas ADA
Fórmulas ADAFórmulas ADA
Fórmulas ADA
 
Asymptotic analysis
Asymptotic analysisAsymptotic analysis
Asymptotic analysis
 
AsymptoticAnalysis.ppt
AsymptoticAnalysis.pptAsymptoticAnalysis.ppt
AsymptoticAnalysis.ppt
 
Paper computer
Paper computerPaper computer
Paper computer
 
Paper computer
Paper computerPaper computer
Paper computer
 
lecture 1
lecture 1lecture 1
lecture 1
 
Asymptotic Notation and Complexity
Asymptotic Notation and ComplexityAsymptotic Notation and Complexity
Asymptotic Notation and Complexity
 
Algorithm.ppt
Algorithm.pptAlgorithm.ppt
Algorithm.ppt
 
04. Growth_Rate_AND_Asymptotic Notations_.pptx
04. Growth_Rate_AND_Asymptotic Notations_.pptx04. Growth_Rate_AND_Asymptotic Notations_.pptx
04. Growth_Rate_AND_Asymptotic Notations_.pptx
 
Annie
AnnieAnnie
Annie
 
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
 
3 analysis.gtm
3 analysis.gtm3 analysis.gtm
3 analysis.gtm
 
Introduction to Algorithms
Introduction to AlgorithmsIntroduction to Algorithms
Introduction to Algorithms
 
A Mathematically Derived Number of Resamplings for Noisy Optimization (GECCO2...
A Mathematically Derived Number of Resamplings for Noisy Optimization (GECCO2...A Mathematically Derived Number of Resamplings for Noisy Optimization (GECCO2...
A Mathematically Derived Number of Resamplings for Noisy Optimization (GECCO2...
 
Chapter 1 review topic in algebra 1
Chapter 1 review topic in algebra 1Chapter 1 review topic in algebra 1
Chapter 1 review topic in algebra 1
 
Introduction to the AKS Primality Test
Introduction to the AKS Primality TestIntroduction to the AKS Primality Test
Introduction to the AKS Primality Test
 
Indices and logarithms
Indices and logarithmsIndices and logarithms
Indices and logarithms
 
Computation of Semi-Magic Squares Generated by Serpentine Matrices
Computation of Semi-Magic Squares Generated by Serpentine MatricesComputation of Semi-Magic Squares Generated by Serpentine Matrices
Computation of Semi-Magic Squares Generated by Serpentine Matrices
 
module1_Introductiontoalgorithms_2022.pdf
module1_Introductiontoalgorithms_2022.pdfmodule1_Introductiontoalgorithms_2022.pdf
module1_Introductiontoalgorithms_2022.pdf
 
Data structures notes for college students btech.pptx
Data structures notes for college students btech.pptxData structures notes for college students btech.pptx
Data structures notes for college students btech.pptx
 

More from Beat Winehouse

More from Beat Winehouse (17)

Metodos numéricos (euler, euler modificado, rk)
Metodos numéricos (euler, euler modificado, rk)Metodos numéricos (euler, euler modificado, rk)
Metodos numéricos (euler, euler modificado, rk)
 
Gráficos en MATLAB
Gráficos en MATLABGráficos en MATLAB
Gráficos en MATLAB
 
Parallel processing for linear programming
Parallel processing for linear programmingParallel processing for linear programming
Parallel processing for linear programming
 
Improving Tree augmented Naive Bayes for class probability estimation
Improving Tree augmented Naive Bayes for class probability estimationImproving Tree augmented Naive Bayes for class probability estimation
Improving Tree augmented Naive Bayes for class probability estimation
 
Curso de edición fotográfica
Curso de edición fotográficaCurso de edición fotográfica
Curso de edición fotográfica
 
Redes bayesianas
Redes bayesianasRedes bayesianas
Redes bayesianas
 
Cómo construir y validar redes bayesianas con netica
Cómo construir y validar redes bayesianas con neticaCómo construir y validar redes bayesianas con netica
Cómo construir y validar redes bayesianas con netica
 
Modelizacion con curvas y superficies de bezier
Modelizacion con curvas y superficies de bezierModelizacion con curvas y superficies de bezier
Modelizacion con curvas y superficies de bezier
 
Taller de edicion
Taller de edicionTaller de edicion
Taller de edicion
 
Sums (Sumatorias)
Sums (Sumatorias)Sums (Sumatorias)
Sums (Sumatorias)
 
Problems on Algorithms
Problems on AlgorithmsProblems on Algorithms
Problems on Algorithms
 
Manual análisis de algoritmos
Manual análisis de algoritmosManual análisis de algoritmos
Manual análisis de algoritmos
 
The bayesian revolution in genetics
The bayesian revolution in geneticsThe bayesian revolution in genetics
The bayesian revolution in genetics
 
Inducción matemática
Inducción matemáticaInducción matemática
Inducción matemática
 
La eficiencia de los algoritmos
La eficiencia de los algoritmosLa eficiencia de los algoritmos
La eficiencia de los algoritmos
 
Algoritmos de vuelta atrás
Algoritmos de vuelta atrásAlgoritmos de vuelta atrás
Algoritmos de vuelta atrás
 
Algoritmos de ordenación
Algoritmos de ordenaciónAlgoritmos de ordenación
Algoritmos de ordenación
 

Recently uploaded

Chemical Tests; flame test, positive and negative ions test Edexcel Internati...
Chemical Tests; flame test, positive and negative ions test Edexcel Internati...Chemical Tests; flame test, positive and negative ions test Edexcel Internati...
Chemical Tests; flame test, positive and negative ions test Edexcel Internati...
ssuser79fe74
 
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
Lokesh Kothari
 
Conjugation, transduction and transformation
Conjugation, transduction and transformationConjugation, transduction and transformation
Conjugation, transduction and transformation
Areesha Ahmad
 
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptxSCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
RizalinePalanog2
 
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsBiogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Sérgio Sacani
 
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Lokesh Kothari
 
Seismic Method Estimate velocity from seismic data.pptx
Seismic Method Estimate velocity from seismic  data.pptxSeismic Method Estimate velocity from seismic  data.pptx
Seismic Method Estimate velocity from seismic data.pptx
AlMamun560346
 

Recently uploaded (20)

Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verifiedConnaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
Connaught Place, Delhi Call girls :8448380779 Model Escorts | 100% verified
 
High Profile 🔝 8250077686 📞 Call Girls Service in GTB Nagar🍑
High Profile 🔝 8250077686 📞 Call Girls Service in GTB Nagar🍑High Profile 🔝 8250077686 📞 Call Girls Service in GTB Nagar🍑
High Profile 🔝 8250077686 📞 Call Girls Service in GTB Nagar🍑
 
Chemical Tests; flame test, positive and negative ions test Edexcel Internati...
Chemical Tests; flame test, positive and negative ions test Edexcel Internati...Chemical Tests; flame test, positive and negative ions test Edexcel Internati...
Chemical Tests; flame test, positive and negative ions test Edexcel Internati...
 
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICESAMASTIPUR CALL GIRL 7857803690  LOW PRICE  ESCORT SERVICE
SAMASTIPUR CALL GIRL 7857803690 LOW PRICE ESCORT SERVICE
 
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
 
Chemistry 4th semester series (krishna).pdf
Chemistry 4th semester series (krishna).pdfChemistry 4th semester series (krishna).pdf
Chemistry 4th semester series (krishna).pdf
 
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
GUIDELINES ON SIMILAR BIOLOGICS Regulatory Requirements for Marketing Authori...
 
Conjugation, transduction and transformation
Conjugation, transduction and transformationConjugation, transduction and transformation
Conjugation, transduction and transformation
 
CELL -Structural and Functional unit of life.pdf
CELL -Structural and Functional unit of life.pdfCELL -Structural and Functional unit of life.pdf
CELL -Structural and Functional unit of life.pdf
 
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptxSCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
SCIENCE-4-QUARTER4-WEEK-4-PPT-1 (1).pptx
 
Nanoparticles synthesis and characterization​ ​
Nanoparticles synthesis and characterization​  ​Nanoparticles synthesis and characterization​  ​
Nanoparticles synthesis and characterization​ ​
 
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsBiogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
 
TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...
TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...
TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...
 
GBSN - Microbiology (Unit 2)
GBSN - Microbiology (Unit 2)GBSN - Microbiology (Unit 2)
GBSN - Microbiology (Unit 2)
 
module for grade 9 for distance learning
module for grade 9 for distance learningmodule for grade 9 for distance learning
module for grade 9 for distance learning
 
Factory Acceptance Test( FAT).pptx .
Factory Acceptance Test( FAT).pptx       .Factory Acceptance Test( FAT).pptx       .
Factory Acceptance Test( FAT).pptx .
 
GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)
 
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
Labelling Requirements and Label Claims for Dietary Supplements and Recommend...
 
Seismic Method Estimate velocity from seismic data.pptx
Seismic Method Estimate velocity from seismic  data.pptxSeismic Method Estimate velocity from seismic  data.pptx
Seismic Method Estimate velocity from seismic data.pptx
 
Forensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdfForensic Biology & Its biological significance.pdf
Forensic Biology & Its biological significance.pdf
 

Formulas para algoritmos

  • 1. APPENDIX A Useful Formulas for the Analysis of Algorithms This appendix contains a list of useful formulas and rules that are helpful in the mathematical analysis of algorithms. More advanced material can be found in [Gra94], [Gre07], [Pur04], and [Sed96]. Properties of Logarithms All logarithm bases are assumed to be greater than 1 in the formulas below; lg x denotes the logarithm base 2, ln x denotes the logarithm base e = 2.71828 . . . ; x, y are arbitrary positive numbers. 1. loga 1 = 0 2. loga a = 1 3. loga xy = y loga x 4. loga xy = loga x + loga y 5. loga x y = loga x − loga y 6. alogb x = xlogb a 7. loga x = logb x logb a = loga b logb x Combinatorics 1. Number of permutations of an n-element set: P(n) = n! 2. Number of k-combinations of an n-element set: C(n, k) = n! k!(n − k)! 3. Number of subsets of an n-element set: 2n 475
  • 2. 476 Useful Formulas for the Analysis of Algorithms Important Summation Formulas 1. u i=l 1 = 1 + 1 + . . . + 1 u−l+1 times = u − l + 1 (l, u are integer limits, l ≤ u); n i=1 1 = n 2. n i=1 i = 1 + 2 + . . . + n = n(n + 1) 2 ≈ 1 2 n2 3. n i=1 i2 = 12 + 22 + . . . + n2 = n(n + 1)(2n + 1) 6 ≈ 1 3 n3 4. n i=1 ik = 1k + 2k + . . . + nk ≈ 1 k + 1 nk+1 5. n i=0 ai = 1 + a + . . . + an = an+1 − 1 a − 1 (a = 1); n i=0 2i = 2n+1 − 1 6. n i=1 i2i = 1 . 2 + 2 . 22 + . . . + n2n = (n − 1)2n+1 + 2 7. n i=1 1 i = 1 + 1 2 + . . . + 1 n ≈ ln n + γ , where γ ≈ 0.5772 . . . (Euler’s constant) 8. n i=1 lg i ≈ n lg n Sum Manipulation Rules 1. u i=l cai = c u i=l ai 2. u i=l (ai ± bi) = u i=l ai ± u i=l bi 3. u i=l ai = m i=l ai + u i=m+1 ai, where l ≤ m < u 4. u i=l (ai − ai−1) = au − al−1
  • 3. Useful Formulas for the Analysis of Algorithms 477 Approximation of a Sum by a Definite Integral u l−1 f (x)dx ≤ u i=l f (i) ≤ u+1 l f (x)dx for a nondecreasing f (x) u+1 l f (x)dx ≤ u i=l f (i) ≤ u l−1 f (x)dx for a nonincreasing f (x) Floor and Ceiling Formulas The floor of a real number x, denoted x , is defined as the greatest integer not larger than x (e.g., 3.8 = 3, −3.8 = −4, 3 = 3). The ceiling of a real number x, denoted x , is defined as the smallest integer not smaller than x (e.g., 3.8 = 4, −3.8 = −3, 3 = 3). 1. x − 1 < x ≤ x ≤ x < x + 1 2. x + n = x + n and x + n = x + n for real x and integer n 3. n/2 + n/2 = n 4. lg(n + 1) = lg n + 1 Miscellaneous 1. n!≈ √ 2πn n e n as n → ∞ (Stirling’s formula) 2. Modular arithmetic (n, m are integers, p is a positive integer) (n + m) mod p = (n mod p + m mod p) mod p (nm) mod p = ((n mod p)(m mod p)) mod p