ST
Edition
UV
SOLUTIONS
IA
MANUAL
_A
PP
John A. Dossey
RO
Comprehensive Solutions Manual for
VE
Instructors and Students
D?
© John A. Dossey
All rights reserved. Reproduction or distribution without permission is prohibited.
??
©STUDYSTREAM
,ST
UV
Contents
IA
1 An Introduction to Combinatorial Problems and Techniques 1
_A
1.1 The Time to Complete a Project . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 A Matching Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 A Knapsack Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 Algorithms and Their Efficiency . . . . . . . . . . . . . . . . . . . . . . . . . 4
PP
Supplementary Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2 Sets, Relations, and Functions 6
2.1 Set Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
RO
2.2 Equivalence Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3 Partial Ordering Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.4 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.5 Mathematical Induction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.6 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Supplementary Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
VE
3 Coding Theory 14
3.1 Congruence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.2 The Euclidean Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
D?
3.3 The RSA Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.4 Error-Detecting and Error-Correcting Codes . . . . . . . . . . . . . . . . . . 17
3.5 Matrix Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.6 Matrix Codes That Correct All Single-Digit Errors . . . . . . . . . . . . . . . 19
Supplementary Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
??
iii
,ST
Table of Contents
4 Graphs 22
4.1 Graphs and Their Representations . . . . . . . . . . . . . . . . . . . . . . . . 22
UV
4.2 Paths and Circuits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.3 Shortest Paths and Distance . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.4 Coloring a Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.5 Directed Graphs and Multigraphs . . . . . . . . . . . . . . . . . . . . . . . . 30
Supplementary Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
IA
5 Trees 36
5.1 Properties of Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.2 Spanning Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
_A
5.3 Depth-First Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.4 Rooted Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
5.5 Binary Trees and Traversals . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
5.6 Optimal Binary Trees and Binary Search Trees . . . . . . . . . . . . . . . . . 51
Supplementary Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
PP
6 Matching 63
6.1 Systems of Distinct Representatives . . . . . . . . . . . . . . . . . . . . . . . 63
6.2 Matchings in Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
6.3 A Matching Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
RO
6.4 Applications of the Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . 66
6.5 The Hungarian Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Supplementary Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
7 Network Flows 68
VE
7.1 Flows and Cuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
7.2 A Flow Augmentation Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . 70
7.3 The Max-Flow Min-Cut Theorem . . . . . . . . . . . . . . . . . . . . . . . . 73
7.4 Flows and Matchings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Supplementary Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
D?
??
iv
,ST
Table of Contents
8 Counting Techniques 78
8.1 Pascal’s Triangle and the Binomial Theorem . . . . . . . . . . . . . . . . . . 78
UV
8.2 Three Fundamental Principles . . . . . . . . . . . . . . . . . . . . . . . . . . 78
8.3 Permutations and Combinations . . . . . . . . . . . . . . . . . . . . . . . . . 79
8.4 Arrangements and Selections with Repetitions . . . . . . . . . . . . . . . . . 79
8.5 Probability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
8.6 The Principle of Inclusion-Exclusion . . . . . . . . . . . . . . . . . . . . . . . 81
8.7 Generating Permutations and r-Combinations . . . . . . . . . . . . . . . . . 82
Supplementary Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
IA
_A
9 Recurrence Relations and Generating Functions 84
PP
9.1 Recurrence Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
9.2 The Method of Iteration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
9.3 Linear Difference Equations with Constant Coefficients . . . . . . . . . . . . 91
9.4∗ Analyzing the Efficiency of Algorithms with Recurrence Relations . . . . . . 94
9.5 Counting with Generating Functions . . . . . . . . . . . . . . . . . . . . . . . 99
9.6 The Algebra of Generating Functions . . . . . . . . . . . . . . . . . . . . . . 100
RO
Supplementary Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
VE
10 Combinatorial Circuits and Finite State Machines 105
10.1 Logical Gates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
D?
10.2 Creating Combinatorial Circuits . . . . . . . . . . . . . . . . . . . . . . . . . 107
10.3 Karnaugh Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
10.4 Finite State Machines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Supplementary Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
??
v