1 The Foundations:Logic and Proof,Sets,and Functions 1
1.1 Logic 1
1.2 Propositional Equivalences 20
1.3 Predicates and Quantifiers 28
1.4 Nested Quantifiers 44
1.5 Methods of Proof 56
1.6 Sets 77
1.7 Set Operations 86
1.8 Functions 97
End-of-Chapter Material 111
2 The Fundamentals:Algorithms,the Integers,and Matrices 119
2.1 Algorithms 120
2.2 The Growth of Functions 131
2.3 Complexity of Algorithms 144
2.4 The Integers and Division 153
2.5 Integers and Algorithms 169
2.6 Applications of Number Theory 181
2.7 Matrices 196
End-of-Chapter Material 206
3 Mathematical Reasoning,Induction,and Recursion 213
3.1 Proof Strategy 214
3.2 Sequences and Summations 225
3.3 Mathematical Induction 238
3.4 Recursive Definitions and Structural Induction 256
3.5 Recursive Algorithms 274
3.6 Program Correctness 284
End-of-Chapter Material 290
4 Counting 301
4.1 The Basics of Counting 301
4.2 The Pigeonhole Principle 313
4.3 Permutations and Combinations 320
4.4 Binomial Coefficients 327
4.5 Generalized Permutations and Combinations 335
4.6 Generating Permutations and Combinations 344
End-of-Chapter Material 349
5 Discrete Probability 355
5.1 An Introduction to Discrete Probability 355
5.2 Probability Theory 362
5.3 Expected Value and Variance 379
End-of-Chapter Material 394
6 Advanced Counting Techniques 401
6.1 Recurrence Relations 401
6.2 Solving Recurrence Relations 413
6.3 Divide-and-Conquer Algorithms and Recurrence Relations 425
6.4 Generating Functions 435
6.5 Inclusion-Exclusion 451
6.6 Applications of Inclusion-Exclusion 457
End-of-Chapter Material 465
7 Relations 471
7.1 Relations and Their Properties 471
7.2 n-ary Relations and Their Applications 482
7.3 Representing Relations 489
7.4 Closures of Relations 496
7.5 Equivalence Relations 507
7.6 Partial Orderings 516
End-of-Chapter Material 530
8 Graphs 537
8.1 Introduction to Graphs 537
8.2 Graph Terminology 545
8.3 Representing Graphs and Graph Isomorphism 557
8.4 Connectivity 567
8.5 Euler and Hamilton Paths 577
8.6 Shortest-Path Problems 593
8.7 Planar Graphs 603
8.8 Graph Coloring 613
End-of-Chapter Material 622
9 Trees 631
9.1 Introduction to Trees 631
9.2 Applications of Trees 644
9.3 Tree Traversal 660
9.4 Spanning Trees 674
9.5 Minimum Spanning Trees 688
End-of-Chapter Material 694
10 Boolean Algebra 701
10.1 Boolean Functions 701
10.2 Representing Boolean Functions 709
10.3 Logic Gates 712
10.4 Minimization of Circuits 719
End-of-Chapter Material 734
11 Modeling Computation 739
11.1 Languages and Grammars 739
11.2 Finite-State Machines with Output 751
11.3 Finite-State Machines with No Output 758
11.4 Language Recognition 765
11.5 Turing Machines 775
End-of-Chapter Material 783
Appendixes 788
A.1 Exponential and Logarithmic Functions 788
A.2 Pseudocode 791
Suggested Readings 797
Answers to Odd-Numbered Exercises 805
Photo Credits 888
Index of Biographies 889
Index 890