SlideShare a Scribd company logo
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

PPTX
3. Gráfico de Barras, gráfico Circular, histogramas y ojiva..pptx
PDF
Propiedades de-potenciacion-radicacion-y-logartimos
PPTX
Leyes de los exponentes
PPTX
Diagramas de flujo
PDF
Sucesiones y series
PPT
Términos semejantes
PPTX
Desigualdades e inecuaciones
PPT
Estructura pseudocodigo
3. Gráfico de Barras, gráfico Circular, histogramas y ojiva..pptx
Propiedades de-potenciacion-radicacion-y-logartimos
Leyes de los exponentes
Diagramas de flujo
Sucesiones y series
Términos semejantes
Desigualdades e inecuaciones
Estructura pseudocodigo

What's hot (9)

DOC
LISTA DE SÍMBOLOS EN ÁLGEBRA
PPTX
Plan de prevencion de riesgos
PPSX
Grado de expresiones algebraicas
PDF
Ejercicios resueltos calculo diferencial
PPTX
Clase 2 POTENCIA Y RAIZ ENESIMA - GUIA.pptx
PPTX
Problemas de 3 incógnitas
PDF
Teoría y Problemas del Limite de una Función ccesa007
PPT
Actividades humanas que inciden en el ambiente
LISTA DE SÍMBOLOS EN ÁLGEBRA
Plan de prevencion de riesgos
Grado de expresiones algebraicas
Ejercicios resueltos calculo diferencial
Clase 2 POTENCIA Y RAIZ ENESIMA - GUIA.pptx
Problemas de 3 incógnitas
Teoría y Problemas del Limite de una Función ccesa007
Actividades humanas que inciden en el ambiente
Ad

Similar to Formulas para algoritmos (20)

PDF
Algorithmic Mathematics.
PPT
Complete Book Lectures maths theory helpful for kids.ppt
PDF
02 Notes Divide and Conquer
PPT
data unit notes from department of computer science
PPT
lecture07 dicrete mathematics relation .ppt
PDF
Math for programmers
PPT
Lecture in Sets, Sequences and Summations
PPT
daaadafrhdncxfbfbgdngfmfhmhagshh_unit_i.ppt
PPT
daa_unit THIS IS GNDFJG SDGSGS SFDF .ppt
PPTX
Presentation_23953_Content_Document_20240906040454PM.pptx
PDF
Discrete strucures
PPTX
A presentation on Counting Principles.pptx
PDF
A primer on computer algebra
PPTX
Asymptotic notation
PDF
Computer science-formulas
PDF
Digital logic circuits
PPTX
Lecture2a algorithm
PDF
Abstract algebra
PDF
abstract algebra
PDF
Data Structures Chapter-2
Algorithmic Mathematics.
Complete Book Lectures maths theory helpful for kids.ppt
02 Notes Divide and Conquer
data unit notes from department of computer science
lecture07 dicrete mathematics relation .ppt
Math for programmers
Lecture in Sets, Sequences and Summations
daaadafrhdncxfbfbgdngfmfhmhagshh_unit_i.ppt
daa_unit THIS IS GNDFJG SDGSGS SFDF .ppt
Presentation_23953_Content_Document_20240906040454PM.pptx
Discrete strucures
A presentation on Counting Principles.pptx
A primer on computer algebra
Asymptotic notation
Computer science-formulas
Digital logic circuits
Lecture2a algorithm
Abstract algebra
abstract algebra
Data Structures Chapter-2
Ad

More from Beat Winehouse (17)

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

Recently uploaded (20)

PPTX
cpcsea ppt.pptxssssssssssssssjjdjdndndddd
PPTX
Comparative Structure of Integument in Vertebrates.pptx
PPTX
Derivatives of integument scales, beaks, horns,.pptx
PDF
CAPERS-LRD-z9:AGas-enshroudedLittleRedDotHostingaBroad-lineActive GalacticNuc...
PPTX
Cell Membrane: Structure, Composition & Functions
PPTX
ognitive-behavioral therapy, mindfulness-based approaches, coping skills trai...
PDF
HPLC-PPT.docx high performance liquid chromatography
PDF
The scientific heritage No 166 (166) (2025)
PDF
An interstellar mission to test astrophysical black holes
PDF
SEHH2274 Organic Chemistry Notes 1 Structure and Bonding.pdf
PPT
The World of Physical Science, • Labs: Safety Simulation, Measurement Practice
PPTX
2. Earth - The Living Planet Module 2ELS
PDF
Mastering Bioreactors and Media Sterilization: A Complete Guide to Sterile Fe...
PDF
Sciences of Europe No 170 (2025)
PPTX
DRUG THERAPY FOR SHOCK gjjjgfhhhhh.pptx.
DOCX
Viruses (History, structure and composition, classification, Bacteriophage Re...
PPTX
7. General Toxicologyfor clinical phrmacy.pptx
PDF
AlphaEarth Foundations and the Satellite Embedding dataset
PDF
ELS_Q1_Module-11_Formation-of-Rock-Layers_v2.pdf
PDF
Placing the Near-Earth Object Impact Probability in Context
cpcsea ppt.pptxssssssssssssssjjdjdndndddd
Comparative Structure of Integument in Vertebrates.pptx
Derivatives of integument scales, beaks, horns,.pptx
CAPERS-LRD-z9:AGas-enshroudedLittleRedDotHostingaBroad-lineActive GalacticNuc...
Cell Membrane: Structure, Composition & Functions
ognitive-behavioral therapy, mindfulness-based approaches, coping skills trai...
HPLC-PPT.docx high performance liquid chromatography
The scientific heritage No 166 (166) (2025)
An interstellar mission to test astrophysical black holes
SEHH2274 Organic Chemistry Notes 1 Structure and Bonding.pdf
The World of Physical Science, • Labs: Safety Simulation, Measurement Practice
2. Earth - The Living Planet Module 2ELS
Mastering Bioreactors and Media Sterilization: A Complete Guide to Sterile Fe...
Sciences of Europe No 170 (2025)
DRUG THERAPY FOR SHOCK gjjjgfhhhhh.pptx.
Viruses (History, structure and composition, classification, Bacteriophage Re...
7. General Toxicologyfor clinical phrmacy.pptx
AlphaEarth Foundations and the Satellite Embedding dataset
ELS_Q1_Module-11_Formation-of-Rock-Layers_v2.pdf
Placing the Near-Earth Object Impact Probability in Context

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