Due to the change in Chapter 9, in the introductory chapter on graph theory (Chapter 11), bipartite graphs are no longer assumed to have been discussed before. Except for the last example, it is separate from the graph theory and design chapters.
Chapter 1
What Is Combinatorics?
In counting problems, the inclusion-exclusion principle, the so-called pigeon principle, methods of repeated relations and generating functions, Burnside's theorem, and the P61ya counting formula are all examples of general principles and methods that we will discuss in the following chapters. . The result is that in combinatorics, as in mathematics in general, the more problems one solves, the more likely one is to be able to solve the next problem.
Example: Perfect Covers of Chessboards
For a perfect cover to exist, the trimmed board must have an equal number of black and white squares. There is another way to generalize the problem of completely covering an m-by-n board with dominoes.
Since each color appears the same number of times on the entire board, it follows that each color appears the same number of times in the lower right r-by-s area. Since r ~ s, the nature of the coloring is such that color 1 appears once in each row of the r-by-s portion and thus r times in the r-by-s portion.

Example: Magic Squares
It is not difficult to verify that there can be no magic square of order 2 (the magic sum would have to be 5). EXAMPLE: MAGIC SQUARES 9 The magic square of order 3 in (1.1), as well as the magic square.
But this means that 14 must be the center of each plane cross-section of the magic cube and therefore must occupy seven different places. But it can occupy only one place, and we conclude that there is no magic cube of order 3.
Example: The Four-Color Problem
Example: The Problem of the 36 Officers
The preceding sets of ranks and regiments are examples of Latin squares of order 3; each of the integers 1, 2, and 3 appears once in each row and once in each column. Euler showed how to construct a pair of right-angled Latin squares of order n whenever n is odd or has a factor of 4.
Example: Shortest-Route Problem
Solving a Sudoku puzzle is an example of a Latin square called gerechte design, where an n-times-n square is divided into n areas, each containing n squares and each of the integers 1,2,.,. We give a simple example of a gerechte design, which results from dividing a 4 by 4 square into four L-shaped areas, each containing four squares.
So if player II takes c-coins from one of the piles, player I takes the same number of c-coins from the other pile. We call a Nim game balanced provided the number of subheaps of each size is even.

Exercises
Use de la Loubere's method to construct a magic square of order 9. Construct a magic square of order 6. Show that a magic square of order 3 must have the number 5 in the middle. Check that this construction produces a magic square of order n when n = 4 and n = 8. It actually produces a magic square for every n divisible by 4.).
Chapter 2
Permutations and Combinations
Four Basic Counting Principles
The number of objects of a set 8 is denoted 181 and is sometimes referred to as the size of 8. Suppose we want to find the number of different courses offered by the University of Wisconsin-Madison.
What is important for the application of the multiplication principle is that the number of choices is always 8. The other idea is that to find the number of features in a set A (in this case the set of two-digit numbers with distinct and non-zero digits) it may be easier to find the number of features in a larger set U containing S (the set of all two-digit numbers in the previous example) and then subtract from U the number of objects that do not belong to A (the two-digit numbers with a 0 or identical digits).
IAI = 1U1-IAI·
- FOUR BASIC COUNTING PRINCIPLES 31 subtraction principle makes sense only if it is easier to count the number of objects in
- FOUR BASIC COUNTING PRINCIPLES 33 we might have a multiset M with three a's, one b, two e's, and four d's, that is, 10
- PERMUTATIONS OF SETS 35 be occupied by the 8 (four choices). The remaining three places are occupied by Is
- Permutations of Sets
- PERMUTATIONS OF SETS 37 The solution to this problem (like so many counting problems) is straightforward
- PERMUTATIONS OF SETS 39 many different ways can they form their circle? Since the children are moving, what
- COMBINATIONS (SUBSETS) OF SETS 41 Example. What is the number of necklaces that can be made from 20 beads, each of
- Combinations (Subsets) of Sets
- COMBINATIONS (SUBSETS) OF SETS 43 If there are 25 seats in the classroom, the 12 students could seat themselves in
The number of the first type is 8 (the tens digit cannot be 0 nor can it be 5). What is the number of positions in the puzzle (ignoring whether it is possible to move to the position from the initial one).
Permutations of Multisets
We first count the number of r-permutations of a multiset S whose repetition number is infinite. An alternative formulation of the theorem is: The number of r-permutations of k distinct objects, each available in unlimited supply, is equal to kr.
Having decided which eight squares the rooks will occupy (8! . possibilities), we must now also decide what color the rook is in each of the occupied squares. As we look at the bed from row 1 to row 8, we see a shift of eight colors.
PERMUTATIONS OF MULTISETS 51 Thus, the number of ways to put one red stone, three blue and four yellow in one.
Combinations of Multisets
We show that the number of these solutions is equal to the number of permutations of the multiset. In this correspondence, Xi represents the number of objects of the i type used in the r combination.
Finite Probability
If we use the reasoning in (b), we see that. 4) Let E be the case that the poker hand consists of exactly two pairs; that is, two cards of the same rank, two cards of a different rank, and one card of a different rank. Here we have to be a bit careful, as the first two ranks mentioned appear similar (unlike the full house, where there were three cards of one rank and two cards of another rank). a) Choose the two ranks that appear in the two pairs.
Exercises
The number of ways to perform these three tasks are as follows:. 5) Let E be the event that the poker hand contains at least one Ace. As we see in the calculation in (5), our subtraction principle becomes in terms of probability.
In how many ways can six indistinguishable stones be placed on a 6 by 6 board so that no two stones can attack each other. In how many ways can the eight heads be arranged on an 8 by 8 chessboard so that no two heads can attack each other.
How many permutations are there of the letters in the words (a) TRISKAIDEKAPHOBIA (fear of the number 13). If one of the types of bagels is Sesame, what is the probability that your selection contains at least three bagels?
Chapter 3
The Pigeonhole Principle
- Pigeonhole Principle: Simple Form
- PIGEONHOLE PRINCIPLE: SIMPLE FORM 71
- PIGEONHOLE PRINCIPLE: STRONG FORM 73 To show this, we consider the n integers
- Pigeonhole Principle: Strong Form
- PIGEONHOLE PRINCIPLE: STRONG FORM 75 The connection between the assertion in Corollary 2 and this averaging prin-
- A THEOREM OF RAMSEY 77 either their heights are increasing or their heights are decreasing. It is instructive to
- A Theorem of Ramsey
- A THEOREM OF RAMSEY 79 or there is a blue Kn. The existence of either a red Km or a blue Kn is guaranteed,
- A THEOREM OF RAMSEY
- Exercises
- Chapter 4
Also note that the conclusion of the dovecote principle cannot be guaranteed if there are only n (or fewer) objects. This shows that Ramsey's theorem is a generalization of the strong form of the dovecote principle.
Generating Permutations and (om bi nations
Generati ng Perm utations
To generate the permutations {I, 2, .. n} in the manner just described, we must first generate the permutations {I, 2, . We then show how permutations {I, 2, .. n} can be generated in this way in the same order as above.
way to do this is to choose an integer at random from A (so that each of the integers in A. The disadvantage of this algorithm is that the position of each integer in the permutation is not known until the very end; only the relative positions of the integers remain fixed throughout the algorithm.
We now seek an algorithm that generates all 2n combinations of S, that is, all 2n subsets of S. The resulting list must contain all subsets of S (and only subsets of S) without duplicates.
The ordering of the n-tuples of Os and Is produced by the base 2 generation scheme is called the lexicographic ordering of n-tuples. For this reason, the lexicographic ordering on n-tuples of Os and Is, when viewed as an ordering of the subsets of {Xn-l,.
GENERATING COMBINATIONS 103 Notice how, in this ordering, all the subsets that do not contain 4 come before those
This is exactly the characteristic we are looking for when generating n-tuples Os and Is. An n-cube unit (I-cube is a distance, 2-cube is a square, 3-cube is a regular cube) has 2n corners whose coordinates are 2n n-tuples of Os and Is.
GENERATING COMBINATIONS 105 every corner exactly once. Any such walk (or the resulting list of n-tuples) is called
The general inductive definition of reflected gray code of ·order n is as follows:. To do this, we must first construct the reflected Gray code of order 4, and so on.
GENERATING COMBINATIONS 107
The lexicographic order corresponds to the integers from 0 to 2n - 1 in base 2, and we can think of the mirrored order of the Gray code by arranging the binary n-tuples in a certain order from 0 to 2n - 1. We can say explicitly in which place this binary n-tuple is located in the list in Gray code order.
Generating r-Subsets
Now let ala2'" a r be any r-subset except the last one, and we determine k as stated in the theorem. We conclude by determining the position of each r-subset in the lexicographic order of r-subsets {I, 2 , .. in the lexicographic to the order of the r-subsets {I, 2,.
A partial order R on a set X is a total order, provided that every pair of elements of X is similar. 19This is one of the reasons why we must be careful to distinguish between the abstract symbol for a partial order and the standard relation on numbers; the latter is a total order where any two numbers a and b are similar (either a :'0: b or b :'0: a), but this property does not hold for a general partial order.
Conversely, given any partition of X into non-empty parts, there is an equivalence relation on X whose equivalence classes are the parts of the partition. Then it is easy to check if this is an equivalence relation on X whose different equivalence classes are AI, A2.
Exercises
Note that two equivalence classes that have a person in common are, in fact, identical; i.e. the disjoint equivalence classes X. We need to show that the different equivalence classes are pairwise disjoint and that their union is X.
Construct the reflected Gray code of order 5 using (a) the inductive definition, and (b) using the Gray code algorithm. Determine the immediate successors of the following 9-tuples in the reflected Gray order code 9:.
By identifying subsets of the set X of n elements with n-folds Os and Is, prove that a partially ordered set (X, <;;;;) can be identified by an n-fold direct product.
Use Exercise 54 to prove that a finite partially ordered set is the intersection of all its linear extensions (see Exercise 37). Prove that R is a partial order on X and that the dimension of the partial order (X, R) is 2, assuming that iI, i2,.
Chapter 5
The Binomial Coefficients
- Pascal's Triangle
- PASCAL'S TRIANGLE 129 of Theorem 3.3.2 is discovered by adding the numbers in a row of Pascal's triangle
- The Binomial Theorem
- THE BINOMIAL THEOREM 131 Thus, the number of times the term xn-kyk occurs in the expanded product equals
- THE BINOMIAL THEOREM 133 We note that the coefficients that occur in these expansions are the numbers in the
The numbers (~) = n( n - 1)/2 in column k = 2 are the so-called triangle numbers, which are equal to the number of dots in the triangular array of dots illustrated in Figure 5.2. We get the term xn-look by choosing y in k of the n factors and x (by default) in the remaining n - k factors.

134 CHAPTER 5
A number of interesting identities can be derived by sequential differentiation and multiplication of the binomial expansion by x. We now extend the domain of definition of the numbers G) so that n can be any real number and k any integer (positive, negative or zero).
UNIMODALITY OF BINOMIAL COEFFICIENTS 139 the formula for the sum of the first n positive integers
Unimodality of Binomial Coefficients
For any real number x, let Lx J denote the largest integer less than or equal to x. Similarly, the ceiling of x is the smallest integer IX 1 greater than or equal to x.
Focusing first on a maximal chain C, since each maximal chain contains at most one subgroup in the antichain A, f3 is at most the number of maximal chains; that is, (3 ::; n!. Let Qk be the number of subgroups in the antichain A of size k such that IAI = I:~=o Qk.
THE MULTINOMIAL THEOREM 145
The number of different terms that appear in the multinomial expansion of (Xl + .. xt)n is equal to the number of nonnegative integral solutions of. Thus, the number of different ways of obtaining zk, that is, the coefficient of zk in (5.24), is equal to the number of nonnegative integral solutions of.
MORE ON PARTIALLY ORDERED SETS
More on Partially Ordered Sets
Similarly, if there is an antichain A of size s, then, since no two elements of A can belong to the same chain, X cannot be split into fewer than s chains. The set P(X) of all subsets of X can be divided into n + 1 counterchains, namely the counterchains consisting of all subsets of X of size k by k.
MORE ABOUT PARTIALLY ORDERED SETS 153 (1) The first obtained by confirming at the end, the subset obtained by adding 4. Each chain in asymmetric chain partition must contain exactly one Ln/2J subset (and exactly one r n/21 subset) ; hence the number of chains in a symmetric chain partition is equal.
Exercises
Use Theorem 5.6.1 to show that, if m and n are positive integers, then a partially ordered set of mn + 1 elements has a chain of size m + 1 or an antichain of size n+1. Use the result of the previous exercise to show that a sequence of mn + 1 real numbers either contains an increasing subsequence of m + 1 numbers or a decreasing subsequence of n + 1 numbers (see Application 9 of Section 2.2). a) Define a chain of largest size and a division of X into the smallest number of antichains.
Chapter 6
The Inclusion-Exclusion Principle and Applications
- The Inclusion-Exclusion Principle
- THE INCLUSION-EXCLUSION PRINCIPLE 163 to the right side, while if it has only the property P 2 , it contributes
- THE INCLUSION-EXCLUSION PRINCIPLE 165 Corollary 2 The number of objects of S which have at least one of the properties
- THE INCLUSION-EXCLUSION PRINCIPLE
- Combinations with Repetition
- COMBINATIONS WITH REPETITION 169 and that the number of r-combinations of a multiset with k distinct objects, each with
We want to count the number of objects in S that do not have either of the properties PI and P2. The left side of equation (6.2) counts the number of objects of 8 with none of the properties.
- Derangements
- DERANGEMENTS 173 the "word" spelled disagrees completely with the spelling of the word MADISON in
- DERANGEMENTS 175 From elementary facts about alternating infinite series, we conclude that e- 1 and
- Permutations with Forbidden Positions
- PERMUTATIONS WITH FORBIDDEN POSITIONS
- Another Forbidden Position Problem
- Mobius Inversion
- MOBIUS INVERSION 187 Equation (6.18) implies that
Thus, Dn is equal to (n - l)dn, where dn is the number of disorders in which 2 is in the first position. Tn than to directly estimate the number of ways to place n non-attacking heads in an n-by-n table with forbidden positions.