# A word about basic enumeration

Reference: Combinatorial Problems and Exercises, Second Edition, Laszlo Lovasz, AMS Chelsea Publishing, Indian Edition, available Amazon India.

There is no rule which says that enumeration problems even the simplest ones, must have solutions expressible as closed formulas/formulae. Some have, of course, and one important thing to be learnt here is how to recognize such problems. Another approach, avoiding the difficulty of trying to produce a closed formula, is to look for “substitute” solutions in other forms such as formulas involving summations, recurrence relations or generating functions. A typical (but not unique or universal) technique for solving an enumeration problem, in one or more parameters, is to find a recurrence relation, deduce a formula for the generating function (the recurrence relation is usually equivalent to a differential equation involving this function) and finally, where possible, to obtain the coefficients in the Taylor expansion of the generating function.

However, it should be pointed out that, in many cases, elementary transformations of the problems may lead to another problem already solved. For example, it may be possible by such transformations to represent each element to be counted as the result of a n consecutive decisions such that there are $a_{i}$ possible choices at the ith step. The answer would then be $a_{1}a_{2} \ldots a_{n}$. This is particularly useful when each decision is independent of all the previous decisions. Finding such a situation equivalent to the given problem is usually difficult and a matter of luck combined with expressions.

Cheers
Nalin Pithwa

# Symmetric difference is associative

We want to show that : $A \triangle (B \triangle C) = (A \triangle B) \triangle C$

Part I: TPT: $LHS \subset RHS$

Proof of Part I: let $x \in LHS$

Then, $x \in A \triangle (B \triangle C)$. By definition of symmetric difference,

$x \in \{ A - (B \triangle C)\} \bigcup \{(B \triangle C) -A \}$

Hence, $x \in A$, $x \notin (B \triangle C)$, OR $x \in B \triangle C$, $x \in A$

That is, $x \notin A \bigcap (B \triangle C)$.

Hence, $x \notin A$, and $x \notin B \triangle C$

Hence, $x \notin A$ and $x \in B \bigcap C$.

Hence, $x \in (B \bigcap C)-A$.

Hence, $x \in B$, $x \in C$, but $x \notin A$.

Therefore, $x \in B$, but $x \notin A \bigcap C$. —- Call this I.

Consider $y \in (A \triangle B) \triangle C$.

Therefore, $y \notin (A \triangle B) \bigcap C$.

Therefore, $y \notin C$, and $y \notin A \triangle B$

Therefore, $y \notin C$, and $y \in A \bigcap B$.

Therefore, $y \in (A \bigcap B)-C$.

Hence, $y \in A$, $y \in B$, but $y \notin C$.

That is, $y \in B$, $y \notin A \bigcap C$. Call this II.

From I and II, $LHS \subset RHS$.

Part II: TPT: $RHS \subset LHS$.

Quite simply, reversing the above steps we prove part II.

QED.

Cheers,

Nalin Pithwa

# Compilation of elementary results related to permutations and combinations: Pre RMO, RMO, IITJEE math

1. Disjunctive or Sum Rule:

If an event can occur in m ways and another event can occur in n ways and if these two events cannot occur simultaneously, then one of the two events can occur in $m+n$ ways. More generally, if $E_{i}$ ($i=1,2,\ldots,k$) are k events such that no two of them can occur at the same time, and if $E_{i}$ can occur in $n_{i}$ ways, then one of the k events can occur in $n_{1}+n_{2}+\ldots+n_{k}$ ways.

2. Sequential or Product Rule:

If an event can occur in m ways and a second event can occur in n ways, and if the number of ways the second event occurs does not depend upon how the first event occurs, then the two events can occur simultaneously in mn ways. More generally, \$if $E_{1}$ can occur in $n_{1}$, $E_{2}$ can occur in $n_{2}$ ways (no matter how $E_{1}$ occurs), $E_{3}$ can occur in $n_{3}$ ways (no matter how $E_{1}$ and $E_{2}$ occur), $\ldots$, $E_{k}$ can occur in $n_{k}$ ways (no matter how the previous $k-1$ events occur), then the k events can occur simultaneously in $n_{1}n_{2}n_{3}\ldots n_{k}$ ways.

)3. Definitions and some basic relations:

Suppose X is a collection of n distinct objects and r is a nonnegative integer less than or equal to n. An r-permutation of X is a selection of r out of the n objects but the selections are ordered.

An n-permutation of X is called a simply a permutation of X.

The number of r-permutations of a collection of n distinct objects is denoted by $P(n,r)$; this number is evaluated as follows: A member of X can be chosen to occupy the first of the r positions in n ways. After that, an object from the remaining collections of $(n-1)$ objects can be chosen to occupy the second position in $(n-1)$ ways. Notice that the number of ways of placing the second object does not depend upon how the first object was placed or chosen. Thus, by the product rule, the first two positions can be filled in $n(n-1)$ ways,….and all r positions can be filled in

$P(n,r) = n(n-1)\ldots (n-r+1) = \frac{n!}{(n-r)}!$ ways.

In particular, $P(n,n) = n!$

Note: An unordered selection of r out of the n elements of X is called an r-combination of X. In other words, any subset of X with r elements is an r-combination of X. The number of r-combinations or r-subsets of a set of n distinct objects is denoted by $n \choose r$ (read as ” n ‘choose’ r). For each r-subset of X there is a unique complementary $(n-r)$-subset, whence the important relation ${n \choose r}$ = $n \choose {n-r}$.

To evaluate $n \choose r$, note that an r-permutation of an n-set X is necessarily a permutation of some r-subset of X. Moreover, distinct r-subsets generate r-permutations each. Hence, by the sum rule:

$P(n,r)=P(r,r)+P(r,r)+\ldots + P(r,r)$

The number of terms on the right is the number of r-subsets of X. That is, $n \choose r$. Thus, $P(n,r)=P(r,r) \times {n \choose r}$=$r! \times {n \choose r}$.

The following is our summary:

1. $P(n,r) = \frac{n!}{(n-r)!}$
2. ${n \choose r}=\frac{P(n,r)}{r!}=\frac{n!}{r! (n-r)!}$=$n \choose {n-r}$

4. The Pigeonhole Principle: Basic Version:

If n pigeonholes (or mailboxes) shelter n+1 or more pigeons (or letters), at least 1 pigeonhole (or mailbox) shelters at least 2 pigeons (or letters).

5. The number of ways in which $m+n$ things can be divided into two groups containing m and n equal things respectively is given by : $\frac{(m+n)!}{m!n!}$

Note: If $m=n$, the groups are equal (and hence, indistinguishable), and in this case the number of different ways of subdivision is $\frac{(2m)!}{2!m!m!}$

6. The number of ways in which m+n+p things can be divided into three groups containing m, n, p things severally is given by: $\frac{(m+n+p)!}{m!n!p!}$

Note: If we put $m=n=p$, we obtain $\frac{(3m)!}{m!m!m !}$ but this formula regards as different all the possible orders in which the three groups can occur in any one mode of subdivision. And, since there are 3! such orders corresponding to each mode of subdivision, the number of different ways in which subdivision into three equal groups can be made in $\frac{(3m)!}{m!m!m!3!}$ ways.

7. The number of ways in which n things can be arranged amongst themselves, taking them all at a time, when p of the things are exactly alike of one kind, q of them are exactly alike of a another kind, r of them are exactly alike of a third kind, and the rest are all different is as follows: $\frac{n!}{p!q!r!}$

8. The number of permutations of n things r at a time, when such things may be repeated once, twice, thrice…up to r times in any arrangement is given by: $n^{r}$. Cute quiz: In how many ways, can 5 prizes be given away to 4 boys, when each boy is eligible for all the prizes? (Compare your answers with your friends’ answers :-))

9. The total number of ways in which it is possible to make a selection by taking some or all of n things is given by : $2^{n}-1$

10. The total number of ways in which it is possible to make a selection by taking some or all out of $p+q+r+\ldots$ things, whereof p are alike of one kind, q alike of a second kind, r alike of a third kind, and so on is given by : $(p+1)(q+1)(r+1)\ldots-1$.

Regards,

Nalin Pithwa.

# Tutorial problems. I. Symmetric and Alternating functions. RMO/IITJEE Math

Exercises:

1. Show that $(bc-ad)(ca-bd)(ab-cd)$ is symmetric with respect to a, b, c, d.
2. Show that the following expressions are cyclic with respect to a, b, c, d, taken in this order: $(a-b+c-d)^{2}$ and $(a-b)(c-d)+(b-c)(d-a)$
3. Expand the expression using $\Sigma$ notation: $(y+z-2x)(z+x-2y)(x+y-2z)$
4. Expand the expression using $\Sigma$ notation: $(x+y+z)^{2}+(y+z-x)^{2}+(z+x-y)^{2}+(x+y-z)^{2}$
5. Prove that $(\beta^{2}\gamma^{2}+\gamma^{2}\alpha^{2}+\alpha^{2}\beta^{2})(\alpha+\beta+\gamma)= \Sigma\alpha^{2}\beta^{2}+\alpha\beta\gamma\Sigma\alpha\beta$
6. Prove that $(\alpha-\beta)(\alpha-\gamma)+(\beta-\gamma)(\beta-\alpha)+(\gamma-\alpha)(\gamma-\beta)=\Sigma{\alpha^{2}}-\Sigma{\alpha}{\beta}$
7. Prove that $(\beta-\gamma)(\beta+\gamma-\alpha)+(\gamma-\alpha)(\gamma+\alpha-\beta)+(\alpha-\beta)(\alpha+\beta-\gamma)=0$
8. Prove that : $\alpha(\beta-\gamma)^{2}+\beta(\gamma-\alpha)^{2}+\gamma(\alpha-\beta)^{2}=\Sigma{\alpha^{2}}{\beta}-6\alpha\beta\gamma$
9. Prove that: $(\beta^{2}\gamma+\beta\gamma^{2}+\gamma^{2}\alpha+\gamma\alpha^{2}+\alpha^{2}\beta+\alpha\beta^{2})(\alpha+\beta+\gamma)=\Sigma{\alpha^{2}}\beta+2\Sigma{\alpha^{2}}{\beta^{2}}+2\alpha\beta\gamma\Sigma{\alpha}$
10. Prove that : $a^{2}(b+c)+b^{2}(c+a)+c^{2}(a+b)+abc(a+b+c)=\Sigma{a^{2}}.\Sigma{ab}$.
11. Prove that: $(a+b-c)(a^{2}+b^{2}-c^{2})+(b+c-a)(b^{2}+c^{2}-a^{2})+(c+a-b)(c^{2}+a^{2}-b^{2})=3\Sigma{a^{3}}-\Sigma{a^{2}{b}}$
12. Prove that: $(a^{2}+b^{2}+c^{2})(x^{2}+y^{2}+z^{2})=(ax+by+cz)^{2}+(bz-cy)^{2}+(cx-az)^{2}+(ay-bz)^{2}$
13. Prove that: $(b^{2}-ac)(c^{2}-ab)+(c^{2}-ab)(a^{2}-bc)+(a^{2}-bc)(b^{2}-ac)=-(bc+ca+ab)(a^{2}+b^{2}+c^{2}-bc-ca-ab)$
14. Prove that: $(a^{2}-bc)(b^{2}-ac)(c^{2}-ab)=abc(a^{2}+b^{2}+c^{2})-(b^{2}c^{2}+c^{2}a^{2}+a^{2}b^{2})$
15. If one of the numbers a, b, and c is the geometric mean of the other two, use the previous problem to prove the following: $abc(a^{2}+b^{2}+c^{2})=b^{2}c^{2}+c^{2}a^{2}+a^{2}b^{2}$
16. If the numbers x, y, z taken in some order or other form an AP, use problem 3 to prove that $2(x+y+z)^{2}+27xyz=9(x+y+z)(yz+zx+xy)$
17. Express $2(a-b)(a-c)+2(b-c)(b-a)+2(c-a)(c-b)$ as the sum of three squares. Hence, show that $(b-c)(c-a)+(c-a)(a-b)+(a-b)(b-c)$ is negative for all real values of a, b, c except when $a=b=c$. Hint: Put $b-c=x$, $c-a=y$, $a-b=z$, and notice that $x^{2}+y^{2}+z^{2}+2(xy+yz+zx)=(x+y+z)^{2}=0$.
18. If $x+y+z=0$, show that (i) $2yz=x^{2}-y^{2}-z^{2}$; (ii) $(y^{2}+z^{2}-x^{2})(z^{2}+z^{2}-y^{2})(x^{2}+y^{2}-z^{2})+8x^{2}y^{2}z^{2}=0$ (iii) $ax^{2}+by^{2}+cz^{2}+2fyz+2gzx+2hxy$ can be expressed in the form $px^{2}+qy^{2}+rz^{2}$; and, find p, q, r in terms of a, b, c, f, g, h.

Cheers,

Nalin Pithwa.

# Miscellaneous Questions: part I: solution to chess problem by my student RI

Some blogs away I had posted several interesting, non-trivial, yet do-able-with-some-effort problems for preRMO and RMO.

A student of mine, RI has submitted the following beautiful solution to the chess problem. I am reproducing the question for convenience of the readers:

Question:

The sixty four squares of a chess board are filled with positive integers one on each in such a way that each integer is the average of the integers on the neighbouring squares. (Two squares are neighbours if they share a common edge on vertex. Thus, a square can have 8, 5 or 3 neighbours depending on its position.) Show that all the sixty four entries are in fact equal.

Let us denote the set of all integers on the chess board by S (assume they are distinct). [Now, we can use the Well-ordering principle: every non-empty set of non-negative integers contains a least element. That is, every non-empty set S of non-negative integers contains an element a in S such that $a \leq b$ for all elements b of S}. So, also let “a” be the least element of set S here. As it is the average of the neighbouring elements, it can’t be less than each of them. But it can’t be greater than all of them also. So, all the elements of S are equal.

QED.

Three cheers for RI 🙂 🙂 🙂

Regards,

Nalin Pithwa

# Miscellaneous questions: part II: solutions to tutorial practice for preRMO and RMO

Refer the blog questions a few days before:

Question 1:

Let $a_{1}, a_{2}, \ldots, a_{10}$ be ten real numbers such that each is greater than 1 and less than 55. Prove that there are three among the given numbers which form the lengths of the sides of a triangle.

Without loss of generality, we may take $1…..call this relation (i).

Let, if possible, no three of the given numbers be the lengths of the sides of a triangle. (That is, no three satisfy the triangle inequality. Note that when we say three numbers a, b and c satisfy the triangle inequality —- it means all the following three inequalities have to hold simultaneously: $a+b>c$, $a+c>b$ and $b+c>a$). We will consider triplets $a_{i}, a_{i+1}, a_{i+2}$ and $1 \leq i \leq 8$. As these numbers do not form the lengths of the sides of a triangle, the sum of the smallest two numbers should not exceed the largest number, that is, $a_{i}+a_{i+1} \leq a_{i+2}$. Hence, we get the following set of inequalities:

$i=1$ gives $a_{1}+a_{2} \leq a_{3}$ giving $2 < a_{3}$.

$i=2$ gives $a_{2}+a_{3} \leq a_{4}$ giving $3 < a_{4}$

$i=3$ gives $a_{3}+a_{4} \leq a_{5}$ giving $5 < a_{5}$

$i=4$ gives $a_{4}+a_{5} \leq a_{6}$ giving $8 < a_{6}$

$i=5$ gives $a_{5}+a_{6} \leq a_{7}$ giving $13 < a_{7}$

$i=6$ gives $a_{6}+a_{7} \leq a_{8}$ giving $21 < a_{8}$

$i=7$ gives $a_{7}+a_{8} \leq a_{9}$ giving $34 < a_{9}$

$i=8$ gives $a_{8}+a_{9} \leq a_{10}$ giving $55

contradicting the basic hypothesis. Hence, there exists three numbers among the given numbers which form the lengths of the sides of a triangle.

Question 2:

In a collection of 1234 persons, any two persons are mutual friends or enemies. Each person has at most 3 enemies. Prove that it is possible to divide the collection into two parts such that each person has at most 1 enemy in his sub-collection.

Let C denote the collection of given 1234 persons. Let $\{ C_{1}, C_{2}\}$ be a partition of C. Let $e(C_{1})$ denote the total number of enemy pairs in $C_{1}$. Let $e(C_{2})$ denote the total number of enemy pairs in $C_{2}$.

Let $e(C_{1}, C_{2})= e(C_{1})+e(C_{2})$ denote the total number of enemy pairs corresponding to the partition $\{ C_{1}, C_{2}\}$ of C. Note $e(C_{1}, C_{2})$ is an integer greater than or equal to zero. Hence, by Well-Ordering Principle, there exists a partition having the least value of $e(C_{1}, C_{2})$.

Claim: This is “the” required partition.

Proof: If not, without loss of generality, suppose there is a person P in $C_{1}$ having at least 2 enemies in $C_{1}$. Construct a new partition $\{D_{1}, D_{2}\}$ of C as follows: $D_{1}=C_{1}-\{ P \}$ and $D_{2}=C_{2}- \{P\}$. Now, $e(D_{1}, D_{2})=e(D_{1})+e(D_{2}) \leq \{ e(C_{1})-2\} + \{ e(C_{2})+1\}=e(C_{1}, C_{2})-1$. Hence, $e(D_{1}, D_{2}) contradicting the minimality of $e(C_{1}, C_{2})$. QED.

Problem 3:

A barrel contains 2n balls, numbered 1 to 2n. Choose three balls at random, one after the other, and with the balls replaced after each draw.

What is the probability that the three element sequence obtained has the properties that the smallest element is odd and that only the smallest element, if any is repeated?

The total number of possible outcomes is $N=2n \times 2n \times 2n=8n^{3}$. To find the total number of favourable outcomes we proceed as follows:

Let a be any odd integer such that $1 \leq a \leq 2n-1$ and let us count the sequences having a as least element.

(i) There is only one sequence $(a,a,a)$ with a repeated thrice.

(ii) There are $2n-a$ sequences of the form $(a,a,b)$ with $a. For each such sequence there are three distinct permutations possible. Hence, there are in all $3(2n-a)$ sequences with a repeated twice.

iii) When $n>1$, for values of a satisfying $1 \leq a \leq (2n-3)$, sequences of the form $(a,b,c,)$ with $a are possible and the number of such sequences is $r=1+2+3+\ldots+(2n+a-1)=\frac{1}{2}(2n-a)(2n-a-1)$. For each such sequence, there are six distinct permutations possible. Hence, there are $6r=3(2n-a)(2n-a-1)$ sequences in this case.

Hence, for odd values of a between 1 and $2n-1$, the total counts of possibilities $S_{1}$, $S_{2}$, $S_{3}$ in the above cases are respectively.

$S_{1}=1+1+1+\ldots+1=n$

$S_{2}=3(1+3+5+\ldots+(2n-1))=3n^{2}$

$3(2 \times 3 + 4 \times 5 + \ldots+ (2n-2)(2n-1))=n(n-1)(4n+1)$.

Hence, the total number A of favourable outcomes is $A=S_{1}+S_{2}+S_{3}=n+3n^{2}+n(n-1)(4n+1)=4n^{3}$. Hence, the required probability is $\frac{A}{N} = \frac{4n^{3}}{8n^{3}} = \frac{1}{2}$. QED>

Cheers,

Nalin Pithwa

# Pre RMO Training: Plane geometry with combinatorics

Question 1:

There are 4 possible ways to place three distinct lines in a plane. Two of these configurations involve parallel lines, the other two do not. Draw all these possibilities including the one which encloses a region.

Question 2:

Prove that the sum of any two sides of a triangle is greater than the third side. Hint: Use the following permissible clever argument: the shortest distance joining any two distinct points is given by a straight line joining those two points.

Question 3:

There are 8 possible ways to place 4 distinct lines in a plane. Five of these configurations involve parallel lines; the other three do not. Draw all the possibilities.

Remark: Questions like 1 and 2 are at the heart of combinatorics questions in plane geometry in pre RMO and RMO.

Cheers,
Nalin Pithwa

PS: Prove the parallelogram law: $|a+b| \leq |a|+|b|$

# A Primer: Generating Functions: Part II: for RMO/INMO 2019

We shall now complicate the situation a little bit. Let us ask for the combinations of the symbols $\alpha_{1}, \alpha_{2}, \ldots, \alpha_{n}$ with repetitions of each symbol allowed once more in the combinations. For example, let there be only two symbols $\alpha_{1}, \alpha_{2}$. Let us look for combinations of the form:

$\alpha_{1}$, $\alpha_{2}$, $\alpha_{1}\alpha_{2}$, $\alpha_{1}\alpha_{1}$, $\alpha_{2}\alpha_{2}$, $\alpha_{1}\alpha_{1}\alpha_{2}$, $\alpha_{1}\alpha_{2}\alpha_{2}$, $\alpha_{1}\alpha_{1}\alpha_{2}\alpha_{2}$

where, in each combination, each symbol may occur once, twice, or not at all. The OGF for this can be constructed by reasoning as follows: the choices for $\alpha_{1}$ are not-$\alpha_{1}$, $\alpha_{1}$ once, $\alpha_{1}$ twice. This is represented by the factor $(1+\alpha_{1}t+\alpha_{1}^{2}t^{2})$. Similarly, the possible choices for $\alpha_{2}$ correspond to the factor $(1+\alpha_{2}t+\alpha_{2}^{2}t^{2})$. So, the required OGF is $(1+\alpha_{1}t+\alpha_{1}^{2}t)(1+\alpha_{2}t+\alpha_{2}^{2}t^{2})$

On expansion, this gives : $1+(\alpha_{1}+\alpha_{2})t+(\alpha_{1}\alpha_{2}+\alpha_{1}^{2}+\alpha_{2}^{2})t^{2}+(\alpha_{1}^{2}\alpha_{2}+\alpha_{1}\alpha_{2}^{2})t^{3}+(\alpha_{1}^{2}\alpha_{2}^{2})t^{4}$

Note that if we omit the term 1 (which corresponds to not choosing any $\alpha$), the other 8 terms correspond to the 8 different combinations listed in (*). Also, observe that the exponent r of the $t^{r}$ tells us that the coefficient of $t^{r}$ has the list or inventory of the r-combinations (under the required specification — in this case, with the restriction on repetitions of symbols) in it:

$\bf{Illustration}$

In the light of the foregoing discussion, let us now take up the following question again: in how many ways, can a total of 16 be obtained by rolling 4 dice once?; the contribution of each die to the total is either a “1” or a “2” or a “3” or a “4” or a “5” or a “6”. The contributions from each of the 4 dice have to be added to get the total — in this case, 16. So, if we write: $t^{1}+t^{2}+t^{3}+t^{4}+t^{5}+t^{6}$

as the factor corresponding to the first die, the factors corresponding to the other three dice are exactly the same. The product of these factors would be:

(*) $(t+t^{2}+t^{3}+t^{4}+t^{5}+t^{6})^{4}$

Each term in the expansion of this would be a power of t, and the exponent k of such a term $t^{k}$ is nothing but the total of the four contributions which went into it. The number of times a term $t^{k}$ can be obtained is exactly the number of times k can be obtained as a total on a throw of the four dice. So, if $\alpha_{k}$ is the coefficient of $t^{k}$ in the expansion, $\alpha_{16}$ is the answer for the above question. Further, since (*) simplifies to $(\frac{t(1-t^{6})}{1-t})^{4}$, it follows that the answer for the above question tallies with the coefficient specified in the following next question: calculate the coefficient of $t^{12}$ in $(\frac{(1-t^{6})}{(1-t)})^{4}$.6

Now, consider the following problem: Express the number $N(n,p)$ of ways of obtaining a total of n by rolling p dice, as a certain coefficient in a suitable product of binomial expansions in powers of t. [ this in turn, is related to the observation that the number of ways a total of 16 can be obtained by rolling 4 dice once is the same as the coefficient of $t^{12}$ in $(\frac{1-t^{6}}{1-t})^{4}$]:

So, we get that $N(n,p)=$ coefficient of $t^{n-p}$ in $(\frac{1-t^{6}}{1-t})^{p}$

Let us take an example from a graphical enumeration:

A $\it {graph}$ $G=G(V,F)$ is a set V of vertices a, b, c, …, together with a set $E=V \times V$ of $\it {edges}$ $(a,b), (a,a), (b,a), (c,b), \ldots$ If $(x,y)$ is considered the same as $(y,x)$, we say the graph is $\it{undirected}$. Otherwise, the graph is said to be $\it{directed}$, and we say ‘$(a,b)$ has a direction from a to b’. The edge $(x,x)$ is called a loop. The graph is said to be of order $|V|$.

If the edge-set E is allowed to be a multiset, that is, if an edge $(a,b)$ is allowed to occur more than once, (and, this may be called a ‘multiple edge’), we refer to the graph as a general graph.

If $\phi_{5}(n)$ and $\psi_{5}(n)$ denote the numbers of undirected (respectively, directed) loopless graphs of order 5, with n edges, none of them a multiple edge, find the series $\sum \phi_{5}(n)t^{n}$ and $\sum \psi_{5}(n)t^{n}$.

Applying our recently developed techniques to the above question, a graph of 5 specified vertices is uniquely determined once you specify which pairs of vertices are ‘joined’. Suppose we are required to consider only graphs with 4 edges. This would need four pairs of vertices to be selected out of the total of $5 \choose 2$ equal to 10 pairs that are available. So selection of pairs of vertices could be made in $10 \choose 4$ ways. Each such selection corresponds to one unique graph, with the selected pairs being considered as edges. More informally, having selected a certain pairs of vertices, imagine that the vertices are represented by dots in a diagram and join the vertices of each selected pair by a running line. Then, the “graph” becomes a “visible” object. Note that the number of graphs is just the number of selections of pairs of vertices. Hence, $\phi_{5}(4)=10 \choose 4$.

Or, one could approach this problem in a different way. Imagine that you have a complete graph on 5 vertices — the “completeness” here means that every possible pair of vertices has been joined by an edge. From the complete graph which has 10 edges, one has to choose 4 edges — any four, for that matter — in order to get a graph as required by the problem.

On the same lines for a directed graph, one has a universe of 10 by 2, that is, 29 edges to choose from, for, each pair x,y gives rise to two possible edges $(x,y)$ and $(y,x)$. Hence,

$\psi_{5}(4)=20 \choose 4$.

Thus, the counting series for labelled graphs on 5 vertices is $1 + \sum_{p=1}^{10} {10 \choose p}t^{p}$
and the counting series for directed labelled graphs on 5 vertices is
$1+ \sum_{p=1}^{20}{20 \choose p}t^{p}$.

Finally, the OGF for increasing words on an alphabet ${a,b,c,d,e}$ with $a is

$(1+at+a^{2}t^{2}+\ldots)(1+bt+b^{2}t^{2}+\ldots)(1+ct+c^{2}t^{2}+\ldots)\times (1+dt+d^{2}t^{2}+\ldots)(1+et+e^{2}t^{2}+\ldots)$

The corresponding OE is $(1+t+t^{2}+t^{3}+\ldots)^{5}$ which is nothing but $(1-t)^{-5}$ (this explains the following problem: Verify that the number of increasing words of length 10 out of the alphabet $\{a,b,c,d,e \}$ with $a is the coefficient of $t^{10}$ in $(1-t)^{-5}$ ).

We will continue this detailed discussion/exploration in the next article.

Until then aufwiedersehen,
Nalin Pithwa

# A Primer: Generating Functions: Part I : RMO/INMO 2019

GENERATING FUNCTIONS and RECURRENCE RELATIONS:

The concept of a generating function is one of the most useful and basic concepts in the theory of combinatorial enumeration. If we want to count a collection of objects that depend in some way on n objects and if the desired value is say, $\phi (n)$, then a series in powers of t such as $\sum \phi (n) t^{n}$ is called a generating function for $\phi (n)$. The generating functions arise in two different ways. One is from the investigation of recurrence relations and another is more straightforward: the generating functions arise as counting devices, different terms being specifically included to account for specific situations which we wished to count or ignore. This is a very fundamental, though difficult, technique in combinatorics. It requires considerable ingenuity for its success. We will have a look at the bare basics of such stuff.

We start here with the common knowledge:

$(1+\alpha_{1}t)(1+\alpha_{2}t)\ldots (1+\alpha_{n}t)=1+a_{1}t+a_{2}t^{2}+ \ldots + a_{n}t^{n}$….(2i) where $a_{r}=$sum of the products of the $\alpha$‘s taken r at a time. …(2ii)

Incidentally, the $a$‘s thus defined in (2ii) are called the elementary symmetric functions associated with the $a$‘s. We will re-visit these functions later.

Let us consider the algebraic identity (2i) from a combinatorial viewpoint. The explicit expansion in powers of t of the RHS of (2i) is symbolically a listing of the various combinations of the $\alpha$‘s in the following sense:

$a_{1}=\sum \alpha_{1}$ represents all the 1-combinations of the $\alpha$‘s
$a_{2}=\sum \alpha_{1}\alpha_{2}$ represents all the 2-combinations of the $\alpha$‘s
and so on.

In other words, if we want the r-combinations of the $\alpha$‘s, we have to look only at the coefficients of $t^{r}$. Since the LHS of (2i) is an expression which is easily constructed and its expansion generates the combinations in the said manner,we say that the LHS of (2i) is a Generating Function (GF) for the combinations of the $\alpha$‘s. It may happen that we are interested only in the number of combinations and not in a listing or inventory of them. Then, we need to look for only the number of terms in each coefficient above and this number will be easily obtained if we set each $\alpha$ as 1. Thus, the GF for the number of combinations is $(1+t)(1+t)(1+t)\ldots (1+t)$ n times;

and this is nothing but $(1+t)^{n}$. We already know that the expansion of this gives $n \choose r$ as the coefficient of $t^{r}$ and this tallies with the fact that the number of r-combinations of the $\alpha$‘s is $n \choose r$. Abstracting these ideas, we make the following definition:

Definition I:
The Ordinary Generating Function (OGF) for a sequence of symbolic expressions $\phi(n)$ is the series

$f(t)=\sum_{n}\phi (n)t^{n}$ …(2iii)

If $\phi (n)$ is a number which counts a certain type of combinations or permutations, the series $f(t)$ is called the Ordinary Enumeration (OE) or counting series for $\phi (n)$ for $n=1,2,\ldots$

Example 2:
The OGF for the combinations of five symbols a, b, c, d, e is $(1+at)(1+bt)(1+ct)(1+dt)(1+et)$

The OE for the same is $(1+t)^{5}$. The coefficient of $t^{4}$ in the first expression is

(*) abcd+abce+ abde+acde+bcde.

The coefficient of $t^{4}$ in the second expression is $5 \choose 4$, that is, 5 and this is the number of terms in (*).

Example 3:

The OGF for the elementary symmetric functions $a_{1}, a_{2}, \ldots$ in the symbols $\alpha_{1},\alpha_{2}, \alpha_{3}, \ldots$ is $(1+\alpha_{1}t)(1+\alpha_{2}t)(1+\alpha_{3}t)\ldots$ ….(2iv)

This is exactly the algebraic result with which we started this section.

Remark:

The fact that the series on the HRS of (2iii) is an infinite series should not bother us with questions of convergence and the like. For, throughout (combinatorics) we shall be working only in the framework of “formal power series” which we now elaborate.

*THE ALGEBRA OF FORMAL POWER SERIES*

The vector space of infinite sequences of real numbers is well-known. If $(\alpha_{k})$ and $\beta_{k}$ are two sequences, their sum is the sequence $(\alpha_{k}+\beta_{k})$, and a scalar multiple of the sequence $(\alpha_{k})$ is $(c\alpha_{k})$. We now identify the sequence $(\alpha_{k})$ with $k=0,1,2, \ldots$ with the “formal” series

$f = \sum_{k=0}^{\infty}\alpha_{k}t^{k}$….(2v)

where $t^{k}$ only means the following:

$t^{0}=1$, $t^{k}t^{l}=t^{k+l}$.

In the same way, $(\beta_{k})$, where $k=0,1,2,\ldots$ corresponds to the formal series:

$g=\sum_{k=0}^{\infty}\beta_{k}t^{k}$ and

we define: $f+g = \sum (\alpha_{k}+\beta_{k})t^{k}$, and $cf= \sum (c\alpha_{k})t^{k}$.

The set of all power series f now becomes a vector space isomorphic to the space of infinite sequences of real numbers. The zero element of this space is the series with every coefficient zero.

Now, let us define a product of two formal power series. Given f and g as above, we write $fg=\sum_{k=0}^{\infty}\gamma_{k} t^{k}$ where

$\gamma_{k}=\alpha_{0}\beta_{k}+\alpha_{1}\beta_{k-1}+\ldots + \alpha_{k}\beta_{0} = \sum (\alpha_{i}\beta_{j})$, where $i+j=k$.

The multiplication is associative, commutative, and also distributive wrt addition. (the students/readers can take up this as an appetizer exercise !!) In fact, the set of all formal power series becomes an algebra. It is called the algebra of formal power series over the real s. It is denoted by $\bf\Re[t]$, where $\bf\Re$ means the algebra of reals. We further postulate that $f=g$ in $\bf\Re[t]$ iff $\alpha_{k}=\beta_{k}$ for all $k=0,1,2,\ldots$. As we do in polynomials, we shall agree that the terms not present indicate that the coefficients are understood to be zero. The elements of $\bf\Re$ may be considered as elements of $\bf\Re[t]$. In particular, the unity 1 of $\bf\Re$ is also the unity of $\bf\Re[t]$. Also, the element $t^{n}$ with $n>0$ belongs to $\bf\Re$, it being the formal power series $\sum \alpha_{k}t^{k}$ with $\alpha_{n}=1$ and all other $\alpha$‘s zero. We now have the following important proposition which is the only tool necessary for working with formal power series as far as combinatorics is concerned:

Proposition : 2_4:
The element f of $\bf\Re[t]$ given by (2v) has an inverse in $\bf\Re[t]$ iff $\alpha_{0}$ has an inverse in $\bf\Re$.

Proof:
If $g=\sum \beta_{k}t^{k}$ is such that $fg=1$, the multiplication rule in $\bf\Re[t]$ tells us that $\alpha_{0}\beta_{0}=1$ so that $\beta_{0}$ is the inverse of $\alpha_{0}$. Hence, the “only if” part is proved.

To prove the “if” part, let $\alpha_{0}$ have an inverse $\alpha_{0}^{-1}$ in $\bf\Re$. We will show that it is possible to find $g=\sum \beta_{k}t^{k}$ in $\bf\Re[t]$ such that $fg=1$. If such a g were to exist, then the following equations should hold in order that $fg=1$, that is,

$\alpha_{0}\beta_{0}=1$
$\alpha_{0}\beta_{1}+\alpha_{1}\beta_{0}=0$
$\alpha_{0}\beta_{2}+\alpha_{1}\beta_{1}+\alpha_{2}\beta_{0}=0$
$\vdots$

So we have $\beta_{0}=\alpha_{0}^{-1}$ from the first equation. Substituting this value of $\beta_{0}$ in the second equation, we get $\beta_{1}$ in terms of the $\alpha$‘s. And, so on, by the principle of mathematical induction, all the $\beta$‘s are uniquely determined. Thus, f is invertible in $\bf\Re$. QED.

Note that it is the above proposition which justifies the notation in $\bf\Re[t]$, equalities such as

$\frac{1}{1-t}=1+t+t^{2}+t^{3}+\ldots$

The above is true because the RHS has an inverse and $(1-t)(1+t+t^{2}+t^{3}+\ldots)=1$

So, the unique inverse of $1+t+t^{2}+t^{3}+\ldots$ is $(1-t)$ and vice versa. Hence, the expansion of $\frac{1}{1-t}$ as above. Similarly, we have

$\frac{1}{1+t}=1-t+t^{2}-\ldots$
$\frac{1}{1-t^{2}}=1+t^{2}+t^{4}+\ldots$ and many other such familiar expansions.

There is a differential operator in $D$ in $\bf\Re[t]$, which behaves exactly like the differential operator of calculus.

Define: $(Df)(\alpha)=\sum_{k=0}^{\infty}(k+1)\alpha_{k+1}t^{k}$

Then, one can easily prove that $D: f \rightarrow Df$ is linear on $\bf\Re[t]$, and further
$D^{r}f(t)=\sum_{k=0}^{\infty}(k+r)(k+r-1)\ldots(k+1)\alpha_{k+r}t^{k}$ from which we get the term “Taylor-MacLaurin” expansion

$f(t)=f(0)+Df(0)+\frac{D^{2}f(0)}{2!}+ \ldots$…(2vi)

In the same manner, one can obtain, from $f(t)=\frac{1}{1-\alpha t}$, which in turn is equal to
$1+ \alpha t + \alpha^{2} t^{2}+ \alpha^{3} t^{3} + \ldots$

the result which mimics the logarithmic differentiation of calculus, viz.,

$\frac{(Df)(t)}{f(t)} = \alpha + \alpha^{2} t+ \alpha^{3}t^{2}+ \alpha^{4}t^{3}+\ldots$…(2vii)

The truth of this in $\bf\Re[t]$ is seen by multiplying the series on the RHS of (2vii) by the series for $f(t)$, and thus obtaining the series for $(Df)(t)$.

Let us re-consider generating functions now. We saw that the GF for combinations of $\alpha_{1}, \alpha_{2}, \ldots, \alpha_{n}$ is $(1+\alpha_{1}t)(1+\alpha_{2}t)\ldots(1+\alpha_{n}t)$.

Let us analyze this and find out why it works. After all, what is a combination of the symbols : $\alpha_{1}, \alpha_{2}, \ldots, \alpha_{n}$? It is the result of a decision process involving a sequence of independent decisions as we move down the list of the $\alpha$‘s. The decisions are to be made on the following questions: Do we choose $\alpha_{1}$ or not? Do we choose $\alpha_{2}$ or not? $\ldots$ Do we choose $\alpha_{n}$ or not? And, if it is an r-combination that we want, we say “yes” to r of the questions above and say “no” to the remaining. The factor $(1+\alpha_{1}t)$ in the expression (2ii) is an algebraic indication of the combinatorial fact that there are only two mutually exclusive alternatives available for us as far as the symbol $\alpha_{1}$ is concerned. Either we choose $\alpha_{1}$ or not. Choosing “$\alpha_{1}$” corresponds to picking the term $\alpha_{1}t$ and choosing “not $-\alpha_{1}$” corresponds to picking the term 1. This correspondence is justified by the fact that in the formation of products in the expression of (2iv), each term in the expansion has only one contribution from $1+\alpha_{1}t$ and that is either $1$ or $\alpha_{t}$.

The product $(1+\alpha_{1}t)(1+\alpha_{2}t)$ gives us terms corresponding to all possible choices of combinations of the symbols $\alpha_{1}$ and $\alpha_{2}$ — these are:

$1.1$ standing for the choice “not-$\alpha_{1}$” and “not-$\alpha_{2}$

$\alpha_{1}t . 1$ standing for the choice of $\alpha_{1}$ and “not-$\alpha_{2}$

$1.\alpha_{2}t$ standing for the choice of “not-$\alpha_{1}$” and $\alpha_{2}$.

$\alpha_{1}t . \alpha_{2}t$ standing for the choice of $\alpha_{1}$ and $\alpha_{2}$.

This is, in some sense, the rationale for (2iv) being the OGF for the several r-combinations of $\alpha_{1}, \alpha_{2}, \ldots, \alpha_{n}$.

We shall now complicate the situation a little bit. Let us ask for the combinations of the symbols $\alpha_{1}, \alpha_{2}, \ldots, \alpha_{n}$ with repetitions of each symbol allowed once more in the combinations.

To be discussed in the following article,

Regards,
Nalin Pithwa.

Reference:
Combinatorics, Theory and Applications, V. Krishnamurthy, East-West Press.