MAT5107 : Combinatorial Enumeration Course Notes
Total Page:16
File Type:pdf, Size:1020Kb
MAT5107 : Combinatorial Enumeration Course Notes (this version: December 2018) Mike Newman These notes are intended for the course MAT5107. They somewhat follow approaches in the two (ex- cellent!) books generatingfunctionology by Herbert Wilf [2] and Analytic Combinatorics by Phillipe Flajolet and Robert Sedgewick [1]. Both of these are available in relatively inexpensive print versions, as well as free downloadable .pdf files. W: https://www.math.upenn.edu/~wilf/DownldGF.html F&S: http://algo.inria.fr/flajolet/Publications/AnaCombi/anacombi.html Both of these books are highly recommended and both could be considered unofficial textbooks for the course (and both are probably not explicitly cited as much as they should be in these notes). The origin of these notes traces back to old course notes scribed by students in a course given by Jason and/or Daniel. I typically cover most of the material in these notes during one course. Wilf's book covers more than a course's worth of material; Flajolet and Sedgewick cover much more. These notes are available on my webpage. Please don't post them elsewhere. Feel free to share the link; the current url is http://web5.uottawa.ca/mnewman/notes/. Despite my best efforts to eliminate typos, there \may" be some that remain. Please let me know if you find any mistakes, big or small. Thanks to those who have pointed out typos in the past! References [1] Philippe Flajolet and Robert Sedgewick. Analytic Combinatorics. Cambridge University Press, Cambridge, 2009. [2] Herbert S. Wilf. generatingfunctionology. A K Peters, Ltd., Wellesley, MA, third edition, 2006. ∗ These notes are intended for students in mike's MAT5107. For other uses please say \hi" to [email protected]. MAT5107 : Combinatorial Enumeration Mike Newman, December 2018 1. generating functions basic ideas and setup Combinatorial enumeration is about counting combinatorial (discrete) structures such as sequences, permutations, graphs, polynomials over finite fields, and partitions. We start with a set A of objects (graphs, permutations, etc.), as well as a function ! : A! N that measure the \size" of an object. The exact meaning of \size" depends on the objects and how we wish to treat them. Then we set An to be the pre-image of n and an = jAnj; that is An is the set of objects of size n, and an is the number of such objects. The sequence a0; a1; a2; ··· ; an; ··· is an answer to the question \How many objects are there of size n?" We might have an explicit formula for the an, we might have an asymptotic formula that is close for large n, we might only know a relation with some other sequence. In this course we will be dealing with both exact enumeration and asymptotic enumeration. For example, let an be the number of permutationsp of n elements. Then an = n! gives an exact answer. n Using Stirling's formula, we have an ∼ 2πn(n=e) , which gives an asymptotic expression for an. Here fn ∼ gn means fn=gn ! 1 as n ! 1. So the asymptotic expression of an gives the main order of magnitude of an. Of special interest is the fact that there are many cases where we are unable to get an exact formula for an but we can get an asymptotic one. The unifying tool is the generating function. Given a sequence of numbers (an)n≥0, its ordinary generating function (OGF) and exponential generating function (EGF) are, respectively, 2 3 X n a0 + a1x + a2x + a3x + ··· = anx n≥0 x2 x3 X xn a + a x + a + a + ··· = a 0 1 2 2 3 6 n n! n≥0 These are formal sums, so the question of convergence does not arise (for the moment!); it is just a quirky way of writing the sequence a0; a1; a2; ··· . As we will see later, ordinary generating functions are usually associated with unlabelled structures while exponential generating functions are usually associated with labelled structures (though the reasons for that might seem a little mysterious at the moment). formal power series We define a formal power series in the indeterminate x to be an expression of the form 2 X n A(x) = a0 + a1x + a2x + ··· = anx : n≥0 The coefficients an are typically integers or rational numbers; this is the most useful case for us. Formal power series form a ring, in particular if the coefficients are rational then this ring is denoted by Q[[x]]. ∗ These notes are intended for students in mike's MAT5107. For other uses please say \hi" to [email protected]. 1 The \x" that appears is not really a variable in the traditional sense; it might more properly be called an indeterminate or even a marker. It is a way of associating the numerical value an that appears as the coefficient, with the value n that appears as the exponent. In other words, you should think of a formal power series as being a strange way of representing a sequence. In fact there will come a point where it will be useful to consider a formal power series as a \function" of its variable x, but this will not alter its formal nature. Note that the exponents that appear are exactly the non-negative integers; this corresponds with the choice to start indexing our sequences at n = 0. This is a somewhat arbitrary but useful choice, motivated by the fact that the exponent usually represents the size of a discrete object, and most natural ways of measuring the size of a discrete object are as a natural number. It is elementary but still worth noticing that the letter n is not really part of A(x), it is just a dummy variable of summation. So in particular we have things like the following. X n X k−3 X i+2 anx = ak−3x = a0 + a1x + ai+2x n≥0 k≥3 i≥0 These are somewhat spurious examples, but there will be other instances where it will be useful to \re-index" a formal power series. Note that both ordinary generating functions and exponential generating functions are elements of Q[[x]]. In particular, whether a generating function is ordinary or exponential is really a question of interpretation. For instance, is the following an ordinary generating function or an exponential one? ( 2 3 P n X n 1 + x + x + x + ··· = n≥0 anx OGF with an = 1 x = 2 3 n 1 + x + 2 x + 6 x + ··· = P a x EGF with a = n! n≥0 2 6 n≥0 n n! n We use the notation [xn] F (x) to mean the coefficient of xn in F (x). So given an OGF F (x), the n corresponding sequence is exactly ([x ] F (x))n≥0. If we know F (x), then we know (implicitly at least) [xn] F (x) for every n ≥ 0, and vice versa. Note that what we typically want is not the coefficient of n x , but rather the value an. So for exponential generating functions there is a slight twist. P xn Problem 1.1. Let A(x) = n≥0 an n! be an exponential generating function. xn n Explain why an = [ n! ] A(x) = n![x ] A(x). We will sometimes commit a small but heinous abuse of notation. Namely we will write down expressions like the left-hand equation, when what we \should" write is something like the right- hand expression. n X n n X k [x ] anx = an [x ] akx = an n≥0 k≥0 We are using n for two different things: both as a dummy variable, and as an operator that extracts the coefficient of something (namely xn). So n has two meanings, in the same equation. This is clearly insane. but in fact presents no practical difficulty. The index-of-summation n has no existence outside the sum, so there is no risk of confusion with the coefficient-extractor n. So we will tolerate this. In fact it is surprisingly natural, helpful even, and you quite possibly would not have even noticed without prompting. operations on formal power series We can add or subtract formal power series in a natural way, as we might add a sequence: X n X n X n anx ± bnx = (an ± bn)x n≥0 n≥0 n≥0 2 We can also multiply formal power series (which was not an obvious operation for sequences): 0 1 0 1 n ! X n X n X X n @ anx A @ bnx A = akbn−k x n≥0 n≥0 n≥0 k=0 Note that determining the coefficient of xn in the product is a finite process. Of course this process takes longer and longer as n increases, but for each n it is finite. This means we can determine coef- ficients in the product, and thus the product is well-defined as a formal power series. We emphasize that this has nothing to do with convergence. Problem 1.2. Consider the arithmetic of Q[[x]]. • Show that addition and multiplication are commutative and associative. • Show that the additive identity is 0 + 0x + 0x2 + ··· . P n P n • Show that the unique additive inverse of n≥0 anx is n≥0(−an)x . • Show that the multiplicative identity is 1 + 0x + 0x2 + ··· . For simplicity, we often write 0 and 1 for the additive and multiplicative inverses, even though they are indeed formal power series. For that matter, we permit ourselves to omit any terms in a formal power series whose coefficients are zero; in particular all polynomials are formal power series. There remains the question of which elements of Q[[x]] have multiplicative inverses, i.e., reciprocals.