You are on page 1of 53

Combinatorics, Second Edition

Nicholas Loehr
Visit to download the full and correct content document:
https://textbookfull.com/product/combinatorics-second-edition-nicholas-loehr/
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

An Introduction to Mathematical Proofs 1st Edition


Nicholas A. Loehr

https://textbookfull.com/product/an-introduction-to-mathematical-
proofs-1st-edition-nicholas-a-loehr/

Biota Grow 2C gather 2C cook Loucas

https://textbookfull.com/product/biota-grow-2c-gather-2c-cook-
loucas/

System Safety Engineering and Risk Assessment A


Practical Approach Second Edition Nicholas J. Bahr

https://textbookfull.com/product/system-safety-engineering-and-
risk-assessment-a-practical-approach-second-edition-nicholas-j-
bahr/

Introduction to Combinatorics Walter D. Wallis

https://textbookfull.com/product/introduction-to-combinatorics-
walter-d-wallis/
Math 108 notes Combinatorics Kannan Soundararajan

https://textbookfull.com/product/math-108-notes-combinatorics-
kannan-soundararajan/

University of Waterloo MATH 239 Course Notes, Fall


2016: Intro to Combinatorics Department Of
Combinatorics And Optimization

https://textbookfull.com/product/university-of-waterloo-
math-239-course-notes-fall-2016-intro-to-combinatorics-
department-of-combinatorics-and-optimization/

Lessons in Enumerative Combinatorics 2021st Edition


Ömer E■ecio■lu

https://textbookfull.com/product/lessons-in-enumerative-
combinatorics-2021st-edition-omer-egecioglu/

Analytic Combinatorics - A Multidimensional Approach


1st Edition Marni Mishna

https://textbookfull.com/product/analytic-combinatorics-a-
multidimensional-approach-1st-edition-marni-mishna/

Algorithmic Combinatorics Enumerative Combinatorics


Special Functions and Computer Algebra In Honour of
Peter Paule on his 60th Birthday Veronika Pillwein

https://textbookfull.com/product/algorithmic-combinatorics-
enumerative-combinatorics-special-functions-and-computer-algebra-
in-honour-of-peter-paule-on-his-60th-birthday-veronika-pillwein/
COMBINATORICS
Second Edition
DISCRETE
MATHEMATICS
AND
ITS APPLICATIONS
Series Editors

Miklos Bona
Patrice Ossona de Mendez
Douglas West
R. B. J. T. Allenby and Alan Slomson, How to Count: An Introduction to Combinatorics,
Third Edition
Craig P. Bauer, Secret History: The Story of Cryptology
Jürgen Bierbrauer, Introduction to Coding Theory, Second Edition
Katalin Bimbó, Combinatory Logic: Pure, Applied and Typed
Katalin Bimbó, Proof Theory: Sequent Calculi and Related Formalisms
Donald Bindner and Martin Erickson, A Student’s Guide to the Study, Practice, and Tools of
Modern Mathematics
Francine Blanchet-Sadri, Algorithmic Combinatorics on Partial Words
Miklós Bóna, Combinatorics of Permutations, Second Edition
Miklós Bóna, Handbook of Enumerative Combinatorics
Miklós Bóna, Introduction to Enumerative and Analytic Combinatorics, Second Edition
Jason I. Brown, Discrete Structures and Their Interactions
Richard A. Brualdi and Dragos̆ Cvetković, A Combinatorial Approach to Matrix Theory and Its
Applications
Kun-Mao Chao and Bang Ye Wu, Spanning Trees and Optimization Problems
Charalambos A. Charalambides, Enumerative Combinatorics
Gary Chartrand and Ping Zhang, Chromatic Graph Theory
Henri Cohen, Gerhard Frey, et al., Handbook of Elliptic and Hyperelliptic Curve Cryptography
Charles J. Colbourn and Jeffrey H. Dinitz, Handbook of Combinatorial Designs, Second Edition
Titles (continued)
Abhijit Das, Computational Number Theory
Matthias Dehmer and Frank Emmert-Streib, Quantitative Graph Theory:
Mathematical Foundations and Applications
Martin Erickson, Pearls of Discrete Mathematics
Martin Erickson and Anthony Vazzana, Introduction to Number Theory
Steven Furino, Ying Miao, and Jianxing Yin, Frames and Resolvable Designs: Uses,
Constructions, and Existence
Mark S. Gockenbach, Finite-Dimensional Linear Algebra
Randy Goldberg and Lance Riek, A Practical Handbook of Speech Coders
Jacob E. Goodman and Joseph O’Rourke, Handbook of Discrete and Computational Geometry,
Second Edition
Jonathan L. Gross, Combinatorial Methods with Computer Applications
Jonathan L. Gross and Jay Yellen, Graph Theory and Its Applications, Second Edition
Jonathan L. Gross, Jay Yellen, and Ping Zhang Handbook of Graph Theory, Second Edition
David S. Gunderson, Handbook of Mathematical Induction: Theory and Applications
Richard Hammack, Wilfried Imrich, and Sandi Klavžar, Handbook of Product Graphs,
Second Edition
Darrel R. Hankerson, Greg A. Harris, and Peter D. Johnson, Introduction to Information Theory
and Data Compression, Second Edition
Darel W. Hardy, Fred Richman, and Carol L. Walker, Applied Algebra: Codes, Ciphers, and
Discrete Algorithms, Second Edition
Daryl D. Harms, Miroslav Kraetzl, Charles J. Colbourn, and John S. Devitt, Network Reliability:
Experiments with a Symbolic Algebra Environment
Silvia Heubach and Toufik Mansour, Combinatorics of Compositions and Words
Leslie Hogben, Handbook of Linear Algebra, Second Edition
Derek F. Holt with Bettina Eick and Eamonn A. O’Brien, Handbook of Computational Group Theory
David M. Jackson and Terry I. Visentin, An Atlas of Smaller Maps in Orientable and
Nonorientable Surfaces
Richard E. Klima, Neil P. Sigmon, and Ernest L. Stitzinger, Applications of Abstract Algebra
with Maple™ and MATLAB®, Second Edition
Richard E. Klima and Neil P. Sigmon, Cryptology: Classical and Modern with Maplets
Patrick Knupp and Kambiz Salari, Verification of Computer Codes in Computational Science
and Engineering
William L. Kocay and Donald L. Kreher, Graphs, Algorithms, and Optimization, Second Edition
Donald L. Kreher and Douglas R. Stinson, Combinatorial Algorithms: Generation Enumeration
and Search
Titles (continued)

Hang T. Lau, A Java Library of Graph Algorithms and Optimization


C. C. Lindner and C. A. Rodger, Design Theory, Second Edition
San Ling, Huaxiong Wang, and Chaoping Xing, Algebraic Curves in Cryptography
Nicholas A. Loehr, Bijective Combinatorics
Nicholas A. Loehr, Combinatorics, Second Edition
Toufik Mansour, Combinatorics of Set Partitions
Toufik Mansour and Matthias Schork, Commutation Relations, Normal Ordering, and Stirling
Numbers
Alasdair McAndrew, Introduction to Cryptography with Open-Source Software
Pierre-Loïc Méliot, Representation Theory of Symmetric Groups
Elliott Mendelson, Introduction to Mathematical Logic, Fifth Edition
Alfred J. Menezes, Paul C. van Oorschot, and Scott A. Vanstone, Handbook of Applied
Cryptography
Stig F. Mjølsnes, A Multidisciplinary Introduction to Information Security
Jason J. Molitierno, Applications of Combinatorial Matrix Theory to Laplacian Matrices of Graphs
Richard A. Mollin, Advanced Number Theory with Applications
Richard A. Mollin, Algebraic Number Theory, Second Edition
Richard A. Mollin, Codes: The Guide to Secrecy from Ancient to Modern Times
Richard A. Mollin, Fundamental Number Theory with Applications, Second Edition
Richard A. Mollin, An Introduction to Cryptography, Second Edition
Richard A. Mollin, Quadratics
Richard A. Mollin, RSA and Public-Key Cryptography
Carlos J. Moreno and Samuel S. Wagstaff, Jr., Sums of Squares of Integers
Gary L. Mullen and Daniel Panario, Handbook of Finite Fields
Goutam Paul and Subhamoy Maitra, RC4 Stream Cipher and Its Variants
Dingyi Pei, Authentication Codes and Combinatorial Designs
Kenneth H. Rosen, Handbook of Discrete and Combinatorial Mathematics
Yongtang Shi, Matthias Dehmer, Xueliang Li, and Ivan Gutman, Graph Polynomials
Douglas R. Shier and K.T. Wallenius, Applied Mathematical Modeling: A Multidisciplinary
Approach
Alexander Stanoyevitch, Introduction to Cryptography with Mathematical Foundations and
Computer Implementations
Jörn Steuding, Diophantine Analysis
Douglas R. Stinson, Cryptography: Theory and Practice, Third Edition
Titles (continued)

Roberto Tamassia, Handbook of Graph Drawing and Visualization


Roberto Togneri and Christopher J. deSilva, Fundamentals of Information Theory and Coding
Design
W. D. Wallis, Introduction to Combinatorial Designs, Second Edition
W. D. Wallis and J. C. George, Introduction to Combinatorics, Second Edition
Jiacun Wang, Handbook of Finite State Based Models and Applications
Lawrence C. Washington, Elliptic Curves: Number Theory and Cryptography, Second Edition
DISCRETE MATHEMATICS AND ITS APPLICATIONS

COMBINATORICS
Second Edition

Nicholas A. Loehr
CRC Press
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742

© 2018 by Taylor & Francis Group, LLC


CRC Press is an imprint of Taylor & Francis Group, an Informa business

No claim to original U.S. Government works

Printed on acid-free paper


Version Date: 20170712

International Standard Book Number-13: 978-1-4987-8025-4 (Hardback)

This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been
made to publish reliable data and information, but the author and publisher cannot assume responsibility for the validity
of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright
holders of all material reproduced in this publication and apologize to copyright holders if permission to publish in this
form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may
rectify in any future reprint.

Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or utilized
in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying,
microfilming, and recording, or in any information storage or retrieval system, without written permission from the
publishers.

For permission to photocopy or use material electronically from this work, please access www.copyright.com (http://
www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923,
978-750-8400. CCC is a not-for-profit organization that provides licenses and registration for a variety of users. For
organizations that have been granted a photocopy license by the CCC, a separate system of payment has been arranged.

Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for
identification and explanation without intent to infringe.

Library of Congress Cataloging-in-Publication Data

Names: Loehr, Nicholas A. | Loehr, Nicholas A. Combinatorics.


Title: Combinatorics / Nicholas A. Loehr.
Description: Second edition. | Boca Raton : CRC Press, 2017. | Previous
edition: Bijective combinatorics / Nicholas A. Loehr (Boca Raton, FL :
Chapman & Hall/CRC, c2011).
Identifiers: LCCN 2017011283 | ISBN 9781498780254
Subjects: LCSH: Combinatorial analysis.
Classification: LCC QA164 .L64 2017 | DDC 511/.62--dc23
LC record available at https://lccn.loc.gov/2017011283

Visit the Taylor & Francis Web site at


http://www.taylorandfrancis.com
and the CRC Press Web site at
http://www.crcpress.com
Dedication
This book is dedicated to
my sister Heather (1973–2015),
my aunt Nanette (1963–2011),
and my grandmother Oliva (1926–1982).
Contents

Preface to the Second Edition xvii

Introduction xix

I Counting 1
1 Basic Counting 3
1.1 The Product Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 The Sum Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 Counting Words and Permutations . . . . . . . . . . . . . . . . . . . . . . . 7
1.4 Counting Subsets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.5 Counting Anagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.6 Counting Rules for Set Operations . . . . . . . . . . . . . . . . . . . . . . . 14
1.7 Probability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.8 Lotteries and Card Games . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.9 Conditional Probability and Independence . . . . . . . . . . . . . . . . . . 21
1.10 Counting Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
1.11 Cardinality and the Bijection Rule . . . . . . . . . . . . . . . . . . . . . . . 27
1.12 Counting Multisets and Compositions . . . . . . . . . . . . . . . . . . . . . 30
1.13 Counting Balls in Boxes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
1.14 Counting Lattice Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
1.15 Proofs of the Sum Rule and the Product Rule . . . . . . . . . . . . . . . . 36
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

2 Combinatorial Identities and Recursions 51


2.1 Initial Examples of Combinatorial Proofs . . . . . . . . . . . . . . . . . . . 51
2.2 The Geometric Series Formula . . . . . . . . . . . . . . . . . . . . . . . . . 53
2.3 The Binomial Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
2.4 The Multinomial Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
2.5 More Binomial Coefficient Identities . . . . . . . . . . . . . . . . . . . . . . 58
2.6 Sums of Powers of Integers . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
2.7 Recursions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
2.8 Recursions for Multisets and Anagrams . . . . . . . . . . . . . . . . . . . . 64
2.9 Recursions for Lattice Paths . . . . . . . . . . . . . . . . . . . . . . . . . . 66
2.10 Catalan Recursions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
2.11 Integer Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
2.12 Set Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
2.13 Surjections, Balls in Boxes, and Equivalence Relations . . . . . . . . . . . . 81
2.14 Stirling Numbers and Rook Theory . . . . . . . . . . . . . . . . . . . . . . 83
2.15 Stirling Numbers and Polynomials . . . . . . . . . . . . . . . . . . . . . . . 87
2.16 Solving Recursions with Constant Coefficients . . . . . . . . . . . . . . . . 90

xi
xii Contents

Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

3 Counting Problems in Graph Theory 103


3.1 Graphs and Digraphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
3.2 Walks and Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
3.3 Directed Acyclic Graphs and Nilpotent Matrices . . . . . . . . . . . . . . . 108
3.4 Vertex Degrees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
3.5 Functional Digraphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
3.6 Cycle Structure of Permutations . . . . . . . . . . . . . . . . . . . . . . . . 115
3.7 Counting Rooted Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
3.8 Connectedness and Components . . . . . . . . . . . . . . . . . . . . . . . . 119
3.9 Forests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
3.10 Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
3.11 Counting Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
3.12 Pruning Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
3.13 Bipartite Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
3.14 Matchings and Vertex Covers . . . . . . . . . . . . . . . . . . . . . . . . . . 130
3.15 Two Matching Theorems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
3.16 Graph Coloring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
3.17 Spanning Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
3.18 The Matrix-Tree Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
3.19 Eulerian Tours . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150

4 Inclusion-Exclusion, Involutions, and Möbius Inversion 159


4.1 The Inclusion-Exclusion Formula . . . . . . . . . . . . . . . . . . . . . . . . 159
4.2 Examples of the Inclusion-Exclusion Formula . . . . . . . . . . . . . . . . . 162
4.3 Surjections and Stirling Numbers . . . . . . . . . . . . . . . . . . . . . . . 163
4.4 Euler’s φ Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
4.5 Derangements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
4.6 Involutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
4.7 Involutions Related to Inclusion-Exclusion . . . . . . . . . . . . . . . . . . 171
4.8 Generalized Inclusion-Exclusion Formulas . . . . . . . . . . . . . . . . . . . 172
4.9 Möbius Inversion in Number Theory . . . . . . . . . . . . . . . . . . . . . . 174
4.10 Partially Ordered Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
4.11 Möbius Inversion for Posets . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
4.12 Product Posets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184

5 Generating Functions 191


5.1 What is a Generating Function? . . . . . . . . . . . . . . . . . . . . . . . . 191
5.2 Convergence of Power Series . . . . . . . . . . . . . . . . . . . . . . . . . . 194
5.3 Examples of Analytic Power Series . . . . . . . . . . . . . . . . . . . . . . . 195
5.4 Operations on Power Series . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
5.5 Solving Recursions with Generating Functions . . . . . . . . . . . . . . . . 199
5.6 Evaluating Summations with Generating Functions . . . . . . . . . . . . . 203
5.7 Generating Function for Derangements . . . . . . . . . . . . . . . . . . . . 204
5.8 Counting Rules for Weighted Sets . . . . . . . . . . . . . . . . . . . . . . . 205
Contents xiii

5.9 Examples of the Product Rule for Weighted Sets . . . . . . . . . . . . . . . 206


5.10 Generating Functions for Trees . . . . . . . . . . . . . . . . . . . . . . . . . 208
5.11 Tree Bijections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
5.12 Exponential Generating Functions . . . . . . . . . . . . . . . . . . . . . . . 213
5.13 Stirling Numbers of the First Kind . . . . . . . . . . . . . . . . . . . . . . . 216
5.14 Stirling Numbers of the Second Kind . . . . . . . . . . . . . . . . . . . . . 217
5.15 Generating Functions for Integer Partitions . . . . . . . . . . . . . . . . . . 219
5.16 Partition Bijections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
5.17 Euler’s Pentagonal Number Theorem . . . . . . . . . . . . . . . . . . . . . 225
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230

6 Ranking, Unranking, and Successor Algorithms 239


6.1 Introduction to Ranking and Successor Algorithms . . . . . . . . . . . . . . 239
6.2 The Bijective Sum Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
6.3 The Bijective Product Rule for Two Sets . . . . . . . . . . . . . . . . . . . 241
6.4 The Bijective Product Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
6.5 Ranking Words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
6.6 Ranking Permutations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
6.7 Ranking Subsets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
6.8 Ranking Anagrams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
6.9 Ranking Integer Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
6.10 Ranking Set Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
6.11 Ranking Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
6.12 The Successor Sum Rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
6.13 Successor Algorithms for Anagrams . . . . . . . . . . . . . . . . . . . . . . 258
6.14 The Successor Product Rule . . . . . . . . . . . . . . . . . . . . . . . . . . 260
6.15 Successor Algorithms for Set Partitions . . . . . . . . . . . . . . . . . . . . 262
6.16 Successor Algorithms for Dyck Paths . . . . . . . . . . . . . . . . . . . . . 263
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266

II Algebraic Combinatorics 275


7 Groups, Permutations, and Group Actions 277
7.1 Definition and Examples of Groups . . . . . . . . . . . . . . . . . . . . . . 277
7.2 Basic Properties of Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
7.3 Notation for Permutations . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
7.4 Inversions and Sign of a Permutation . . . . . . . . . . . . . . . . . . . . . 283
7.5 Subgroups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 287
7.6 Automorphism Groups of Graphs . . . . . . . . . . . . . . . . . . . . . . . 290
7.7 Group Homomorphisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
7.8 Group Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
7.9 Permutation Representations . . . . . . . . . . . . . . . . . . . . . . . . . . 299
7.10 Stable Subsets and Orbits . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
7.11 Cosets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
7.12 The Size of an Orbit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
7.13 Conjugacy Classes in Sn . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
7.14 Applications of the Orbit Size Formula . . . . . . . . . . . . . . . . . . . . 309
7.15 The Number of Orbits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
7.16 Pólya’s Formula . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
xiv Contents

Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319

8 Permutation Statistics and q-Analogues 327


8.1 Statistics on Finite Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
8.2 Counting Rules for Finite Weighted Sets . . . . . . . . . . . . . . . . . . . 329
8.3 Inversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
8.4 q-Factorials and Inversions . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
8.5 Descents and Major Index . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
8.6 q-Binomial Coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336
8.7 Combinatorial Interpretations of q-Binomial Coefficients . . . . . . . . . . 337
8.8 q-Binomial Coefficient Identities . . . . . . . . . . . . . . . . . . . . . . . . 340
8.9 q-Multinomial Coefficients . . . . . . . . . . . . . . . . . . . . . . . . . . . 342
8.10 Foata’s Bijection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
8.11 q-Catalan Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
8.12 Set Partitions and q-Stirling Numbers . . . . . . . . . . . . . . . . . . . . . 350
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353

9 Tableaux and Symmetric Polynomials 359


9.1 Fillings and Tableaux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
9.2 Schur Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 360
9.3 Symmetric Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
9.4 Vector Spaces of Symmetric Polynomials . . . . . . . . . . . . . . . . . . . 366
9.5 Symmetry of Schur Polynomials . . . . . . . . . . . . . . . . . . . . . . . . 367
9.6 Orderings on Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 369
9.7 Schur Bases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
9.8 Tableau Insertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374
9.9 Reverse Insertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 377
9.10 The Bumping Comparison Theorem . . . . . . . . . . . . . . . . . . . . . . 380
9.11 The Pieri Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 382
9.12 Schur Expansion of hα . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383
9.13 Schur Expansion of eα . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
9.14 Algebraic Independence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
9.15 Power-Sum Symmetric Polynomials . . . . . . . . . . . . . . . . . . . . . . 389
9.16 Relations between e’s and h’s . . . . . . . . . . . . . . . . . . . . . . . . . . 390
9.17 Generating Functions for e’s and h’s . . . . . . . . . . . . . . . . . . . . . . 392
9.18 Relations between p’s, e’s, and h’s . . . . . . . . . . . . . . . . . . . . . . . 393
9.19 Power-Sum Expansions of hn and en . . . . . . . . . . . . . . . . . . . . . 395
9.20 The Involution ω . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398
9.21 Permutations and Tableaux . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
9.22 Inversion Property of RSK . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
9.23 Words and Tableaux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
9.24 Matrices and Tableaux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
9.25 Cauchy’s Identities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
9.26 Dual Bases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412
9.27 Skew Schur Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414
9.28 Abstract Symmetric Functions . . . . . . . . . . . . . . . . . . . . . . . . . 416
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
Contents xv

10 Abaci and Antisymmetric Polynomials 429


10.1 Abaci and Integer Partitions . . . . . . . . . . . . . . . . . . . . . . . . . . 429
10.2 The Jacobi Triple Product Identity . . . . . . . . . . . . . . . . . . . . . . 431
10.3 Ribbons and k-Cores . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
10.4 k-Quotients of a Partition . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
10.5 k-Quotients and Hooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
10.6 Antisymmetric Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
10.7 Labeled Abaci . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
10.8 The Pieri Rule for pk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
10.9 The Pieri Rule for ek . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
10.10 The Pieri Rule for hk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
10.11 Antisymmetric Polynomials and Schur Polynomials . . . . . . . . . . . . . 453
10.12 Rim-Hook Tableaux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454
10.13 Abaci and Tableaux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
10.14 Skew Schur Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460
10.15 The Jacobi–Trudi Formulas . . . . . . . . . . . . . . . . . . . . . . . . . . 462
10.16 The Inverse Kostka Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
10.17 Schur Expansion of Skew Schur Polynomials . . . . . . . . . . . . . . . . . 469
10.18 Products of Schur Polynomials . . . . . . . . . . . . . . . . . . . . . . . . 473
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477

11 Algebraic Aspects of Generating Functions 481


11.1 Limit Concepts for Formal Power Series . . . . . . . . . . . . . . . . . . . . 481
11.2 The Infinite Sum and Product Rules . . . . . . . . . . . . . . . . . . . . . . 484
11.3 Multiplicative Inverses of Formal Power Series . . . . . . . . . . . . . . . . 485
11.4 Partial Fraction Expansions . . . . . . . . . . . . . . . . . . . . . . . . . . 487
11.5 Generating Functions for Recursively Defined Sequences . . . . . . . . . . . 490
11.6 Formal Composition and Derivative Rules . . . . . . . . . . . . . . . . . . . 491
11.7 Formal Exponentials and Logarithms . . . . . . . . . . . . . . . . . . . . . 493
11.8 The Exponential Formula . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
11.9 Examples of the Exponential Formula . . . . . . . . . . . . . . . . . . . . . 498
11.10 Ordered Trees and Terms . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
11.11 Ordered Forests and Lists of Terms . . . . . . . . . . . . . . . . . . . . . . 502
11.12 Compositional Inversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509

12 Additional Topics 515


12.1 Cyclic Shifting of Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
12.2 The Chung–Feller Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
12.3 Rook-Equivalence of Ferrers Boards . . . . . . . . . . . . . . . . . . . . . . 521
12.4 Parking Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
12.5 Parking Functions and Trees . . . . . . . . . . . . . . . . . . . . . . . . . . 525
12.6 Möbius Inversion and Field Theory . . . . . . . . . . . . . . . . . . . . . . 529
12.7 q-Binomial Coefficients and Subspaces . . . . . . . . . . . . . . . . . . . . . 531
12.8 Tangent and Secant Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . 535
12.9 Combinatorial Definition of Determinants . . . . . . . . . . . . . . . . . . . 539
12.10 The Cauchy–Binet Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . 544
12.11 Tournaments and the Vandermonde Determinant . . . . . . . . . . . . . . 546
12.12 The Hook-Length Formula . . . . . . . . . . . . . . . . . . . . . . . . . . . 548
xvi Contents

12.13 Knuth Equivalence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 553


12.14 Quasisymmetric Polynomials . . . . . . . . . . . . . . . . . . . . . . . . . 559
12.15 Pfaffians and Perfect Matchings . . . . . . . . . . . . . . . . . . . . . . . . 563
12.16 Domino Tilings of Rectangles . . . . . . . . . . . . . . . . . . . . . . . . . 570
Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 576
Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578

Appendix: Definitions from Algebra 589


Rings and Fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589
Vector Spaces and Algebras . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590
Linear Algebra Concepts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593

Bibliography 595

Index 603
Preface to the Second Edition

This book presents a general introduction to enumerative, bijective, and algebraic combina-
torics. Enumerative combinatorics is the mathematical theory of counting. This branch of
discrete mathematics has flourished in the last few decades due to its many applications to
probability, computer science, engineering, physics, and other areas. Bijective combinatorics
produces elegant solutions to counting problems by setting up one-to-one correspondences
(bijections) between two sets of combinatorial objects. Algebraic combinatorics uses com-
binatorial methods to obtain information about algebraic structures such as permutations,
polynomials, matrices, and groups. This relatively new subfield of combinatorics has had
a profound influence on classical mathematical subjects such as representation theory and
algebraic geometry.
Part I of the text covers fundamental counting tools including the Sum and Product
Rules, binomial coefficients, recursions, bijective proofs of combinatorial identities, enumer-
ation problems in graph theory, inclusion-exclusion formulas, generating functions, ranking
algorithms, and successor algorithms. This part requires minimal mathematical prerequisites
and could be used for a one-semester combinatorics course at the advanced undergradu-
ate or beginning graduate level. This material will be interesting and useful for computer
scientists, statisticians, engineers, and physicists, as well as mathematicians.
Part II of the text contains an introduction to algebraic combinatorics, discussing groups,
group actions, permutation statistics, tableaux, symmetric polynomials, and formal power
series. My presentation of symmetric polynomials is more combinatorial (and, I hope, more
accessible) than the standard reference work [84]. In particular, a novel approach based
on antisymmetric polynomials and abaci yields elementary combinatorial proofs of some
advanced results such as the Pieri Rules and the Littlewood–Richardson Rule for multiply-
ing Schur symmetric polynomials. Part II assumes a bit more mathematical sophistication
on the reader’s part (mainly some knowledge of linear algebra) and could be used for a
one-semester course for graduate students in mathematics and related areas. Some relevant
background material from abstract algebra and linear algebra is reviewed in an appendix.
The final chapter consists of independent sections on optional topics that complement ma-
terial in the main text. In many chapters, some of the harder material in later sections can
be omitted without loss of continuity.
Compared to the first edition, this new edition has an earlier, expanded treatment of
generating functions that focuses more on the combinatorics and applications of generating
functions and less on the algebraic formalism of formal power series. In particular, we provide
greater coverage of exponential generating functions and the use of generating functions to
solve recursions, evaluate summations, and enumerate complex combinatorial structures.
We cover successor algorithms in more detail in Chapter 6, providing automatic methods to
create these algorithms directly from counting arguments based on the Sum and Product
Rules. The final chapter contains some new material on quasisymmetric polynomials. Many
chapters in Part I have been reorganized to start with elementary content most pertinent
to solving applied problems, deferring formal proofs and advanced material until later. I
hope this restructuring makes the second edition more readable and appealing than the
first edition, without sacrificing mathematical rigor.

xvii
xviii Preface to the Second Edition

Each chapter ends with a summary, a set of exercises, and bibliographic notes. The
book contains over 1200 exercises, ranging in difficulty from routine verifications to unsolved
problems. Although we provide references to the literature for some of the major theorems
and harder problems, no attempt has been made to pinpoint the original source for every
result appearing in the text and exercises.
I am grateful to the editors, reviewers, and other staff at CRC Press for their help
with the preparation of this second edition. Readers may communicate errors and other
comments to the author by sending e-mail to nloehr@vt.edu.
Nicholas A. Loehr
Introduction

The goal of enumerative combinatorics is to count the number of objects in a given finite
set. This may seem like a simple task, but the sets we want to count are often very large
and complicated. Here are some examples of enumeration problems that can be solved using
the techniques in this book. How many encryption keys are available using the 128-bit AES
encryption algorithm? How many strands of DNA can be built using five copies of each of
the nucleotides adenine, cytosine, guanine, and thymine? How many ways can we be dealt
a full house in five-card poker? How many ways can we place five rooks on a chessboard
with no two rooks in the same row or column? How many subsets of {1, 2, . . . , n} contain no
two consecutive integers? How many ways can we write 100 as a sum of positive integers?
How many connected graphs on n vertices have no cycles? How many integers between
1 and n are relatively prime to n? How many circular necklaces can be made with three
rubies, two emeralds, and one diamond if all rotations of a given necklace are considered
the same? How many ways can we tile a chessboard with dominos? The answers to such
counting questions can help us solve a wide variety of problems in probability, cryptography,
algorithm analysis, physics, abstract algebra, and other areas of mathematics.
Part I of this book develops the basic principles of counting, placing particular emphasis
on the role of bijections. To give a bijective proof that a given set S has size n, one must
construct an explicit one-to-one correspondence (bijection) from S onto the set {1, 2, . . . , n}.
More generally, one can prove that two sets A and B have the same size by exhibiting a
bijection between A and B. For example, given a fixed positive integer n, let A be the set
of all strings w1 w2 · · · w2n consisting of n left parentheses and n right parentheses that are
balanced (every left parenthesis can be matched to a right parenthesis later in the sequence).
Let B be the set of all arrays  
y1 y2 · · · yn
z1 z2 · · · zn
such that every number in {1, 2, . . . , 2n} appears once in the array, y1 < y2 < · · · < yn , z1 <
z2 < · · · < zn , and yi < zi for every i. The sets A and B seem quite different at first glance.
Yet, we can demonstrate that A and B have the same size using the following bijection.
Given w = w1 w2 · · · w2n in A, let y1 , y2 , . . . , yn be the positions of the left parentheses in w
(written in increasing order), and let z1 , z2 , . . . , zn be the positions of the right parentheses
in w (written in increasing order). For example, the string (()())((()))() in A maps to
the array  
1 2 4 7 8 9 13
.
3 5 6 10 11 12 14
One may check that the requirement yi < zi for all i is equivalent to the fact that w is
a balanced string of parentheses. The string w is uniquely determined by the array of yi ’s
and zi ’s, and every such array arises from some string w in A. Thus we have defined the
required one-to-one correspondence between A and B. We now know that the sets A and
B have the same size, although we have not yet determined what that size is!
Bijective proofs, while elegant, can be very difficult to discover. For example, let C be
the set of rearrangements of 1, 2, . . . , n that have no decreasing subsequence of length three.
It turns out that the sets B and C have the same size, so there must exist a bijection from

xix
xx Introduction

B to C. Can you find one? (Before spending too long on this question, you might want to
read §12.13.)
Luckily, the field of enumerative combinatorics contains a whole arsenal of techniques to
help us solve complicated counting problems. Besides bijections, some of these techniques
include recursions, generating functions, group actions, inclusion-exclusion formulas, linear
algebra, probabilistic methods, and symmetric polynomials. In the rest of this introduction,
we describe several challenging enumeration problems that can be solved using these more
advanced methods. These problems, and the combinatorial technology needed to solve them,
will be discussed at greater length later in the text.

Standard Tableaux
Suppose we are given a diagram D consisting of a number of rows of boxes, left-justified,
with each row no longer than the one above it. For example, consider this diagram:

Let n be the total number of boxes in the diagram. A standard tableau of shape D is a filling
of the boxes in D with the numbers 1, 2, . . . , n (used once each) so that every row forms an
increasing sequence (reading left to right), and every column forms an increasing sequence
(reading top to bottom). For example, here are three standard tableaux of shape D, where
D is the diagram pictured above:
1 2 3 4 1 3 4 9 1 2 3 7
5 6 2 5 4 8
7 8 6 7 5 9
9 8 6
Question: Given a diagram D of n cells, how many standard tableaux of shape D are there?
There is a remarkable answer to this counting problem, known as the Hook-Length
Formula. To state it, we need to define hooks and hook lengths. The hook of a box b in a
diagram D consists of all boxes to the right of b in its row, all boxes below b in its column,
and box b itself. The hook length of b, denoted h(b), is the number of boxes in the hook of
b. For example, if b is the first box in the second row of D, then the hook of b consists of
the marked boxes in the following picture:

• •


So h(b) = 4. In the picture below, we have labeled each box in D with its hook length.
7 5 2 1
4 2
3 1
1
Hook-Length Formula: Given a diagram D of n cells, the number of standard tableaux
of shape D is n! divided by the product of the hook lengths of all the boxes in D.
Introduction xxi

For the diagram D in our example, the formula says there are exactly
9!
= 216
7·5·2·1·4·2·3·1·1
standard tableaux of shape D. Observe that the set B of 2 × n arrays (discussed above) can
also be enumerated with the aid of the Hook-Length Formula. In this case, the diagram D
consists of two rows of length n. The hook lengths for boxes in the top row are n + 1, n,
n − 1, . . ., 2, while the hook lengths in the bottom row are n, n − 1, . . . , 1. Since there are
2n boxes in D, the Hook-Length Formula asserts that

(2n)! (2n)!
|B| = = .
(n + 1) · n · (n − 1) · . . . · 2 · n · (n − 1) · . . . · 1 (n + 1)!n!

The fraction on the right side is an integer called the nth Catalan number. Since we previ-
ously displayed a bijection between B and A (the set of strings of balanced parentheses),
we conclude that the size of A is also given by a Catalan number. As we will see, many
different types of combinatorial structures are counted by the Catalan numbers.
How is the Hook-Length Formula proved? Many proofs of this formula have been found
since it was originally discovered in 1954. There are algebraic proofs, probabilistic proofs,
combinatorial proofs, and (relatively recently) bijective proofs of this formula. Here we
discuss a flawed probabilistic argument that gives a little intuition for how the mysterious
Hook-Length Formula arises. Suppose we choose a random filling F of the boxes of D with
the integers 1, 2, . . . , n. What is the probability that this filling will actually be a standard
tableau? We remark that the filling is standard if and only if for every box b in D, the
entry in b is the smallest number in the hook of b. Since any of the boxes in the hook
is equally likely to contain the smallest value, we see that theQprobability of this event is
1/h(b). Multiplying these probabilities together would give 1/ b∈D h(b) as the probability
that the random filling we chose is a standard tableau. Since the total number of possible
fillings
Q is n! (by the Product Rule, discussed in Chapter 1), this leads us to the formula
n!/ b∈D h(b) for the number of standard tableaux of shape D.
Unfortunately, the preceding argument contains a fatal error. The events “the entry
in box b is the smallest in the hook of b,” for various choices of b, are not necessarily
independent (see §1.9). Thus we cannot find the probability that all these events occur by
multiplying together the probabilities of each individual event. Nevertheless, remarkably,
the final answer obtained by making this erroneous independence assumption turns out
to be correct! The Hook-Length Formula can be justified by a more subtle probabilistic
argument due to Greene, Nijenhuis, and Wilf. We describe this argument in §12.12.

Rook Placements
A rook is a chess piece that can travel any number of squares along its current row or column
in a single move. We say that the rook attacks all the squares in its row and column. How
many ways can we place eight rooks on an ordinary 8 × 8 chessboard so that no two rooks
attack one another? The answer is 8! = 40, 320. More generally, we can show that there are
n! ways to place n non-attacking rooks on an n × n chessboard. To see this, first note that
there must be exactly one rook in each of the n rows. The rook in the top row can occupy
any of the n columns. The rook in the next row can occupy any of the n − 1 columns not
attacked by the first rook; then there are n − 2 available columns for the next rook, and
xxii Introduction

so on. By the Product Rule (discussed in Chapter 1), the total number of placements is
therefore n × (n − 1) × (n − 2) × · · · × 1 = n!.
Now consider an (n + 1) × (n + 1) chessboard with a bishop occupying the upper-left
corner square. (A bishop is a chess piece that attacks all squares that can be reached from
its current square by moving in a straight line northeast, northwest, southeast, or southwest
along a diagonal of the chessboard.) Question: How many ways can we place n rooks on
this chessboard so that no two pieces attack one another? An example of such a placement
on a standard chessboard (n + 1 = 8, so n = 7) is shown below:

8
BZ0Z0Z0Z
7
Z0s0Z0Z0
6
0Z0Z0ZrZ
5
ZrZ0Z0Z0
4
0Z0s0Z0Z
3
Z0Z0Z0Zr
2
0Z0Z0s0Z
1
Z0Z0s0Z0
a b c d e f g h

It turns out that the number of


P∞non-attacking placements is the closest integer to n!/e. Here,
e is the famous constant e = k=0 1/k! ≈ 2.718281828 that appears throughout the subject
of calculus. When n = 7, the number of placements is 1854 (note 7!/e = 1854.112 . . .).
This answer follows from the Inclusion-Exclusion Formulas to be discussed in Chapter 4.
We sketch the derivation now to indicate how the number e appears. First, there are n!
ways to place the n rooks on the board so that no two rooks attack each other, and no rook
occupies the top row or the leftmost column (lest a rook attack the bishop). However, we
have counted many configurations in which one or more rooks occupy the diagonal attacked
by the bishop. To correct for this, we will subtract a term that accounts for configurations of
this kind. We can build such a configuration by placing a rook in row i, column i, for some
i between 2 and n + 1, and then placing the remaining rooks in different rows and columns
in (n − 1)! ways. So, presumably, we should subtract n × (n − 1)! = n! from our original
count of n!. But now our answer is zero! The trouble is that our subtracted term over-counts
those configurations in which two or more rooks are attacked by the bishop. A naive count
leads to the conclusion that there are n(n−1)2 (n − 2)! = n!/2! such configurations, but this
figure over-counts configurations with three or more rooks on the main diagonal. Thus we
are led to a formula (called an Inclusion-Exclusion Formula) in which we alternately add
and subtract various terms to correct for all the over-counting. In the present situation, the
final answer turns out to be
n
X
n! − n! + n!/2! − n!/3! + n!/4! − n!/5! + · · · + (−1)n n!/n! = n! (−1)k /k!.
k=0
P∞
Next, recall from calculus that ex = k=0 xk /k! for all real x. In particular, taking x = −1,
we have

1 X
e−1 = = 1 − 1 + 1/2! − 1/3! + 1/4! − 1/5! + · · · = (−1)k /k!.
e
k=0
We see that the combinatorial formula stated above consists of the first n + 1 terms in
the
P∞infinite series for n!/e. It can be shown (see §4.5) that the “tail” of this series, namely
k
k=n+1 (−1) n!/k!, is always less than 0.5 in absolute value. Thus, rounding n!/e to the
nearest integer will produce the required answer.
Introduction xxiii

Another interesting combinatorial problem arises by comparing non-attacking rook


placements on two boards of different shapes. For instance, consider the two generalized
chessboards shown here:

One can check that for every k ≥ 1, the number of ways to place k non-attacking rooks
on the first board is the same as the number of ways to place k non-attacking rooks on the
second board. We say that two boards are rook-equivalent whenever this property holds. It
turns out that an n × n board is always rook-equivalent to a board with successive row
lengths 2n − 1, 2n − 3, . . . , 5, 3, 1. More generally, there is a simple criterion for deciding
whether two boards “of partition shape” are rook-equivalent. We will present this criterion
in §12.3.

Tilings
Now we turn to yet another problem involving chessboards. A domino is a rectangular object
that can cover two horizontally or vertically adjacent squares on a chessboard. A tiling of a
board is a covering of the board with dominos such that each square is covered by exactly
one domino. For example, here is one possible tiling of a standard 8 × 8 chessboard:

Question: Given a board of dimensions m×n, how many ways can we tile it with dominos?
This question may seem unfathomably difficult, so let us first consider the special case where
m = 2. In this case, we are tiling a 2 × n region with dominos. Let fn be the number of
such tilings, for n = 0, 1, 2, . . .. One can see by drawing pictures that

f0 = f1 = 1, f2 = 2, f3 = 3, f4 = 5, f5 = 8, f6 = 13, . . . .

The reader may recognize these numbers as being the start of the famous Fibonacci sequence.
This sequence is defined recursively by letting F0 = F1 = 1 and Fn = Fn−1 + Fn−2 for all
n ≥ 2. Now, a routine counting argument can be used to prove that the tiling numbers fn
satisfy the same recursive formula fn = fn−1 + fn−2 . To see this, note that a 2 × n tiling
either ends with one vertical domino or two stacked horizontal dominos. Removing this part
of the tiling either leaves a 2 × (n − 1) tiling counted by fn−1 or a 2 × (n − 2) tiling counted
by fn−2 . Since the sequences (fn ) and (Fn ) satisfy the same recursion and initial conditions,
we must have fn = Fn for all n.
Now, what about the original tiling problem? Since the area of a tiled board must be
even, there are no tilings unless at least one of the dimensions of the board is even. For
boards satisfying this condition, Kasteleyn, Temperley, and Fisher proved the following
amazing result. The number of domino tilings of an m × n chessboard (with m even) is
xxiv Introduction

exactly equal to s
m/2 n    
mn/2
YY jπ kπ
2 cos2 + cos2 .
j=1 k=1
m+1 n+1

The formula is especially striking since the individual factors in the product are transcen-
dental numbers, yet the product of all these factors is a positive integer! When m = n = 8,
the formula reveals that the number of domino tilings of a standard chessboard is 12,988,816.
The proof of the formula involves Pfaffians, which are quantities analogous to determinants
that arise in the study of skew-symmetric matrices. For details, see §12.15 and §12.16.

Notes
Different proofs of the Hook-Length Formula may be found in [37, 40, 55, 96, 103]. Treat-
ments of various aspects of rook theory appear in [36, 48, 49, 69]. The Domino Tiling
Formula was proved by Kasteleyn in [70] and discovered independently by Fisher and Tem-
perley [31].
Part I

Counting
1
Basic Counting

This chapter develops the basic counting techniques that form the foundation of enumerative
combinatorics. We apply these techniques to study fundamental combinatorial objects such
as words, permutations, subsets, functions, and lattice paths. We also give some applications
of combinatorics to probability theory.

1.1 The Product Rule


We begin with the Product Rule, which gives us a way to count objects that can be built
up from smaller ingredients by making a sequence of choices.
1.1. The Product Rule. Suppose S is a set of objects such that every object in S can
be constructed in exactly one way by making a sequence of k choices, where k is a fixed
positive integer. Suppose the first choice can be made in n1 ways; the second choice can be
made in n2 ways, no matter what the first choice was; and so on. In general, for 1 ≤ i ≤ k,
suppose the ith choice can be made in ni ways, no matter what the previous choices were.
Then the total number of objects in S is n1 n2 · · · nk , the product of the number of choices
possible at each stage.
We prove the Product Rule later (see §1.15). When using this rule to count objects, the
key question to ask is: how can I build the objects I want by making a sequence of choices?
The following examples illustrate how this works.
1.2. Example: License Plates. A Virginia license plate consists of three uppercase letters
followed by four digits. How many license plates are possible? To answer this with the
Product Rule, we build a typical license plate by making a sequence of seven choices. First,
choose the leftmost letter; there are n1 = 26 ways to make this choice. Second, choose
the next letter in any of n2 = 26 ways. Third, choose the next letter in any of n3 = 26
ways. Fourth, choose the first digit in any of n4 = 10 ways. Continue similarly; we have
n5 = n6 = n7 = 10. By the Product Rule, the total number of license plates is

n1 n2 · · · n7 = 263 · 104 = 175,760,000.

1.3. Example: Numbers. How many odd four-digit numbers have no repeated digits and
do not contain the digit 8? For example, 3461 and 1705 are valid numbers, but 3189 and
1021 are not. We can build a number of the required type by choosing its digits one at a
time in the following order. First, choose the rightmost digit. Since we want an odd number,
there are n1 = 5 possibilities for this digit (1 or 3 or 5 or 7 or 9). Second, choose the leftmost
digit. Here there are n2 = 7 possibilities: of the ten digits 0 through 9, we must avoid 0,
8, and the digit chosen in the first stage. Third, choose the second digit from the left. Now
there are n3 = 7 possibilities, since 0 is available, but we must avoid 8 and the two different
digits chosen in the first two stages. Fourth, choose the third digit from the left; there are

3
4 Combinatorics, Second Edition

n4 = 6 possibilities (avoid 8 and the three different digits chosen previously). The object is
now complete, so the Product Rule tells us there are

n1 n2 n3 n4 = 5 · 7 · 7 · 6 = 1470

numbers satisfying the given conditions.


In this example, we cannot arrive at the answer by choosing digits from left to right.
Using this approach, we would find n1 = 8 (avoid 0 and 8), n2 = 8 (avoid 8 and the first
digit), and n3 = 7 (avoid 8 and the first two digits). But when we try to choose the last
digit, what is n4 ? The last digit needs to be odd and different from the three previously
chosen digits. The number of available choices at the fourth stage depends on how many
of the previous digits are odd. So n4 depends on the particular choices made earlier, which
violates the setup for the Product Rule. Thus, that rule does not apply to the construction
method attempted here. In our solution above, we avoided this difficulty by choosing the
rightmost digit first.
1.4. Example: Poker Hands. A poker hand is a set of five different cards from a 52-card
deck. Each card in the deck has a suit (clubs, diamonds, hearts, or spades) and a value (2
through 10, jack, queen, king, or ace). For example, H = {4♥, 9♣, A♦, 9♥, J♠} is a poker
hand. How many poker hands are there? It might seem we could build a poker hand by
choosing the first card (n1 = 52), then a second card different from the first (n2 = 51), then
the third card (n3 = 50), then the fourth card (n4 = 49), then the fifth card (n5 = 48).
Using the Product Rule would give n1 n2 n3 n4 n5 = 311, 875, 200 possible hands. However,
this argument is flawed because, by definition, a poker hand is an unordered set of cards.
Thus we cannot speak of the “first” card in the hand. Another way to explain the error is to
notice that the same hand can be constructed in many different ways by making different
sequences of choices; but the Product Rule demands that each object to be counted must
arise from one and only one sequence of choices. For example, the hand H shown above
could be built by first choosing 4♥, then 9♣, then A♦, then 9♥, then J♠. But, we could
build the same hand by first choosing 9♥, then J♠, then 9♣, then 4♥, then A♦. By the
Product Rule, we see that there are 5 · 4 · 3 · 2 · 1 = 120 different orderings of these five cards
that would all produce the same (unordered) hand H. In fact, every poker hand (not just
H) is constructed 120 times by the choice process described above. So we can obtain the
correct count by dividing the initial answer by 120, getting N = 2, 598, 960 poker hands.
The Subset Rule (see 1.27 below) generalizes this result.
1.5. Example: Straight Poker Hands. A straight poker hand consists of five cards with
consecutive values, where the ace can be treated as either a low card or a high card. For
example, {A♥, 2♣, 3♦, 4♦, 5♣} and {K♣, 9♣, J♣, Q♣, 10♣} are straight poker hands (note
that the order of cards within the hand is irrelevant). How many straight poker hands are
there? We can build all such hands by making the following choices:
1. Choose the lowest value in the hand. There are n1 = 10 possible values here (ace, 2, . . .,
10). Since the hand is a straight, all values in the hand are determined by this choice.
If we choose 5 (say), then the partially constructed hand looks like {5–,6–,7–,8–,9–}.
2. Choose the suit for the lowest value in the hand; there are n2 = 4 suits we could pick. In
our sample object, suppose we pick spades; the object now looks like {5♠,6–,7–,8–,9–}.
3. Choose the suit for the second lowest value in the hand; there are n3 = 4 possibilities.
Picking ♥ for our sample object, we now have {5♠,6♥,7–,8–,9–}.
4. Choose the suit for the third lowest value in the hand, so n4 = 4. Perhaps we pick hearts
again; the partial hand is now {5♠,6♥,7♥,8–,9–}.
Another random document with
no related content on Scribd:
bottom and cover pieces nearly to the final size before gluing them;
then, if small nicks are made in the edge, they may be removed by a
cut of the plane, when the case is complete. Glue the sliding pieces
to the cover and to the back. This must be done carefully, and it is
convenient to drive small brads part way into the second piece, from
the inner side, to prevent the pieces from slipping while being glued.
If proper care is taken, only a small amount of glue will be forced out,
and this can be removed with a chisel when dry. The edges may be
trimmed off to their exact size, and the entire construction given a
final light sandpapering. It is then ready for the stain and shellac, or
other finish. The parts that slide in grooves should not be shellacked
or varnished, because this is apt to cause them to stick.
A Cylinder Reversing Switch

A cylinder reversing switch for small battery motors may be


constructed cheaply, from a 3-in. length of broom handle and ¹⁄₂-in.
boards, as shown. The four brushes are strips of copper. The
contacts on the moving cylinder are eight brass tacks, connected as
indicated in the diagram. The wires are insulated with paper where
they cross. The handle is of heavy wire, and two tacks limit its
motion, as shown. The method of connecting the switch is as
follows, for either a series or shunt motor: Remove the two wires
from the motor brushes, and connect the two middle brushes of the
switch to the motor brushes. Connect the wires removed from the
motor brushes to the outer brushes of the switch.—Claude Schuder,
Sumner, Ill.
Summer Radiator Cover Serves as Cupboard in
Winter

This Radiator Cover is Built so That Shelves may be Inserted Quickly for Use
as a Cabinet

Because of the accumulation of dust on a kitchen radiator in the


summer, a cupboard was built over it, and used at other seasons of
the year for the storage of various articles, by fitting it with shelves.
While in use as a radiator cover, the top of the cupboard provided a
convenient seat. If properly made, cabinets of this type can be used
in other parts of the home to advantage.
A Safety Spring for Porch Swings
It is often necessary to hang swinging porch seats fairly close to
surrounding woodwork, which is marred by their swinging too far. To
overcome this, procure a coil screen-door spring and cut it in two.
Bend a hook on each cut end, and fasten one of the springs to the
center of each end of the swing, and to the floor. This permits only
gentle swinging.—F. C. Hayes, Niagara Falls, Canada.

¶Proper ventilation of cellars makes it desirable to provide a screen


door on the cellar entrance.
Frying Pan Made of Tin Cover
If you want an egg done to perfection try the frying pan made of a
tin cover. It was intended for emergency use only, but proved so
satisfactory that I kept it as a regular fixture. The wire handle was
fitted to the rim through two holes, as shown and hooks under the
bottom of the pan, the twisting of the wires giving the required
strength.
Safety Cover for Valves on Gas Stove

In order to safeguard the valves of a kitchen gas stove with which


children might occasionally meddle, I fitted a sheet-metal cover over
the valves as shown in the sketch. The cover is wired to the feed
pipe and is swung forward, as indicated by the dotted outline, when
not in use. Small catches may be fixed at each end of the cover, if
desired.—Leroy Schenck, Mount Vernon, N. Y.
A Come-Back Rolling Can

An interesting toy may be made by fitting a rubber band into a tin


can and weighting it as shown. When the can is rolled on the floor it
will return to its original place by reason of the weight which is
supported on a string at the middle of the rubber band. The latter is
passed through two holes at each end of the can, and when the can
is rolled along the floor the elastic is wound at the middle. The weight
reverses the direction of rolling.—Albert French, Hamilton, Ontario,
Can.
Removable Paraffin Covers for Jars

To remove paraffin from the tops of glasses or jars of preserves,


without getting bits of the covering into the contents, is difficult.
When pouring the melted paraffin over the top, put a small cork in
the center and let the paraffin harden around it, as shown. To
remove the covering, dip the top of the glass in hot water. This
sealing can be used again by placing it on the top of hot jelly, the
paraffin melting and adhering to the glass.—J. E. McCoy,
Philadelphia, Pennsylvania.
A Marble-under-Bridge Game of Skill

The object of this game is to pass a marble from one end to the
other of the “roadway,” under the “bridges,” and over the “inclines,”
without dropping it. A stop must be made at each hole. The device is
made as follows: Cut two pieces of wood, ¹⁄₄ by 1³⁄₄ by 12 in., and
join them to form a right angle. Cut pieces of cardboard, 4 each, 1³⁄₄
by 2¹⁄₂ in. wide, with a ³⁄₄-in. hole in the center, for inclines B, and 1³⁄₄
by 3 in., for bridges A; also two pieces 1³⁄₄ in. square for stops C.
Fasten them with tacks as shown. The marble should be large
enough so that it will rest in the holes at B.
Decorative Toys and Boxes
Made at Home
By Bonnie E. Snow

Homemade toys and gifts, as well as the “treasure boxes” in which


they are contained, have an added interest both to the one
making and the one receiving them. The holiday season makes this
work especially attractive, which affords opportunity for individuality
in construction and design limited only by the skill of the worker. The
decorated toys and the box described in detail in this article are
suggestive only, and may be adapted to a large variety of forms and
designs. The gorgeously colored parrot and the gayly caparisoned
rider and horse suggest a host of bird and animal forms, those
having possibilities for attractive coloring being most desirable. The
decorated box shown in Fig. 7 may be adapted as a gift box, to be
used where its decoration may be seen, in the nursery, for example,
and may be made in many forms, in fact as various as cardboard
boxes are. Plant, animal, or geometrical forms may be used to work
out designs, and appropriate color schemes applied to them. A good
plan in determining upon a color scheme is to use the colors of the
flower or other motif. If the design is not associated with objects
having varied colors—a geometrical design, for instance—
harmonious colors should be chosen. These may be bright and
contrasting, as red and green, violet and orange, or subdued in tone.
FIG. 1 FIG. 2

The Outlines for the Horse and Rider and the Parrot may be Made by
Enlarging These Sketches. The Color Scheme Indicated is Suggestive
Only and may be Varied to Suit Individual Taste

A design for a horse and rider, brightly colored, is shown in Fig. 1.


The form is cut out of thin wood, the color applied, and the figure
mounted on the curved wire, weighted at one end, as shown in Fig.
6. The toy adds a touch of color and novelty to a room, when
suspended from the corner of the mantel, from a shelf, or other
suitable place. Balanced in a striking attitude, forefeet upraised, even
grown-ups can hardly resist tipping the rider to see his mount rear
still higher. The parrot shown in Fig. 2 is made similarly, and is
weighted at the end of the tail. The point of balance is at the feet,
which may be fastened to a trapeze, or be arranged to perch on a
convenient place, like that suited to the horse and rider.
The tools and equipment necessary for the making of such toys
are simple, and available in most boys’ workshops or tool chests. A
coping saw, like that shown at A, Fig. 3, is suitable for cutting the
wood. A fretsaw, operated by hand, foot or power, may be used, and
such a tool makes this work quite rapid. To use the coping saw to the
best advantage, particularly if the work is to be done on a table
which must not be marred, a sawing board should be made. In its
simplest form, this consists of a board, as shown at B, about ⁷⁄₈ in.
thick, 3¹⁄₂ in. wide, and 6 in. long, with one end notched. This is
clamped to the end of the table, as at D, with a clamp, an iron one of
the type shown at C being satisfactory. Another form of sawing table
especially useful when it is desired to stand up at the work, is shown
at E in detail and clamped in the vise at F. It consists of a notched
board, 3¹⁄₂ in. wide, fixed at right angles to a board of similar width,
11 in. long, and braced at the joint with a block about 1³⁄₈ in. square.
In using the coping saw with either of these saw tables, the wood is
held down on the support, as shown in Fig. 5, and the saw drawn
downward for each cutting stroke, thus tending to hold the board
more firmly against the saw table. It is, of course, important that the
saw be inserted in the coping-saw frame with the teeth pointing
toward the handle, so that the method of cutting described may be
followed. The wood must be sawed slowly, especially at the
beginning of a cut. The operator soon learns the kinks in handling
the saw and wood to the best advantage, and can then make rapid
progress.
A B C
D E F

FIG. 3
The Tools Required are Found in Most Boys’ Workshops, and a Satisfactory
Saw Table may be Made Easily, as Shown in Detail

An outline drawing of the form to be cut out of the wood must first
be made, to the exact size that the object is to be. There is much
satisfaction if working out the form of the animal or other figure,
especially for the boy or girl who has the time necessary to do good
work. If desired, the figure may be traced from a picture obtained
from a book, magazine, or other source. Cut a piece of wood to the
size required for the design, and place a sheet of carbon paper over
it; or if none is available, rub a sheet of paper with a soft pencil, and
use this as a carbon paper, the side covered with the lead being
placed next to the wood. The carbon paper and the sheet bearing
the design should then be held in place on the wood with thumb
tacks, or pins, and the transfer made with a pencil, as shown in Fig.
4. The design should be placed on the wood so that the weaker
parts, such as the legs of the horse, will extend with the length
instead of across the grain of the wood. In some instances, where a
complicated form is cut out, it is necessary to use wood of several
plies, and where this is available it is worth while to use it for all of
this work. For smaller objects wood ³⁄₁₆ in. thick is suitable, and stock
up to ¹⁄₂ in. in thickness may be used. Whitewood, basswood, poplar
and other soft, smooth-grained woods are suitable.

FIG. 4 FIG. 5
The Design is Traced Carefully onto the Wood and Then Cut Out with the
Coping Saw, on the Saw Table

When the design has been outlined satisfactorily, place the piece
of wood on the saw table with the design on the upper side. Holding
the wood down firmly, as shown in Fig. 5, and sawing in the notch of
the saw table, cut into the edge slowly. Apply light pressure on the
downstroke only, as the upstroke is not intended to cut, and turn the
piece to keep the saw on the line and in the notch. It is important that
the saw be held vertically so that the edge of the cut-out portion will
be square. With proper care and a little practice, the edges may be
cut so smoothly that only a light sandpapering will be required to
produce a smooth edge. When the figure has been cut out, smooth
the edges by trimming them carefully with a sharp knife, if necessary,
and sandpaper them lightly to remove sharp corners. A fine
sandpaper, about No. ¹⁄₂, is suitable for this purpose. The figure is
then ready for painting. The white is put on first and the other colors
applied over it, when dry.
Oil paints may be used, and a varnish or shellac applied over them
to give a high grade of work, but this process requires much care,
considerable skill, and long drying between coats to prevent “runs” in
the colors.

FIG. 6
Water-color paint, which can be purchased in powder form at paint
stores, mixed with water to the consistency of cream is a satisfactory
coloring material, and is easy to apply. Five cents’ worth of each of
the colors used—yellow, red, blue, black, and white—will be
sufficient for several toys. Mix each color in a separate saucer, and
use a small water-color brush to apply the paint. In painting the
horse and rider, the horse is first painted entirely white, and then the
black spots are applied after the color is dry. The rider’s coat is
painted red; the trousers blue; the hat and leggings buff, as indicated
in Fig. 1. Mix a brushful of yellow with a brushful of red, and add
about three brushfuls of white. A half brushful of black may be added
to dull the color, if desired. The flesh tone for the rider’s face is made
by mixing a little red with white. When the colors are dry, all edges
are outlined with a heavy line of black, not less than ¹⁄₈ in. in width.
This outline may be evenly applied with the point of the brush.

You might also like