Combinatorics is the branch of mathematics which deals with finite objects or sets, and the ways in which these can be combined. Basic objects that often arise in combinatorics are, e.g., graphs and permutations. Much of combinatorics deals with the following sort of problem:
Given some set S, what is the number of elements of S?
Let us give a few examples of such counting problems; the reader will probably be able to think of several interesting variations of these.
Example 9.1 What is the number of permutations r = (r1, …, rq) of the set {1, …, q} with the property that no two numbers that differ by exactly 1 are adjacent in the permutation?
Example 9.2 Imagine a chessboard, and a set of 32 domino tiles, such that one tile is exactly large enough to cover two adjacent squares of the chessboard. In how many different ways can the 32 tiles be arranged so as to cover the entire chessboard?
Example 9.3 Given a graph G = (V, E), in how many ways can we pick a subset W of the vertex set V, with the property that no two vertices in W are adjacent in G? In other words, how many different feasible configurations exist for the hard-core model (see Example 7.1) on G?
Example 9.4 Given an integer q and a graph G = (V, E), how many different q-colorings (Example 7.3) are there for G?
In this chapter, we are interested in algorithms for solving counting problems.