COMBINATORICS
COMBINATORICS
COMBINATORICS
1
Definition 2 Let n ∈ Z, n ≥ 0 and 0 ≤ r ≤ n. If we have n objects, then a
subset of r objects where the ordering matters is an r-permutation of the objects. If
ordering does not matter, then the subset is an r-combination.
In particular, when r = n, an n-permutation is simply called a permutation.
Remark. For r = 0 in either case, we choose none of the objects. We define
a 0-permutation or a 0-combination simply to be the empty set. This must be the
case when n = 0.
Proof of Theorem 1. There are n ways of picking the first object. Then there
are n ways of picking the second object, since replacement is allowed. Repeating
this r times, we get nr as the total number of possibilities.
Example 1. There are 64 = 1296 4-digit numbers which contain the digits 1, 2,
3, 4, 5 and 6.
2
picking the rth object, since we are not allowing replacement. So the total number
n!
of possibilities is n × (n − 1) × · · · × (n − r + 1) = (n−r)! .
n!
Definition 3 The expression (n−r)!
is usually denoted by nPr .
Example 2. If n = 5 and r = 2, we have the following 2-permutations of
{1, 2, 3, 4, 5}: {1, 2}, {1, 3}, {1, 4}, {1, 5}, {2, 1}, {2, 3}, {2, 4}, {2, 5}, {3, 1}, {3, 2},
{3, 4}, {3, 5}, {4, 1}, {4, 2}, {4, 3}, {4, 5}, {5, 1}, {5, 2}, {5, 3} and {5, 4}, giving a
5!
total of 20. This agrees with Theorem 2: (5−2)! = 20.
Before we proceed, we would like to divert and make a shorthand notation. The
above listing of r-permutations looks rather cumbersome. We can make such a listing
look a bit more pleasant simply by ignoring the chain brackets, and the commas
within the r-permutations. This shorthand notation also works for r-combinations.
Definition 4 For an r-permutation or an r-combination {x1 , x2 , . . . , xr }, we may
write it as x1 x2 · · · xr
So, the above listing can simply be written as 12, 13, 14, 15, 21, 23, 24, 25, 31,
32, 34, 35, 41, 42, 43, 45, 51, 52, 53, 54.
Next, we consider the same question, but when the objects may not be distinct.
In this case, we only consider the number of permutations.
Theorem 3 Suppose that we have n ≥ 0 objects, where n1 of them are of type 1,
n2 of them are of type 2, . . . , nk of them are of type k, so that n = n1 + · · · + nk .
Then, the number of permutations of the objects is
n!
.
n1 ! × n2 ! × · · · × nk !
Proof. If we disregard that some of the objects are the same, then we would
have n! permutations. Now, in each permutation, within the objects of type 1, they
can be permuted in n1 ! ways; within the objects of type 2, they can be permuted in
n2 ! ways, and so on. So, such a permutation has been counted n1 ! × n2 ! × · · · × nk !
times, and we must divide n! by n1 ! × n2 ! × · · · × nk ! to get the correct answer.
3
where we care about the ordering in which the chosen objects appear. We now want
to count the number of r-combinations from n objects, so that we do not care about
the ordering of the chosen objects. Firstly, Theorem 4 below considers the case when
we cannot replace an object after picking it. This is the analogue of Theorem 2.
Example 4. There are 10 ways of choosing two numbers from the set {1, 2, 3, 4, 5},
the subsets being 12, 13, 14, 15, 23, 24, 25, 34, 35, and 45. This agrees with Theorem
5!
4: 2!(5−2)! = 10.
4
Example 5. A bakery sells ten types of cakes. The number of ways of choosing
four cakes is 13
4
= 715 (provided that there are at least four of each type of cake
available).
digress and discuss some results about these numbers, before we return to discuss
more on counting objects.
Definition 6 We define Pascal’s Triangle as follows. We start with a 1, and this
is row 0 of the triangle. A subsequent row is formed as follows. To get an entry in
row i, we add two adjacent entries in row i − 1, and place the sum in the space in
row i which is between and below the two row i − 1 entries. If one of the entries in
row i − 1 is missing, we assign a 0 to the missing spot.
Also, in each row, the entry on the left is the 0th entry of the row, and the entries
to its right are, in order, the 1st entry, the 2nd entry, and so on.
Below are row 0 to row 5 of Pascal’s Triangle.
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
It is well-known that the entries of Pascal’s Triangle are precisely the binomial
coefficients.
Theorem 6 For n ∈ Z, n ≥ 0 and 0 ≤ r ≤ n, the rth entry in row n of Pascal’s
triangle is precisely nr .
Proof. We use induction on n. The result is true for n = 0. We only have r = 0,
0
and 0 = 1, the only entry in row 0 of the triangle.
Now, let i ≥ 1, and suppose that the result holds for every entry in row i − 1 of
the triangle. Let 0 ≤ r ≤ i. If 1 ≤ r ≤ i − 1, then the rth entry in row i is
i−1 i−1 (i − 1)! (i − 1)!
+ = +
r−1 r (r − 1)!(i − r)! r!(i − 1 − r)!
(i − 1)! 1 1
= +
(r − 1)!(i − 1 − r)! i − r r
(i − 1)! i
= ·
(r − 1)!(i − 1 − r)! (i − r)r
i! i
= = .
r!(i − r)! r
5
If r = 0, then the 0th entry in row i of the triangle is
i−1 i
0+ =1= .
0 0
We have now shown that the result holds for the entries in row i. Hence the
result follows by induction.
Next, we have the most well-known result involving binomial coefficients, the
binomial theorem.
Proof. There are many proofs of this result. We give probably the simplest.
When we expand out (x + y)n , each term we obtain consists of some x’s and
some y’s multiplied together, the total number of x’s and y’s being n (this is before
we add any equal terms together). So, it suffices to show that, for each 0 ≤ r ≤ n,
n n−r r
there are precisely r terms x y . But this is clear by Theorem 4. We have n
y’s, and we have nr ways of picking r y’s from them. Whenever we choose r y’s,
n n−r r
we are automatically left with n − r x’s. So we have precisely r terms x y .
The binomial coefficient also satisfies many properties, and Theorem 8 below
shows some of the most well-known ones.
(a) nr = n−r n n!
, if 0 ≤ r ≤ n. Both are equal to r!(n−r)! .
(c) nr + r+1 n
= n+1
r+1
, if 0 ≤ r ≤ n − 1.
(d) n0 + n1 + n2 + · · · + nn = 2n .
(e) n0 − n1 + n2 − · · · + (−1)n nn = 0.
(f ) 1 n1 + 2 n2 + 3 n3 + · · · + n nn = n2n−1 .
2 2 2 2
(g) n0 + n1 + n2 + · · · + nn = 2n
n
.
6
Proof. Properties (a) and (b) are obvious from the definition of nr .
Property (c) has already been proved in the main calculation in the proof of
Theorem 6.
Properties (d) and (e) follow from Theorem 7 by letting x = y = 1 and x = 1,
y = −1, respectively.
= nr=0 nr y r .
To get property (f), we let x = 1 in Theorem 7 to get (1 + y)n P
P
n n r−1
Differentiating both sides with respect to y gives n(1 + y)n−1 = r=1 r r y .
Then, letting y = 1 gives the result.
n 2n
To get property (g), we
consider the coefficient of x in the expansion of (1+x) .
2n
On one hand, this is n , by Theorem 7. On the other hand, by Theorem 7 again,
we have
n
! n
!
2n n n
X n r X n s
(1 + x) = (1 + x) (1 + x) = x x .
r=0
r s=0
s
In the product on the right, when we expand, we get a term involving xn whenever
we multiply a term which involves xt in the first sum by a term which involves xn−t
in the second
n n
sum, for some 0 ≤ t ≤ n. For such a t, the corresponding coefficient
is t n−t . Summing these coefficients as t varies, and using property (a), we
get that the overall coefficient of xn is also n0 nn + n1 n−1
n
+ · · · + nn n0 =
n 2
2 2
+ n1 + · · · + nn . This gives property (g).
0
Example 6. n real numbers whose sum is n are placed on a circle. Show that
for any 1 ≤ k ≤ n, some k successive numbers must have a sum at least k.
Let a1 , a2 , . . . , an be the numbers. We can use the numbers to form an array as
7
follows.
a1 a2 a3 ··· an
a2 a3 a4 ··· a1
a3 a4 a5 ··· a2
.. .. .. ..
. . . .
ak ak+1 ak+2 · · · an+k−1
Note that the indices are taken modulo n. Now, the total sum of all the numbers
in the array is kn, since there are k rows, each with sum n. So, the sum of the
columns is also kn. Since there are n columns, some column must have a sum of
at least kn
n
= k (if every column has sum less than k, then the total sum of the
columns, hence the sum of everything in the array, is less than kn, a contradiction).
Moreover, each column represents successive terms on the circle. So we are done.
The idea is that we do not actually try to find the common total number (which
may be difficult to compute), but we try to ‘match’ the objects with property A to
the objects with property B in a ‘one-on-one’ manner. Such a matching is formally
known as a bijection.
So, going back to the scenario, let A be the set of objects with property A, and
define B likewise. If we can find a bijection from A to B, then it easily follows that
|A| = |B|, provided that the common number is finite. For a problem of such a
form, a proof which exhibits a bijection is a ‘bijection proof’.
8
we want to list out all the distinct partitions of n, it is a good idea to assume that
the terms are decreasing in each partition.
.............................................................................
.... .... ....
... ... ...
... ... ...
..................................................................................................................
.... .... .... ....
.... .... .... ....
.............................................................................................................
Figure 1
In a Young diagram, the number of boxes is n. The columns are always decreasing
in height from left to right (possibly by zero), and the number of boxes in the columns
are the terms of the partition.
We use this idea to produce a bijection proof. Firstly, it is easy to check that
the correspondence between the partitions and the Young diagrams of n is bijective
(clearly, two different partitions of n map to different Young diagrams, and every
Young diagram of n is formed from some partition of n). Now, a partition of n with
at most r terms has at most r columns in its diagram, while a partition of n, each of
whose terms is at most r, has a diagram such that every column has height at most
r. So, it is enough to find a bijection between these two classes of Young diagrams.
But this is fairly obvious. For a Young diagram of the first type, if we reflect it about
the diagonal line at 45◦ , we get another Young diagram whose columns have heights
at most r, and so is of the second type. The converse holds as well. Obviously, two
distinct Young diagrams of the first type, when reflected, give two distinct Young
diagrams of the second type. From these, it is obvious that this ‘reflection’ is the
required bijection, and we are done.
9
For the example where n = 5 and r = 3, we get the bijection
3+1+1 ←→ 3+1+1
2+2+1 ←→ 3+2
4+1 ←→ 2+1+1+1
3+2 ←→ 2+2+1
5 ←→ 1+1+1+1+1
Remark. It is easily conceivable that, for general n and r, the above common
number of partitions is difficult to find exactly. This indeed is the case.
If we were just to add the 18 to the 13, we get 31, but we will have counted those
students who got grade A’s in both exams twice. So we need to subtract the number
of such students, which is 5. The answer is therefore 18 + 13 − 5 = 26 students.
To generalise this, we first define some well-known set operations.
Definition 9 Let A and B be any two sets.
(a) We call the elements which belong to both A and B the intersection of A and
B. This set is denoted by A ∩ B.
(b) We call the elements which belong to A or B (including both) the union of A
and B. This set is denoted by A ∪ B.
(c) We call the elements which belong to A, but not to B, the difference of B from
A. This set is denoted by A \ B, or A − B.
Remark. These three operations can obviously extend to more than two sets.
But when this happens, if we have at least two of ∩, ∪ and \, or at least two of \
involved, we must use brackets to show which operation(s) must be done first. For
example, ‘A∩B ∪C’ does not make sense, since in general, (A∩B)∪C 6= A∩(B ∪C).
‘A \ B \ C’ makes no sense, since (A \ B) \ C 6= A \ (B \ C), in general.
However, if we just have ∩ or ∪ on its own, we do not need any brackets, because
in these cases, the set that we get at the end will be the same, no matter which order
we use for the operations. For example, A ∩ B ∩ C makes sense, since (A ∩ B) ∩ C =
10
A ∩ (B ∩ C) for any three sets A, B, C, and we use A ∩ B ∩ C for both of these.
Similarly for ∪ on its own, and for more than three sets.
So, we can interpret Example 8 in this way. Let A be the set of the students
who got a grade A in maths, and B be the set of the students who got a grade A
in English. So, we have |A| = 18, |B| = 13 and |A ∩ B| = 5. We want to find the
value of |A ∪ B|. With the same argument as given in the example, we get
Can we extend this formula to three sets? Suppose that we have three sets A, B
and C, and we know the values of |A|, |B|, |C|, |A∩B|, |A∩C|, |B∩C| and |A∩B∩C|.
Can we find the value of |A ∪ B ∪ C|?
We can indeed apply the same argument. If we add |A|, |B| and |C|, we will
have counted the elements of (A ∩ B) \ (A ∩ B ∩ C), (A ∩ C) \ (A ∩ B ∩ C) and
(B ∩ C) \ (A ∩ B ∩ C) twice, and the elements of A ∩ B ∩ C three times. Then, if
we subtract |A ∩ B|, |A ∩ C| and |B ∩ C|, we will then have counted the elements of
(A ∩ B) \ (A ∩ B ∩ C), (A ∩ C) \ (A ∩ B ∩ C) and (B ∩ C) \ (A ∩ B ∩ C) correctly,
but we also will have counted the elements of A ∩ B ∩ C 3 − 3 = 0 times. So, adding
|A ∩ B ∩ C|, we get the correct formula for |A ∪ B ∪ C|:
where, in the sum on the right, we have the size of every k-wise intersection for
every 1 ≤ k ≤ n, where a k-wise intersection is assigned with the sign (−1)k−1 .
Before we prove this, we shall prove a well-known identity about sets.
Lemma 10 Let n ∈ N, n ≥ 3. For sets B1 , B2 , . . . , Bn , we have
11
Proof. We first prove that, for three sets A, B, C, we have (A ∪ B) ∩ C =
(A ∩ C) ∪ (B ∩ C). We have
x ∈ (A ∪ B) ∩ C ⇐⇒ x ∈ A ∪ B and x ∈ C
⇐⇒ x ∈ A or x ∈ B, and x ∈ C
⇐⇒ x ∈ A ∩ C or x ∈ B ∩ C
⇐⇒ x ∈ (A ∩ C) ∪ (B ∩ C),
so the identity holds. Now, using this identity repeatedly, we have
(B1 ∪ B2 ∪ · · · ∪ Bn−1 ) ∩ Bn = [(B1 ∪ B2 ∪ · · · ∪ Bn−2 ) ∩ Bn ] ∪ (Bn−1 ∩ Bn )
= [(B1 ∪ B2 ∪ · · · ∪ Bn−3 ) ∩ Bn ]
∪(Bn−2 ∩ Bn ) ∪ (Bn−1 ∩ Bn )
= ···
= (B1 ∩ Bn ) ∪ · · · ∪ (Bn−1 ∩ Bn ).
12
The final expression consists exactly the missing terms that we needed, with the
correct signs.
Example 9. How many positive integers less than 3000 are coprime to 3000?
The prime factorisation of 3000 is 3000 = 23 × 3 × 53 . Let S be the positive
integers less than 3000, that is, S = {1, 2, . . . , 2999}. We count the number of
elements of S which are not coprime to 3000. The highest common factor of such a
number with 3000 is divisible by at least one of 2, 3 and 5, so such a number must be
divisible by at least one of 2, 3 and 5. Let A be the elements of S which are divisible
by 2, B be the elements of S which are divisible by 3, and C be the elements of S
which are divisible by 5. We would like to find |A ∪ B ∪ C|, the number of elements
of S which are divisible by at least one of 2, 3 and 5.
We have |A| = |{2, 4, 6, . . . , 2998}| = 1499, |B| = |{3, 6, 9, . . . , 2997}| = 999, and
|C| = |{5, 10, 15, . . . , 2995}| = 599. Also, A ∩ B are the elements of S which are
divisible by 6, so |A ∩ B| = |{6, 12, 18, . . . , 2994}| = 499. Similarly,
This is the number of elements of S which are not coprime to 3000. So the
number of elements of S which are coprime to 3000 is 2999 − 2199 = 800.
Example 10. Suppose that we have 10 points within a square of side length 3
(including on
√ the edges of the square). Prove that some two points must be within a
distance of 2 of each other.
13
Divide the square into nine 1×1 squares. Then by the pigeonhole principle, some
two points must lie within one of the squares (including the sides of that square).
So
√ we are done,
√ since the longest possible distance between any two such points is
2 2
1 + 1 = 2.
2. Graph Theory
2.1 Graphs: Definitions
Graphs are very important objects in combinatorics. They are so important that
there is actually an area of mathematics devoted to them: graph theory (which is
a rather large area). Graphs interact very well with other areas of combinatorics.
Roughly speaking, a graph is just a set of points, with some pairs of them being
joined by some lines. Below, we give a more precise definition.
Definition 10 A (simple) graph is a pair G = (V, E), where V is a set, and E is
a family of subsets of V , each is of size 2 (and unordered).
An element of V is called a vertex of G, and an element of E is called an edge
of G. V is the vertex set of G, and E is the edge set of G.
Sometimes, we may want to write V (G) = V and E(G) = E, to emphasize the
dependence of V and E on G.
We write |G| = |V (G)| and e(G) = |E(G)|, and call these the order and the size
of the graph G, respectively. Note that each of these can be infinite (we shall see
some examples soon).
The best way to think of a (simple) graph is by a picture. V is a set of points
(namely, vertices). E is a set of line or curve segments (namely, edges) joining pairs
of vertices such that, a subset of V of size 2 is in E if and only if there is an edge
joining the corresponding two vertices of V .
In this way, we usually use letters like v and u for the vertices of a graph. For
edges, if the edge with end-vertices u and v is in the graph, we just write uv to
denote this edge, rather than {u, v}. Note that uv = vu. We may also use letters
like e and f to denote edges.
. . . .... .
. v1
.
....................
........ ...... ...........
......
. .. ..
.... .. ...
... ......................................... ...........
. .
. ..
v5 ..........
.
..................................
...... ....
...... ...
.
..
.
. ..
....
.
.................................
......
.......
...... v2
....... .... .
. .... .....
... ........... ..........
.... .... ... .
. ...........
... ...... ...........
.... ..........
v4
.
...... .......
....
v3
Figure 2
14
Remark. We need to be rather careful. We do not allow the following here.
• No ‘loops’ are allowed. That is, a vertex cannot be joined to itself. If we are
allowed to have ‘loops’, then we are talking about ‘graphs with loops’.
• No pair of distinct vertices can have more than one edge joining them. If we
allow this, then we have ‘multiedges’, and we are talking about ‘multigraphs’.
• The edges are ‘unordered pairs of vertices’. If we care about the ordering of
an edge, we have ‘directed edges’, and we are talking about ‘directed graphs’.
Hence, sometimes we use the word ‘simple’ to emphasize that we do not allow
these things. But here, we will drop this word, since we will only be talking about
simple graphs.
However, the edges do not necessarily have to be straight line segments. We can
use curves for edges. But it is absolutely essential to use large dots to show the
vertices, because for certain graphs, it may be the case that no matter how we draw
them, we may be forced to have that some edges must cross (this ought to happen if
we have lots of edges), so that we must declare if there is a vertex at such a position
or not.
Also, the set V can be an infinite set, in which case E can also be infinite. Here
are some examples.
Example 12. We may have V = Z, and E consisting of the edges which join
distinct pairs of even numbers. So, such a graph can only be partially drawn.
Indeed, depending on the vertex set, some graphs may be even harder to draw,
maybe impossible. For example, if V = R, and E consists of the edges which join
pairs of real numbers with unit distance between them. We can only barely draw a
few vertices and edges of this graph. We can only define it in an abstract way.
Graphs can model many real life situations. For example, a situation where a
‘network scenario’ is present. The vertices can represent people and edges can join
two people if they are related. Or, the vertices can represent computers and the
edges can join two computers if they are related in some way. And so on. In this
way, graphs present very nice ways of looking at such a situation.
Now, we define several important classes of graphs, with their notations.
Definition 11 Let n, m ∈ N.
(a) The complete graph on n vertices is the graph with n vertices, where each pair
of vertices is joined by an edge. It is denoted by Kn . We have e(Kn ) = n2 .
(b) The empty graph on n vertices is the graph with n vertices, but with no edges.
It is denoted by En . We have e(En ) = 0.
15
(c) For n ≥ 3, the cycle on n vertices is the graph with n vertices, v1 , v2 , . . . , vn
say, with edges v1 v2 , v2 v3 , . . . , vn−1 vn , vn v1 . It is denoted by Cn . We have
e(Cn ) = n.
(d) The path of length n − 1 is the graph with n vertices, v1 , v2 , . . . , vn say, with
edges v1 v2 , v2 v3 , . . . , vn−1 vn . It is denoted by Pn−1 . We have e(Pn−1 ) = n − 1.
K4 E3 C5 P3 K2,3
Figure 3
Next, we consider some properties of a vertex of a graph.
Definition 12 Let G = (V, E) be a graph, and let v ∈ V be a vertex of G.
(a) The vertex u ∈ V is adjacent to v, or is a neighbour of v, if uv ∈ E.
(c) The number of neighbours of v is the degree of v, and is denoted by d(v). Note
that d(v) = |Γ(v)|. Again, this may be finite or infinite.
(e) The smallest of all the degrees is the minimum degree of G, and the largest is
the maximum degree of G. These are denoted by δ(G) and ∆(G), respectively.
Sometimes, we may want to write ΓG (v) for Γ(v) and dG (v) for d(v), if we want
to emphasize the dependence of neighbourhood and degree on G.
Remark. If δ(G) and ∆(G) are both finite, then obviously, δ(G) ≤ ∆(G). Also,
these quantities are always well-defined, even if the graph G is infinite. It is possible
to have δ(G) = ∞ and/or ∆(G) = ∞.
We have an elementary result about the sum of the degrees of a graph with finite
order.
16
Theorem 12 Let G = (V, E) be a graph, with V finite. Let V = {v1 , v2 , . . . , vn }.
Then,
X n
d(vi ) = 2e(G).
i=1
Proof. This is another good example illustrating counting objects in two ways.
We count the number of edges of G in two ways. On one hand, this is e(G). On
the other hand, if we consider summing the degrees of G, then each edge has been
counted exactly twice;
Pn an edge uv is counted in the terms d(u) and d(v) of the degree
1
sum. So, e(G) = 2 i=1 d(vi ), and we are done.
Now, we define some more properties about graphs themselves. We can talk
about a graph containing other graphs.
(b) Let A ⊆ V . Then the subgraph of G induced by A is the subgraph with vertex
set A, and the edges of E whose end-vertices are in A. We write G[A] for this
subgraph.
(c) Let x ∈ V (G). Then the graph G − x is the graph formed by removing x from
G, along with the edges which touch x.
(d) Let e ∈ E(G). Then the graph G − e is the graph (V, E \ {e}). That is, we
just remove the edge e from G.
The above ideas are often useful for proving statements about graphs, when we
want to apply induction on the number of vertices, or on the number of edges (or
some other similar quantity).
Finally, given a graph, it has a ‘complement graph’.
In other words, to get G from G, we just remove the edges of G, and add back
the edges between vertices of V that were not present in G.
17
Definition 15 Let r ∈ N, r ≥ 2. A graph G = (V, E) is an r-partite graph if there
is a partition of V into r parts, V = V1 ∪ V2 ∪ · · · ∪ Vr say, such that for every edge
uv ∈ E, we have u ∈ Vi and v ∈ Vj for some i 6= j. The sets V1 , . . . , Vr are the
classes of G.
If G contains every edge between every two classes, then G is a complete r-partite
graph. In the case where all the classes are finite, G is denoted by Kk1 ,k2 ,...,kr , where
k
P i = |Vi | for every 1 ≤ i ≤ r, so that k1 + · · · + kr = |V |. We have e(Kk1 ,k2 ,...,kr ) =
i<j ki kj .
Finally, a 2-partite graph is more commonly called a bipartite graph.
Note that in an r-partite graph, two vertices in the same class cannot be joined
by an edge.
Figure 4 below shows a 4-partite graph, and the graph K4,2,3 . The classes in each
case are shown in the ovals.
... ....
........ ...
..... . ................
.........
..... ...................................................... ....... ..............
.. ..
.............................. .....
....
........................ ........................
.......
..
... . . . ... ... ..... ..... ......... ........ ........ ........ .....
... .............
.... .... .......... ..... ...... .... ..... .. ............................ ............. ............ ...............
..... ............................................. ... ..... ............... ..... .. ...............................................
..
.. . . . ..
... ... ... ...
. . ...
. . ...... ........................... ....... ............
................. .
. ..... ... ..
.. ......................................
. . .. ..... ...................... ........... ...... ...
.
.... .. . ... ..
... ...
... ... ... ......................... ....................................................................
.
.... ............................... . . ... .... ........... ... .. ...... ... ....................
.... .......... ..... ................ ..... .....
. . .. .............. .. ... ....................................................................... ...........
. . ..........................................
........ ....
..
... ......
...... ........................ .
..... .............. ................
..... ................. ..
..... ................ .. .......................... .. . .. ...
.
... .. .. .......... ... ...... .. .
... ... ................. ............... ...
..... ............................................................................................................................................................................. ...
.... .
. ..
..... .............................. ............. .. ....... ....
.
..
... ............................................................................................................................. ......
..
..................... ....
... .................................................................................................................. .. .......... ...
...
. ................. .......... .
......................... ..
... .........................................................................................................................................................
......
..................
. ....
.
.... .........
...............
.....
..
.... ................................................................................ ..... .....
..... ..
.........
. ....
.......... ..... ....
... .....
..........
.
K4,2,3
Figure 4
In certain problems, r-partite graphs, and in particular, bipartite graphs, are
very useful graphs to consider. Here is an example.
18
So, 13a = 6i=1 3bi , from which it follows that a is a multiple of 3. Now, since a
P
M ........... ......
...........................
.........................
...................................................
......
......
.....................................................
...
.................
..................................
........ ...... ....... ...... ........
........................... .........................
..
.. .....
..
... ........ ... ... ..... . .
.............
.....................
....................
..
........................................
..
........ ..
... .
. ..
.................. ..
.....
......
.. ... ............ ....... ..
...............
............... .. .... ...........................................
. ... ... ...
...............
. ..... ...... .....
...............
............... .... ... .....
. ...... .............. .... .......................
............... .. .. .. . .......... .............. .... .... ....
.. .. .. .. .. ... ............ ................ ... ... ...
............ ... ..........................
P ........ ...
...............
...............
................. .
.
...................
... .......
.....................................
. ... .. .
........ ... ..... ..... ........
...............
.
............... ..... ......................
.....................................
.
Figure 5
2.3 Connectedness
In this section, we consider yet another important property about graphs, the
concept of ‘connectedness’.
• H is connected.
19
Theorem 13 Let G = (V, E) be a graph, with V finite. Then either G or G is
connected.
Proof. If G is connected, we are done, so suppose not. Then G is made up
of at least two components, say, H1 , H2 , . . . , Hr , where r ≥ 2. Consider any two
components Hi and Hj . For any u ∈ V (Hi ) and v ∈ V (Hj ), we have uv ∈ E(G), so
that any two vertices of V (Hi ) ∪ V (Hj ) is connected by a path of length at most 2.
Since this holds for every i 6= j, we have, in fact, that every pair of vertices in G is
connected by a path of length at most 2. Hence G is connected.
Proof of Theorem 14. If xy is an edge of G, then they may not have a common
neighbour (otherwise we will get a triangle). So d(x) + d(y) ≤ n. Summing over all
edges, we have X
ne(G) ≥ (d(x) + d(y))
xy∈E(G)
In the sum on the right, we want to turn it into a sum over the vertices of G.
For each vertex v ∈ V (G),
P the number of occurrences of the term d(v) is d(v). So
2
the sum is the same as v∈V (G) d(v) . So we have
X
ne(G) ≥ d(v)2
v∈V (G)
20
Now,
P by the Cauchy-Schwarz Pinequality, if x1 , . . . , xn are non-negative reals,
P we
have ( x2i )(12 + · · · + 12 ) ≥ ( xi )2 , where we have n 1s. So xi ≥ n1 ( xi )2 .
P 2
Using Theorem 12 as well, we have
X 2
X
2 1 1
ne(G) ≥ d(v) ≥ d(v) = (2e(G))2 ,
n n
v∈V (G) v∈V (G)
n2
which gives e(G) ≤ 4
. Since e(G) is integral, we have, in fact,
j n2 k
e(G) ≤ .
4
2
It is easy to verify that b n4 c = b n2 cd n2 e, by considering the parity of n. Indeed,
2 2
they are both equal to n4 is n is even, and n 4−1 if n is odd. So we have the first part
of the theorem.
Now we prove the second part. We first consider the case when n is even. Assume
2
that we have equality in the theorem, so that e(G) = n4 . We must have equality in
Cauchy-Schwarz, so that all the degrees are equal. We must also have d(x)+d(y) = n
for every distinct x, y ∈ V (G), so we must have d(v) = n2 for every v ∈ V (G). Now,
take an edge uw ∈ E(G). We have |Γ(u)| = |Γ(w)| = n2 , Γ(u) ∩ Γ(w) = ∅ (the empty
set), and Γ(u) ∪ Γ(w) = V (G). Now, every z ∈ Γ(u) \ {w} can only be adjacent
to vertices of Γ(w), otherwise a K3 will be created. Since d(z) = n2 = |Γ(w)|, it
follows that Γ(z) = Γ(w). Similarly, Γ(z 0 ) = Γ(u) if z 0 ∈ Γ(w) \ {u}. It follows that
G = Kn/2,n/2 , as required (with classes Γ(u) and Γ(w)).
2
Finally, let n ≥ 3 be odd, say, n = 2m + 1. This time, we have e(G) = n 4−1 =
m2 + m. So, v d(v) = 2e(G) = 2m2 + 2m. So, there exists a vertex v ∈ V (G) with
P
j 2m2 + 2m k j m k
d(v) ≤ = m+ = m,
2m + 1 2m + 1
since 0 < 2m+1m
< 1. Now, let G0 = G − v. Then, e(G0 ) ≥ m2 + m − m = m2 .
Moreover, |V (G0 )| = 2m, and G0 also does not contain a K3 . So by the first part of
2
the theorem, we have e(G0 ) ≤ b (2m) 4
c = m2 . Hence, e(G0 ) = m2 , so by the result
0
for even n, we must have G = Km,m . Also, we now know that dG (v) = m as well
(since e(G0 ) = m2 ), so, replacing v back in to reform G, v must be joined to all the
vertices of one of the classes of G0 . It follows that G = Km,m+1 , which is exactly
what we want.
Can we generalise Mantel’s Theorem? Yes, we can, in the following way. We can
ask the more general question with Kk in place of K3 , for any prescribed k ∈ N.
That is, we want to know: “Given n, k ∈ N, where k ≥ 3, how many edges on n
vertices can a graph G have, so that G does not contain a Kk as a subgraph?”
In this case, it is conceivable that complete, (k − 1)-partite graphs are good
candidates, since they do not contain Kk as a subgraph. Moreover, the sizes of the
classes should be ‘as equal as possible’.
So, we introduce a little notation.
21
Definition 18 For n, r ∈ N, where n, r ≥ 2, the r-partite Turán graph of order n
is the complete r-partite graph on n vertices, where each class has size b nr c or d nr e.
It is denoted by Tr (n).
Remark.
(b) Note that, given n, r ∈ N, where 2 ≤ r ≤ n, there is only one way to partition
n into r terms, each of which is either b nr c or d nr e. Namely, we can think of the
formation of the unique partition as follows. Deal a pack of n cards to r people
in a cyclic manner. The distribution of the cards is then clearly unique, (up
to permutation), and the first s people get d nr e cards, with the others getting
b nr c cards, where s is the remainder when n is divided by r.
So, from (a) and (b) above, the graph Tr (n) is always well-defined.
Also, note that δ(Tr (n)) = n − d nr e, and ∆(Tr (n)) = n − b nr c.
...
.............
............................................
...... .......... ............ ........... ......
........................................................................
.... ..... .. ........ ... .
.. .. ......................... .............
.. . ... .. ........... ......... ...... ...
... ..............................................................................
.
.. ..... ...... ... ..... ...............................................
.. ..... ...... ...
........................ ..... ... ............ .. .............. ............
.
. ..
................................ ...............
... .. ..... ... .. ............ ...
... ... ............ ... ....... ..
. .
.......... ....
.... ...................................................................................................................................................... ....
. . .
.. .
... . . . .
... ....... ............................................................................ . . ..
... ............................................................................................................................................... ...
... ..
.... ...................................................... ..................... .........
.... ... ........................................................................... .....
.............. . .... .......
..........
...
T3 (8)
Figure 6
Now we can state Turán’s Theorem, which generalises Mantel’s Theorem, and it
says that these graphs Tr (n) are the best graphs.
This result is one of the most famous results in graph theory. It has many proofs.
However, all the known proofs are fairly technical. As a result, we will leave one of
these proofs as an exercise.
We will have at least one problem at the end where either Mantel’s Theorem or
Turán’s Theorem can be used.
22
The starting point of Ramsey theory is usually the following problem.
Example 14. Among a party of at least six people, there are either three people
who all know each other, or there are three people, none of whom knows the other
two (assuming that ‘knowing’ is a symmetric relationship).
Moreover, the assertion is false for fewer than six people. That is, ‘six’ is the
minimum integer for which this assertion holds.
To prove the first part, it suffices to prove it for six people, since if we have more
than six people, we can just take any subset of six people and consider whether they
know each other or not.
So, consider six people. Represent each of them by a vertex in a graph, and join
two vertices with a blue edge if the two people they represent know each other, and
by a red edge if the two people do not know each other. So, we have a K6 , whose
edges are coloured either blue or red. We are done if we can show that, no matter
which colouring we use, there is always either a blue triangle or a red triangle.
So, take any such colouring. Choose any vertex x. Since x has five neighbours,
by the pigeonhole principle, some three neighbours y1 , y2 , y3 are joined to x with the
same colour. Suppose that this colour is blue. If some yi yj is blue, then x, yi and
yj form a blue triangle. Otherwise, y1 y2 , y1 y3 and y2 y3 are all red, so y1 , y2 and y3
form a red triangle. A similar argument holds if xy1 , xy2 and xy3 are all red; we just
switch the colours and use the same argument. Since our colouring was arbitrary,
we have now proved the first part.
For the second part, it suffices to show that there is a colouring of the edges of
K5 , using blue and red, so that there is no triangle in one colour. For, if we have
such a colouring of the edges of K5 , then for each n ≤ 4, we can get a colouring of
the edges of Kn with no triangle in one colour, simply by taking any subset of n
vertices, along with the corresponding colours of the edges.
So, for K5 itself, we take the colouring as shown in Figure 7. The solid lines
are the blue edges, and the dotted lines are the red edges. We see that there is no
triangle in either colour in this colouring.
.
. .. . .
. . ............ . . .
.. .. .. . .
. . . ..... ....... . . .
. .. .......
..
.. ........... .... ..
.. ..
...
... .......... ..
..
.. .
.
...........................................................................................................................
. . ... ...... .
.. .. . .. . .
...... ......
.. .... ........................ ....... ...
..
.. ... ........ ......... .... .. . .. .. .
................ ...... ... .
. ...... . . . . . . . . . . ..........
.... .
.
Figure 7
23
(a) For r ∈ N, an (edge) r-colouring of G is a function f : E(G) → {1, 2, . . . , r}.
In other words, such a function is just a colouring of the edges of G, using at
most r colours.
Definition 20 For the above question, the least such integer, if it exists, is denoted
by R(s, t). It is called the Ramsey number of Kr versus Ks .
24
red Kt ? The answer is “no”; it turns out that R(s, t) does have an upper bound,
for every s and t. We have R(s, t) ≤ s+t−2s−1
, and we will leave a proof of this as
another exercise.
To round off this section, we end by mentioning some more extensions. We may,
of course, consider using r colours (where r ≥ 3) instead of 2 colours. The resulting
Ramsey numbers are also known to exist, but almost nothing is known about their
exact values. We may also consider finding monochromatic copies of some other
graphs, rather than complete subgraphs. For example, R(P3 , C4 ) denotes the least
integer n such that, whenever Kn is 2-coloured in blue and red, there is either a blue
P3 or a red C4 .
3. Colouring Proofs
We shall have a very short section here about another very useful technique for
combinatorics problems: the idea of colouring structures.
This idea of colouring a structure is extremely useful, and often, it is not easy
to notice in a certain problem that the idea can be applied. So one has to be very
wary about the possibility of using a colouring to tackle a problem.
4. Problems
25
We divide the problems into two parts. The first set consists of a few exercises,
which complete the missing proofs in the notes. The second set consists of the
challenges.
4.1 Exercises
1. Use the following guidelines to prove Turán’s Theorem. (This proof, when
k = 3, does not coincide with the proof of Theorem 14. Hence it is another
proof of Mantel’s Theorem.)
Let n, k ∈ N with n ≥ 2 and k ≥ 3. Suppose that G is a graph on n vertices
which does not contain Kk . We shall prove Theorem 15 by induction on n.
The base case n = 2 is trivial (why?). So, assume that n ≥ 3.
• Assume firstly that e(G) = e(Tk−1 (n)). We claim that G = Tk−1 (n).
– Explain why we have δ(G) ≤ δ(Tk−1 (n)).
– Then, show that there exists a vertex x ∈ V (G) such that e(G − x) ≥
e(Tk−1 (n)). Hence, considering induction on n, what can you say
about G − x?
– Now, replace x back. Where in G − x ( = ?) must x be joined to?
Deduce that G = Tk−1 (n).
• Now, assume that e(G) > e(Tk−1 (n)). By considering the removal of a
suitable number of edges from G, explain why we cannot have this case.
2. Prove that R(s, t) ≤ R(s − 1, t) + R(s, t − 1) for s, t > 2 (Hint: Mimic the
argument used in Example 14).
Deduce that
s+t−2
R(s, t) ≤ ,
s−1
so that the Ramsey numbers R(s, t) are actually well-defined (Hint: Use
induction).
1. Suppose that we have a standard 8×8 chessboard, and we remove two opposite
corners. Is it possible to cover the mutated chessboard with 31 1×2 dominoes,
where each domino covers exactly two abutting squares of the chessboard?
26
2. We have a 4 × 7 chessboard. Prove that, no matter how we colour each square
with black or white, we can always find four distinct squares with the same
colour which form the four corners of a rectangle.
Is the same result true for a 4 × 6 chessboard?
3. Let A be a subset of {1, 2, . . . , 99, 100} with 10 elements. Prove that there are
two disjoint, non-empty subsets of A such that the sum of the elements of one
set equals the sum of the elements of the other set.
4. Consider the 2-dimensional integer lattice (that is, the collection of all points
in the plane where each point has integer coordinates). Show that, no matter
how we choose five distinct lattice points, some two of these points have the
property that their midpoint is also a lattice point.
bn/2c
X n n − k n−2k
5. Simplify 2 .
k=0
k k
A, A, A, A, A, B, B, B, B, B, C, C, C, C, C
7. Let x1 , x2 , . . . , x101 be a sequence of 101 real numbers. Prove that we can find
11 indices 1 ≤ i1 < i2 < · · · < i11 ≤ 101 such that xi1 , xi2 , . . . , xi11 is either an
increasing sequence or a decreasing sequence.
(A sequence of real numbers y1 , y2 , y3 , . . . is increasing if yi ≤ yj whenever
i < j, and decreasing if yi ≥ yj whenever i < j.)
8. 20 points on the circumference of a circle are evenly spaced. They are joined
up in disjoint pairs by 10 chords. Prove that, no matter how these 10 chords
are drawn, some two of them have the same length.
10. In a certain country, there are at least 101 towns. A railway network connects
the towns, and it satisfies the following properties.
27
• From any town, it is possible to get to any other town, possibly via some
other towns.
Prove that it is possible to close down 50 of the lines connected to the capital,
and preserve the property that, from any town, we can get to any other town
(again, possibly via some other towns).
(Note that “directly connected” is a symmetric relationship. That is, if we
can get directly from town A to town B, then we can get directly from town
B to town A.)
11. The circumference of a circle has length 3. We mark 21 points on the circum-
ference. Prove that, among the arcs which join two of the points, we can find
at least 100 of them with length less than 1.
Can ‘100’ be replaced by a larger integer?
12. Suppose that n is a positive integer not divisible by 2 or 5. Show that there
exists a multiple of n which consists entirely of 1s.
13. 11 students tackled a set of 18 problems. Each problem was solved by at least
7 students. Prove that we can find three students who, between them, solved
all the problems.
14. Suppose that we have 100 fruits, 10 each of 10 types. They are arranged in a
10 × 10 formation. Prove that there is a column or a row which contains at
least four different types of fruit.
+15. Is it possible to have a subset A ⊂ {1, 2, 3, . . . , 3000} with |A| = 2000, and
with the property that whenever x ∈ A, we have 2x 6∈ A?
+16. Let n be a positive integer. Prove that the number of partitions of n into
distinct terms is equal to the number of partitions of n into terms which are
all odd. For example, for n = 5, the partitions satisfying the former are 1 + 4,
2 + 3 and 5, while the partitions satisfying the latter are 1 + 1 + 1 + 1 + 1,
1 + 1 + 3 and 5.
+17. A rectangular board has m rows and n columns of unit squares, where m < n.
We mark some of the squares so that each column has at least one marked
square. Prove that we can find a marked square such that the row containing
it has more marked squares than the column containing it.
+18. Prove that in a group of 50 people, we can find two people who commonly know
an even number (possibly zero) of the other 48 people. (Here, “knowing” is a
symmetric relationship. That is, if A knows B, then B knows A.)
28