Generating Functions

Similar documents
Combinatorial Enumeration. Jason Z. Gao Carleton University, Ottawa, Canada

Review problems solutions

Generating Functions

and the compositional inverse when it exists is A.

Chapter Generating Functions

Partition of Integers into Distinct Summands with Upper Bounds. Partition of Integers into Even Summands. An Example

Generating Functions (Revised Edition)

Applications. More Counting Problems. Complexity of Algorithms

1 Solving Linear Recurrences

are the q-versions of n, n! and . The falling factorial is (x) k = x(x 1)(x 2)... (x k + 1).

*Generating Function Topics

CALCULUS JIA-MING (FRANK) LIOU

An Introduction to Combinatorial Species

Enumerative Combinatorics 7: Group actions

5. Analytic Combinatorics

Notes by Zvi Rosen. Thanks to Alyssa Palfreyman for supplements.

q xk y n k. , provided k < n. (This does not hold for k n.) Give a combinatorial proof of this recurrence by means of a bijective transformation.

Taylor and Maclaurin Series

Generating Functions of Partitions

1 Basic Combinatorics

Named numbres. Ngày 25 tháng 11 năm () Named numbres Ngày 25 tháng 11 năm / 7

Course : Algebraic Combinatorics

PUTNAM PROBLEMS SEQUENCES, SERIES AND RECURRENCES. Notes

Multiplying two generating functions

Notes on cycle generating functions

1 + lim. n n+1. f(x) = x + 1, x 1. and we check that f is increasing, instead. Using the quotient rule, we easily find that. 1 (x + 1) 1 x (x + 1) 2 =

Character Polynomials

Notes on generating functions in automata theory

A = A U. U [n] P(A U ). n 1. 2 k(n k). k. k=1

Ma 530 Power Series II

Basic counting techniques. Periklis A. Papakonstantinou Rutgers Business School

Power series and Taylor series

Generating Function Notes , Fall 2005, Prof. Peter Shor

The Inclusion Exclusion Principle

A196837: Ordinary Generating Functions for Sums of Powers of the First n Positive Integers

Contents. Counting Methods and Induction

DISCRETE AND ALGEBRAIC STRUCTURES

Legendre s Equation. PHYS Southern Illinois University. October 18, 2016

CSCE 222 Discrete Structures for Computing. Dr. Hyunyoung Lee

Introduction to Techniques for Counting

Sequences of Real Numbers

1. How many labeled trees are there on n vertices such that all odd numbered vertices are leaves?

Solutions to Exercises Chapter 5: The Principle of Inclusion and Exclusion

Algorithmic Approach to Counting of Certain Types m-ary Partitions


NOTES ON OCT 9, 2012

Week 9-10: Recurrence Relations and Generating Functions

INFINITE SEQUENCES AND SERIES

Groups. 3.1 Definition of a Group. Introduction. Definition 3.1 Group

Math 0230 Calculus 2 Lectures

The candidates are advised that they must always show their working, otherwise they will not be awarded full marks for their answers.

What you learned in Math 28. Rosa C. Orellana

Power series solutions for 2nd order linear ODE s (not necessarily with constant coefficients) a n z n. n=0

THE NUMBER OF INDEPENDENT DOMINATING SETS OF LABELED TREES. Changwoo Lee. 1. Introduction

3.4 Introduction to power series

Introduction to Combinatorial Mathematics

The cycle polynomial of a permutation group

Math Homework 5 Solutions

6 CARDINALITY OF SETS

Binomial Coefficient Identities/Complements

Chapter 11 - Sequences and Series

MATH 802: ENUMERATIVE COMBINATORICS ASSIGNMENT 2

n=0 xn /n!. That is almost what we have here; the difference is that the denominator is (n + 1)! in stead of n!. So we have x n+1 n=0

Economics 204 Fall 2011 Problem Set 1 Suggested Solutions

Convergence of sequences and series

Power Series Solutions We use power series to solve second order differential equations

) = nlog b ( m) ( m) log b ( ) ( ) = log a b ( ) Algebra 2 (1) Semester 2. Exponents and Logarithmic Functions

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

Derangements with an additional restriction (and zigzags)

11.10a Taylor and Maclaurin Series

Discrete Mathematics. Kishore Kothapalli

Taylor and Maclaurin Series. Copyright Cengage Learning. All rights reserved.

7 Asymptotics for Meromorphic Functions

Topics in Algorithms. 1 Generation of Basic Combinatorial Objects. Exercises. 1.1 Generation of Subsets. 1. Consider the sum:

CHAPTER 1. Relations. 1. Relations and Their Properties. Discussion

Quadratics and Other Polynomials

Catalan numbers Wonders of Science CESCI, Madurai, August

MATH39001 Generating functions. 1 Ordinary power series generating functions

Mathematical Induction Assignments

16.4. Power Series. Introduction. Prerequisites. Learning Outcomes

Series Solutions. 8.1 Taylor Polynomials

Upper Bounds for Partitions into k-th Powers Elementary Methods

Unlabeled Motzkin numbers

Notes on the Matrix-Tree theorem and Cayley s tree enumerator

Partitions, permutations and posets Péter Csikvári

MATH3283W LECTURE NOTES: WEEK 6 = 5 13, = 2 5, 1 13

Rooted tree graphs and the Butcher group: Combinatorics of elementary perturbation theory

Mathematical Induction Again

AP Calculus Chapter 9: Infinite Series

Finite-dimensional spaces. C n is the space of n-tuples x = (x 1,..., x n ) of complex numbers. It is a Hilbert space with the inner product

Quiz 3 Reminder and Midterm Results

Relations Graphical View

e x = 1 + x + x2 2! + x3 If the function f(x) can be written as a power series on an interval I, then the power series is of the form

Part IA. Numbers and Sets. Year

APPENDIX : PARTIAL FRACTIONS

Generating Functions and the Fibonacci Sequence

Mathematical Induction Again

Applications of Chromatic Polynomials Involving Stirling Numbers

Is Analysis Necessary?

Taylor Expansions with Finite Radius of Convergence Work of Robert Jentzsch, 1917

Transcription:

Semester 1, 2004

Generating functions Another means of organising enumeration. Two examples we have seen already. Example 1. Binomial coefficients. Let X = {1, 2,..., n} c k = # k-element subsets of X = ( n k). Consider F (x) = n c k x k. k=0 This is the generating function for k-element subsets of X. We can find it explicitly: n ( ) n F (x) = x k = (1 + x) n. k k=0

Example 2. Cycle types of permutations. Type a = 1 a 1 2 a 2... n an i.e. a i cycles of length i, where n i=1 a ii = n. The cycle index is the generating function for cycle types. For a permutation group G Z(G; x 1,..., x n ) = a c a x a 1 1 xa 2 2... xan n where c a = # elements in G with cycle type a.

Generating functions are defined for any sequence a = (a 1, a 2,...). We usually assume a is an infinite sequence. When a is of finite length a = (a 1, a 2,..., a n ) we can define a i = 0 for i > n. There can be many variables (as for the cycle index) but we will consider mainly one variable generating functions. Sometimes we can find the functions explicitly (as for the k-subsets) and in other cases we may only find information about their asymptotic or analytic properties.

Suppose f n is the number of objects (of a certain kind) of size n. The ordinary generating function (ogf) for these objects is f n x n n 0 and the exponential generating function (egf) for these objects is f n x n. n! n 0 These are called formal power series because we are not concerned (at least not right now) in letting x take on any particular value and we ignore (for now) questions of convergence and divergence.

Example 3. Partition function. (An ordinary generating function). p(n) = # partitions of n P (x)= 1 + n 1 p(n)x n. (Convention: p(0) = 1.) Let p k (n) = # partitions of n with exactly k (non-zero) parts. So p k (n) = 0 for k > n, and for k = 0, n 1, while p 0 (0) = 1 P k (n) = n 0 p k (n)x n the k-part partition function. Recurrences on coefficients lead to equations on the generating functions.

Exercise. Use the recursion you proved for Assignment 2 to prove that p k (n) = p k (n k) + p k 1 (n k) P k (x) = x 1 + x k P k 1(x). You can use this to find an explicit formula for P k (t).

Examples 4. Consider the all-1 sequence (1, 1, 1,...). (ogf) F (x) = 1.x n. n=0 Note (1 + x + x 2 +... + x n )(1 x) = 1 x n+1 so for x small and n (1 + x + x 2 +... + x n ) = 1 xn+1 1 x 1 1 x (egf) G(x) = F (x) = 1 1 x. n=0 1 n! xn = e x. We can use simple generating functions like these to determine more interesting/complicated ones.

For sequences (a n ) n 0 and (b n ) n 0. ogfs: A(x) = a n x n n 0 B(x) = b n x n n 0 Addition: A(x) + B(x) = n 0(a n + b n )x n, the ogf for (a n + b n ) n 0. Multiplication: A(x).B(x) = ( n ) a k b n k x n, n 0 k=0 the ogf for ( n k=0 a kb n k ) n 0.

egfs: A(x) = n 0 a n n! xn, B(x) = b n n! xn n 0 Addition: A(x) + B(x) = n 0 Multiplication: A(x).B(x) = n 0 = n 0 a n + b n x n, the egf for (a n + b n ) n 0. n! ( n 1 n! k=0 a k b n k k! (n k)! ( n k=0 ) x n ( ) n )a k b n k x n k the egf for ( n ( n ) ) k=0 k ak b n k n 0.

We can also do calculus: differentiate, take logs etc. Example 5. Derangements: d(n) = # derangements on {1, 2,..., n}. Permutations with k fixed points are derangements on the remaining n k points. For a given k there are ( n ) k) subsets of size k and hence d(n k) permutations with exactly k fixed points. Hence ( n k n! = n k=0 ( ) n d(n k). k Form the egf for the sequence (n!) n 0. F (x) = n 0 n! n! xn = x n = 1 1 x. n 0

But we also have F (x) = n 0 1 n! ( n k=0 = A(x).D(x) ( ) ) n d(n k) x n k where A(x) is the egf for (1) n 0, i.e. A(x) = e x and D(x) is the egf for ( d(n) ) n 0. Hence D(x) = F (x) A(x) = 1 1 x 1 e x = e x 1 x.

We can use this to find d(n) by expanding both sides and equating coefficients. d(n) x n 1 = n! 1 x.e x = x n ( x) n n! n 0 n 0 n 0 = ( n ) ( 1) k x n. k! n 0 So, equating coefficients: k=0 d(n) = n! n ( 1) k. k! k=0 This alternative derivation is sometimes simpler than combinatorial or Pólya-theoretic methods.

Infinite products occur and are useful the partition function P (t) = n 0 p(n)t n where p(0) = 1 (convention) and p(n) = # partitions of n. Each partition of n consists of a i parts of size i (i = 1,..., n) where each a i 0 and a 1.1 + a 2.2 +... + a n.n = n. So: p(n) = the coefficient of t n in (1 + t i + t 2i + t 3i +...). i 1

continued To simplify this product recall 1 1 x = 1 + x + x2 +... So taking x = t i, 1 + t i + t 2i +... = 1 1 t i. Hence p(n) = coeff. of t n in i 1 1 1 t i. So P (t) = i 1 1 1 t i This is a famous result going back to Euler.

continued The i th factor is 1 + t i + t 2i +... Note: coefficient of t ij is 1 and this is the number of partitions of ij with all parts of size i. The partition function P (t) is the product over all i of the (rather trivial) generating functions P i (t) = 1 + t i + t 2i +... for the partitions with all parts of size i. We can use this observation in several ways. First way: To get at p odd (n) = # partitions of n with all odd parts. We just take the P i (t) with i odd so P odd (t) = n 0 p odd (n)t n = i odd 1 1 t i

Second way: Restricting multiplicities. Suppose we only want partitions in which all parts have distinct sizes; i.e. a i parts of size i where each a i = 0 or 1 and a i i = n. Let p unequal (n) = # partitions of n with distinct parts. Then p unequal (n) is the coefficient of t n in 1 i 1. 1+t i So P unequal (t) = n 0 p unequal (n)t n = i 1(1 + t i ). You can experiment with many other restrictions e.g. all parts even, no part occurs more than k times, etc.

A Bizarre Coincidence In the expression for P unequal (t) write each 1 + t i as 1 t2i 1 t i so P unequal (t) = i 1 1 t 2i 1 t i. Every 1 t 2i in the numerator (i th term) cancels with 1 t 2i in the denominator (2i th term) and leaves P unequal (t) = i odd 1 1 t i = P odd(t). This slightly hand-waving proof is hard to believe, so here is a bijective combinatorial proof.

Take a partition λ of n into odd parts λ : a 2i 1 parts of size 2i 1. Define a new partition µ = µ(λ) depending on and determined by λ as follows. Write each positive integer (uniquely) as 2 k j where k 0 and j is odd. µ has either zero or 1 part of size 2 k j (for each k 0 and odd j), namely µ has a part of size 2 k j a j contains the term 2 k in its binary expansion.

Examples n = 7 λ : 1 + 3 + 3 a 1 = 1, a 3 = 2 So µ has 1 part of size 2 0.1 = 1 and 1 part of size 2 1.3 = 6 n = 19 λ : 1 + 3 + 3 + 3 + 3 + 3 + 3 a 1 = 1, a 3 = 6 = 2 + 4 Here µ has 1 part of size 2 0.1 = 1 and 1 part of size 2 1.3 = 6 and 1 part of size 2 2.3 = 12

Always µ = µ(λ) is a partition of n with distinct parts, and the correspondence λ µ(λ) is 1 1 and onto. Why is µ a partition of n? n = a i i by definition of λ. i odd Let a i = 2 k i 1 + 2 k i 2 +... (binary expansion). Then n = i,j 2 k i j.i = sum of sizes of parts of µ.

Why is λ µ(λ) 1 1? Suppose µ(λ) = µ(λ ) and λ has a i parts of size i, odd i. By definition of µ : µ has a part of size 2 k j 2 k occurs in binary expansion of a j (and a j ). This means a j and a j have exactly the same binary expansion, so a j = a j for all j. So λ = λ.

Why is λ µ(λ) onto? Take any partition of n into distinct parts µ. For each part 2 k j (j odd) put 2 k into a j. i.e. for each odd j, define a j = sum of all 2 k such that µ has a part of size 2 k j.

There are also generating function proofs for results where no natural combinatorial proofs are known. the number of self-complementary digraphs on 2n vertices is equal to the number of self-complementary graphs on 4n vertices. the number of self-complementary graphs on n vertices is equal to the difference between the numbers of graphs with an even number of edges and an odd number of edges on n vertices.

g n = # unlabelled graphs on n vertices c n = # connected graphs on n vertices. Consider ogf for these C(t) = n 1 c n t n, G(t) = n 0 g n t n (g 0 = 1). Each unlabelled graph on n vertices arises as a union of its connected components, say c Γ copies of each connected unlabelled graph Γ where each c Γ 0 and Γ c Γn(Γ) = n. Here n(γ) = # vertices of Γ.

So g n = the coefficient of t n in (1 + t n(γ) + t 2n(Γ) +...) Γ where the product is over all finite unlabelled graphs Γ. This product is equal to (1 + t n + t 2n +...) cn n 1 since for each n there are c n factors (1 + t n +...), one for each of the c n unlabelled connected graphs on n vertices. This function is equal to n 1 G(t) = n 1 1 (1 t n. Thus cn ) 1 (1 t n ) cn.

Remark: We can find g n (Pólya theory) and solve for the c n, one by one. Question: How might we find C(t) = n 1 c nt n from this? Or at least see an equation relating C(t) and G(t). log G(t) = n 1 c n log(1 t n ) by an extension of the properties of log. (This can be proved.)

Then using the Taylor expansion of log: log G(t) = n 1 c n log(1 t n ) = c n ( t jn j ) n 1 j 1 = 1 j ( c n (t j ) n ) j 1 n 1 = j 1 C(t j ) j Hence G(t) = exp( j 1 C(t j ) ). j

Exercises I Exercise 1: Use the recursion you proved for Assignment 2 to prove that p k (n) = p k (n k) + p k 1 (n k) P k (x) = x 1 + x k P k 1(x). Hence find an explicit formula for P k (t). Exercise 2: The Fibonacci Numbers are defined by F 0 = 1, F 1 = 1, F 2 = 2 and, for all n 2, F n = F n 1 + F n 2. (a) Find an equation satisfied by the ogf for (F n ) n 1. (b) Solve it to find the ogf.

(c) (Link with partitions.) Show that F n is the number of ordered partitions of n with all parts equal to 1 or 2. [ e.g. the ordered partitions 1 + 2 and 2 + 1 of 3 are regarded as different. ]

Exercises II Exercise 3: (Exercise 11 on p70 of Cameron s book) (a) Let s(n) be the number of sequences (x 1,..., x k ) of integers satisfying 1 x i n for all i and x i+1 2x i for i = 1,..., k 1. (The length of the sequence is not specified; in particular, the empty sequence is included.) Prove the recurrence s(n) = s(n 1) + s( n 2 ) for n 1, with s(0) = 1. Calculate a few values of s. Show that the generating function S(t) satisfies (1 t)s(t) = (1 + t)s(t 2 ).

Exercises III Exercise 3 continued: (b) Let u(n) be the number of sequences (x 1,..., x k ) of integers satisfying 1 x i n for all i and x i+1 > i j=1 x j for i = 1,..., k 1. Calculate a few values of u. Can you discover a relationship between s and u? Can you prove it?

Exercises IV Exercise 4: Let g n (m) = # labelled graphs on n vertices with m edges. Define the ogf for g n (m) by G n (x) = m 0 g n (m)x m. Recursion: Let S n,m be the set of labelled graphs on n vertices with m edges. Define a map φ from X to Y, where X = {(e, Γ) Γ S n,m+1, e E(Γ)} Y = {(e, Γ ) Γ S n,m, e E(Γ )}, by φ : (e, Γ) (e, Γ\e) where Γ\e denotes the graph Γ with the edge e removed.

Exercises V Exercise 4 continued: For example, if Γ is the triangle on vertex set {1, 2, 3}, then φ : ({1, 2}, Γ) ({1, 2}, P ) where P is the path with edges {1, 3}, and {2, 3}. (a) Prove that φ is a well-defined bijection. (b) Hence prove that (m + 1) g n (m + 1) = (( ) ) n m g n (m). 2

Exercises VI Exercise 4 continued: (c) Multiply by x m and add over all m 0 to obtain ( ) n (m+1) g n (m+1)x m = G n (x) mg n (x)x m. 2 m 0 m 1 What is this? Differentiate G n (x) with respect to x: G n(x) = m 1 mg n (m)x m 1. (d) Prove that G n(x) = ( ) n Gn(x) 2 1+x and deduce that G n (x) = (1 + x) (n 2). Can you also give a more direct proof of this result?