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 (7)

Algebra 5 6
Algebra 5 6Algebra 5 6
Algebra 5 6
 
Subset sum problem Dynamic and Brute Force Approch
Subset sum problem Dynamic and Brute Force ApprochSubset sum problem Dynamic and Brute Force Approch
Subset sum problem Dynamic and Brute Force Approch
 
Work book on POLYNOMIALS
Work book on POLYNOMIALSWork book on POLYNOMIALS
Work book on POLYNOMIALS
 
PCExam 1 study guide answers
PCExam 1 study guide answersPCExam 1 study guide answers
PCExam 1 study guide answers
 
6.5 notes p2 DeMoivres
6.5 notes p2 DeMoivres6.5 notes p2 DeMoivres
6.5 notes p2 DeMoivres
 
Sum of subset problem
Sum of subset problemSum of subset problem
Sum of subset problem
 
Equations in Polar Coordinates
Equations in Polar CoordinatesEquations in Polar Coordinates
Equations in Polar Coordinates
 

Similar to Fórmulas ADA

lecture 1
lecture 1lecture 1
lecture 1
sajinsc
 
Paper computer
Paper computerPaper computer
Paper computer
bikram ...
 
Paper computer
Paper computerPaper computer
Paper computer
bikram ...
 
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 Fórmulas ADA (20)

Asymptotic analysis
Asymptotic analysisAsymptotic analysis
Asymptotic analysis
 
AsymptoticAnalysis.ppt
AsymptoticAnalysis.pptAsymptoticAnalysis.ppt
AsymptoticAnalysis.ppt
 
lecture 1
lecture 1lecture 1
lecture 1
 
Paper computer
Paper computerPaper computer
Paper computer
 
Paper computer
Paper computerPaper computer
Paper computer
 
Algorithm.ppt
Algorithm.pptAlgorithm.ppt
Algorithm.ppt
 
Asymptotic Notation and Complexity
Asymptotic Notation and ComplexityAsymptotic Notation and Complexity
Asymptotic Notation and Complexity
 
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
 
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
 
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...
 
Introduction to the AKS Primality Test
Introduction to the AKS Primality TestIntroduction to the AKS Primality Test
Introduction to the AKS Primality Test
 
Introduction to Algorithms
Introduction to AlgorithmsIntroduction to Algorithms
Introduction to Algorithms
 
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
 
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
 
3 analysis.gtm
3 analysis.gtm3 analysis.gtm
3 analysis.gtm
 
Indices and logarithms
Indices and logarithmsIndices and logarithms
Indices and logarithms
 
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
 
A0280106
A0280106A0280106
A0280106
 
module1_Introductiontoalgorithms_2022.pdf
module1_Introductiontoalgorithms_2022.pdfmodule1_Introductiontoalgorithms_2022.pdf
module1_Introductiontoalgorithms_2022.pdf
 

More from Spacetoshare

More from Spacetoshare (20)

EL HUECO.pdf
EL HUECO.pdfEL HUECO.pdf
EL HUECO.pdf
 
Probles on Algorithms
Probles on AlgorithmsProbles on Algorithms
Probles on Algorithms
 
Sums ADA
Sums ADASums ADA
Sums ADA
 
Manual de análisis y diseño de algoritmos
Manual de análisis y diseño de algoritmosManual de análisis y diseño de algoritmos
Manual de análisis y diseño de algoritmos
 
Inducción matemática
Inducción matemáticaInducción matemática
Inducción matemática
 
Ejercicios Investigación de operaciones
Ejercicios Investigación de operacionesEjercicios Investigación de operaciones
Ejercicios Investigación de operaciones
 
Algoritmos de ordenamiento
Algoritmos de ordenamientoAlgoritmos de ordenamiento
Algoritmos de ordenamiento
 
Ejercicios jess
Ejercicios jessEjercicios jess
Ejercicios jess
 
Sistemas Expertos
Sistemas ExpertosSistemas Expertos
Sistemas Expertos
 
Como escribir tesis
Como escribir tesisComo escribir tesis
Como escribir tesis
 
COMPONENTES BÁSICOS DE UN SISTEMA MS-DOS
COMPONENTES BÁSICOS DE UN SISTEMA MS-DOSCOMPONENTES BÁSICOS DE UN SISTEMA MS-DOS
COMPONENTES BÁSICOS DE UN SISTEMA MS-DOS
 
Curso básico de Ensamblador
Curso básico de EnsambladorCurso básico de Ensamblador
Curso básico de Ensamblador
 
Ejercicios álgebra superior
Ejercicios álgebra superiorEjercicios álgebra superior
Ejercicios álgebra superior
 
INDUCCIÓN MATEMÁTICA
INDUCCIÓN MATEMÁTICA INDUCCIÓN MATEMÁTICA
INDUCCIÓN MATEMÁTICA
 
Sistemas de ecuaciones
Sistemas de ecuacionesSistemas de ecuaciones
Sistemas de ecuaciones
 
Determinantes
DeterminantesDeterminantes
Determinantes
 
Inducción matemática
Inducción matemáticaInducción matemática
Inducción matemática
 
Tareas números complejos
Tareas números complejosTareas números complejos
Tareas números complejos
 
Ejer
EjerEjer
Ejer
 
Notas metodologia de la programación
Notas metodologia de la programaciónNotas metodologia de la programación
Notas metodologia de la programación
 

Recently uploaded

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 

Recently uploaded (20)

Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-IIFood Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
Food Chain and Food Web (Ecosystem) EVS, B. Pharmacy 1st Year, Sem-II
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 

Fórmulas ADA

  • 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