• No results found

Math 244: Discrete Mathematics

N/A
N/A
Protected

Academic year: 2021

Share "Math 244: Discrete Mathematics"

Copied!
79
0
0

Loading.... (view fulltext now)

Full text

(1)

Math 244: Discrete Mathematics

Cosmin Pohoata Yale University

(2)

Contents

1 Introduction to combinatorics 4 1.1 Some Basics . . . 4 1.2 Pigeonhole Principle . . . 9 1.3 Induction . . . 10 1.4 Additional Reading . . . 15 1.5 Problems . . . 15

2 The Principle of Inclusion-Exclusion 17 2.1 The Main Result: PIE . . . 18

2.2 Generalized PIE . . . 21

2.3 Rook Polynomials . . . 22

2.4 Additional Reading . . . 24

2.5 Problems . . . 24

2.6 Solutions to Selected Problems . . . 28

3 Intersecting sets and poset madness 31 3.1 The Erdos-Ko-Rado Theorem . . . 31

3.2 Sperner’s Theorem and the LYM Inequality . . . 32

3.3 Chain Decompositions and Their Applications . . . 34

3.4 Mirsky and Dilworth . . . 35

3.5 Additional Reading . . . 36

3.6 Problems . . . 37

3.7 Selected Solutions . . . 39

4 Introduction to graph theory 41 4.1 Standard definitions . . . 41

4.2 Basic (but not necessarily simple) facts . . . 43

4.3 Cayley’s theorem . . . 44

4.4 Two min-cost spanning tree algorithms . . . 45

4.5 Additional Reading . . . 47

4.6 Planar Graphs . . . 47

4.7 Testing for planarity . . . 50

4.8 Additional Reading . . . 52

4.9 Problems: Elementary Properties of Graphs . . . 53

4.10 Problems: Planar Graphs . . . 54

5 Extremal graph / Ramsey theory 56 5.1 Turan’s theorem . . . 57

5.2 Ramsey’s theorem . . . 60

5.3 Using infinite statements to prove finite ones . . . 62

5.4 A cute application: happy ending theorem . . . 63

5.5 Additional Reading . . . 64

5.6 Problems: extremal graph theory . . . 65

6 Probabilistic Method 66 6.1 The basic tools . . . 66

(3)

Contents

6.2 Using the Union Bound . . . 68

6.3 Using the Linearity of Expectation . . . 69

6.4 The Szemer´edi-Trotter theorem . . . 71

6.5 An application to additive combinatorics . . . 74

6.6 Additional Reading . . . 74

6.7 Problems: The Probabilistic Method . . . 74

(4)

1

Introduction to combinatorics

It is difficult to find a definition of combinatorics that is both concise and complete, unless we are satisfied with the statement “Combinatorics is what combinatorialists do.” —William Tutte Combinatorics is a fascinatingly broad subject. This makes it hard to classify, but a common theme is that it deals with structures that are, in some sense, finite or discrete: sets, permutations, relations, partitions, graphs, hypergraphs, incidences, etc. These simple combinatorial objects can be used to express beautiful mathematical ideas with little technical work.

The goal of Math 244 (and of these notes) is to showcase as many such ideas as possible and, along the way, to develop problem-solving techniques that have broad applications in multiple areas in (and out of) mathematics.

Combinatorial problems can take on many shapes. This semester, we focus mostly on the following three types:

• Enumeration: How many different structures of a certain type are there? • Extremal: Given a large collection of objects with various properties, how many

of these objects can I possibly choose if I want this subcollection to not have a specific property?

• Existence: Does there exist an object with some special properties?

Techniques for solving these are varied, and anything is fair game! Throughout this course we will see eminently combinatorial techniques such as the pigeonhole principle, counting through bijections, induction, inclusion-exclusion, double counting, generating functions, but also ideas from probability theory, linear algebra, and even a little topology. Combinatorics is an exciting area where simple new ideas can become so powerful that they can be felt throughout all areas of mathematics.

§1.1

Some Basics

Let us kick this off by asking (and answering) some simple questions.

Example 1.1.1

How many different ways are there to rearrange the elements of the sequence (1, 2, . . . , n)?

For example, when n = 3, we have the following options: (1, 2, 3), (1, 3, 2), (2, 3, 1), (2, 1, 3), (3, 1, 2), (3, 2, 1). Total: 6 possible rearrangements. We can try to do this as well for n = 4, n = 5, and so on, but we need to develop a way to figure out the answer in general. So we have to think! How should we actually enumerate all these elements in order to make sure we are not forgetting something?

Well, first we decide on the faith of the first new element in the rearrangement. How many choices do we have? Every element can be in pole position, so there are n options.

(5)

1.1 Some Basics

What about the second one? It cannot be the same as the first element, so n − 1 options. And so on. Once we get to the last element, the previous n − 1 have been chosen, so the last one can only be what is left (therefore 1 option). We therefore have

n · (n − 1) · . . . 2 · 1 := n! possible rearrangements.

Definition 1.1.2. A rearrangement of the elements of a certain sequence is called a permutation.

Permutations are extremely rich combinatorial objects. A lot of combinatorics can be modeled in terms of permutations and since they possess a natural group structure, they are quite useful because algebraic tools come in (e.g. representation theory). We will not pursue this direction in the course, but every now and then permutations will pop up. This is not surprising, in some sense they kind of have to. At the end of the day, a permutation of a set X is simply a bijective function from X to itself . Let’s make this precise.

Definition 1.1.3. Let X and Y be finite sets. A function f : X → Y is an assignment of values from Y to elements from X such that each element from X has precisely one assignment (and not more).

1. If the function satisfies the property that f (a) = f (b) implies a = b, then we say f is injective or one-to-one.

2. If the function satisfies the property that for all y ∈ Y , there exist an x ∈ X such that f (x) = y, then we say that f is surjective or onto.

3. If both things above happen, we say that f is a bijection from X to Y .

If X = Y = {1, . . . , n}, note that a bijection function f : {1, . . . , n} → {1, . . . , n} captures precisely the same information as a permutation of [n].

Example 1.1.4

Consider the permutation 123 → 312. “312” is known as one-line notation, or “word form”. As a function, this is simply the assignment f : {1, 2, 3} → {1, 2, 3} defined by

f (1) = 3, f (2) = 1, f (3) = 2.

The one-line notation has a cousin known as the two-line notation 1 2 3

3 1 2

 .

Hence the two notions “permutation” and “bijection” are used somewhat interchange-ably. The connection between the two perspectives is important. Functions can be combined in a natural way. For finite sets X, Y , Z, if f : X → Y and g : Y → Z are functions, one can define a new function h : X → Z by

h(x) = g(f (x)) for each x ∈ X.

(6)

1.1 Some Basics

Definition 1.1.5. The function h is called the composition of the functions g and f and is denoted by g ◦ f . We thus have

(g ◦ f )(x) = g(f (x)).

Hence permutations can also be composed in the same way. And this leads to group structure and very interesting mathematics! For now, just an example:

Example 1.1.6

Consider the permutations f and g given by 123 → 312 and 123 → 213, respectively, i.e. f =1 2 3 3 1 2  and g =1 2 3 2 1 3  . Note that g ◦ f is given by

1 2 3

3 2 1

 , which is another permutation of {1, 2, 3}.

Definition 1.1.7. The first permutation f =1 2 3

3 1 2



is a rather special: 1 gets sent to 3, 3 gets sent to 2 and 2 gets sent to 1. Such permutations are called cyclic and in some sense represent the building blocks in this world of permutations. Note that g =1 2 3

2 1 3



is not cyclic by itself, but it is made up by two smaller cycles: (12) and (3). This leads to yet another notation: g = (12)(3), the so-called cycle notation.

A remarkable fact about permutations is that every permutation of {1, . . . , n} has a unique cycle decomposition, just like every number has a unique factorization into prime numbers. This is not a coincidence!

Let’s do some more counting. How do we show that two sets X and Y have the same size? We pair elements from X with elemens from Y . In other words, if f : X → Y is a bijection, then |X| = |Y |. This very simple fact can be quite powerful, if used correctly.

Proposition 1.1.8

The number of all subsets of {1, . . . , n} is 2n.

Proof. Let’s create a bijection between subsets of {1, . . . , n} and {0, 1}n. For every A ⊂ {1, . . . , n}, we construct a binary string a1, . . . , an, where ai = 1 if i is an element

of A and 0 otherwise. Why is this a bijection? Check injectivity and surjectivity. Let’s now ask a more refined question.

Example 1.1.9

Given integers n ≥ k ≥ 0, how many subsets of size k are there in {1, . . . , k}?

This quantity is usually denoted by nk. Let’s prove a nice formula for nk by illustrating another important counting principle: double counting.

(7)

1.1 Some Basics Proposition 1.1.10 Given integers n ≥ k ≥ 0, n k  = n! k!(n − k)!.

Proof. Rearrange this as nk · k! · (n − k)! = n!. What does the RHS count? We saw above that n! represents the number of permutations of a set of n elements, in our case say {1, . . . , n}. Can we think about the collection of permutations of {1, . . . , n} in a different way? We can: every permutation arises as a concatenation of a permutation of some k elements among {1, . . . , n} and a permutation of the other n − k elements. There are precisely nk · k! · (n − k)! such concatenations.

These numbers are usually called binomial coefficients. This has to do with the following fundamental result.

Theorem 1.1.11 (Binomial Theorem)

For real numbers x and y and integers n, we have (x + y)n= n X k=0 n k  xkyn−k.

Proof. When expanding (x + y)n, we need to have k x’s and n − k y’s in order to get a

term xkyn−k. We must choose k terms from the n parantheses to be an x (the rest we will take y’s), leaving us with a coefficient of nk.

This has an immediate consequence:

n X k=0 n k  = 2n.

But this is not surprising in light of the above discussion, is it? We are simply counting the number of subsets of {1, . . . , n} in two different ways. Note also that

n X k=0 (−1)kn k  = 0. Does this have any combinatorial “interpretation”?

The Multinomial Theorem is a slight generalization of the Binomial Theorem.

Theorem 1.1.12 (Multinomial Formula)

For real numbers x1, x2, . . . , xm and an integer n, we have

(x1+ . . . + xm)n= X i1+...+im=n i1,...,im≥0  n i1, . . . , im  xi1 1 · . . . · x im m.

The proof is so similar to the proof of the Binomial Theorem that we chose to omit it here. We leave it to the reader as an exercise. Can you guess what i n

1,...,im stands for?

(8)

1.1 Some Basics

Theorem 1.1.13 (Pascal’s Identity)

For integers n, k ≥ 2, we have n k  =n − 1 k − 1  +n − 1 k  .

There are many proofs, including just expanding the binomial coefficients using the formula we learned above, but let’s present a nice combinatorial argument.

Proof. Suppose we have n people in a class and we wish to select a committee of k people. There are nk ways to select such a committee.

Now let Anna be a person in the class. If Anna is selected, then there are n−1k−1 ways to select the remaining members of the committee. If Anna is not selected, then there are n−1k  ways to select all k members. Hence there are n−1k−1 + n−1k  ways to select the committee. Equating this with the original count gives the desired result.

Let’s see two more examples, which rely on the Binomial Theorem. These solutions have a flavor similar to the generating functions approach, which we will discuss later.

Example 1.1.14 (Vandermonde’s Identity)

Let a, b, n be positive integers such that a, b ≥ n. Prove that

n X k=0 a k  b n − k  =a + b n  .

Proof. Consider the RHS as the coefficient of xn of (1 + x)a+b, which is equivalent to (1 + x)a(1 + x)b.

To obtain xn from this we need some k amount of x in the first parenthesis and n − k in the second. This is the same summation as the LHS.

This has an interesting consequence: if a = b = n, then we get

n X k=0 n k 2 =2n n  .

The next identity is difficult to prove by using different methods, but the same trick of comparing coefficients works remarkably well.

Example 1.1.15 Prove that p X i=0 p i q i  ap−ibi= p X i=0 p i q + i i  (a − b)p−ibi.

Proof. Again we apply a similar strategy: Consider the expansion

(aX + b)p(1 + X)q=   p X j=0 p j  ap−jbjXp−j   q X i=0 q i  Xi ! .

(9)

1.2 Pigeonhole Principle

The coefficient of Xp is exactly the sum on the LHS.

To obtain the RHS we can rewrite aX + b = X(a − b) + (1 + X)b, so

(aX + b)p(1 + X)q = p X i=0 p i 

(a − b)p−ibiXp−i(1 + X)q+i.

To obtain the coefficient of Xp we need the coefficient of Xi in (1 + X)q+i and this is obviously equal to q+ii .

More fun with binomial coefficients to follow! Let’s add more tools.

§1.2

Pigeonhole Principle

The Pigeonhole Principle is an extremely basic observation: if n pigeons are divided over strictly fewer than n holes, there will be a hole containing at least two pigeons. More formally,

Proposition 1.2.1 (Pigeonhole Principle)

Let X and Y be finite sets and let f : X → Y be a function. If |X| > |Y | then there exist a, b ∈ X such that f (a) = f (b).

In other words, if f : X → Y is an injective function, then |X| ≤ |Y |. This seemingly simple fact can be used in surprising ways. The key typically is to put objects into boxes according to some rule, so that when two objects end up in the same box it is because they have some desired relationship.

Example 1.2.2

Among any 13 people, at least two share a birth month.

Label 12 boxes with the names of the months. Put each person in the box labeled with his or her birth month. Some box will contain at least two people, who share a birth month.

Example 1.2.3

Suppose 5 pairs of socks are in a drawer. Picking 6 socks guarantees that at least one pair is chosen.

Label the boxes by ”the pairs” (e.g., the red pair, the blue pair, the argyle pair,. . . ). Put the 6 socks into the boxes according to description.

Some uses of the principle are not nearly so straightforward. In fact, it can be used in some really impressive ways, as we shall soon see. For now, we discuss a beautiful example due to Erd˝os.

Example 1.2.4

No matter how one chooses n integers a1, . . . , an, there always exists a subset among

(10)

1.3 Induction

For example, when the integers are 1, . . . , n, this is trivially satisfied because the last element is divisible by n. Let’s try to make things harder by removing this last element and replacing it by some large integer not divisible by n, say n100+ 1. But then we still

have 1 + (n − 1) = n, and so on. We would like to show that we will always have such a subsum, regardless of how much we try to break this property.

Proof. The main idea is to consider the following set of sums: s1 = a1,

s2 = a1+ a2,

. . .

sn = a1+ . . . + an.

If one of these sums is divisible by n, we are done. If not, then their nonzero remainders upon division by n must be 1, 2, . . . , n − 1 in some order. There are n sums and only n − 1 such remainders, so by the pigeonhole principle two sums must share the same remainder, say si = a1+ . . . + ai and sj = a1+ . . . + aj, where i < j. But in this case

note that sj − si = ai+ . . . + aj must have remainder zero upon division by n, which

means we found our subsum.

As we will begin to study graph theory more systematically, more and more examples of such arguments will surface. For now, let us leave you with a friendly (but useful) observation. We remind the reader a couple of definitions.

Definition 1.2.5. A graph G is a pair (V, E), where V is a finite set, and E is a collection of subsets of size two of V . We say that V is the set of vertices of G and that E is the set of edges. The degree of a vertex x ∈ V is the number of edges from E which contain x.

Example 1.2.6

Let G = (V, E) be a finite graph. Then, there exist vertices x, y ∈ V such that the degree of x is the same as the degree of y.

We leave this as an exercise.

§1.3

Induction

The principle of mathematical induction, which lies at the very heart of Peano’s axiomatic construction of the set of positive integers, is stated as follows.

Proposition 1.3.1 (Induction Principle)

Given P (n), a property depending on a positive integer n, (i) if P (n0) is true for some positive integer n0, and

(ii) if for every k ≥ n0, P (k) true implies P (k + 1) true,

(11)

1.3 Induction

Put simply, this means that when proving a statement by mathematical induction you should first check the base case and then verify the inductive step by showing how to pass from an arbitrary integer to the next.

The prototypical examples of how to use induction involves identities. For example, note that you can use this principle to show that

1 + 2 + . . . + n =n(n + 1)

2 .

This is an identity which simply depends on n, so proving its validity can be interpreted as asking some predicate P (n) to hold true. P (1) simply means that 1 = 1·22 . This is clear. Now, suppose that P (n) is true. Does this imply that P (n + 1) is also true? First, what is P (n + 1)? P (n + 1) represents the statement

1 + 2 + . . . + n + (n + 1) = (n + 1)(n + 2)

2 .

Note that the sum from the left-hand side consists of the left-hand side from the P (n) predicate together with an additional term. Therefore, by the validity of P (n), we can write

1 + 2 + . . . + n + (n + 1) = [1 + 2 + . . . + n] + (n + 1) = n(n + 1)

2 + (n + 1). The right-hand side can be then easily rewritten as (n + 1)(n + 2)/2, so it follows that P (n + 1) is true. We are done.

The idea here is that induction is useful when the statement to prove can be rewritten as some predicate P (n), which has the crucial feature that it still involves P (n − 1) in a certain way within its content. Here’s another simple example, which we leave as an exercise (it is also discussed in [MN, Section 1.3]).

Example 1.3.2

Prove that 1 + 2 + . . . + 2n= 2n+1− 1 holds by using induction on n.

There are many diverse types of problems in which this kind of thing can happen (and where induction is great). For a first more “unusual” example, let’s take Fermat’s little theorem from number theory.

Example 1.3.3 (Fermat’s Little Theorem)

Let p be a prime number, and n a positive integer. Then np− n is divisible by p. Proof. We prove the theorem by induction on n. The base case n = 1 is obvious. Let us assume that the property is true for n = k and prove it for n = k + 1. Using the induction hypothesis, we obtain

(k + 1)p− (k + 1) ≡ kp+ p−1 X j=1 p k  kj+ 1 − k − 1 ≡ p−1 X j=1 p j  kj

modulo p. The key observation is that for 1 ≤ j ≤ p − 1, pj is divisible by p. Indeed, just note that

p j 

= p(p − 1) . . . (p − j + 1) 1 · 2 · . . . j ,

(12)

1.3 Induction

it is easy to see that when 1 ≤ j ≤ p − 1, the numerator is divisible by p while the denominator is not. Therefore, (k + 1)p− (k + 1) is zero modulo p, thus completing the induction.

Now, here’s a nice example from combinatorial geometry.

Example 1.3.4

Finitely many lines divide the plane into regions. Show that these regions can be colored by two colors in such a way that neighboring regions have different colors. Proof. We prove this by induction on the number n of lines. The base case n = 1 is again straightforward, but important: color one half-plane black, the other white.

For the inductive step, assume that we know how to color any map defined by n lines. Consider a configuration with n + 1 which we would like to color; fix some line and pretend that it is not there. Color the regions determined by the other n − 1 lines from the inductive hypothesis. When we add the line we ignored for a moment back, we keep the color of the regions on one side of this line the same, while changing the color of the regions on the other side. Note that this gives a two-coloring with the desired property.

Another sweet example is the following problem from [MN, Section 1.3, Exercise 6].

Example 1.3.5

Prove that for any n ≥ 1, a 2n× 2n checkerboard with a 1 × 1 square removed can

be tiled by 2 × 2 tiles with one square removed.

Proof. Call a 2 × 2 tile with one square removed a “trominoe”. We proceed by induction on n. The base case where n = 1 is trivial (namely, do nothing).

Now assume that we can tile a 2n× 2n checkerboard with a 1 × 1 square removed

with trominoes. Given a 2n+1× 2n+1 checkerboard, we can split it up into four 2n× 2n

checkerboards. The removed square must lie in one of these 4 sections, so tile that section using the inductive hypothesis.

The key observation is that we can removed the square closest to the center of the 2n+1× 2n+1 checkerboard from each of the remaining 3 sections. Tile each of these

sections with trominoes with the inductive hypothesis and fill in the three removed square with one extra trominoe. This shows that we can tile the 2n+1× 2n+1 checkerboard,

completing the induction.

Sometimes, we need more than just P (n) to prove P (n + 1).

Proposition 1.3.6 (Strong Induction)

Given P (n), a property depending on a positive integer n, if we have the following properties:

(i) P (n0), P (n0 + 1), . . . , P (n0 + m) is true for some positive integer n0, and

nonnegative integer m,

(ii) For every k > n0+ m, P (j) is true for all n0 ≤ j < k implies P (k + 1) true,

(13)

1.3 Induction

Example 1.3.7

Every positive integer can be written in the form pn1 1 · p n2 2 · . . . · p nk k ,

where ni ≥ 0 and p1, . . . , pk are distinct prime numbers.

In fact, this factorization is unique, except possibly for the order of the factors. These two statements represent the so-called Fundamental Theorem of Arithmetic. The first part has a very nice simple proof using strong induction.

Proof. If n = 2, then n is already prime, so the result is true. Suppose n > 2, and assume tha every number less than n can be factored into a product of primes. If n is a prime number again, we are done. Otherwise, n is composite, which means it can be factored as n = ab, where 1 < a, b < n. By induction, the smaller numbers a and b can be factored into primes. Since n = ab, one can then combine these factorizations to get a factorization into primes for n.

Note that simple induction wouldn’t have sufficed above because the numbers a and b can be anything. The next theorem is a beautiful result about Fibonacci numbers whose proof also requires strong induction.

Example 1.3.8 (Zeckendorf’s Theorem)

Show that every positive integer can be written as a sum of distinct terms of the Fibonacci sequence, no two of which are consecutive.

Proof. The base case is obvious. Recall that the Fibonacci sequence is defined by the relations F1= F2 = 1 and Fk+1= Fk+ Fk−1. We proceed by strong induction: Assume

1, . . . , n − 1 are able to be expressed as a sum of distinct terms of the sequence. For n, we either have that Fk < n < Fk+1 or that n = Fk. If the latter holds, we are done.

Otherwise, we must have 0 < n − Fk< Fk+1− Fk= Fk−1. To finish, we write

n − Fk = r

X

x=1

Fix

which follows from using our strong inductive hypothesis on n − Fk. This expression

gives a desired representation for n.

Remark 1.3.9. The full statement of Zeckendorf’s Theorem states that this representa-tion is unique. This result is much more difficult and does not require inducrepresenta-tion.

Other times, when we try induction, we need to make a clever choice regarding how to reduce the statement to the previous statement.

Example 1.3.10 (AM-GM Inequality)

For every n positive real numbers a1, . . . , an, the following inequality holds:

a1+ . . . + an

n ≥

n

(14)

1.3 Induction

This is a useful inequality you should know as a future combinatorialist. It can be proved as follows.

Proof. First, notice that we can assume WLOG (without loss of generality) that a1· . . . ·

an= 1, in which case we only have to prove that

a1+ . . . + an≥ n.

Indeed, this can be seen by simply diving by the RHS and relabelling ai/n

a1· . . . · an

by a0i for each i = 1, . . . , n. The inequality to prove is completely equivalent to a01+ . . . + a0n≥ n,

where a01, . . . , a0n clearly satisfy a01· . . . · a0n= 1. So, for convenience, we shall drop the0. Now, in order to prove this cleaner version of the inequality, we proceed by induction on n. First, let us understand what the predicate P (n) being true stands for here: “for every positive reals such that a1· . . . · an= 1, the inequality

a1+ . . . + an≥ n.

is always true”.

The base case n = 1 is trivial. Now, suppose P (n − 1) holds and let us try to deduce from it P (n). We are given a set of n arbitrary reals a1· . . . · an= 1 for which we would

like to prove the inequality above. In order to hope to use P (n − 1), we need to create a product of n − 1 numbers which equals 1. A simple way to do that would be to simply relabel the numbers as follows: for i = 1, . . . , n − 2, let bi= ai, and define bn−1= an−1· an.

Clearly, b1· . . . · bn−1= 1 holds, so by the inductive hypothesis we have that

a1+ . . . + an−2+ an−1· an= b1+ . . . + bn−2+ bn−1≥ n − 1.

Hence, in order to prove that this implies a1+ . . . + an≥ n, it would be great if

a1+ . . . + an≥ a1+ . . . + an−2+ an−1· an+ 1

were true. This is a good idea but note that this rewrites much more conveniently as an−1+ an≥ an−1· an+ 1,

and this is simply not true in general. For example, consider an−1 = an = 1/2. So we

are stuck, what do we do?

We have to make a better reduction to P (n − 1). Note that an−1+ an≥ an−1· an+ 1

further rewrites as

(an−1− 1)(1 − an) ≥ 0,

which would actually hold if an−1 and an were on opposide sides of 1. This may not be

true for an−1 and an but recall that a1· . . . · an= 1. There must be two numbers among

these terms which are on opposide sides of 1! If a1= . . . = an= 1, then a1+ . . . + an= n

and we have nothing to prove, but if the numbers are not all equal to each other, then surely one is smaller than n and one is larger than n. We simply choose those two to concatenate instead of an−1 and an, if these two do not satisfy this property, and run

the argument again from the beginning. This time it will work!

We end this first set of notes by leaving in the air a further example of a problem where naive induction will go wrong for similar reasons.

(15)

1.4 Additional Reading

Example 1.3.11 (Erd˝os)

Every n points in the plane which are not all collinear must determine at least n distinct lines.

§1.4

Additional Reading

See Sections 1.1-1.4 and 3.1-3.3 from the textbook. For sake of clarity, this is the reference [MN] which was also cited above, namely “Invitation to Discrete Mathematics” (2nd ed.) by Jiri Matousek and Jaroslav Nesetril.

§1.5

Problems

These are some problems to practice the material above and do not represent homework unless explicitly mentioned otherwise. Give them a try! Some of them will be discussed by your TA during the upcoming discussion sessions from 4 to 5 PM on Tuesdays and Thursdays (starting with September 8th).

Problem 1.5.1. How many subsets of {1, . . . , n} are there which do not contain the element 5?

Problem 1.5.2. How many permutations of {1, . . . , n} are cyclic, in the sense of Defini-tion 1.1.7?

Problem 1.5.3. How many permutations of {1, . . . , n} have the property that they fix precisely k elements? In other words, how many bijective functions f : [n] → [n] are there with the property that f (x) = x for precisely k values of x ∈ [n]. Here [n] is convenient notation for {1, . . . , n}.

Problem 1.5.4. Let m ≥ n ≥ 1 be integers. How many strictly increasing functions f : [n] → [m] are there?

Problem 1.5.5. Prove that nk = n k

n−1

k−1 for all positive integers n ≥ k.

Problem 1.5.6. Show that nk mk = mn n−mk−m for all positive integer n ≥ k ≥ m. Problem 1.5.7. Prove that:

X k≥0 n k  k m  = n m  2n−m.

Can you also find a combinatorial argument by counting a quantity in two different ways directly?

Problem 1.5.8. Let n be a positive integer. Show that

n X k=0 kn k  = n2n−1. Problem 1.5.9. Compute n P k=0 1 k+1 n k.

(16)

1.5 Problems Problem 1.5.10. Compute n P k=0 k2 nk. Problem 1.5.11. Prove the formula

r r  +r + 1 r  +r + 2 r  + . . . +n r  =n + 1 r + 1 

by induction on n (for r arbitrary but fixed). Note that what the formula says for r = 1. Can you also prove the same formula combinatorially?

Problem 1.5.12. Use the previous problem to calculate the sumsPn

i=1i2 and

Pn

i=1i3

in terms of n.

Problem 1.5.13. Consider a pentagon in the plane whose vertices have integer cartesian coordinates. Prove that the midpoint of one of its diagonals must also have integer coordinates. More generally, prove that every set of 2n+ 1 vectors in Zn (integer coordinates) contains a pair of distinct points whose midpoint also has integer coordinates. Problem 1.5.14. Consider five poins in a square with side length 2. Prove that no matter how these points are placed, some pair of them are no more than√2 apart. Problem 1.5.15. A chess grandmaster has 77 days to prepare for a tournament. He wants to play at least one game per day, but not more then 132 games. Prove that there is a sequence of successive days on which he plays exactly 21 games.

Problem 1.5.16. Prove that every polygon can be dissected into triangles by interior diagonals.

Problem 1.5.17. Prove Bernoulli’s inequality: if x ≥ −1 is a real number, then (1 + x)n≥ 1 + nx for all natural numbers n.

Problem 1.5.18. Recall the so-called harmonic numbers from Math 115: Hk= 1 +

1

2 + . . . + 1 k for k ≥ 1. Use induction to prove that

H2n≥ 1 + n

2 for every n ≥ 1.

Problem 1.5.19. Given is a list of n positive integers whose sum is less than 2n. Prove that, for any positive integer m not exceeding the sum of these integers, one can choose a sublist of the integers whose sum is m.

(17)

2

The Principle of Inclusion-Exclusion

There is no problem in all mathematics that cannot be solved by direct counting. —Ernst Mach When considering sets, it is often very useful to define a characteristic function which indicates whether a element is part of a given set.

Definition 2.0.1. Given a subset A of a set S, the characteristic function of A, denoted by 1A(s) is a map 1A: S → {0, 1} defined by

1A(s) =

(

1 if s ∈ A 0 otherwise.

This gives a bijection between the subsets of S and maps f : S → {0, 1}, the inverse associating to such a map f the subset

A = {s ∈ S | f (s) = 1}.

These characteristic functions provide a nice way to encode properties of sets alge-braically. However, we need a few obvious identities to effectively do so.

Proposition 2.0.2 (Characteristic Function Identities)

Let A, B be subsets of a set S. Then we have • 1A∩B = 1A· 1B

• 1A∪B = 1A+ 1B− 1A· 1B.

• 1S\A = 1 − 1A.

• A ⊂ B if and only if 1A(s) ≤ 1B(s) for all s ∈ S.

• If A is finite, then |A| = Ps∈S1A(s).

Here’s a weird application which demonstrates the power of characteristic functions in an algebraic sense.

Example 2.0.3

Let S be a finite set and for each subset A of S let aAbe a real number. Then

X

A,B⊂S

aAaB|A ∩ B| ≥ 0.

(18)

2.1 The Main Result: PIE of summation, giving X A,B⊂S aAaB|A ∩ B| = X A,B⊂S aAaB X s∈S 1A(s) · 1B(s) =X s∈S X A,B⊂S aAaB1A(s) · 1B(s) =X s∈S X A⊂S aA1A(s) !2 ≥ 0.

Remark 2.0.4. This proof was essentially just an algebraic manipulation with charac-teristic functions. While the problem makes sense algebraically, it is quite challening to find a combinatorial proof! I was unable to find one. Maybe you can?

Here is another example of characteristic functions simplifying the argument.

Example 2.0.5

Given a set E, together with a finite subset A ⊂ E, how many solutions does the system

(

X ∪ Y = E X∆Y = A have for X, Y ?

Here, A∆B = (A \ B) ∪ (B \ A) denotes the symmetric difference.

Proof. In terms of characteristic functions, an element a ∈ A has to satisfy (1X(a), 1Y(a)) ∈ {(0, 1), (1, 0)}.

Also, an element e ∈ E − A must have (1X(e), 1Y(e)) = (1, 1). This shows that the

number of solutions of the system above is 2|A|.

§2.1

The Main Result: PIE

Now with the preliminaries out of the way, we are now ready to state the main result of the chapter.

Theorem 2.1.1 (Principle of Inclusion-Exclusion)

If A1, ..., Anare finite sets, then

|A1∪ · · · ∪ An| = n X k=1 (−1)k−1 X 1≤i1<···<ik≤n |Ai1∩ · · · ∩ Aik| = n X i=1 |Ai| − X 1≤i<j≤n |Ai∩ Aj| + · · · + (−1)n−1|A 1∩ · · · ∩ An|.

In practice, the principle of inclusion-exclusion (abbreviated PIE) helps us count objects that have at least one of n properties. We let Ai be the set of objects which satisfy

(19)

2.1 The Main Result: PIE

property i and apply PIE. This is useful because it is often much easier to find the size of the intersection of sets than to find the size of the union.

There are several proofs in the textbook. See Section 3.7 for a nice discussion. This one is a bit different and makes usage of characteristic functions.

Proof of theorem 2.1.1. Let X = A1∪ · · · ∪ An. Recall that for any subset Y of X, we

have |Y | =P

x∈X1Y(x). Hence it suffices to prove that

1A1∪···∪An(x) = n X k=1 (−1)k−1 X 1≤i1<···<ik≤n 1Ai1∩···∩Aik(x)

for every x because then we can just sum over all x ∈ X. Now, letting Yc denote the complement of Y in X, we have

1A1∪···∪An(x) = 1 − 1Ac1∩···∩Acn(x) = 1 − 1Ac1(x) · . . . · 1Acn(x).

Since 1Ac

i(x) = 1−1Ai(x), the result follows by expanding (1−1A1(x)) . . . (1−1An(x)).

Example 2.1.2 (Derangements Problem)

If σ is a permutation of the set X = {1, . . . , n}, we say that the number i is a fixed point of the permutation if σ(i) = i, where 1 ≤ i ≤ n. Prove that the number of permutations of X that have no fixed points is

D(n) = n! 1 − 1 1!+ 1 2!− 1 3!+ . . . + (−1)n n! ! .

Proof. We use the standard technique of complementary counting and PIE. Let Ai be

the set of permutations σ such that σ(i) = i, that is for which i is a fixed point. Clearly there are n! total permutations, so the quantity we seek is

n! − |A1∪ · · · ∪ An|.

If 1 ≤ i1 < · · · < ik ≤ n, then Ai1 ∩ · · · ∩ Aik is the set of permutations σ which

are the identity on {i1, . . . , ik}. This is in bijection with the set of permutations of

X − {i1, . . . , ik}, so we must have

|Ai1 ∩ · · · ∩ Aik| = (n − k)!.

Hence by PIE, we get D(n) = n! −n 1  (n − 1)! −n 2  (n − 2)! + · · · + (−1)n−1n n  (n − n)!  = n!  1 − 1 1!+ 1 2!− 1 3!+ · · · + (−1)n n!  . This completes the proof.

Sometimes it can be very hard to actually evaluate all sums P |Ai1 ∩ ... ∩ Aik|, so it

is useful to be able to say something about their behavior without actually computing them, or by computing only a small number of them. The following result is the first one in this direction.

(20)

2.1 The Main Result: PIE

Theorem 2.1.3 (Bonferroni’s inequalities)

Let A1, ...., An be finite subsets of some set S and let k ∈ [n]. Let N (r) denote

N (r) = X 1≤i1<...<ir≤n |Ai1∩ ... ∩ Air|. a) If k is even, then | n [ i=1 Ai| ≥ k X r=1 (−1)r−1N (r).

b) If k is odd, then the opposite inequality holds.

Proof. We have | n [ i=1 Ai| − k X r=1 (−1)r−1N (r) =X x∈S  1∪iAi(x) − k X r=1 (−1)r−1 X 1≤i1<...<ir≤n 1Ai1∩...∩Air(x)  .

We claim that the numbers Mx= 1∪iAi(x) − k X r=1 (−1)r−1 X 1≤i1<...<ir≤n 1Ai1∩...∩Air(x)

have the same sign for all x ∈ S: positive if k is even and negative if k is odd.

Say x belongs to exactly s of the Ai’s. If s = 0, then clearly Mx= 0, so assume that

s > 0. Then Mx = 1 − k X r=1 (−1)r−1s r  = k X r=0 (−1)rs r  .

Of course, we may assume that s ≥ r. But recall that by Homework 1, we have

m X r=0 (−1)rn r  = (−1)mn − 1 m  for all n, m.

Now we can just sum up the Mx’s over all x ∈ [n] and apply the last part of

proposi-tion 2.0.2.

Bonferroni’s inequalities are very useful in applications. Let’s see an example that puzzled many people at the International Mathematics Olympiad from 1989.

Example 2.1.4

A permutation {x1, . . . , x2n} of the set {1, 2, . . . , 2n}, where n is a positive integer,

is said to have property T if |xi− xi+1| = n for at least one i in {1, 2, . . . , 2n − 1}.

Show that, for each n, there are more permutations with property T than without.

Proof. Let Ar be the set of permutations in which r and n + r are adjacent. We need to

prove that

|A1∪ ... ∪ An| > (2n)! 2

(21)

2.2 Generalized PIE

for n ≥ 2. Using Bonferroni’s inequalities we obtain |A1∪ ... ∪ An| ≥ n X i=1 |Ai| − X 1≤i<j≤n |Ai∩ Aj|.

Now, one can easily see that |Ai| = 2(2n − 1)! and |Ai∩ Aj| = 22(2n − 2)! for i 6= j, and

the rest is just an immediate computation.

§2.2

Generalized PIE

In this section, we will generalize the previous results by allowing a more flexible framework. We take a finite set X and a list of properties P1, ..., Pn that elements of X may or may

not have. If A is a subset of [n], we let N≥A be the number of elements of X which

have property Pi for all i ∈ A. We let N=A be the number of elements of X which have

property Pi if and only if i ∈ A. Once you digest the notation, it should be clear that

N≥A=

X

A⊂B

N=B.

Now, it turns out that in practice it is easier to evaluate N≥A and harder to evaluate

N=A, so we would like to “invert” the previous formula and express N=A in terms of

N≥B for A ⊂ B. We can do this easily thanks to the following

Proposition 2.2.1

Suppose that f, g are functions defined on the subsets of [n], with real values (or more generally, with values in an arbitrary abelian group, if you happen to be familiar with that terminology). Suppose that

f (A) = X

A⊂B

g(B)

for all subsets A of [n]. Then

g(A) = X

A⊂B

(−1)|B|−|A|f (B)

for all A.

Proof. This is can be checked by a not so difficult computation: X A⊂B (−1)|B|−|A|f (B) = X A⊂B (−1)|B|−|A|· X B⊂C g(C) = X A⊂B⊂C (−1)|B|−|A|g(C) = X A⊂C g(C) X A⊂B⊂C (−1)|B|−|A|. Now it suffices to prove that for any A ⊂ C we have

X

A⊂B⊂C

(−1)|B|−|A|= 1

if A = C and 0 otherwise. But this is immediate when A = C, and otherwise X

A⊂B⊂C

(−1)|B|−|A|= X

B0⊂C\A

(22)

2.3 Rook Polynomials

since there are 2|C\A|−1 subsets B0 with an even number of elements, and as many with an odd number of elements. The result follows.

There are many other similar inversion formulas. For instance, there’s the following remarkable binomial inversion formula: if an and bn are sequences linked by

bn= n X k=0 n k  ak, then an= n X k=0 (−1)n−kn k  bk.

Can you prove this? These inversion formulas play a crucial role in enumerative com-binatorics (see Richard Stanley’s book called “Enumerative Comcom-binatorics” for many details and examples).

Using the above discussion and the proposition we get the following general theorem.

Theorem 2.2.2 (General PIE)

Let X be a finite set, P1, ..., Pn properties that elements of X may or may not have.

With the notations introduced above, we have N=A =

X

A⊂B

(−1)|B|−|A|N≥B

for all A ⊂ [n]. In particular, the number of elements of X which have none of the properties P1, ..., Pn is N=∅ = X B⊂[n] (−1)|B|N≥B.

§2.3

Rook Polynomials

Let’s consider the following setup.

Theorem 2.3.1 (Rook Polynomials)

Consider a subset B of [n] × [n]. We think of [n] × [n] as the cells of some n × n board, and B as a set of certain marked cells. We will be interested in the number of permutations σ of [n] with the property that (i, σ(i)) /∈ B for all i ∈ [n]. This means that the graph

Gσ= {(i, σ(i)) | i ∈ [n]}

should not pass through any marked cell. Let us denote N (B) this number of permutations.

On the other hand, let rk be the kth rook number of B by each k. By definition,

this is the number of ways of placing k non-attacking rooks on the marked cells (elements of B). Thus rk is the number of ways of choosing k cells in B, no two in

the same row or column. Prove that N (B) =

n

X

k=0

(23)

2.3 Rook Polynomials

Proof. If S is a subset of B, we let f (S) be the number of permutations σ for which S ⊂ Gσ and g(S) the number of permutations σ for which S = Gσ∩ B. Clearly

f (S) = X S⊂T g(T ), so by proposition 2.2.1, we have g(S) = X S⊂T (−1)|T |−|S|f (T ). In particular we have N (B) = g(∅) = X T ⊂B (−1)|T |f (T ).

Now, let’s try to understand f (T ) for a given T . If T ⊂ Gσ, hence clearly no two elements

of T are on the same line or column. So we can only restrict to such T . Let’s look at such T with k elements. It corresponds to a placement of k non attacking rooks on the cells in B. Say T = {(i1, j1), (i2, j2), ..., (ik, jk)} with i1, ..., ik and j1, ..., jk pairwise

distinct. Now f (T ) is the number of permutations σ with σ(i1) = j1, ..., σ(ik) = jk. It is

immediate to see that this is (n − k)!, and putting everything together yields the desired result (see Stanley’s book for another proof, by double counting).

Now let’s consider the following important counting problem.

Example 2.3.2 (Crazy Dog Owners Problem)

Consider n lonely people in a not so distance future, who are trying to socialize after the Covid-19 pandemic. Each person owns a dog, and all n dogs are brought to a strange dog party. In how many ways can they all (humans and dogs) sit around a big table so that

• No two humans are consecutive.

• No person is sitting next to his or her own dog.

Solution. It is easy to see that this comes down to counting permutations σ of [n] such that σ(i) is not congruent to i or i + 1 mod n for all i ∈ [n]. Thus, we need to compute N (B), where

B = {(i, i)|i ∈ [n]} ∪ {(i, i + 1)|1 ≤ i ≤ n − 1} ∪ {(n, 1)}.

By the previous theorem it suffices to compute rk for this board B. But it is easy to see

from the definition of B that rk is the number of ways of choosing k numbers among 2n

points on a circle, so that no two are consecutive. Now we need the following lemma to evaluate rk.

Lemma 2.3.3 (Choosing Non-Consecutive Numbers)

The number of ways to choose k non-consecutive numbers among n numbers a) written on a line is n−k+1k .

(24)

2.4 Additional Reading

Proof. For a), if f (n, k) is this number, then f (n, k) = f (n − 2, k − 1) + f (n − 1, k) by discussing whether we choose 1 or not. This immediately yields the result by induction on n + k.

For b), if g(n, k) is this number, then g(n, k) = f (n − 3, k − 1) + f (n − 1, k) again by discussing whether we choose 1 or not. The result follows by an easy computation from a).

We conclude that the answer to the Crazy Dog Owners Problem is

n X k=0 (−1)k(n − k)! 2n 2n − k 2n − k k  .

§2.4

Additional Reading

Sections 3.7 and 3.8 from the textbook, i.e. “Invitation to Discrete Mathematics” (2nd ed.) by Jiri Matousek and Jaroslav Nesetril. Also, start looking at Chapter 4.

§2.5

Problems

These are some problems to practice the material above and do not represent homework unless explicitly mentioned otherwise. Give them a try! Some of them will be discussed by your TA during the upcoming discussion sessions from 4 to 5 PM on Tuesdays and Thursdays.

I also included some solutions to a selected few which are more difficult than usual (some are also beyond what we will be covering in class, but I could not help myself).

Problem 2.5.1. In a survey on the gelato preferences among of group of students at Yale the following data was obtained:

1. 78 like mixed berry 2. 32 like irish cream 3. 57 like tiramisu

4. 13 like both mixed berry and irish cream 5. 21 like both irish cream and tiramisu 6. 16 like both tiramisu and mixed berry 7. 5 like all three flavours above

8. 14 like none of these three flavours

(25)

2.5 Problems

Problem 2.5.2. In a mathematics contest with three problems, 80% of the participants solved the first problem, 75% solved the second and 70% solved the third. Prove that at least 25% of the participants solved all three problems.

Problem 2.5.3. Let ϕ(n) denote Euler’s totient function, the number of positive integers less than or equal to n which are relatively prime with n. If p1, ..., pk are the distinct

prime factors of n, prove that

ϕ(n) = n 1 − 1 p1 ! 1 − 1 p2 ! . . . 1 − 1 pk ! .

Problem 2.5.4. Define the M¨obius function µ : N :→ R by

µ(n) =      1 if n = 1,

(−1)k if n is squarefree with k ≥ 0 distinct prime factors, 0 if n is not squarefree. Prove that X d|n µ(d) = ( 1 if n = 1, 0 if n > 1.

Problem 2.5.5. Given a function f : N → R, let F : N → R be F (n) =X d|n f (d). Prove that f (n) =X d|n F (d)µ n d  .

This is called the M¨obius inversion formula. It is a very important tool in number theory.

Problem 2.5.6. Prove that the number sm,n of surjective functions f : X → Y , where

|X| = n and |Y | = m is given by the expression sm,n = mn− m 1  (m − 1)n+m 2  (m − 2)n− . . . + (−1)m−1  m m − 1  1n.

Problem 2.5.7. Consider 3 sets X, Y, Z with |X| = n, |Y | = m, |Z| = r and Z ⊂ Y . Denote by sm,n,r the number of functions f : X → Y for which Z ⊆ f (X). Prove that:

sm,n,r= mn− r 1  (m − 1)n+r 2  (m − 2)n− . . . + (−1)r(m − r)n.

Problem 2.5.8. How many ways are there to seat n married couples at a round table with 2n chairs in such a way that the couples never sit next to each other?

(26)

2.5 Problems

Problem 2.5.9. [rook polynomials] Let B be a subset of [n] × [n]. If j ∈ {0, 1, ..., n} we let Nj be the number of permutations σ of [n] such that exactly j elements of the set

{(i, σ(i))|i ∈ [n]} belong to B. Also, we let rk be the number of ways to place k non

attacking rooks on B, i.e. the number of k-subsets of B such that no two elements have a common coordinate. a) Prove that n X j=k j k  Nj = rk(n − k)! for all k. b) Deduce that n X j=0 NjXj = n X k=0 rk(n − k)!(X − 1)k and so N0= n X k=0 (−1)krk(n − k)!.

Problem 2.5.10. Show that the number of ways of seating n couples around a table, so that no one sits next to his or her partner is

mn= 2n · n X k=0 (−1)kn k  · 2k· (2n − k − 1)!.

Problem 2.5.11. Arguing as in the previous problem, give a new solution to the Crazy Dog Owners Problem.

Problem 2.5.12. Let A1, A2, . . . , An (n ≥ 3) be finite sets of positive integers. Prove,

that 1 n n X i=1 |Ai| ! + 1n 3  X 1≤i<j<k≤n |Ai∩ Aj∩ Ak| ≥ 2 n 2  X 1≤i<j≤n |Ai∩ Aj|

holds, where |E| is the cardinality of the set E.

Problem 2.5.13. Let A1, A2, . . ., Anbe finite subsets of some set S. Let d(n) be the

number of elements which appear exactly in an odd number of sets among A1, A2, . . .,

An. Prove that for any k, 1 ≤ k ≤ n the number

d(n) − n X i=1 |Ai| + 2 X i<j |Ai∩ Aj| + ... + (−1)k2k−1 X i1<...<ik |Ai1∩ Ai2∩ ... ∩ Aik| is divisible by 2k.

Exercise 2.5.14. Let a1, a2, ..., ak be all positive integers less than n and relatively

(27)

2.5 Problems

Problem 2.5.15. Let |U |, σ(U ) and π(U ) denote the number of elements, the sum, and the product, respectively, of a finite set U of positive integers. (If U is the empty set, |U | = 0, σ(U ) = 0, π(U ) = 1.) Let S be a finite set of positive integers. As usual, let nk denote k!(n−k)!n! . Prove that

X U ⊆S (−1)|U |m − σ(U ) |S|  = π(S)

for all integers m ≥ σ(S).

Problem 2.5.16. 25 little donkeys stand in a row; the rightmost of them is Eeyore. Winnie-the-Pooh wants to give a balloon of one of the seven colours of the rainbow to each donkey, so that successive donkeys receive balloons of different colors, and so that at least one balloon of each color is given to some donkey. Eeyore wants to give to each of the 24 remaining donkeys a pot of one of six colors of the rainbow (except red), so that at least one pot of each color is given to some donkey (but successive donkeys can receive pots of the same color). Whom of the two friends has more ways to get his plan implemented, and how many times more?

(28)

2.6 Solutions to Selected Problems

§2.6

Solutions to Selected Problems

Solution 2.5.3. Let us count numbers less than n and which are not relatively prime to n, i.e. they are multiples of one of the numbers p1, ..., pk. Let Ai be the set of

positive integers which are less than n and multiples of pi. If 0 ≤ i1< ... < ij ≤ k, then

Ai1∩ ... ∩ Aij is the set of multiples of pi1...pij which are less than n. Thus

|Ai1∩ ... ∩ Aij| = n pi1...pij

. Using PIE we obtain

n − ϕ(n) =X i n pi −X i<j n pipj + ..., which rearranges easily to the desired formula.

Solution 2.5.6. We may of course assume that X = [n] and Y = [m]. Let’s count non surjective maps. This means that they miss at least one value in [m]. So let Ai be the

set of maps f : X → Y which miss the value i, that is i is not in the image of f . Then Ai1 ∩ ...Aik is the set of maps g : [n] → Y − {i1, ..., ik}, and this clearly has (m − k)

n

elements. The result follows now directly from PIE.

Solution 2.5.7. Same arguments: look at maps which do not satisfy this property. This means that they are missing at least one element of Z. Let Z = [r] and for 1 ≤ i ≤ r let Ai be the set of those f missing the value i. Now redo the previous arguments.

Solution 2.5.9. a) We count pairs (σ, C), where σ is a permutation and C is a subset with k elements of B ∩ {(i, σ(i))|i ∈ [n]}. For a given j ∈ [k, n] there are Nj ways to

choose σ such that B ∩ {(i, σ(i))|i ∈ [n]} has j elements, and kj ways to choose a subset with k elements of this set. So the number of pairs isPn

j=k j

kNj. On the other hand,

we can first choose C in rk ways and then we have (n − k)! permutations available, so

the number of pairs is rk(n − k)!.

b) Simply multiply by (X − 1)k and take the sum over k.

Solution 2.5.10. We’ll compute the number mn of ways of seating n couples around a

table, so that no one sits next to his or her partner. There are (2n)! ways to seat the 2n persons around the table. Let Ai be the set of arrangements in which the ith couple sits

together. Then mn= (2n)! − n X i=1 |Ai| + X i<j |Ai∩ Aj| − ...

By symmetry, the number Nk = |Ai1∩...∩Aik| is independent of the choice of i1 < ... < ik

and mn= (2n)! − n 1  N1+ n 2  N2− ...

Now, to get an arrangement in which the first k couples sit together, we must have the following:

• Choose k sits si1, ..., sik among the 2n sits, no two of which are consecutive. Each

couple among the first k will occupy sits sij and sij+1 for some j. The number of

ways of choosing these sits is 2n−kk  ·2n−k2n .

(29)

2.6 Solutions to Selected Problems

• Once a permutation is fixed, there is still an ambiguity whether the wife takes sit sij or the next one, so we get 2

k possibilities.

• Finally, once these 2k persons are sit, we still have to sit the other 2n − 2k persons in any way we like, giving (2n − 2k)! arrangements.

All in all, we have Nk = 2n − k k  2n 2n − k· k! · 2 k· (2n − 2k)! = 2n · (2n − 2k − 1)! · 2k.

The result follows.

Solution 2.5.11. An alternating distribution will be a distribution of men and women in which no two persons of the same sex are adjacent. The total number of alternating distributions is 2(n!)2: choose which seats are for men and which are for women and n! ways to seat the men and n! ways to seat the women. Now let Nk be the number of

alternating distributions in which the first k couples end up together. The solution of the menage problem is then (by PIE)

n X k=0 (−1)kn k  Nk.

Now, to get an alternating distribution in which the first k couples are together we must do the following:

• Specify which seats are for men and which are for women: 2 possibilities.

• Once this is done, pick k sits among the 2n, no two of which are consecutive, and which are reserved (together with the next seats) for the k couples. This gives

2n−k k

 2n

2n−k possibilities, as before.

• Decide which couple among the k chooses seat j for all j: k! possibilities.

• Finally, arrange the remaining persons. This is done now in (n − k)!2 ways, because

of the alternating condition. Hence Nk= 2n 2n − k 2n − k k  · k! · 2 · (n − k)!2, as desired.

Solution 2.5.13. It is clearly sufficient to prove the result for k = n. For each x ∈ S let Px be 1 if x belongs to an odd number of Ai’s and 0 otherwise. It suffices to prove that

for all x ∈ S we have Px− n X i=1 1x∈Ai + ... + (−1) n2n−11

x∈A1∩...∩An ≡ 0 (mod 2

n),

as then the result follows by summing over all x ∈ S. On the other hand,

n X i=1 1x∈Ai− ... + (−1) n−12n−11 x∈A1· ... · 1x∈An = 1 − (1 − 2 · 1x∈A1)...(1 − 2 · 1x∈An) 2

and the last number is clearly equal to 1−(−1)2 k, where k is the number of Ai’s containing

(30)

2.6 Solutions to Selected Problems

Solution 2.5.15. Say S = {x1, ..., xn}. Let R be a set with m elements, containing

n pairwise disjoint subsets A1, ..., An such that |Ai| = xi. We will count the number

of n-element subsets of R meeting each of the Ai’s. Clearly, such a set is obtained by

picking one element from each Ai, so there are x1...xn= π(S) such sets.

On the other hand, let Xi be the set of n-element subsets of R which do not meet

Ai. Then |Xi1 ∩ ... ∩ Xik| =

m−σ(U )

n , where U = {xi1, ..., xik}. By PIE and the first

paragraph we obtain the desired result.

Solution 2.5.16. An easy application of PIE gives that the first thing can be done in

7 X m=0 (−1)m−1 7 m  m(m − 1)24

ways, while the second one can be done in

6 X m=0 (−1)m 6 m  m24

ways. Now in the first sum each term is 7 times the corresponding term in the second sum, which shows that the first number is seven times greater than the second number.

(31)

3

Intersecting sets and poset madness

Chaos is merely order waiting to be deciphered.

—Jos´e Saramago

§3.1

The Erdos-Ko-Rado Theorem

Definition 3.1.1. A family of subsets A1, ..., Am of some set S is called intersecting if

Ai∩ Aj 6= ∅ for all i 6= j.

What are some examples? How large can an intersecting family of subsets be? For example, take all the subsets of {1, . . . , n}. This can’t be an intersecting family because we see things like {1, 3} and {2, 4, 6} which have nothing in common. Alright, so I can take for example all the subsets of {1, . . . , n} which contain some fixed element, say 1. There are 2n−1 such subsets. Can I find any larger collection? Turns out no.

Theorem 3.1.2 (Baby Erdos-Ko-Rado)

Let F be an intersecting family of subsets of {1, . . . , n}. Then, |F | ≤ 2n−1.

Proof. The proof relies on a very simple observation. Since F is intersecting, there is no way that A and Ac can both be in F for any subset A of {1, . . . , n}. Since there are precisely 2n−1 pairs of the form {A, Ac}, this implies precisely that |F | ≤ 2n−1.

Things become much more interesting if we ask for each set in F to have the same size.

Theorem 3.1.3 (Erdos-Ko-Rado)

Let k ≤ n2. Then the maximum cardinality of an intersecting family of subsets of [n] with k elements is n−1k−1.

Before passing to the proof, let us make a few remarks. First, the hypothesis k ≤ n2 is crucial, for if k > n2, then any two subsets with k elements of [n] have nonempty intersection. Second, checking that the value n−1k−1 is attained is fairly easy: simply take all subsets with k elements of [n] that contain 1 (for example). Actually one can prove (I will not do it) that this is the only case realizing equality.

We will give Katona’s beautiful and short proof, using cyclic permutations. Recall that a permutation σ of [n] is called cyclic if there are i1, ..., in∈ [n] pairwise distinct such

that σ(i1) = i2, σ(i2) = i3,. . . ,σ(in) = i1. It is easy to see that there are (n − 1)! cyclic

permutations (there are n! choices for i1, ..., in, but cyclically permuting them gives rise

to the same cyclic permutation).

Proof. We say that a cyclic permutation σ of [n] contains a set Ai if the elements of Ai

(32)

3.2 Sperner’s Theorem and the LYM Inequality

Lemma 3.1.4

Given a subset A of [n] with k elements, there are n! (n k)

cyclic permutations σ of [n] containing A.

Proof. Count in two ways pairs (σ, A), where A is a k-subset of [n] contained in σ. Given σ, there are n possibilities for A, so we get n(n − 1)! = n! pairs. Let c(A) be the number of σ containing A. Then c(A) is independent of A having k elements: any two such sets differ by a permutation of [n] and conjugation by this permutation induces a bijection on cyclic permutations. Thus the number of pairs is P

Ac(A) = c(A0) n

k for any A0 having

k elements. The result follows. Now here is the key lemma:

Lemma 3.1.5

Let A1, ..., Am be an intersecting family of k-element subsets of [n], with k ≤ n2.

Then each cyclic permutation σ of [n] contains at most k Ai’s.

Proof. WLOG σ contains A1 and A1 appears as consecutive elements i1, ..., ik in σ. Any

other Ai contained in σ must begin with one of i2, ..., ik or end with some i1, ..., ik−1 (if

not, it begins with i1 and ends with ik, so it is A1). However, if some Ai begins with

is+1, then no Aj can end with is, since Ai∩ Aj 6= ∅ and 2k ≤ n (draw a circle with the

is’s consecutive on it and everything will be clear!). The result follows.

Now we are done: count in two ways pairs (σ, i) where σ is a cyclic permutation containing Ai. By the second lemma there are at most (n − 1)! · k such pairs. By the

first lemma, there are m · n! (n k)

such pairs. The result follows immediately.

§3.2

Sperner’s Theorem and the LYM Inequality

The following result is one of the most important ones in extremal set theory. An antichain in [n] := {1, . . . , n} is simply a family of (pairwise distinct) subsets of [n] such that A is not a subset of B whenever A, B are distinct subsets in the family.

Theorem 3.2.1 (Sperner’s theorem)

The maximal size of an antichain in [n] is [n/2]n .

There are a few proofs in the book. We deduce this here from a more complicated result:

Theorem 3.2.2 (LYM inequality, Lubell, Yamamoto, Meshalkin)

Let A be an antichain in [n]. Then X A∈A 1 n |A|  ≤ 1.

(33)

3.2 Sperner’s Theorem and the LYM Inequality

Proof. The following beautiful proof is due to Lubell. A chain will be a family C = (C1, ..., Cn) of subsets of [n] such that C1 ⊂ ... ⊂ Cn and |Ci| = i. To construct it, we

need to choose an element of [n] and then successively add one extra element. Thus there are n! chains. We will count pairs (A, C), where A ∈ A and C is a chain such that A is a member of C (i.e. A is some Ci). Since A is an antichain, for any chain C there is

at most 1 subset A in A such that C contains A. So the number of pairs is ≤ n!. On the other hand, it is easy to see that given a subset X with k elements of [n], there are precisely k!(n − k)! chains having X as one of the members. So the number of pairs is

X

A∈A

|A|!(n − |A|)! ≤ n!

and the result follows by dividing by n!.

Proof of Theorem 3.2.1. To get an antichain of that size, simply choose all subsets with [n/2] elements. Conversely, if A is an antichain, since [n/2]n  = maxk nk we deduce

from the LYM inequality that

1 ≥ X A∈A 1 n |A|  ≥ |A| n [n/2] 

and the result follows.

 This has the following beautiful application. We note that the theorem actually holds for arbitrary vectors and any ball of radius 1, but we stick to the 1-dimensional case for simplicity.

Example 3.2.3 (Littlewood-Offord problem)

Let a1, . . . , an be real numbers of absolute value |ai| ≥ 1. Consider the 2n linear

combinationsPn

i=1iai, i∈ {−1, +1}. Then the number of sums which are in any

interval (x − 1, x + 1) is at most [n/2]n .

An interpretation of this theorem is that for any random walk on the real line, where the i-th step is either +ai or −ai at random, the probability that after n steps we end

up in some fixed interval (x − 1, x + 1) ist at most [n/2]n /2n= O(1/n).

Proof. We can assume that ai ≥ 1. For  ∈ {−1, 1}n, let I = {i ∈ [n] : i = +1}. If

I ⊂ I0, and 0 corresponds to I0, we have X 0iai− X iai = 2 X i∈I0−I ai ≥ 2|I0− I|.

Thus, if I is a proper subset of I0 then only one of them can correspond to a sum inside (x − 1, x + 1). Consequently, the sums inside (x − 1, x + 1) correspond to an antichain

and we can have at most [n/2]n  such sums by Sperner’s lemma.

Speaking of Sperner’s theorem, we take the opportunity to emphasize that there is another beautiful theorem under his name which can be proven using a double counting argument.

We say that a triangle subdivision of a planar triangle T is a partition of T into small triangles such that any two triangles are either disjoint, share a vertex or share a face (in some other places this is called a triangulation). A proper coloring of a triangle

(34)

3.3 Chain Decompositions and Their Applications

subdivision is an assignment of 3 colors to the vertices of the subdivision, so that the vertices of T receive all different colors, and points on each side use only the colors of the vertices defining the respective side of T . (Note that we do not require that endpoints of an edge receive different colors.)

Theorem 3.2.4 (Sperner’s other theorem)

Every properly colored triangle subdivision contains a (small) triangle whose vertices have all different colors.

Proof. Note that there is a one-dimensional version of this problem as well. Namely, if we have a line segment (a, b), subdivided into smaller segments and we color the vertices of the subdivision with 2 colors, then there is definitely a small segment on (a, b) that has its endpoints colored differently. In fact there is an odd number of them!

For the triangle case, let Q denote the number of triangles colored (1, 1, 2) or (1, 2, 2), and let R be the number of triangles labeled (1, 2, 3). Consider edges in the subdivision whose endpoints receive colors 1 and 2. Let X denote the number of boundary edges colored (1, 2), and Y the number of interior edges colored (1, 2) (inside the triangle T ). We count in two different ways:

(i) Over triangles of the subdivision: for each triangle of type Q, we get 2 colored (1, 2), while for each cell of type R, we get exactly 1 such edge. Note that this way we count internal edges of type (1, 2) twice, whereas boundary edges only once. Hence, 2Q + R = X + 2Y .

(ii) Over the boundary of T : edges colored (1, 2) can be only inside the edge between two vertices of T colored 1 and 2. As we already argued in the first paragraph, X is odd; hence (i) implies that R is odd. In particular, there has to be some small triangle of the subdivision with different labels.

This theorem can be generalized to n dimensions using induction. Its main application consists of the celebrated Brouwer fixed point theorem.

Theorem 3.2.5 (Brouwer’s fixed point theorem)

Let Bn denote an n-dimensional ball. For any continuous map f : Bn→ Bn, there

is a point x ∈ Bn such that f (x) = x.

The full proof requires some topology and so it is beyond the scope of this class.

§3.3

Chain Decompositions and Their Applications

Let S be a finite set. A family A1, ..., Ah of subsets of S forms a chain if Ai ⊂ Ai+1and

|Ai+1| = 1 + |Ai| for all i. This chain is symmetric if moreover |A1| + |Ah| = |S|.

Similarly, we can define chains and symmetric chains for the set of positive divisors of some positive integer n: d1, ..., dh form a chain if di+1/di is a prime number for all i, and

the chain is symmetric if moreover f (d1) + f (dh) = f (n), where f (x) is the number of

prime factors of x, counted with multiplicities.

Remark 3.3.1. Actually one can define the notion of chain and symmetric chain in a very general context. We’ll only stick to the previous examples in these notes for sake of simplicity.

(35)

3.4 Mirsky and Dilworth

Theorem 3.3.2 (de Bruijn, Tengbergen, Kruyswijk)

The set of positive divisors of a positive integer n can be partitioned into symmetric chains. The same happens with the set of subsets of a finite set S.

Proof. The second part follows easily from the first part (applied to a square-free integer) and I leave this deduction as an exercise. The first part will be proved by induction on the number k of distinct prime factors of n. If k = 1, then n is a power of a prime p, and 1, p, p2, ..., n is already a symmetric chain. Suppose the result holds for numbers with k prime factors and let n have k + 1 prime factors.

Choose any prime factor p of n and write n = psm, with m relatively prime to p and s ≥ 1. Note that m has k prime factors, so we can use the induction hypothesis for it and write the set of its divisors as a disjoint union of symmetric chains. Choose such a chain d1, ..., dh. We’ll partition the divisors d1, d1p, ..., d1ps, d2, ..., d2ps, ..., dh, ..., dhps

into symmetric chains. Doing this for all chains d1, ..., dh we’ll get the desired result for

n.

Consider a matrix whose row of index i (1 ≤ i ≤ s + 1) has entries d1pi−1, d2pi−1, ..., dhpi−1.

Now the first chain will be formed by elements in the first row and last column: d1, d2, ..., dh, dhp, ..., dhps.

Easily, this chain is symmetric. The second chain consists of what remains from the second row and next to last column, namely d1p, d2p, ..., dh−1p, dh−1p2, ..., dh−1ps. It is also

symmetric. We continue like this and obtain the desired symmetric chain decomposition (draw a picture to see what is actually happening!).

Note that the theorem trivially implies Sperner’s theorem: consider a symmetric chain decomposition of the subsets of [n]. There are exactly [n/2]n  chains in the partition, since each chain contains exactly one subset of size [n/2]. But each antichain contains at most one member of each chain in the decomposition.

§3.4

Mirsky and Dilworth

We will now discuss two very general and important theorems in combinatorics. Before doing that, we need to introduce the notion of partially ordered set , which we will conventionally abbreviate as poset . A binary relation on a set X is simply the data of a subset of X × X, i.e. we select some ordered pairs (x, y) of elements of X. If (x, y) is a selected pair, we say that x is in relation with y. When we talk about order relations, we usually write x ≤ y instead of saying that (x, y) is selected. Now an order relation is simply a binary relation ≤ for which

• x ≤ x for all x

• if x ≤ y and y ≤ x, then x = y • if x ≤ y and y ≤ z, then x ≤ z.

A poset is just a set with an order relation. The fundamental examples are positive integers with divisibility relation, real numbers with the usual order relation, subsets of a set S with the inclusion relation, etc.

References

Related documents

None of reference is invalid, drug information to opioids under the references from a group of the technologies we cannot show you already on our pdr.. Just some electronic access

• Suppose that a connected planar simple graph has 10 vertices, each of degree 3.. Into how many regions does a representation of this planar graph split

For example, we will now use Definition 5.8.2 and structural induction to establish one of the most basic properties of a connected planar graph; namely, the number of vertices

Lemma: Every planar graph on n vertices contains an independent vertex set of size n/18 in which each vertex has degree at most 8.. Let’s use this now to build the triangle

at 10 (emphasis by Majority omitted, current emphasis added). Instantly, Selective will not suffer detriment from the trial court’s decision so much as from its own

Thompson was negligent by performing an ileo-transverse anastomosis on November 5, 2002 and that the standard of care required that he perform an ileostomy.. Becker

A dose is given EVERY TIME you eat any carbs AND/OR have a high blood sugar that requires insulin.. Delivered just as if you were taking a shot of Humalog, Novolog

– I wish to transfer my Stocks and Shares ISA to Threadneedle Investment Services Limited – I have read the Terms and Conditions attached to this transfer form. – I have read