- Shopping Bag ( 0 items )
Want a NOOK? Explore Now
Despite growing interest, basic information on methods and models for mathematically analyzing algorithms has rarely been directly accessible to practitioners, researchers, or students. An Introduction to the Analysis of Algorithms, Second Edition, organizes and presents that knowledge, fully introducing primary techniques and results in the field.
Robert Sedgewick and the late Philippe Flajolet have drawn from both classical mathematics and computer science, integrating discrete mathematics, elementary real analysis, combinatorics, algorithms, and data structures. They emphasize the mathematics needed to support scientific studies that can serve as the basis for predicting algorithm performance and for comparing different algorithms on the basis of performance.
Techniques covered in the first half of the book include recurrences, generating functions, asymptotics, and analytic combinatorics. Structures studied in the second half of the book include permutations, trees, strings, tries, and mappings. Numerous examples are included throughout to illustrate applications to the analysis of algorithms that are playing a critical role in the evolution of our modern computational infrastructure.
Improvements and additions in this new edition include
The book’s thorough, self-contained coverage will help readers appreciate the field’s challenges, prepare them for advanced results—covered in their monograph Analytic Combinatorics and in Donald Knuth’s The Art of Computer Programming books—and provide the background they need to keep abreast of new research.
"[Sedgewick and Flajolet] are not only worldwide leaders of the field, they also are masters of exposition. I am sure that every serious computer scientist will find this book rewarding in many ways."
—From the Foreword by Donald E. Knuth
A thorough overview of the primary techniques and models used in the mathematical analysis of algorithms. This book draws upon classical mathematical material from discrete mathematics, elementary real analysis, and combinations and discusses properties of discrete structures and covers the analysis of a variety of classic forting, searching, and string processing algorithms.
This book is intended to be a thorough overview of the primary techniques used in the mathematical analysis of algorithms. The material covered draws from classical mathematical topics, including discrete mathematics, elementary real analysis, and combinatorics; as well as from classical computer science topics, including algorithms and data structures. The focus is on "average-case'' or "probabilistic'' analysis, though the basic mathematical tools required for "worst-case" or "complexity" analysis are covered, as well.
It is assumed that the reader has some familiarity with basic concepts in both computer science and real analysis. In a nutshell, the reader should be able to both write programs and prove theorems; otherwise, the book is intended to be self-contained. Ample references to preparatory material in the literature are also provided. A planned companion volume will cover more advanced techniques. Together, the books are intended to cover the main techniques and to provide access to the growing research literature on the analysis of algorithms.
The book is meant to be used as a textbook in a junior- or senior-level course on "Mathematical Analysis of Algorithms.'' It might also be useful in a course in discrete mathematics for computer scientists, since it covers basic techniques in discrete mathematics as well as combinatorics and basic properties of important discrete structures within a familiar context for computer science students. It is traditional to have somewhat broader coverage in such courses, but many instructors may find the approach here a useful way to engage students in a substantial portion of the material. The bookalso can be used to introduce students in mathematics and applied mathematics to principles from computer science related to algorithms and data structures.
Supplemented by papers from the literature, the book can serve as the basis for an introductory graduate course on the analysis of algorithms, or as a reference or basis for self-study by researchers in mathematics or computer science who want access to the literature in this field. It also might be of use to students and researchers in combinatorics and discrete mathematics, as a source of applications and techniques.
Despite the large literature on the mathematical analysis of algorithms, basic information on methods and models in widespread use has not been directly accessible to students and researchers in the field. This book aims to address this situation, bringing together a body of material intended to provide the reader with both an appreciation for the challenges of the field and the requisite background for learning the advanced tools being developed to meet these challenges.
Mathematical maturity equivalent to one or two years' study at the college level is assumed. Basic courses in combinatorics and discrete mathematics may provide useful background (and may overlap with some material in the book), as would courses in real analysis, numerical methods, or elementary number theory. We draw on all of these areas, but summarize the necessary material here, with reference to standard texts for people who want more information.
Programming experience equivalent to one or two semesters' study at the college level, including elementary data structures, is assumed. We do not dwell on programming and implementation issues, but algorithms and data structures are the central object of our studies. Again, our treatment is complete in the sense that we summarize basic information, with reference to standard texts and primary sources.
Access to a computer system for mathematical manipulation such as MAPLE or Mathematica is highly recommended. These systems can relieve one from tedious calculations, when checking material in the text or solving exercises.
Related texts include "The Art of Computer Programming" by Knuth; "Handbook of Algorithms and Data Structure" by Gonnet and Baeza-Yates; "Algorithms"by Sedgewick; "Concrete Mathematics" by Graham, Knuth and Patashnik; and "Introduction to Algorithms" by Cormen, Leiserson, and Rivest. This book could be considered supplementary to each of these, as examined below, in turn.
In spirit, this book is closest to the pioneering books by Knuth, but our focus is on mathematical techniques of analysis, where those books are broad and encyclopaedic in scope with properties of algorithms playing a primary role and methods of analysis a secondary role. This book can serve as basic preparation for the advanced results covered and referred to in Knuth's books.
We also cover approaches and results in the analysis of algorithms that have been developed sincepublication of Knuth's books. The book by Gonnet and Baeza-Yates is a thorough survey of such results, including a comprehensive bibliography. That book primarily presents results with reference to derivations in the literature. Again, this book provides the basic preparation for access to this literature.
We also strive to keep the focus on covering algorithms of fundamental importance and interest, such as those described in Sedgewick, where Graham, Knuth, and Patashnik focus almost entirely on mathematical techniques. This book is intended to bea link between the basic mathematical techniques discussed in Knuth, Graham, and Patashnik and the basic algorithms covered in Sedgewick.
The book by Cormen, Leiserson, and Rivest is representative of a number of books that provide access to the research literature on "design and analysis'' of algorithms, which is normally based on rough worst-case estimates of performance. When more precise results are desired (presumably for the most important methods), more sophisticated models and mathematical tools are required. This book is supplementary to books like Cormen, Leiserson and Rivest in that they focus on design of algorithms (usually with the goal of bounding worst-case performance), with analytic results used to help guide the design, where we focus on the analysis of algorithms, especially on techniques that can be used to develop detailed results that could be used to predict performance. In this process, we also consider relationships to various classical mathematical tools. Chapter 1 is devoted entirely to developing this context.
This book also lays the groundwork for a companion volume, "Analytic Combinatorics", a general treatment that places the material in this book into a broader perspective and develops advanced methods and models that can serveas the basis for new research, not only in average-case analysis of algorithms, but also in combinatorics. A higher level of mathematical maturity is assumed for that volume, perhaps at the senior or beginning graduate student level. Of course, careful study of this book is adequate preparation. It certainly has been our goal to make the present volume sufficiently interesting that some readers will be inspired to tackle more advanced material!
Readers of this book are likely to have rather diverse backgrounds in discrete mathematics and computer science. With this in mind, it is useful to be aware the basic structure of book: There are eight chapters, an introduction followed by three chapters that emphasize mathematical methods, then four chapters that emphasize applications in the analysis of algorithms, as shown in the following outline:
- Introduction
- Analysis of Algorithms
- Discrete Mathematical Methods
- Recurrences
- Generating Functions
- Asymptotic Analysis
- Algorithms and Combinatorial Structures
- Trees
- Permutations
- Strings and Tries
- Words and Maps
Chapter 1 puts the material in the book into perspective, and will help all readers understand the basic objectives of the book and the role of the remaining chapters in meeting those objectives. Chapters 2-4 are more oriented towards mathematics, as they cover methods from discrete mathematics, primarily focused on developing basic concepts and techniques. Chapters 5-8 are more oriented towards computer science, as they cover properties of combinatorial structures, their relationships to fundamental algorithms, and analytic results.
Though the book is intended to be self-contained, differences in emphasis are appropriate in teaching the material, depending on the background and experience of students and instructor. One approach, more mathematically oriented, would be to emphasize the theorems and proofs in the first part of the book, with applications drawn from Chapters 5-8. Another approach, more oriented towards computer science, would be to briefly cover the major mathematical tools in Chapters 2-4 and emphasize the algorithmic material in the second half of the book. But our primary intention is that most students should be able to learn new material from both mathematics and computer science in an interesting context by working carefully all the way through the book.
Students with a strong computer science background are likely to have seen many of the algorithms and data structures from the second half of the book but not much of the mathematical material at the beginning; students with a strong background in mathematics are likely to find the mathematical material familiar but perhaps not the algorithms and data structures. A course covering all of the material in the book could help either group of students fill in gaps in their background while building upon knowledge they already have.
There are several hundred exercises, and a list of references at the end of each chapter is included to encourage readers to consider the material in the text in more depth and to examine original sources. Further, our experience in teaching this material has shown that there are numerous opportunities for instructors to supplement lecture and reading material with computation-based laboratories and homework assignments. The material covered here is an ideal framework for students to develop expertise in a symbolic manipulation system such as Mathematica or MAPLE. Also, the experience of validating the mathematical studies by comparing them against empirical studies can be very valuable for many students.
Chapter 1: Analysis of Algorithms 3
1.1 Why Analyze an Algorithm? 3
1.2 Theory of Algorithms 6
1.3 Analysis of Algorithms 13
1.4 Average-Case Analysis 16
1.5 Example: Analysis of Quicksort 18
1.6 Asymptotic Approximations 27
1.7 Distributions 30
1.8 Randomized Algorithms 33
Chapter 2: Recurrence Relations 41
2.1 Basic Properties 43
2.2 First-Order Recurrences 48
2.3 Nonlinear First-Order Recurrences 52
2.4 Higher-Order Recurrences 55
2.5 Methods for Solving Recurrences 61
2.6 Binary Divide-and-Conquer Recurrences and Binary Numbers 70
2.7 General Divide-and-Conquer Recurrences 80
Chapter 3: Generating Functions 91
3.1 Ordinary Generating Functions 92
3.2 Exponential Generating Functions 97
3.3 Generating Function Solution of Recurrences 101
3.4 Expanding Generating Functions 111
3.5 Transformations with Generating Functions 114
3.6 Functional Equations on Generating Functions 117
3.7 Solving the Quicksort Median-of-Three Recurrence with OGFs 120
3.8 Counting with Generating Functions 123
3.9 Probability Generating Functions 129
3.10 Bivariate Generating Functions 132
3.11 Special Functions 140
Chapter 4: Asymptotic Approximations 151
4.1 Notation for Asymptotic Approximations 153
4.2 Asymptotic Expansions 160
4.3 Manipulating Asymptotic Expansions 169
4.4 Asymptotic Approximations of Finite Sums 176
4.5 Euler-Maclaurin Summation 179
4.6 Bivariate Asymptotics 187
4.7 Laplace Method 203
4.8 “Normal” Examples from the Analysis of Algorithms 207
4.9 “Poisson” Examples from the Analysis of Algorithms 211
Chapter 5: Analytic Combinatorics 219
5.1 Formal Basis 220
5.2 Symbolic Method for Unlabelled Classes 221
5.3 Symbolic Method for Labelled Classes 229
5.4 Symbolic Method for Parameters 241
5.5 Generating Function Coefficient Asymptotics 247
Chapter 6: Trees 257
6.1 Binary Trees 258
6.2 Forests and Trees 261
6.3 Combinatorial Equivalences to Trees and Binary Trees 264
6.4 Properties of Trees 272
6.5 Examples of Tree Algorithms 277
6.6 Binary Search Trees 281
6.7 Average Path Length in Catalan Trees 287
6.8 Path Length in Binary Search Trees 293
6.9 Additive Parameters of Random Trees 297
6.10 Height 302
6.11 Summary of Average-Case Results on Properties of Trees 310
6.12 Lagrange Inversion 312
6.13 Rooted Unordered Trees 315
6.14 Labelled Trees 327
6.15 Other Types of Trees 331
Chapter 7: Permutations 345
7.1 Basic Properties of Permutations 347
7.2 Algorithms on Permutations 355
7.3 Representations of Permutations 358
7.4 Enumeration Problems 366
7.5 Analyzing Properties of Permutations with CGFs 372
7.6 Inversions and Insertion Sorts 384
7.7 Left-to-Right Minima and Selection Sort 393
7.8 Cycles and In Situ Permutation 401
7.9 Extremal Parameters 406
Chapter 8: Strings and Tries 415
8.1 String Searching 416
8.2 Combinatorial Properties of Bitstrings 420
8.3 Regular Expressions 432
8.4 Finite-State Automata and the Knuth-Morris-Pratt Algorithm 437
8.5 Context-Free Grammars 441
8.6 Tries 448
8.7 Trie Algorithms 453
8.8 Combinatorial Properties of Tries 459
8.9 Larger Alphabets 465
Chapter 9: Words and Mappings 473
9.1 Hashing with Separate Chaining 474
9.2 The Balls-and-Urns Model and Properties of Words 476
9.3 Birthday Paradox and Coupon Collector Problem 485
9.4 Occupancy Restrictions and Extremal Parameters 495
9.5 Occupancy Distributions 501
9.6 Open Addressing Hashing 509
9.7 Mappings 519
9.8 Integer Factorization and Mappings 532
List of Theorems 543
List of Tables 545
List of Figures 547
Index 551
This book is intended to be a thorough overview of the primary techniques used in the mathematical analysis of algorithms. The material covered draws from classical mathematical topics, including discrete mathematics, elementary real analysis, and combinatorics; as well as from classical computer science topics, including algorithms and data structures. The focus is on "average-case'' or "probabilistic'' analysis, though the basic mathematical tools required for "worst-case" or "complexity" analysis are covered, as well.
It is assumed that the reader has some familiarity with basic concepts in both computer science and real analysis. In a nutshell, the reader should be able to both write programs and prove theorems; otherwise, the book is intended to be self-contained. Ample references to preparatory material in the literature are also provided. A planned companion volume will cover more advanced techniques. Together, the books are intended to cover the main techniques and to provide access to the growing research literature on the analysis of algorithms.
The book is meant to be used as a textbook in a junior- or senior-level course on "Mathematical Analysis of Algorithms.'' It might also be useful in a course in discrete mathematics for computer scientists, since it covers basic techniques in discrete mathematics as well as combinatorics and basic properties of important discrete structures within a familiar context for computer science students. It is traditional to have somewhat broader coverage in such courses, but many instructors may find the approach here a useful way to engage students in a substantial portion of the material. The book also can beused to introduce students in mathematics and applied mathematics to principles from computer science related to algorithms and data structures.
Supplemented by papers from the literature, the book can serve as the basis for an introductory graduate course on the analysis of algorithms, or as a reference or basis for self-study by researchers in mathematics or computer science who want access to the literature in this field. It also might be of use to students and researchers in combinatorics and discrete mathematics, as a source of applications and techniques.
Despite the large literature on the mathematical analysis of algorithms, basic information on methods and models in widespread use has not been directly accessible to students and researchers in the field. This book aims to address this situation, bringing together a body of material intended to provide the reader with both an appreciation for the challenges of the field and the requisite background for learning the advanced tools being developed to meet these challenges.
Mathematical maturity equivalent to one or two years' study at the college level is assumed. Basic courses in combinatorics and discrete mathematics may provide useful background (and may overlap with some material in the book), as would courses in real analysis, numerical methods, or elementary number theory. We draw on all of these areas, but summarize the necessary material here, with reference to standard texts for people who want more information.
Programming experience equivalent to one or two semesters' study at the college level, including elementary data structures, is assumed. We do not dwell on programming and implementation issues, but algorithms and data structures are the central object of our studies. Again, our treatment is complete in the sense that we summarize basic information, with reference to standard texts and primary sources.
Access to a computer system for mathematical manipulation such as MAPLE or Mathematica is highly recommended. These systems can relieve one from tedious calculations, when checking material in the text or solving exercises.
Related texts include "The Art of Computer Programming" by Knuth; "Handbook of Algorithms and Data Structure" by Gonnet and Baeza-Yates; "Algorithms"by Sedgewick; "Concrete Mathematics" by Graham, Knuth and Patashnik; and "Introduction to Algorithms" by Cormen, Leiserson, and Rivest. This book could be considered supplementary to each of these, as examined below, in turn.
In spirit, this book is closest to the pioneering books by Knuth, but our focus is on mathematical techniques of analysis, where those books are broad and encyclopaedic in scope with properties of algorithms playing a primary role and methods of analysis a secondary role. This book can serve as basic preparation for the advanced results covered and referred to in Knuth's books.
We also cover approaches and results in the analysis of algorithms that have been developed sincepublication of Knuth's books. The book by Gonnet and Baeza-Yates is a thorough survey of such results, including a comprehensive bibliography. That book primarily presents results with reference to derivations in the literature. Again, this book provides the basic preparation for access to this literature.
We also strive to keep the focus on covering algorithms of fundamental importance and interest, such as those described in Sedgewick, where Graham, Knuth, and Patashnik focus almost entirely on mathematical techniques. This book is intended to bea link between the basic mathematical techniques discussed in Knuth, Graham, and Patashnik and the basic algorithms covered in Sedgewick.
The book by Cormen, Leiserson, and Rivest is representative of a number of books that provide access to the research literature on "design and analysis'' of algorithms, which is normally based on rough worst-case estimates of performance. When more precise results are desired (presumably for the most important methods), more sophisticated models and mathematical tools are required. This book is supplementary to books like Cormen, Leiserson and Rivest in that they focus on design of algorithms (usually with the goal of bounding worst-case performance), with analytic results used to help guide the design, where we focus on the analysis of algorithms, especially on techniques that can be used to develop detailed results that could be used to predict performance. In this process, we also consider relationships to various classical mathematical tools. Chapter 1 is devoted entirely to developing this context.
This book also lays the groundwork for a companion volume, "Analytic Combinatorics", a general treatment that places the material in this book into a broader perspective and develops advanced methods and models that can serveas the basis for new research, not only in average-case analysis of algorithms, but also in combinatorics. A higher level of mathematical maturity is assumed for that volume, perhaps at the senior or beginning graduate student level. Of course, careful study of this book is adequate preparation. It certainly has been our goal to make the present volume sufficiently interesting that some readers will be inspired to tackle more advanced material!
Readers of this book are likely to have rather diverse backgrounds in discrete mathematics and computer science. With this in mind, it is useful to be aware the basic structure of book: There are eight chapters, an introduction followed by three chapters that emphasize mathematical methods, then four chapters that emphasize applications in the analysis of algorithms, as shown in the following outline:
- Introduction
- Analysis of Algorithms
- Discrete Mathematical Methods
- Recurrences
- Generating Functions
- Asymptotic Analysis
- Algorithms and Combinatorial Structures
- Trees
- Permutations
- Strings and Tries
- Words and Maps
Chapter 1 puts the material in the book into perspective, and will help all readers understand the basic objectives of the book and the role of the remaining chapters in meeting those objectives. Chapters 2-4 are more oriented towards mathematics, as they cover methods from discrete mathematics, primarily focused on developing basic concepts and techniques. Chapters 5-8 are more oriented towards computer science, as they cover properties of combinatorial structures, their relationships to fundamental algorithms, and analytic results.
Though the book is intended to be self-contained, differences in emphasis are appropriate in teaching the material, depending on the background and experience of students and instructor. One approach, more mathematically oriented, would be to emphasize the theorems and proofs in the first part of the book, with applications drawn from Chapters 5-8. Another approach, more oriented towards computer science, would be to briefly cover the major mathematical tools in Chapters 2-4 and emphasize the algorithmic material in the second half of the book. But our primary intention is that most students should be able to learn new material from both mathematics and computer science in an interesting context by working carefully all the way through the book.
Students with a strong computer science background are likely to have seen many of the algorithms and data structures from the second half of the book but not much of the mathematical material at the beginning; students with a strong background in mathematics are likely to find the mathematical material familiar but perhaps not the algorithms and data structures. A course covering all of the material in the book could help either group of students fill in gaps in their background while building upon knowledge they already have.
There are several hundred exercises, and a list of references at the end of each chapter is included to encourage readers to consider the material in the text in more depth and to examine original sources. Further, our experience in teaching this material has shown that there are numerous opportunities for instructors to supplement lecture and reading material with computation-based laboratories and homework assignments. The material covered here is an ideal framework for students to develop expertise in a symbolic manipulation system such as Mathematica or MAPLE. Also, the experience of validating the mathematical studies by comparing them against empirical studies can be very valuable for many students.
Overview
Despite growing interest, basic information on methods and models for mathematically analyzing algorithms has rarely been directly accessible to practitioners, researchers, or students. An Introduction to the Analysis of Algorithms, Second Edition, organizes and presents that knowledge, fully introducing primary techniques and results in the field.
Robert Sedgewick and the late Philippe Flajolet have drawn from both classical mathematics and computer science, integrating ...