Binomial Theorem, Polynomials and Distribution Problems - Examples | MATH 180, Study notes of Mathematics

Material Type: Notes; Class: Combinatorics; Subject: Mathematics; University: University of California - Los Angeles; Term: Spring 2009;

Typology: Study notes

Pre 2010

Uploaded on 08/26/2009

koofers-user-yoq
koofers-user-yoq 🇺🇸

10 documents

1 / 11

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Lecture 6 April 10
As another application of the binomial theorem we
have the following.
For n1n
X
k=0
(1)nn
k= 0.
In other words starting with the second row and
going down if we sum along the rows alternating sign as
we go the result is 0. Given the symmetry n
k=n
nk
it trivially holds when kis odd, it is not trivial to show
that it holds when kis even.
Algebraic proof: In the binomial theorem set x=1
and y= 1 to get
0=(1+ 1)n=
n
X
k=0
(1)k1nkn
k=
n
X
k=0
1kn
k.
Combinatorial proof: First note that this is equivalent
to showing the following:
n
0+n
2+n
4+··· =n
1+n
3+n
5+···
The left hand side counts the number of subsets of
{1,2, . . . , n}with an even number of elements while
the right hand side counts the number of subsets with
an odd number of elements. To show that we have
an equal number of these two types we will use an
involution argument.
An involution on a set Xis a mapping φ:XXso
that φ(φ(x)) = x. Given an involution φthe elements
then naturally split into fixed points (elements with
φ(x) = x) or pairs (two elements x6=ywhere φ(x) = y
and φ(y) = x).
In our case our involution will act on 2[n](the set of
all subsets of {1,2, . . . , n}) and is defined for a subset
Aas follows:
φ(A) = (A\ {1}if 1 is in A,
A {1}if 1 is not in A.
In other words we take a set and if 1 is in it we re-
move it and if 1 is not in it we add it. We now make
some observations. First, for any subset Awe have
φ(φ(A)) = Aso that it is an involution. Further, there
are no fixed points since 1 must either be in or not in
a set. So we can now break the collection of subsets
into pairs {A, φ(A)}. Finally, by the involution Aand
φ(A) will differ by exactly one element so one of them
is even and one of them is odd. So we now have a way
to pair every subset with an even number of elements
with a subset with an odd number of elements. So the
number of such subsets must be equal.
We now give two identities which are useful for sim-
plifying sums of binomial coefficients.
n
0+n+ 1
1+· ·· +n+k
k=n+k+ 1
k,
and
k
k+k+ 1
k+· ·· +n
k=n+ 1
k+ 1.
To prove the first one we will count the number of
walks from (0,0) to (n+ 1, k) using right steps and up
steps in two ways.
(0,0)
(n+ 1, k)
We must make n+ 1 steps to the right and ksteps
up. So the number of ways to walk from one corner
to the other is the number of ways to choose when to
make the up steps which is
n+k+ 1
k.
We can also count the number of walks by grouping
them according to which line segment is used in the
last step to the right (in the picture above this cor-
responds to grouping according to the line segment
which intersects the dotted line). These line segments
go from (n, i) to (n+ 1, i) where i= 0, . . . , k. Once
we have crossed the line segment there is only one way
to finish the walk to the corner (straight up the side).
On the other hand the number of ways to get to (n,i)
is n+i
i. So by the rule of addition we have that the
total number of walks is
n+ 0
0+n+ 1
1+n+ 2
2+· ·· +n+k
k.
Combining these two different ways to count the paths
gives the identity.
A proof of the other result can be done similarly us-
ing the following picture (we leave it to the interested
reader to fill in the details).
(0,0)
(nk, k + 1)
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Binomial Theorem, Polynomials and Distribution Problems - Examples | MATH 180 and more Study notes Mathematics in PDF only on Docsity!

Lecture 6 – April 10

As another application of the binomial theorem we have the following.

For n ≥ 1 ∑n

k=

(−1)n

n k

In other words starting with the second row and going down if we sum along the rows alternating sign as we go the result is 0. Given the symmetry

(n k

( (^) n n−k

it trivially holds when k is odd, it is not trivial to show that it holds when k is even.

Algebraic proof: In the binomial theorem set x = − 1 and y = 1 to get

0 = (−1+1)n^ =

∑^ n

k=

(−1)k 1 n−k

n k

∑^ n

k=

1 k

n k

Combinatorial proof: First note that this is equivalent to showing the following: ( n 0

n 2

n 4

n 1

n 3

n 5

The left hand side counts the number of subsets of { 1 , 2 ,... , n} with an even number of elements while the right hand side counts the number of subsets with an odd number of elements. To show that we have an equal number of these two types we will use an involution argument. An involution on a set X is a mapping φ : X → X so that φ(φ(x)) = x. Given an involution φ the elements then naturally split into fixed points (elements with φ(x) = x) or pairs (two elements x 6 = y where φ(x) = y and φ(y) = x). In our case our involution will act on 2[n]^ (the set of all subsets of { 1 , 2 ,... , n}) and is defined for a subset A as follows:

φ(A) =

A \ { 1 } if 1 is in A, A ∪ { 1 } if 1 is not in A.

In other words we take a set and if 1 is in it we re- move it and if 1 is not in it we add it. We now make some observations. First, for any subset A we have φ(φ(A)) = A so that it is an involution. Further, there are no fixed points since 1 must either be in or not in a set. So we can now break the collection of subsets into pairs {A, φ(A)}. Finally, by the involution A and φ(A) will differ by exactly one element so one of them is even and one of them is odd. So we now have a way to pair every subset with an even number of elements with a subset with an odd number of elements. So the number of such subsets must be equal.

We now give two identities which are useful for sim- plifying sums of binomial coefficients.

( n 0

n + 1 1

n + k k

n + k + 1 k

and ( k k

k + 1 k

n k

n + 1 k + 1

To prove the first one we will count the number of walks from (0, 0) to (n + 1, k) using right steps and up steps in two ways.

(n + 1, k)

We must make n + 1 steps to the right and k steps up. So the number of ways to walk from one corner to the other is the number of ways to choose when to make the up steps which is ( n + k + 1 k

We can also count the number of walks by grouping them according to which line segment is used in the last step to the right (in the picture above this cor- responds to grouping according to the line segment which intersects the dotted line). These line segments go from (n, i) to (n + 1, i) where i = 0,... , k. Once we have crossed the line segment there is only one way to finish the walk to the corner (straight up the side). On the other hand the number of ways to get to (n, i) is

(n+i i

. So by the rule of addition we have that the total number of walks is ( n + 0 0

n + 1 1

n + 2 2

n + k k

Combining these two different ways to count the paths gives the identity. A proof of the other result can be done similarly us- ing the following picture (we leave it to the interested reader to fill in the details).

(n − k, k + 1)

These identities can also be proved by using

(n k

n− 1 k− 1

(n− 1 k

. For example, we have the following. ( n + 1 k + 1

n k

n k + 1

n k

n − 1 k

n − 1 k + 1

n k

n− 1 k

k+ k

k+ k+

n k

n− 1 k

k+ k

k k

When I was taught these identities they were called the “hockey stick” identities. This name comes from the pattern that they form in Pascal’s triangle. For instance we have that

3

(shown below in blue) is the ( 2 2

2

(shown below in red). ( 0 0

0

1

0

1

2

0

1

2

3

0

1

2

3

4

0

1

2

3

4

5

0

1

2

3

4

5

6

The other identity corresponds to looking at the mirror image of Pascal’s triangle.

We now give an application of the hockey stick iden- tity.

∑^ n

i=

i^2 =

n(n + 1)(2n + 1) 6

In the first lecture we saw how to add up the sum of i by counting dots in two different ways. Here we want to sum up i^2 , the problem is that we don’t have an easy method to do that. We do have an easy method to add up the binomial coefficients, so if we can rewrite i^2 in terms of binomial coefficients then we can easily answer this question. So consider the following.

i^2 = 2

i(i − 1) 2

  • i = 2

i 2

i 1

(The ability to rewrite i^2 as a combination of binomial coefficients can also be used for any other polynomial expression of i. The trick is to find the coefficients involved. For the case of polynomials of the form i` we have that the coefficient of

(i k

is k!

{ `

k }^ where^ {^

` k }

are the Stirling numbers of the second kind, which we will discuss in a later lecture.) Now using this new way to write i^2 we have

∑^ n

i=

i^2 =

∑^ n

i=

i 2

i 1

∑^ n

i=

i 2

∑^ n

i=

i 1

n + 1 3

n + 1 2

(n + 1)n(n − 1) 6

(n + 1)n 2 = (n + 1)n 6

2(n − 1) + 3

(n + 1)n(2n + 1) 6

The only difficult step now is going from the second to the third line, which is done using the hockey stick identity.

There is a more general form of the binomial the- orem known as the multinomial theorem (“multino- mial” referring to many variables as compared to “bi- nomial” which refers to two). It states

(x 1 + x 2 + · · · + xk)n

=

n 1 +n 2 +···+nk =n n 1 ≥ 0 ,n 2 ≥ 0 ,...,nk ≥ 0

n n 1 , n 2 ,... , nk

xn 11 xn 22 · · · xn kk ,

where ( n n 1 , n 2 ,... , nk

n! n 1 !n 2! · · · nk!

is the multinomial coefficient we have seen in previous lectures.

Returning to the binomial theorem, we have that

(1 + x)n^ =

n 0

n 1

x + · · · +

n n

xn.

In particular for( n fixed all of the binomial coefficients n k

are “stored” as coefficients inside of the function f (x) = (1+x)n. In general given any sequence of num- bers a 0 , a 1 , a 2 ,... (possibly infinitely many) we can store these as coefficients of a function which we call the generating function as follows

g(x) = a 0 + a 1 x + a 2 x^2 + · · ·.

(There are different ways that we can store the se- quence as coefficients leading to different classes of generating functions. This method is what is known as an ordinary generating function, in a later lecture

with each gi a sum of some power of xs, i.e.,

gi(x) =

`

xq

i` .

Then the coefficient of xr^ in g(x) is the number of ways to place r balls into k bins so that in the ith bin the number of balls is qifor some. (The idea is that the term gi(x) tells you the restrictions about the kind of balls that can be placed into that bin. It is important that the coefficients of the gi(x) are all 1’s.) We can also start with a balls and bins problem and translate it into finding the coefficient of some appropriate polynomial.

Example: Translate the following problem into finding a coefficient of some function: “How many ways are there to put 12 balls into four bins so that the first two bins have between 2 and 5 balls, the third bin has at least 3 balls and the last bin has an odd number of balls?”

Solution: Since there will be 12 balls we will be look- ing for the coefficient of x^12. Now let us translate the condition on each bin. For the first two bins there are between 2 and 5 balls so

g 1 (x) = g 2 (x) = x^2 + x^3 + x^4 + x^5

(remember, the powers list the number of balls that can be put in the bin). For the third bin we have to have at least 3 balls so

g 3 (x) = x^3 + x^4 + · · ·.

We could also use the function

g′ 3 (x) = x^3 + x^4 + · · · + x^12 ,

the difference being that we stop and have a poly- nomial instead of an infinite series. The reason we can do this is that we are only interested in the co- efficient of x^12 , anything which will not contribute to that coefficient can be dropped without changing the answer. However by keeping the series we can use the same function to answer the question for any arbitrary number of balls and so the first option is more general. Finally for the last bin we have

g 4 (x) = x + x^3 + x^5 + · · ·.

Putting it altogether we are trying to find the coeffi- cient of x^12 for the function

(x^2 + x^3 + x^4 + x^5 )^2 (x^3 + x^4 + · · · )(x + x^3 + x^5 + · · · ).

Of course translating one problem to another is only good if we have a technique to solve the second prob- lem. So our next natural step is to find ways to deter- mine the coefficient of functions of this type. To help us do this we will make use of the following identities.

(1 + x)n^ =

∑^ n

k=

n k

xk

(1 − xm)n^ =

∑^ n

k=

(−1)k

n k

xmk

1 − xm+ 1 − x

= 1 + x + x^2 + · · · + xm

1 − x

= 1 + x + x^2 + · · · (for |x| < 1)

(1 − x)n^

k≥ 0

n − 1 + k k

xk

The first two are simple applications of the binomial theorem. The third is easily verifiable by multiplying both sides by (1 − x) and simplifying. The fourth one is a well known sum and can be considered the limiting case of the third one. (Note that as a function of x, i.e., analytically, this makes sense only when |x| < 1. Formally there is no restriction on x, this is because formally xk^ is acting as a placeholder.) To see why the last one holds we note that this is

1 (1 − x)n^

1 − x

1 − x

︸ ︷︷ 1 −^ x︸ n times = (1 + x + x^2 + · · · ) · · · (1 + x + x^2 + · · · ) ︸ ︷︷ ︸ n times

Translating this into a balls and bins problem, the co- efficient of xk^ would correspond to the number of so- lutions of e 1 + e 2 + · · · + en = k

where each ei ≥ 0. We have already solved this prob- lem using bars and stars, namely this can be done in( n−1+k k

ways, giving us the desired result.

We will need one more tool, and that is a way to multiply functions. We have the following which is a simple exercise in expanding and grouping coefficients.

Given

f (x) = a 0 + a 1 x + a 2 x^2 + · · · , g(x) = b 0 + b 1 x + b 2 x^2 + · · ·.

Then

f (x)g(x) = a 0 b 0 + (a 0 b 1 + a 1 b 0 )x + · · ·

  • (a 0 bk + a 1 bk− 1 + · · · + akb 0 )xk^ + · · ·.

The key is that the coefficient of xk^ is found by combining elements (aixi)(bk−ixk−^1 ) for i = 0,... , k.

We now show how to use these various rules to solve a combinatorial problem.

Example: How many ways are there to put 25 balls into 7 boxes so that each box has between 2 and 6 balls?

Solution: First we translate this into a polynomial problem. We are looking for 25 balls so we will be looking for a coefficient of x^25. The constraint on each box is the same, namely the between 2 and 6 balls so that the function we will be considering is

g(x) = (x^2 + x^3 + x^4 + x^5 + x^6 )^7 = x^14 (1 + x + x^2 + x^3 + x^4 )^7.

Here we pulled out an x^2 out of the inside which then becomes x^14 in front. Now since we are looking for the coefficient of x^25 and we have a factor of x^14 in front, our problem is equivalent to finding the coefficient of x^11 in

g′(x) = (1 + x + x^2 + x^3 + x^4 )^7.

(Combinatorially, this is also what we would do. Namely distribute two balls into each bin, fourteen balls in total, and then decide how to deal with the remaining 11.) Using our identities we have

g′(x) = (1 + x + x^2 + x^3 + x^4 )^7

1 − x^5 1 − x

= (1 − x^5 )^7 ·

(1 − x)^7

x^5 +

x^10 +· · ·

k≥ 0

6+k k

xk

Finally, we use the rule for multiplying functions to- gether to find the coefficient of x^11. In particular note that in the first part of the product only three terms can be used, as all the rest will not contribute to the coefficient of x^11. So multiplying we have that the coefficient to x^11 is ( 7 0

This can also be done combinatorially. The first term counts the numbers without restriction. The second term then takes off the exceptional cases, but it takes off too much and so the third term is there to add it back in.

Lecture 8 – April 15

We can use the rule for multiplying functions to- gether to prove various results. For instance, let f (x) = (1 + x)m^ and g(x) = (1 + x)n, then f (x)g(x) = (1 + x)m+n. We now compute the coefficient of xr^ of f (x)g(x) in two different ways to get

∑^ r

k=

m k

n r − k

m + n r

The left hand side follows by using the rule of multi- plying f (x) and g(x) while the right hand side is the binomial theorem for f (x)g(x).

We turn to a problem of finding a generating func- tion.

Example: Show that the generating function for the number of integer solutions to

e 1 + e 2 + e 3 + e 4 = n

with 0 ≤ e 1 ≤ e 2 ≤ e 3 ≤ e 4 is

f (x) =

(1 − x)(1 − x^2 )(1 − x^3 )(1 − x^4 )

Solution: First note that we can rewrite the function f (x) as

f (x) = (1 + x + x^2 + x^3 + · · · )(1 + x^2 + x^4 + x^6 + · · · ) × (1 + x^3 + x^6 + x^9 + · · · )(1 + x^4 + x^8 + x^12 + · · · ).

Note that translating this back into a balls and bins problem this says that we have four bins. In the first bin we have any number of balls, in the second bin we have a multiple of two number of balls, in the third bin we have a multiple of three number of balls and in the fourth bin we have a multiple of four number of balls. In other words the generating function f (x) counts the number of solutions to

f 1 + 2f 2 + 3f 3 + 4f 4 = n

with f 1 , f 2 , f 3 , f 4 ≥ 0. We now need to show that these two problems have the same number of solutions. To do this, let us start with a solution of e 1 +e 2 +e 3 +e 4 = n and pictorially represent our solution by putting four row of ∗s with e 4 stars in the first row, e 3 stars in the second row, e 2 stars in the third row and e 1 stars in the fourth row. Finally, let f 4 be the number of columns with four ∗s, f 3 the number of columns with three ∗s, f 2 the number of columns with two ∗s and f 1 the number of columns with one ∗. This gives a solution to f 1 + 2f 2 + 3f 3 + 4f 4 = n. This gives a one-to-one correspondence between solutions to the two different

We can do variations on this. For instance we can look at partitions of n where no part is repeated. In other words we want to restrict our partitions so that ek = 0 or 1 for each k. If we denote these partitions by pd(n) then ∑

n≥ 0

pd(n)xn^ = (1 + x)(1 + x^2 ) · · · (1 + xk) · · ·

k≥ 1

(1 + xk)

Similarly we can count partitions with each part odd. In other words we want to restrict out parti- tions so that e 2 k = 0 for each k. If we denote these partitions by po(n) then it is easy to modify our con- struction for p(n) to get

n≥ 0

po(n) =

k≥ 1

1 − x^2 k−^1

We can combine these two generating functions to derive a remarkable result.

For n ≥ 1 we have pd(n) = po(n).

Remarkably, we do not know in general what pd(n) or po(n) is, nevertheless we do know that they are equal! As an example of this we have that po(6) = 4 because of the partitions

1 + 1 + 1 + 1 + 1 + 1, 1 + 1 + 1 + 3, 1 + 5, 3 + 3,

while pd(6) = 4 because of the partitions

1 + 2 + 3, 1 + 5, 2 + 4, 6

It suffices for us to show that the two generating functions are identical. If the functions are the same then the coefficients must be the same giving us the desired result. So we have that ∑

n≥ 0

pd(n)xn^ =

k≥ 1

(1 + xk)

k≥ 1

1 − x^2 k 1 − xk

1 − x^2 1 − x

1 − x^4 1 − x^2

1 − x^6 1 − x^3

1 − x^8 1 − x^3

1 − x

1 − x^3

1 − x^5

k≥ 1

1 − x^2 k−^1

n≥ 0

po(n)xn.

We can also give a bijective proof. To do this we need to give a way to take a partition with odd parts and produce a (unique) partition with distinct parts, and vice versa. This can be done by repeatedly apply- ing the following rule until it cannot be done anymore:

  • With the current partition, if any two parts are equal combine them into a single part.

For example for the partition

1 + 1 + 1 + 1 + 1 + 1 → 2 + 1 + 1 + 1 + 1 → 2 + 2 + 1 + 1 → 4 + 1 + 1 → 4 + 2

This rule takes a partition with odd parts and produces a partition with distinct parts. To go in the opposite direction this cane be done by applying the following rule until it cannot be done anymore:

  • With the current partition, if any part is even then split it into two equal parts.

For example for the partition

3 + 4 + 6 → 2 + 2 + 3 + 6 → 1 + 1 + 2 + 3 + 6 → 1 + 1 + 1 + 1 + 3 + 6 → 1 + 1 + 1 + 1 + 3 + 3 + 3

These two rules give a bijective relationship between partitions with an odd number of parts and partitions with distinct parts.

Lecture 9 – April 17

We can visually represent a partition as a series of rows of dots (much like we did in the example in the previous lecture). This representation is known as a Ferrer’s diagram. The number of dots in each row is the size of the part and we arrange the rows in weakly decreasing order. The partition 4 + 3 + 1 + 1 would be represented by the following diagram.

We can use Ferrer’s diagrams to gain insight into properties of partitions. For instance one simple op- eration that we can do is to take the transpose (or the conjugate) of the partition. This is done by “flip- ping” across the line in the picture below, so that the columns become rows and rows become columns.

Since we do not change the number of dots by taking the transpose this takes a partition and makes a new

partition. So in this case we get the new partition 4 + 2 + 2 + 1. Note that if we take the transpose of the transpose that we get back the original diagram. There are some partitions such that the transpose of the partition gives back the partition, such partitions are called self con- jugate. For instance there are two self conjugate par- titions for n = 8, namely 4 + 2 + 1 + 1 and 3 + 3 + 2. A famous result says that the number of self conjugate partitions is equal to the number of partitions with distinct odd parts. So for example for n = 8 there are two partitions with distinct odd parts, namely 7 + 1 and 5 + 3. One proof of this relationship is based on using Ferrer’s diagrams. We will not fill in all of the details here but give the following “hint” for n = 8.

Also note that when we take the transposition that the number of rows becomes the size of the largest part in the transposition while the size of the largest part becomes the number of rows. So mapping a partition to its transpose establishes the following fact.

There is a one-to-one correspondence between the number of partitions of n into exactly m parts and the number of partitions of n into parts of size at most m with at least one part of size m.

It is easy to count partitions with parts of size at most m with at least one part of size m. In particular if we let

∣ n m

∣ (^) denote the number of partitions of n into

exactly m parts then we have (using the techniques from the last lecture)

n≥ 0

n m

∣ x

n (^) = x m (1 − x)(1 − x^2 ) · · · (1 − xm)

Another object associated with a Ferrer’s diagram is the Durfee square which is the largest square of dots that is in the upper left corner of the Ferrer’s diagram. For example for the partition 6 + 6 + 4 + 3 + 2 + 1 + 1 we have a 3×3 Durfee square as shown in the following picture.

It should be noted that every partition can be de- composed into three parts. Namely a Durfee square

and then two partitions, one on the right of the Durfee square and one below the Durfee square as illustrated below.

i × i square

partition with at most i parts

partition withparts at most

i

If we group partitions according to the size of the largest Durfee square and then use generating func- tions for partitions with at most i parts and partitions with parts at most i (which by transposition are the same generating function) we get the following iden- tity:

n≥ 0

p(n)xn^ =

n≥ 0

xn

2 ︸︷︷︸ square

∏^ n

k=

1 −xi ︸ ︷︷ ︸ partition^ left

∏^ n

k=

1 −xi ︸ ︷︷ ︸ partition^ bottom

n≥ 0

xn

2

(1 − x)^2 (1 − x^2 )^2 · · · (1 − xn)^2

There are a lot more fascinating and interesting things that we can talk about in regards to partitions. We finish our discussion with the following. ∏

n≥ 1

(1 − xi) = 1 − z − z^2 + z^5 + z^7 − z^12 − z^15 + · · ·

−∞ where again we have restriction on the ni. But now after we have chosen our terms we still need to arrange (or order) them. From a previous lecture if we have n 1 objects of type 1, n 2 objects of type 2, and so on then the number of ways to arrange them is

n! n 1 !n 2! · · · nk!

so now for each solution to n 1 + n 2 + · · · + nk = n this is what will be contributed to the count for the number of arrangements. The exponential function is perfectly set up to count the number of exponential functions. To see this consider, ( ∑

`∈S 1

x!

`∈S 2

x!

`∈Sk

x!

where Si is the possible values for ni. Then a typical product will be of the form

xn^1 n 1!

xn^2 n 2!

xnk nk!

if n 1 +n 2 +· · ·+nk = n then the contribution to xn/n! is n! n 1 !n 2! · · · nk!

xn n!

the number of arrangements, just like we wanted!

Let us look at two related problems to compare the differences of the two types of generating functions.

Example: Find a generating function which counts the number of ways to pick n digits from 0s, 1s and 2s so that there is at least one 0 chosen and an odd number of 1s.

Solution: Using techniques from previous lectures we have that the (ordinary) generating function is

(x + x^2 + x^3 + · · · )(x + x^3 + x^5 + · · · )(1+ x + x^2 + · · · )

= x 1 − x

x 1 − x^2

1 − x

x^2 (1 − x)^3 (1 + x)

Example: Find a generating function which counts the number of ternary sequences (sequences formed using the digits 0, 1 and 2) of length n with at least one 0 and an odd number of 1s.

Solution: This problem is related to the previous, except that after we pick out which digits we will be using we still need to arrange the digits. So we will use an exponential generating function to count these. In our case we have

( x+

x^2 2!

x^3 3!

x+

x^3 3!

x^5 5!

1+x+

x^2 2!

= (ex^ − 1)

( (^) ex^ − e−x 2

ex^ =

(e^3 x^ − e^2 x^ − ex^ − 1).

Note that the approach is nearly identical for both problems, the only difference in the (initial) setup for the generating functions is the introduction of the fac- torial terms. So the same techniques and skills that we learned in setting up problems before still holds. The only real trick is to decide when to use an expo- nential generating function and when not to use it. In the end it boils down (for now) to whether or not we need to account for ordering in what we choose. If we don’t then go with an ordinary generating function, if we do go with an exponential generating function.

Lecture 10 – April 20

In the last lecture we saw how to set up an expo- nential generating function to solve an arrangement problem. As with ordinary generating functions, if we want to use exponential generating functions we need to be able to find coefficients of the functions that we set up. To do this we list some identities.

ex^ =

∑^ ∞

k=

xk k!

e`x^ =

∑^ ∞

k=

`k^

xk k!

ex^ + e−x 2

x^2 2!

x^4 4!

x^6 6!

ex^ − e−x 2

= x + x^3 3!

x^5 5!

x^7 7!

k≥n

xk k!

= ex^ − 1 − x − x^2 2!

x^3 3!

xn−^1 (n − 1)!

Example: Find the number of ternary sequences (se- quences formed using the digits 0, 1 and 2) of length n with at least one 0 and an odd number of 1s.

Solution: From last time we know that the exponen- tial generating function g(x) which counts the number of ternary sequences is

g(x) =

(e^3 x^ − e^2 x^ − ex^ − 1)

n≥ 0

3 n^

xn n!

n≥ 0

2 n^

xn n!

n≥ 0

xn n!

n≥ 1

3 n^ − 2 n^ − 1

) (^) xn n!

So reading off the coefficient of xn/n! we have that the number of such solutions is (3n^ − 2 n^ − 1)/2 for n ≥ 1 and 0 for n = 0.

Example: Find the exponential generating function where the nth coefficient counts the number of n letter words which can be formed using letters from the word “BOOKKEEPER”.

Solution: We will use an exponential generating func- tion since we are interested in counting the number of words and the arrangement of letters in words gives different words. Since order is important we will go with an exponential generating function. We group by letters. There are 3 Es, 2 Ks and Os and 1 B, P and R. So putting this together the desired exponential gen- erating function is

f (x) =

1 + x +

x^2 2!

x^3 3!

1 + x +

x^2 2!

1 + x

= 1 + 6x + 33

x^2 2!

x^3 3!

x^4 4!

x^5 5!

  • 11130

x^6 6!

x^7 7!

x^8 8!

  • 151200

x^9 9!

x^10 10!

(The last step is done by multiplying the polynomial out, letting the computer do all of the heavy lifting. So we can read off the coefficients and see, for example, that there are 34020 words of length 7 that can be formed using the letters from BOOKKEEPER.)

Example: How many ways are there to place n dis- tinct people into three different rooms with at least one person in each room?

Solution: This does not look like an arrangement problem, so we might not automatically think of using exponential generating functions. However, we previ- ously saw that the number of ways of arranging n 1 objects of type 1, n 2 objects of type 2,.. ., and nk objects of type k is the same as the number of ways to distribute n distinct objects into k bins so that bin 1 gets n 1 objects, bin 2 gets n 2 objects,.. ., and bin k gets nk objects. So this problem is perfect for exponential generating functions. In particular, since there are three room we can set this up as n 1 + n 2 + n 3 = n where ni are the number people in room i. Since each room must have at least one person we have that ni ≥ 1. So the exponential generating function is

h(x) =

x + x^2 2!

x^3 3!

x^4 4!

ex^ − 1

= e^3 x^ − 3 e^2 x^ + 3ex^ − 1

n≥ 0

3 n^

xn n!

n≥ 0

2 n^

xn n!

n≥ 0

xn n!

n≥ 1

3 n^ − 3 · 2 n^ + 3

xn.

Reading off the coefficients we see that the answer to our question with n people is 3n^ − 2 · 2 n^ + 3. In a later lecture we will see an alternative way to derive this expression using the principle of inclusion-exclusion.