Combinatorics topics techniques algorithms 1. ed., transferred to digital print., Nachdr. Edition Cameron - Download the ebook and start exploring right away
Combinatorics topics techniques algorithms 1. ed., transferred to digital print., Nachdr. Edition Cameron - Download the ebook and start exploring right away
https://ebookultra.com/download/sat-ii-success-
math-1c-and-2c-2002-peterson-s-sat-ii-success-petersons/
https://ebookultra.com/download/enumerative-combinatorics-
volume-2-1-digital-printing-2004-edition-richard-p-stanley/
https://ebookultra.com/download/english-in-the-southern-united-
states-1-paperback-ed-nachdr-edition-nagle/
Caffeine for the creative mind 250 exercises to wake up
your brain 1. ed., Nachdr. Edition Mumaw
https://ebookultra.com/download/caffeine-for-the-creative-
mind-250-exercises-to-wake-up-your-brain-1-ed-nachdr-edition-mumaw/
https://ebookultra.com/download/made-by-hand-furniture-projects-from-
the-unplugged-woodshop-1-ed-nachdr-edition-fidgen/
https://ebookultra.com/download/core-servlets-and-javaserver-pages-
vol-1-core-technologies-2-ed-nachdr-edition-hall/
https://ebookultra.com/download/digital-techniques-for-wideband-
receivers-3rd-ed-edition-cheng/
https://ebookultra.com/download/metallographic-polishing-by-
mechanical-methods-4th-ed-digital-print-2010-edition-leonard-e-
samuels/
Combinatorics topics techniques algorithms 1. ed.,
transferred to digital print., Nachdr. Edition Cameron
Digital Instant Download
Author(s): Cameron, Peter J
ISBN(s): 9780521457613, 0521457610
Edition: 1. ed., transferred to digital print., Nachdr.
File Details: PDF, 32.22 MB
Year: 2010
Language: english
Combinatorics is a subject of increasing importance, owing to its
links with computer science, statistics and algebra. This is a textbook
aimed at second-year undergraduates to beginning graduates. It
stresses common techniques (such as generating functions and
recursive construction) which underlie the great variety of subject
matter, and the fact that a constructive or algorithmic proof is more
valuable than an existence proof.
The book is divided into two parts, the second at a higher level and
with a wider range than the first. Historical notes are included and
give a wider perspective on die subject. More advanced topics are
given as projects, and there are a number of exercises, some with
solutions given.
Combinatorics:
Topics, Techniques, Algorithms
COMBINATORICS:
TOPICS, TECHNIQUES, ALGORITHMS
PETER J. CAMERON
CAMBRIDGE
UNIVERSITY PRESS
cambridge university press
Cambridge, New York, Melbourne, Madrid, Cape Town,
Singapore, São Paulo, Delhi, Mexico City
Cambridge University Press
The Edinburgh Building, Cambridge CB2 8RU, UK
Published in the United States of America by
Cambridge University Press, New York
www.cambridge.org
Information on this title: www.cambridge.org/9780521451338
© Cambridge University Press 1994
This publication is in copyright. Subject to statutory exception
and to the provisions of relevant collective licensing agreements,
no reproduction of any part may take place without the written
permission of Cambridge University Press.
First edition published 1994
A catalogue record for this publication is available from the British Library
Library of Congress Cataloguing in Publication data
isbn 978-0-521-45133-8 Hardback
isbn 978-0-521-45761-3 Paperback
Cambridge University Press has no responsibility for the persistence or
accuracy of URLs for external or third-party internet websites referred to in
this publication, and does not guarantee that any content on such websites is,
or will remain, accurate or appropriate. Information regarding prices, travel
timetables, and other factual information given in this work is correct at
the time of first printing but Cambridge University Press does not guarantee
the accuracy of such information thereafter.
Contents
Preface ix
1. What is Combinatorics? 1
Sample problems — How to use this book — What you need to know — Exercises
If anything at all can be deduced from the two quotations at the top of this page,
perhaps it is this: Combinatorics is an essential part of the human spirit; but it is
a difficult subject for the abstract, axiomatising Bourbaki school of mathematics to
comprehend. Nevertheless, the advent of computers and electronic communications
have made it a more important subject than ever.
This is a textbook on combinatorics. It's based on my experience of more than
twenty years of research and, more specifically, on teaching a course at Queen Mary
and Westfield College, University of London, since 1986. The book presupposes
some mathematical knowledge. The first part (Chapters 2-11) could be studied by
a second-year British undergraduate; but I hope that more advanced students will
find something interesting here too (especially in the Projects, which may be skipped
without much loss by beginners). The second half (Chapters 12-20) is in a more
condensed style, more suited to postgraduate students.
I am grateful to many colleagues, friends and students for all kinds of contribu-
tions, some of which are acknowledged in the text; and to Neill Cameron, for the
illustration on p. 128.
I have not provided a table of dependencies between chapters. Everything is
connected; but combinatorics is, by nature, broad rather than deep. The more
important connections are indicated at the start of the chapters.
Peter J. Cameron
17 March 1994
1. What is Combinatorics?
Combinatorics is the slums of topology.
J. H. C. Whitehead (attr.)1
DISCUSSION. Euler posed this problem in 1782; he believed that the answer was 'no'.
This was not proved until 1900, by Tarry. Again, the problem can be generalised, to
n2 officers, where the number of regiments, ranks, rows and columns is n (we assume
n > 1) — see Exercise 3. There is no solution for n = 2. Euler knew solutions for
all n not congruent to 2 modulo 4, and guessed that there was no solution for n = 2
(mod 4). However, he was wrong about that. Bose, Shrikhande and Parker showed
in 1960 that there is a solution for all n except n = 2 and n = 6.
A Ramsey game
need of more explanation from a course or textbook in that subject. As you see,
combinatorics connects with all of mathematics; you will see material from many
other areas being used here.
• Basic pure mathematics: Sets and functions, ordered n-tuples and cartesian
products; integers, factorisation, modular arithmetic; [equivalence and order
relations].
• Linear algebra: Vector spaces, subspaces; linear transformations, matrices; row
operations, row space; eigenvalues of real symmetric matrices.
• Abstract algebra: [Elementary group theory; finite fields].
• Number theory: [Quadratic residues; two and four squares theorems].
• Analysis: Basic operations (limits, differentiation, etc.); [power series].4
• Topology: [Definition of metric and topological space; surfaces; Jordan curve
theorem].
• Probability: Basic concepts (for finite spaces only) [except in Chapter 19].
• Set theory: See Chapter 19.
Exercises
1. For n — 3,4,5, calculate the number of ways of putting n letters into their
envelopes so that every letter is incorrectly addressed. Calculate the ratio of this
number to n! in each case.
2. Solve Kirkman's problem for nine schoolgirls, walking for four days.
3. Solve Euler's problem for nine, sixteen and twenty-five officers. Show that no
solution is possible for four officers.
4. Test the assertion that the Ramsey game cannot end in a draw by playing it with
a friend. Try to develop heuristic rules for successful play.
4
As will be explained in Section 4.2, our treatment of power series is formal and does not involve
questions of convergence.
2. On numbers and counting
This chapter is about counting. In some sense, it is crucial to what follows, since
counting is so basic in combinatorics. But this material is part of mathematical
culture, so you will probably have seen most of it before.
1
See Georges Ifrah, From One to Zero: A Universal History of Numbers (1985), for an account of
the development of numbers and their representation.
8 2. On numbers and counting
As each new class of numbers was added to the mathematical repertoire, it was
given a name reflecting the prejudice against its members, or the 'old' numbers were
given a friendly, reassuring name. Thus, zero and negative integers are contrasted
with the 'natural' positive integers. Later, quotients of integers were 'rational', as
opposed to the 'irrational' square root of 2; and later still, all numbers rational and
irrational were regarded as 'real', while the square root of —1 was 'imaginary' (and
its friends were 'complex').
The natural numbers are the first mathematical construct with which we become
familiar. Small children recite the names of the first few natural numbers in the same
way that they might chant a nursery rhyme or playground jingle. This gives them
the concept that the numbers come in a sequence. They grasp this in a sophisticated
way. The rhyme2
One, two,
Missed a few,
Ninety-nine,
A hundred
expresses confidence that the sequence of numbers stretches at least up to 100, and
that the speaker could fill in the gap if pressed.
Order or progression is thus the most basic property of the natural numbers.3
How is this expressed mathematically? First we must stop to consider how natural
numbers are represented. The simplest way to represent the number n is by a
sequence of n identical marks. This is probably the earliest scheme mankind
adopted. It is well adapted for tallying: to move from one number to the next,
simply add one more mark. However, large numbers are not easily recognisable.
After various refinements (ranging from grouping the marks in sets of five to the
complexities of Roman numerals), positional notation was finally adopted.
This involves the choice of a base b (an integer greater than 1), and b digits (dis-
tinguishable symbols for the integers 0,1,2,. . . , 6 — 1). (Early attempts at positional
notation were bedevilled because the need for a symbol for zero was not recognised.)
Now any natural number N is represented by a finite string of digits. Logically the
string is read from right to left; so we write it as xn-i .. .Xixo, where each X{ is
one of our digits. By convention, the leftmost digit is never zero. The algorithm for
advancing to the next number is called the Odometer Principle. It is based on the
principle of trading in b counters in place i for a single counter in place i + 1, and
should be readily understood by anyone who has watched the odometer (or mileage
gauge) of a car.
2
I have heard the feminist version of this: 'One, two, Mrs. Few, ...'
3
'The operations of arithmetic are based on the tacit assumption that we can always pass from any
number to its successor, and this is the essence of the ordinal concept.' Tobias Dantzig, Number: the
Language of Science (1930).
2.1. Natural numbers and arithmetic
For example, if the base 6 is 2 and the digits are 0 and 1, the algorithm (starting
with 1) generates successively 10, 11, 100, 101, 110, . . . .
Now it can be proved by induction that the string xn-\ . . . X^XQ represents the
positive integer
xn-ibn~l H h xxb + x0
(see Exercise 2).
Often the number 0 is included as a natural number. (This is most usually done
by logicians, who like to generate the whole number system out of zero, or nothing.
But it conflicts with our childhood experience: I have never heard a child say
'nought, one, two, ... '4, and we don't count that way.) This is done by modifying
our representation so that the digit 0 represents the number 0. This is the one
allowed exception to the rule that the left-most digit cannot be 0; the alternative,
representing 0 by a blank space, would be confusing.
The odometer of a car actually works slightly differently. It works with a fixed
number of digits which are initially all zero, so that the 'blank space' case of the
algorithm cannot arise. If there are k digits, then the integers 0,... , bk — 1 are
generated in turn, and then the odometer returns to 0 and the process repeats.
Now that we have a representation of positive integers, and understand how to
move to the next integer, we should explore the arithmetic operations (ambition,
distraction, uglification and derision).5 Algorithms for these are taught in primary
school.6 I will not consider the details here. It is a good exercise to program
a computer to perform these algorithms7, or to investigate how many elementary
4
A possible exception occurs when one child has been appointed to be first, and another wishes to
claim precedence, as in 'Zero the hero'. But this is closer to the historical than the logical approach.
5
Lewis Carroll, Alice's Adventures in Wonderland (1865).
6
These algorithms were known to the Babylonians in 1700 B.C.
7
Most programming languages specify the 'maximum integer' to be something like 32767 or
2147483647. Often, the answer to a counting problem will be much larger than this. To find it by
computer, you may have to write routines for arithmetic operations on integers with many digits. If
you need to do this, write your routines so that you can re-use them!
10 2. On numbers and counting
operations are required to add or multiply two ra-digit numbers (where elementary
operations might consist of referring to one's memory of the multiplication tables,
or writing down a digit).
2.2. Induction
Induction is a very powerful principle for proving assertions about the natural
numbers. It is applied in various different forms, some of which are described in
this section. We also see that it is a consequence of our most basic intuition about
the natural numbers.
The Principle of Induction asserts the following:
Why is this true? As we saw, the basic property of the natural numbers,
recognised even by children, is that we can count up to any natural number n
starting from 1 (given sufficient patience!) Now, with the assumptions of the
Principle, P(l) is true, so P(2) is true, so (miss a few here) so P(n — 1) is true, so
P{n) is true.
As this argument suggests, if you are reading a mathematical argument, and the
author puts in a few dots or the words 'and so on', there is probably a proof by
induction hiding there. Consider, for example, the function / satisfying /(I) = 2
and f(n + 1) = 2/(n) for all natural numbers n. Then
/(2) = 4 = 2 2 ,/(3) = 8 = 23, ... /(n)=2».
The dots hide a proof by induction. Let P(n) be the assertion that f(n) = 2 n . Then
P(l) holds; and, assuming that P(n) holds, we have
P(n + 1) = 2P(n) = 2 • 2n = 2 n + \
so P(n + 1) also holds. So the Principle of Induction justifies the conclusion. The
point is that very simple arguments by induction can be written out with three
dots in place of the detailed verification, but this verification could be supplied if
necessary. We'll see more examples of this later.
Now I give some alternative forms of the Principle of Induction and justify their
equivalence. The first one is transparent. Suppose that P(n) is an assertion, for
which we know that P(27) is true, and that if P(n) holds then so does P(n + 1).
Then we conclude that P(n) holds for all n > 27. (To prove this formally, let Q{n)
be the assertion that P(n + 26) is true, and verify the hypotheses of the Principle of
Induction for Q(n).)
For the next variation, let P{n) be a proposition about natural numbers. Suppose
that, for every natural number n, if P(m) holds for all natural numbers m less than
2.3. Some useful functions 11
n, then P(n) holds. Can we conclude that P(n) holds for all n? On the face of it,
this seems a much stronger principle, since the hypothesis is much weaker. (Instead
of having to prove P(n) from just the information that P(n — 1) holds, we may
assume the truth of P(m) for all smaller m.) But it is true, and it follows from the
Principle as previously stated.
We let Q(n) be the statement 'P(ra) holds for all m < n\ Now it is clear that
Q(n + 1) implies P(n), so we will have succeeded if we can prove that Q(n) holds
for all n. We prove this by induction.
First, Q(l) holds: for there are no natural numbers less than 1, so the assertion
P holds for all of them (vacuously).
Now suppose that Q(n) holds. That is, P(ra) holds for all m < n. By assumption,
P(n) also holds. Now P(m) holds for all m < n + 1 (since the numbers less than
n + 1 are just n and the numbers less than n) 8. In other words, Q(n + 1) holds.
Now the Principle of Induction shows that Q(n) holds for all n.
The final re-formulation gives us the technique of 'Proof by Minimal Counterex-
ample'. Suppose that P(n) is a proposition such that it is not true that P(n) holds
for all natural numbers n. Then there is a least natural number n for which P(n) is
false; in other words, P(m) is true for all m < n but P(n) is false. For suppose that
no such n exists; then the truth of P(m) for all m < n entails the truth of -P(n),
and as we have seen, this suffices to show that P(n) is true for all n, contrary to
assumption.
This argument shows that any non-empty set of natural numbers contains a
minimal element. (If S is the set, let P(n) be the assertion n ^ S.)
2.3. Some useful functions
I assume that you are familiar with common functions like polynomials, the function
\x\ (the absolute value or modulus), etc.
Floor and Ceiling. The floor of a real number x, written [x\ > is the greatest integer
not exceeding x. In other words, [^J is the integer m such that m < x < m + l. li x
is an integer, then \x\ = x. This function is sometimes written [x\\ but the notation
\x\ suggests 'rounding down'. It is the number of the floor of a building on which
x would be found, if the height of x above the ground is measured in units of the
distance between floors. (The British system of floor numbering is used, so that the
ground floor is number 0.)
The ceiling is as you would probably expect: \x~\ is the smallest integer not less
than x. So, if x is not an integer, then \x] = [x\ + 1; if x is an integer, its floor and
ceiling are equal. In any case, you can check that
Factorial. The factorial function is defined on positive integers by the rule that n! is
the product of all the integers from 1 to n inclusive. It satisfies the condition
8
Let p be an integer less than n + 1. Then p < n oi p = n OT p > n; and the last case is impossible,
since there is no integer between n and n + 1.
12 2. On numbers and counting
for n > 1. In fact, we can consistently define 0! = 1; then (*) holds for all n > 0.
In fact, the conditions 0! = 1 and (*) actually define n\ for all natural numbers n.
(This is proved by induction: 0! is defined; if n! is defined then so is (n + 1)!; so n\
is defined for all n.)
Exponential and logarithm. These two functions are familiar from elementary
calculus. We will often use the power series expansions of them. The equation
oo n 2
e* - V" — - 1 + Z + — +
71=0
is valid for all real numbers x. On the other hand, the function log re can't be
expanded as a series of powers of z, since log 0 is undefined. Instead, we have
71=1
which is valid for all x with \x\ < 1 (and in fact also for x = 1).
The exponential function grows more rapidly than any power of x] this means
that ex > xc for all sufficiently large x (depending on c). In fact, for x > (c + 1)!, we
have
xc+1
On the other hand, the logarithm function grows more slowly than any power of x.
We will often write exp(z) instead of ex.
/ satisfying the above equation is given by f(n) = acn, where a is a constant (and
is equal to the value of /(0)).
We also say that a function / has 'exponential growth' if it is roughly the same
size as an exponential function. So the function f(n) = 2n + n has exponential
growth, since the term n is dwarfed by 2 n for large n. Formally, the function / is
said to have exponential growth if f(n)lln tends to a limit c > 1 as n —> oo. This
means that, for any positive number e, f(n) lies between (c — e)n and (c + e)n for all
sufficiently large n. The number c is called the exponential constant for / .
Of course, a function may grow more slowly than exponentially. Examples
include
• polynomial growth with degree c, like the function f(n) = nc;
• fractional exponential growth with exponent c, like the function enC, where 0 <
c< 1.
These functions arise in real combinatorial counting problems, as we will see.
But many functions grow faster than exponentially. Here are two examples.
The number of permutations of the set X is equal to n\ = n(n — 1 ) . . . 1, the
product of the integers from 1 t o n inclusive. We have
2n~l <n\<nn-\
because (ignoring the factor 1) there are n — 1 factors, each lying between 2 and
n. In fact it is easy to see that the growth is not exponential. We will find better
estimates in the next chapter.
Now let V(X), the power set of X, denote the set of all subsets of X. We will
be considering subsets of V(X), under the name families of sets. How many families
of sets are there? Clearly the number is 22". This number grows much faster than
exponentially, and much faster than the factorial function. A function like this is
called a double exponential.
For comparing the magnitudes of functions like these, it is often helpful to
consider the logarithm of the function, rather than the function itself. The logarithm
of an exponential function is a (roughly) linear function. The logarithm of n! is
fairly well approximated by nlogn; and the logarithm of a double exponential is
exponential. Other possibilities are functions whose logarithms are polynomial.
Of course, this is only the beginning of a hierarchy of growth rates; but for the
most part we won't have to consider anything worse than a double exponential.
In connection with growth rates, there is a convenient analytic notation. We
write O(f(n)) (read 'big Oh /(n)') to mean a (possibly unknown) function g(n) such
that, for all sufficiently large n, \g(n)\ < cf(n) for some constant c. This is typically
used in the form
where (f> is a combinatorial counting function and F: f are analytic functions where
/ grows more slowly than F] this has the interpretation that the order of magnitude
of <j) is similar to that of F. For example, in Section 3.6, we show that
log n! = n log n — n + O(log n).
14 2. On numbers and counting
We write o(/(n)) (and say 'small oh /(ft)') to man a function g(n) such that
g{n)l f(n) —> 0 as n —> oo; that is, g is of smaller order of magnitude than / .
There are several variants. For example, Ct is the opposite of 0; that is, fi(/(n))
is a function g(n) with |#(^)| > cf(n) for some constant c > 0. Also, g(n) ~ / ( n )
means that both <?(n) = O(f(n)) and #(n) = fi(/(n)) hold: roughly, / and # have
the same order of magnitude apart from a constant factor.
Almost always, we assume that the objects are distinguishable, like the five
spade cards. Under this assumption, the problem will be solved under the four
possible combinations of the other assumptions in Chapter 3. What if they are
indistinguishable? In this case, there is obviously only one way to select three red
billiard balls from a set of five: any three red billiard balls are identical to any other
three.
i
Suppose that we are interested in n towns; some pairs of towns are joined by
a direct road, others not. We are not concerned with the geographical locations,
only in whether the towns are connected or not. (This is described by the structure
known as a graph.11 See Chapter 11 for more about graphs.) Figure 1 shows the
eight labelled graphs for n = 3. If the towns are indistinguishable, then the second,
10
According to folklore, it is impossible to count the Rollright Stones consistently.
11
This usage of the term is quite different from the sense in the phrase 'the graph of y — sin a?'.
Some people distinguish the two meanings by different pronunciation, with a short a for the sense
used here.
2.6. Double counting 15
A A /. A A A A A
23 23 23 23 23 23 23 23
third and fifth graphs are identical, as are the fourth, sixth and seventh. So there
are just four unlabelled graphs with n = 3.
In general, let f(n) and g(n) denote the numbers of labelled and unlabelled
configurations, respectively, with n underlying objects. Then two labelled configura-
tions will be regarded as identical as unlabelled configurations if and only if there
is a permutation of { 1 , 2 , . . . , n } which carries one to the other. (For example, the
cyclic permutation 1 —i > 2 h-> 3 — i > 1 carries the second graph in Fig. 1 to the fifth.)
So at most n! labelled configurations collapse into a single unlabelled one, and we
have
f(n)/n\ < g(n) < f(n).
Now there are two possibilities for the 'order of magnitude' behaviour.
If f(n) grows much more rapidly than n!, then the left and right hand sides
of this equation are not so very far apart, and we have a reasonable estimate for
g(n). For example, we saw that there are 22" families of subsets of the n-element set
X. The number of permutations is insignificant by comparison, so it doesn't matter
very much whether the elements of X are distinguishable or not, that is, whether we
count labelled or unlabelled families.
But if this doesn't occur, then more care is needed. There are just 2 n subsets of
the n-element set X, and this function grows more slowly than n!. In this case, we
can count unlabelled sets another way. If all elements of X are indistinguishable,
then the only thing we can tell about a subset of X is its cardinality; two subsets
containing the same number of elements are equivalent under a permutation. So the
number of unlabelled subsets is n + 1, since the cardinality of a subset can take any
one of the n + 1 values 0,1, 2 , . . . , ra.
This theme can be refined, using the concepts of permutation group and cycle
index. These are more advanced topics, and will be treated in Part 2 (see Chapter 15).
If the same set is counted in two different ways, the answers are the
same.
This is analogous to finding the sum of all the entries in a matrix by adding the row
totals, and then checking the calculation by adding the column totals.
The principle is best illustrated by applications (of which there will be many
later) — here is one:
16 2. On numbers and counting
To show this, let D\,..., Dn be the delegates. We apply double counting to the
set of ordered pairs (Di,Dj) for which D{ and Dj shake hands with each other at
the convention. Let X{ be the number of times that D{ shakes hands, and y the
total number of handshakes that occur. On the one hand, the number of pairs is
YZ=i xii since for each D{ the number of choices of Dj is equal to X{. On the other
hand, each handshake gives rise to two pairs (£),-,Dj) and (Dj,D{)] so the total is
2y. Thus
But, if the sum of n numbers is even, then evenly many of the numbers are odd.
(If we add an odd number of odd numbers and any number of even numbers, the
answer will be odd.)
The double counting principle is usually applied to counting ordered pairs.
For lovers of formalism, here is a general result, which encapsulates most of the
applications we will make of it.
(2.6.2) Proposition. Let A = {«i,..., am} and B = {&i,..., bn) be sets. Let S be a
subset of A x B. Suppose that, for i — 1,..., m, the element at is the first component
of X{ pairs in S, while, for j = 1,..., n, the element bj is the second component of
yj pairs in S. Then
m n
t=l j=l
Often it happens that X{ is constant (say x) and yj is also constant (say y). Then
we have
mx = ny.
The notation {x : P} means the set of all elements x having property P. So, for
example,
AU B = {x : x e A oi x <E B}.
Similarly, {x, y} is the set consisting of the elements x and y only. It is sometimes
called an unordered pair, since {x,y} = {y,x}. By contrast, the ordered pair (x,y)
has the property that (x:y) — (it, v) if and only if x = u and y — v. This is familiar
from Cartesian coordinates of points in the Euclidean plane.
The Cartesian product A x B is the set of all ordered pairs (a, b), with a G A
and b £ B. Similarly for more than two factors. For example, we write An for the
set of ordered n-tuples of elements of A, for any positive integer n. We have
\AxB\ = \A\-\B\,
\An\ = \A\n.
Until last century, a function was something described by a formula (typically a
polynomial or a power series); it was the ambiguity in this definition which led to
the modern version. A function f from A to B is a subset of A x B with the property
that, for any a G A, there is a unique 6 G B such that (a, b) G / . If (a, b) G / , we
write / ( a ) = 6.12 Usually there is a rule for calculating 6 = f(a) from a, but this is
not part of the definition.
If A = {ai, a<i, • • •, an}, then any function f : A —> B can be specified by giving
the n-tuple of values (/(«i), f ^ ) , • • • ? /(«n))- Thus the number of functions from
A to B is |B|'^L Motivated by this, the set of functions from A to B is sometimes
written BA, so that \BA\ = |J3|W.
The power set V(A) is the set of all subsets of A. Any subset X of A is specified
by its characteristic function, the function fx '. A —» {0,1} defined by
1 if a G X;
(Two subsets are equal if and only if their characteristic functions are equal.) So
there are as many subsets of A as there are functions from A to {0,1}; that is,
2.8. Exercises
1. Criticise the following proof that 1 is the largest natural number.
Let n be the largest natural number, and suppose than n ^ 1. Tien
n > 1, and so n2 > n; thus n is not the largest natural number.
12
This definition is very familiar, despite appearances. You probably visualise 'the function y — x2' in
terms of its graph in the Euclidean plane with coordinates (x, y); and the graph consists of precisely
those ordered pairs (x,y) for which y = x2. In other words, the graph is the function!
18 2. On numbers and counting
2. Prove by induction that the Odometer Principle with base b does indeed give the
representation xn-\ . . . X\x$ for the natural number
for n > 1. (You may use the fact that (1 + \)n < e for all n.)
)
(b) Use the arithmetic-geometric mean inequality to show that n! < (ZL2~^)n f° r
13
for n > 1.
4. (a) Prove that log x grows more slowly than xc for any positive number c.
(b) Prove that, for any c, d > 1, we have cx > xd for all sufficiently large x.
5. (a) We saw that there are 223 = 256 labelled families of subsets of a 3-set. How
many unlabelled families are there?
(b) Prove that the number F(n) of unlabelled families of subsets of an n-set
satisfies log2 F(n) = T + 0(n log n).
6. Verity that the numbers of graphs are given in Table 1 for n < 5.
n 2 3 4 5
labelled 2 8 64 1024
unlabelled 2 4 11 34
Table 2.1. Graphs
7. Suppose that an urn contains four balls with different colours. In how many
ways can three balls be chosen? As in the text, we may be interested in the order
of choice, or not; and we may return balls to the urn, allowing repetitions, or not.
Verify the results of Table 2.
order order
important unimportant
repetition &A <\r\
b 4 Z[)
allowed
repetition <\A A
not allowed
Table 2.2. Selections
8. A Boolean function takes n arguments, each of which can have the value TRUE
or FALSE. The function takes the value TRUE or FALSE for each choice of values of
its arguments. Prove that there are 22" different Boolean functions. Why is this the
same as the number of families of sets?
13
The arithmetic-geometric mean inequality states that the arithmetic mean of a list of positive
numbers is greater than or equal to their geometric mean, with equality only if all the numbers are
equal. Can you prove it? (HINT: DO the special case when all but one of the numbers are equal by
calculus, and then the general case by induction.)
2.8. Exercises 19
9. Logicians define a natural number to be the set of all its predecessors: so 3 is the
set {0,1,2}. Why do they have to start counting at 0?
10. A function / has polynomial growth of degree d if there exist positive real numbers
a and b such that and < f(n) < bnd for all sufficiently large n. Suppose that / has
polynomial growth, and g has exponential growth with exponential constant greater
than 1 (as defined in the text). Prove that f(n) < g(n) for all sufficiently large n. If
f(n) = 106n106 and g{n) = (1.000001)n, how large is 'sufficiently large'?
11. Let B be a set of subsets of the set {1,2, . . . , u } , containing exactly b sets.
Suppose that
• every set in B contains exactly k elements;
• for i = 1,2,..., v, the element i is contained in exactly r members of B.
Prove that bk = vr.
Give an example of such a system, with v = 6, k = 3, b = 4, r = 2.
12. The 'Russian peasant algorithm' for multiplying two natural numbers m and n
works as follows.14
666
Table 2.3. Multiplication
PROBLEMS, (i) Prove that this method gives the right answer.
14
No tables needed, except two times!
20 2. On numbers and counting
(ii) What is the connection with the primary school method of long multiplication?
HINT FOR (i) AND (ii): Express m (and n) to the base 2.
(iii) Suppose we change the algorithm by squaring (instead of doubling) the numbers
in the second column, and, in the last step, multiplying (rather than adding)
the undeleted numbers. Prove that the number calculated is nm. How many
multiplications does this method require?
13. According to the Buddha,
Scholars speak in sixteen ways of the state of the soul after death.
They say that it has form or is formless; has and has not form,
or neither has nor has not form; it is Unite or infinite; or both or
neither; it has one mode of consciousness or several; has limited
consciousness or infinite; is happy or miserable; or both or neither.
How many different possible descriptions of the state of the soul after death do you
recognise here?
14. The library of Babel15 consists of interconecting hexagonal rooms. Each room
contains twenty shelves, with thirty-five books of uniform format on each shelf.
A book has four hundred and ten pages, with forty lines to a page, and eighty
characters on a line, taken from an alphabet of twenty-five orthographical symbols
(twenty-two letters, comma, period and space). Assuming that one copy of every
possible book is kept in the library, how many rooms are there?
15. COMPUTER PROJECT. Develop a suite of subroutines for performing arithmetic on
integers of arbitrary size, regarded as strings of digits. (You should deal with input
and output, arithmetic operations — note that division should return a quotient
and a remainder — and comparisons. You might continue with exponentiation and
factorials, as well as various combinatorial functions to be defined later.)
The process is directed always towards analysing and separating the material
into a collection of discrete counters, with which the detached intellect can
make, observe and enjoy a series of abstract, detailed, artificial patterns of
words and images (you may be reminded of the New Criticism)...
Elizabeth Sewell, 'Lewis Carroll and T. S. Eliot as Nonsense Poets'
in Neville Braybrooke (ed.), T. S. Eliot (1958).
This chapter is about the central topic of 'classical' combinatorics, what is often
referred to as 'Permutations and Combinations'. Given a set with n elements, how
many ways can we choose a selection of its elements, with or without respect to the
order of selection, or divide it up into subsets? We'll define the various numbers
involved, and prove some of their properties; but these echo through subsequent
chapters.
22 3. Subsets, partitions, permutations
3.1. Subsets
How many subsets does a set of n elements have?
The number of subsets is 2n. There are several different ways to see this. Perhaps
most easily, for each of the n elements of the set, there are two choices in building
a subset (viz., put the element in, or leave it out); all combinations of these choices
are possible, giving a total of 2 n .
Implicitly, this argument sets up a bijection between the subsets of a set X and
the functions from X to {0,1}. The function fy corresponding to the subset Y is
defined by the rule
/ 1 if x £ Y
written as nCk, and is read 'n choose k\ It is called a binomial coefficient (for reasons
to be elaborated later).
n\ _ n(n - 1)... (n - k + 1) _ n!
k) Jb(Jfc-l)...! k\(n-k)\
Note that (jj) = 1 (the empty set) and (*) = 1 (the whole set) — the proposed
formula is correct in these cases, in view of the convention that 0! = 1 (see
Section 2.3).
As suggested by the name, we prove this by counting choices. Given a set X of
n elements, in how many ways can we choose a set of k of them? Clearly there are
n possible choices for the 'first' element, (n — 1) choices for the 'second', ... , and
(n — k + 1) choices for the 'fcth'; in total, n(n - 1)... (n - k +1). But we put the terms
'first', 'second', etc., in quotes because a subset has no distinguished first, second, ...
element. In other words, if the same k elements were chosen in a different order, the
same subset would result. So we must divide this number by the number of orders
in which the k elements could have been chosen. Arguing exactly as before, there
are k choices for which one is 'first', (k — 1) for which is 'second', and so on. Division
gives the middle expression in the box. Now the third expression is equal to the
second because n(n — 1)... (n — k + 1) = n\/(n — &)!; the denominator cancels all
the factors from n — k on in the numerator.
Once we have a formula, there are two possible ways to prove assertions or
identities about binomial coefficients. There is a combinatorial proof, arguing from
the definition (we will interpret u j as the number of ways of choosing a team of k
players from a class of n pupils); and there is an algebraic proof, from the formula.
We give a few simple ones.
(3.2.2) Fact.
fn
) =(
) \n — k
FIRST PROOF. Choosing a team of k from a class of n is equivalent to choosing the
n — k people to leave out.
SECOND PROOF. It's obvious from the last formula in the box.
(3.2.3) Fact.
-CO—
FIRST PROOF. We choose a team of k and designate one team member as captain.
There are Cf) possible teams and, for each team, there are k choices for the captain.
24 3. Subsets, partitions, permutations
Alternatively, we could choose the captain first (in n possible ways), and then the
remainder of the team (k — 1 from the remaining n — 1 class members).
Note that this is an application of the 'double counting' principle described in
Section 2.6.
SECOND PROOF. Try it yourself!
You will find that the SECOND PROOFS above probably come more naturally to
you. For this reason, I'll concentrate on the combinatorial style of proof for the next
couple of results. Remember that the algebraic proof is not always appropriate or
even possible — sometimes we won't have a formula for the numbers in question,
or the formula is too complex. (See the discussion of Stirling numbers in Section 5.3
for examples of this.)
(3.2.4) Fact.
(3.2.5) Fact.
PROOF. This one is easy — there are 2n subsets altogether (of arbitrary size).
(3.2.6) Fact.
n n\2 (2n
k=0 \ /v / \ n
PROOF. The right-hand side is the number of ways of picking a team of n from a
class of 2n. Now suppose that, of the 2n pupils, n are girls and n are boys. In how
manyy ways can we pick a team of k girls and n — k boys? Obviously this number is
t l i c h is e
(fc) ((n-j
) <l ual t o (fc)2) b y F a c t 3-2-2- T h e r e s u l t n o w follows.
The definition of the binomial coefficient (jj actually makes sense for any non-
negative integers n and k: if k > n, then there are no fc-subsets of an n-set, and
rM = 0. The (first) formula gives the right answer, since if k > n then one of the
factors in the numerator is zero. (This cannot be assumed, since the argument we
gave is only valid if k < n.) However, the second formula makes no sense (unless,
very dubiously, we assume that the factorial of a negative integer is infinite!).
Facts 3.2.2-4 above remain valid with this more general interpretation. (You
should check this.)
Sometimes it is convenient to widen the definition still further. For example, if
k < 0, we should define u ) = 0, in order that Fact 3.2.2 should hold in general. We'll
3.3. The Binomial Theorem and Pascal's Triangle 25
l)...(n-*+l)
k[ itk> U,
if k < 0.
3.3. The Binomial Theorem and Pascal's Triangle
Fact 3.2.5 above can be generalised to the celebrated Binomial Theorem.1 A binomial
is a polynomial with two terms; the Binomial Theorem states that, if a power of a
binomial is expanded, the coefficients in the resulting polynomial are the binomial
coefficients (from which, obviously, they get their name).
FIRST PROOF. It's clear that (1 + t)n is a polynomial in t of degree n. To find the
coefficient of tk, consider the product
(1 + *)(1 + t)... (1 + t) (n factors).
The expansion is obtained by choosing either 1 or t from each factor in all possible
ways, multiplying the chosen terms, and adding all the results. A term tk is obtained
when t is chosen from k of the factors, and 1 from the other n — k factors. There
are u j ways of choosing these k factors; so the coefficient of tk is m , as claimed.
SECOND PROOF. The theorem can be proved by induction on n. It is trivially true
for n = 0. Assuming the result for n, we have
the coefficient of tk on the right is U ^ j + \Jj (the first term coming from tk~x • t
and the second from tk • 1); and
k-l
by Fact 3.2.4.
1
Proved by Sir Isaac Newton in about 1666.
26 3. Subsets, partitions, permutations
The coefficients of tk x
on the left and right of this equation are ^U_j) and k(Jj
respectively.
(3.3.2) Fact. For n > 0, the numbers of subsets of an n-set of even and of odd
cardinality are equal (viz., 2n~1).
PROOF. Put t = — 1 in the Binomial Theorem to obtain
n
hence
In
2
0<k<n
k odd
But the two sides of this equation are just the numbers of subsets of even, resp. odd,
cardinality.
If n is odd, then k is even if and only if n — k is odd; so complementation sets up
a bijection between the subsets of even and odd size, proving the result. However, in
general, a different argument is required. The map X H-> XA{n} (that is, if n £ X,
then remove it; otherwise put n into X) is a bijection on subsets of { 1 , . . . , n} which
changes the cardinality by 1, and hence reverses the parity; so there are equally
many sets of either parity.
The argument can be refined to calculate the number of sets whose size lies in
any particular congruence class. I illustrate by calculating the number of sets of size
divisible by 4. I assume that n is a multiple of 8. (The answer takes different forms
depending on the congruence class of n mod 8.)
(3.3.3) Proposition. If n is a multiple of 8, then the number of sets of size divisible
by 4 is 2 n " 2 + 2<n"2)/2.
For example, if n = 8, the number of such sets is Qj + (4) + (g) = 26 + 23.
PROOF. We let A be the required number, and B the number of sets whose size is
congruent to 2 (mod 4). By Fact 3.3.2, A + B = 2n~1.
Now substitute t = i in the Binomial Theorem. Note that 1 + i = \/2e17r/4, and
so (since n is a multiple of 8), (1 + i) n = 2 n/2 . Thus
2
2"/ - f
k=o
Take the real part of the right-hand side, noting that i* = l,i, — 1, — i according as
k — 0,1,2 or 3 (mod 4). We obtain A — B — 2 n / 2 . From this and the expression for
A + B above, we obtain the value of A (and that of B).
3.4. Project: Congruences of binomial coefficients 27
REMARK. By taking the imaginary part of the equation, we find the numbers of sets
with size congruent to 1, or to 3, mod 4.
The binomial coefficients are often written out in the form of a triangular array,
known as Pascal's Triangle.2
1
1 1
1 2 1
1 3 1 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1
1 8 28 56 70 56 28 7 1
Thus, u j is the A;th element in the n th row, where both the rows an the elements
in them are numbered starting at zero. Fact 3.2.4 shows that each internal element
of the triangle is the sum of the two elements above it (i.e., above and to the left
and right). Moreover, the borders of the triangle are filled with the number 1 (since
(o) = (n) = -O" With these two rules, it is very easy to continue the triangle as far
as necessary. This suggests that Pascal's Triangle is an efficient tool for calculating
binomial coefficients. (See Exercise 7.)
2
Not surprisingly, this object was known long before Pascal. I owe to Robin Wilson the information
that it appears in the works of the Majorcan theologian Ramon Llull (1232-1316). Llull also
gives tables of combinations and mechanical devices for generating them, complete graphs, trees,
etc. However, combinatorics for him was only a tool in his logical system, and logic was firmly
subservient to theology. In his first major work, a commentary on Al-Ghazali, he says, 'We will speak
briefly of Logic, since we should speak of God.'
28 3. Subsets, partitions, permutations
NOTE. We assume here the usual conventions for binomial coefficients, in particular, (J) = 0 if a < b.
PROOF. It suffices to show that, if m = cp + a and n = dp + 6, where 0 < a, 6 < p, then
0 - 0 (;)<—>•
For a = ao, 6 = &o, and c = ai + ... + a*;/?* x, d — b\ + ... + bkPk *; and then induction finishes the
job.
This assertion can be proved directly, but there is a short proof using the Binomial Theorem.
The key is the fact that, if p is prime, then
This is because each binomial coefficient (^), for l < i < p — 1 , i s a multiple of p, so all intermediate
terms in the Binomial Theorem vanish mod p. (For (^) = p\/i\{p — i)!, and p divides the numerator
but not the denominator.) Thus (congruence mod p):
Since 0 < a, b < p, the only way to obtain a term in tn = tdP+b in this expression is to take the
term i = d in the first sum and the term j = b in the second; this gives
(:)•©(;)«-"»•
as required.
3.5. Permutations
There are two ways of regarding a permutation, which I will call 'active' and
'passive'. Let X be a finite set. A permutation of X, in the active sense, is a
one-to-one mapping from X to itself. For the passive sense, we assume that there
is a natural ordering of the elements of X, say {zi,£ 2 ,... ,x n }. (For example, X
3.5. Permutations 29
might be {1,2,..., n}.) Then the passive representation of the permutation n is the
ordered n-tuple (TT(XI), T T ^ ) , • • • ? ^(^n))-3
In the preceding paragraph, I wrote ir(x) for the result of applying the function
7T to the element x. However, in the algebraic theory of permutations, we often have
to compose permutations, i.e., apply one and then the other. In order that the result
of applying first TTI and then ?r2 can be called 7ri7r2, it is more natural to denote the
image of x under TT as xn. Then
The top row of this symbol can be in any order, as long as XTT is directly under x
for all x. If the top row is in natural order, then the bottom row is the passive form
of the permutation.
PROOF. Take the top row of the two-rowed symbol to be (1 2 ... n). Then there
are n choices for the first element in the bottom row; n — 1 choices for the second
(anything except the first chosen element); and so on.
Note that this formula is correct when n = 0: the only permutation of the empty
set is the 'empty function'.
There is another, shorter, representation of a permutation, the cycle form. A
cycle, or cyclic permutation, is a permutation of a set X which maps
PROOF. In the algorithm, we use the notation 7rm for the composition of m copies of
7T. We first have to show that the construction makes sense, that is, (x XTT . . . XTT171'1)
really is a cycle. This could only fail if the sequence of elements contains a repetition.
But, if XTT1 = XTT\ where 0 < i < j < ra, then (because TT is one-to-one) it holds that
x = XTT^~%\ but this contradicts the choice of m as least integer such that XTT171 = x.
Next, we establish that the cycles use disjoint sets of points. Suppose that XTT1 =
yir\ and suppose that x is chosen before y. If yTTm = y, then #7rz+m~J = yTTm = y,
contradicting the fact that y (when chosen) doesn't already lie in a cycle.
It is clear that any point of X lies in one of the chosen cycles. Finally, the
composition of all these cycles is equal to TT. For, given a point z, there is a unique
y and i such that z — y-K1. Then the cycle containing y agrees with ?r in mapping z
to i/7rt+1, and all the other cycles have no effect on z.
EXAMPLE. The permutation (* \ \ \ \ !j), in cycle notation, is (1 3 4)(2 6)(5). This
is just one of 36 different expressions: there are 3! = 6 ways to order the three cycles,
and 3 - 2 - 1 = 6 choices of starting points.
(3.6.1) Theorem.
This is weaker than an asymptotic estimate for n\ itself: the exponentials of the
upper and lower bounds are e(n/e) n and |(n -f I)e 2 (n/e) n , which differ by a factor
of (n + l)e/2. A more precise estimate (not proved here) is:
PROOF OF THEOREM. The main tool is shown in the pictures of Fig. 3.1. Since
= logx
V
12 3 n—1 n 12 3 n—1 n n+1
(a) (b)
Fig. 3.1. Sums and integrals
(3.6.3) Proposition.
22V(2n + 1) < M < 22n.
PROOF. Immediate from the fact that the 2n + 1 binomial coefficients (2nJ, for
i = 0 , . . . , 2n, have sum 22n, and the middle one is the largest.
3.7. Selections
In how many ways can one select k objects from a set of size n?
The answer differs according to the terms of the problem, as we saw in Chapter 2.
Specifically, is the order in which the objects are chosen significant (a permutation)
or not (a combination)'! and is the same object permitted to feature more than once
in the selection, or not? (The term 'permutation' is used in a more general sense
than in the last section: this is what might more accurately be called a 'partial
permutation'.)
Repetitions k fn + k -1
n k
allowed \
Repetitions , .,x , 7 , 1\ ln
not allowed n(n - 1) • • • (n - k + 1) ^
PROOF. For the column 'order significant', these are straightforward. If repetitions
are allowed, there are n choices for each of the k objects; if repetitions are not
allowed, there are n choices for the first, n — 1 for the second, n — k + 1 for the kth.
For 'order not significant', if repetitions are not allowed, we are counting the
^-subsets of an rc-set, which we already know how to do. The final entry is a bit
harder.
(3.7.2) Lemma. The number of choices of k objects from n with repetitions allowed
and order not significant is equal to the number of ways of choosing n non-negative
integers whose sum is k.
PROOF. Given a choice of k objects from the set cti,..., an, let xt be the number of
times that the object az gets chosen. Then X{ > 0, Y^=i xi ~ k- Conversely, given
( x i , . . . , x n ), form a selection by choosing object at just X{ times.
3.7. Selections 33
• • 13 • M •
corresponds to the values Xi = 2, x2 = 1, x3 = 1. Conversely, the values (xi, x2, x3) =
(0,0,4) correspond to the pattern
Now the number of ways of choosing the positions of the markers is fn*^j =
' ~ 1 ), as claimed.
REMARK. Using the extended definition of binomial coefficients, the number of
selections with repetitions allowed and order not significant can be written
\n—k
(3.7.4) Proposition. The number of ordered selections without repetition from a set
ofn objects is [e • n!J, where e is the base of natural logarithms.
6
If it did, how would you look it up?
34 3. Subsets, partitions, permutations
k=o k'
So
. ... i i
+
1 1
+
^TT (n + 1)2 + •' •
so / ( n ) = |_e • n\\.
If the allowed letters contain repetitions, the problem is harder. It is possible to
derive a general formula; but it is probably easier to argue ad hoc in a particular
case, as the next example shows.
EXAMPLE. HOW many words can be made from the letters of the word FLEECE?
We count words according to the number of occurrences of the letter E. If there
is at most one E, we can invoke the previous result: there are 24 + 24 + 12 + 4 + 1 = 65
such words (including the empty word). If there are two Es, let us imagine first that
they are distinguishable; then there are 2 + 3 • 6 + 3 • 24 + 120 = 212 possibilities. (For
example, with four letters altogether, we choose two of the remaining three letters
in \Vj = 3 ways, and arrange the resulting four in 4! = 24 ways.) Since the two
Es are in fact indistinguishable, we have to halve this number, giving 106 words.
Finally, with three distinguishable Es, there would be 6 + 3 • 24 + 3 • 120 + 720 = 1158
possibilities, and so there are 1158/6 = 193 words of this form. So the total is
65 + 106 + 193 =• 364 words.
FOOTNOTES:
[7] These ships of Hagoth carried many colonies to the land northward;
as it was their custom to take one load of emigrants and when they had
disembarked, to return for another. Some of these vessels were
eventually lost; that is, the ships and their passengers never reached
their destination. It is supposed by many that a part of them were
carried out to mid-ocean by storms and probably wrecked; and that the
survivors found safety and shelter on some of the islands of the Pacific
Ocean. In this way, it is suggested, the Hawaiian, Samoan and other
islands were first peopled.
[8] Pacumeni was chosen to succeed Pahoran as Chief Judge.
CHAPTER XXXVI.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookultra.com