PRINCIPLES AND TECHNIQUES
IN COMBINATORICS
CHEN CHUAN-CHONG and KOH KHEE-MENG
Department of Mathematics
National University of Singapore
World Scientific
Singapore * New Jersey * London + Hong Kong16 Section 1.8. Circular Permutations
Principle of Complementation (CP) If A is a subset of a finite
universal set /, then
U\ Al = | - [Al
Now, the number of ways to arrange the 5 boys and 3 girls around a
table so that boy B, and girl G, are adjacent (treating {B,,G,} as an
entity) is
(7-1)! x 2= 1440.
Thus the desired number of ways is by (CP),
7! — 1440 = 3600.
(iii) We first seat the 5 boys around the table in (5 — 1)! = 4! ways.
Given such an arrangement as shown in Figure 1.3.4, there are 5 ways to
seat girl G;. As no girls are adjacent, Gz and G3 have 4 and 3 choices
respectively. Thus the desired number of ways is
4lx5x4x3=1440.
Figure 1.3.4.
Example 1.3.3. Find the number of ways to seat _n married couples
around a table in each of the following cases:
(i) Men and women alternate;
(ii) Every woman is next to her husband.Chapter 1. Permutations and Combinations 41
since object 1 can be put into any of the n boxes, object 2 into any of the
n-—1 boxes left, and so on.
(ii) If each box can hold any number of objects, then the number of
ways to distribute the objects is given by
as each object can be put into any of the n boxes.
(iii) Assume that each box can hold any number of objects and the
orderings of objects in each box count.
In this case, the Ist object, say a1, can be put in any of the n places
(namely, the n boxes); and the 2nd object, say a2, can be put in any of
the n + 1 places (the n — 1 boxes not containing a) plus the left and right
positions of a; in the box containing a;). Similarly, the 3rd object can be
put in any of the n + 2 places due to the presents of a; and az, and so on.
Thus the number of ways that an arrangement can be made in this case is
given by
n(n + 1)(n + 2)---(n+(r—1)).
left right
a.
box 1 box 2 box3 + boxn
There is another way to solve the problem. As shown below,
4a; a aga: <> = agasla;lazaz
box 1 box 2 box 3
n=3,r=5
one can establish a bijection between the set of such distributions of r dis-
tinct objects a1, a2, ...,a, into n distinct boxes and the set of arrangements
of the multi-set {a1,a2,...,a,,(m — 1) - 1} (we treate each vertical stroke
separating adjacent boxes as a ‘1’). Thus by (BP) and result (II) in Section
1.6, the desired number of ways is given by
(n-14+>7)!
(ny?66 Exercise 1
97.
98.
100.
101.
102.
103.
. In a sequence of coin tosses one can keep a record of the number of
instances when a tail is immediately followed by a head, a head is im-
mediately followed by a head, etc.. We denote these by TH, HH, etc..
For example, in the sequence HHTTHHHHTHHTTTT of 15 coin
tosses we observe that there are five HH, three HT, two TH and four
TT subsequences. How many different sequences of 15 coin tosses will
contain exactly two HH, three HT, four TH and five TT subsequences?
(AIME, 1986/13)
. An ordered pair (m,n) of non-negative integers is called “simple” if the
addition m +n in base 10 requires no carrying. Find the number of
simple ordered pairs of non-negative integers that sum to
(i) 1492; (AIME, 1987/1) (ii) 1992.
. Let m/n, in lowest terms, be the probability that a randomly chosen
positive divisor of 10°° is an integer multiple of 10°. Find m+n.
(AIME, 1988/5)
A convex polyhedron has for its faces 12 squares, 8 regular hexagons, and
6 regular octagons. At each vertex of the polyhedron one square, one
hexagon, and one octagon meet. How many segments joining vertices
of the polyhedron lie in the interior of the polyhedron rather than along
an edge or a face? (AIME, 1988/10)
Someone observed that 6! = 8-9-10. Find the largest positive integer
n for which n! can be expressed as the product of n — 3 consecutive
positive integers. (AIME, 1990/11)
Let S = {1,2,...,n}. Find the number of subsets A of S satisfying the
following conditions:
A= {a,a+d,...,a+kd} for some positive integers a,d and k, and
AU {z} is no longer an A.P. with common difference d for each
rES\A.
(Note that |A| > 2 and any sequence of two terms is considered as an
A.P.) (Chinese Math. Competition, 1991)
Find all natural numbers n > 1 and m > 1 such that
11315!---(2n — 1)! = ml.
(Proposed by I. Cucurezeanu, see Amer. Math. Monthly, 94 (1987),
190.)Chapter 2, Binomial Coefficients and Multinomial Coefficients 91
(2) The answer in Example 2.6.3, which is H™ = (™*?-1), sug-
gests another way to enumerate |X|. Indeed, given an increasing map-
ping a : Ny, — Nm, there corresponds a unique n-element multi-subset
{a(1), «(2), ...,a(n)} of the multi-set M = {o0-1,00-2,...,00-m} (thus the
mapping of Figure 2.6.5(a) is associated with the 6-element multi-subset
{2-2,3-3,1-4} of M = {o0-1,00-2,...,00-5} and the mapping of Figure
2.6.6(b) is associated with {1-1,4-3,1-5} of M), and conversely, every
n-element multi-subset of M corresponds to a unique increasing mapping
from Nn to Nm. The existence of this one-to-one correspondence shows
that |X| = H™
Let Nj = {0} UN. Our next problem is to enumerate the number of
increasing mappings a : N, + N}_, such that a(a) < a for each a € Ny.
First of all, we establish a useful principle about shortest routes in a grid,
called the reflection principle.
Let L: y= 2+k (k € Z) be a line of slope 1 on the z-y plane. Suppose
P and Q are two lattice points on one side of L and P’ is the reflection of
P with respect to L as shown in Figure 2.6.7. Then we have:
Reflection Principle (RP). The number of shortest routes from P
to Q that meet the line L is equal to the number of shortest routes
from P! to Q.
R(P'SQ)116 Exercise 2
92.
93.
94,
95.
96.
(ii) Let a be a nonzero real number, and 6, k,m € N. Denote by f(k)
the number of zeros in the base b + 1 representation of k. Compute
i
5 = lal,
k=1
where n= (b+ 1)" —
Remark. Part (i) was a 1981 Hungarian Mathematical Competition
problem. Part (ii) is a generalization of part (i), and was formulated by
M.S. Klamkin (see Cruz Mathematicorum, 9 (1983), 17-18).
Prove that the number of binary sequences of length n which contain
exactly m occurrences of “01” is (rte) (Great Britain MO, 1982/6)
There are n people in a gathering, some being acquaintances, some
strangers. It is given that every 2 strangers have exactly 2 common
friends, and every 2 acquaintances have no common friends. Show that
everyone has the same number of friends in the gathering. (23rd Moscow
MO)
Let n € N*. For p= 1,2,..., define
wi Zen)
Prove that, whenever n is odd, A2(n) = nAi(n). (Proposed by H.W.
Gould, see Amer. Math. Monthly, 80 (1973), 1146.)
Let n € N*. For p=1,2,..., define
oio=¥-{(3) a (.2,)}
Evaluate Bo(n). (Proposed by E.T. Ordman, see Amer. Math.
Monthly, 80 (1973), 1066.)
Show that
7 _1y-2 -1
@) Ory = Br {07 + CA) where 1,0 € N;
a Mned a
Bayern Bp = aie
(Proposed by I. Kancky, 3 see Amer. Math Monthly, 78 (1971), 908.)28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
Chapter 8. The Pigeonhole Principle and Ramsey Numbers 141
Let p,q € N. Show that in any given sequence of R(p,q) distinct inte-
gers, there is either an increasing subsequence of p terms or a decreasing
subsequence of g terms.
Show that given any sequence of pg + 1 distinct real numbers, where p
and q are nonnegative integers, there is either an increasing subsequence
of p+ 1 terms or a decreasing subsequence of g +1 terms. (P. Erdés
and G. Szekeres (1935))
Show that
(a) R(p,q) = R(q,p); for all p,q € Nj
(b) R(2,q) =, for allg EN.
Let p,p’,q,q’ € N with p’ < p and q’ 2
(iii) RP, q') = R(p,q) iff p’ =p and q' =4.
For p,q € N, show that
R(p, 9) $ (a)
p-l1
Show that 1
RG, a) < 50° + 3)
for g > 1.
Show that R(3,5) = 14.
Show that
(a) R(4,4) < 18,
(b) R(3,6) < 19.
Show that
(a) R(pi,p2,.--,Pk) = 1 if p; = 1 for some i € {1,2,...,k};
(b) R(p,2,2,...,2) =p for p> 2.
Let k, pi, P2,---,Pe € N with k > 2. Show that
R(P1,P2,-++sPr) = R(Prs Pay -- Pes 2).166 Section 4.7. The Seive of Eratosthenes and Euler y-function
It follows from the sieve that the desired number of primes is equal to
E(0) + 3 - 1,
because the 3 primes “2, 3, 5” not counted in E(0) must be included,
whereas, the number “1” counted in E(0) must be excluded.
Observe that
(0) = [S| = 48;
w(1) = w(P,) + w(P2) + w(Ps)
i [FI Fi [3 + |? | =44164+9 =49;
ww(2) = w(P; Po) + w(P1 Ps) + w(P2Ps)
[Elli lester
a w(3) = w(P; PePs) = 3 =L
Thus E(0) = w(0) — w(1) + w(2) — w(3) = 48 — 49 + 15-1 = 13 and the
desired number of primes is E(0)+3-—1=15. g
We shall now discuss our second example. For a,b € N, let (a,b) denote
the HCF of a and b. Thus (8,15) = 1 while (9,15) = 3. We say that a is
coprime to b (and vice versa) if (a,6) = 1. Around 1760, in his attempt to
generalize a result of Fermat’s in number theory, the Swiss mathematician
Leonard Euler (1707-1783) introduced the following notion. For n € N, let
y(n) denote the number of integers between 1 and n which are coprime to n.
Table 4.7.1 shows those integers z, 1 < x < n, which are coprime to n, and
the values of p(n) for n < 15. The function y(n), now known as the Euler y-
function, plays a significant role in many enumeration problems in number
theory and modern algebra. As seen in Table 4.7.1, the values of y(n) are
rather irregularly distributed except when n is a prime. Mathematicians
had been interested in finding a general formula of y(n), and it really took
some time before the following result was established.Chapter 5. Generating Functions 191
Proof. (i), (ii) and (v) follows directly from the definition, whereas
(iii), (iv) and (vi) are special cases of (ii). Also, (viii), (ix) and (x) are
straightfoward. We shall prove (vii) only.
(vii) By (5.1.3), 5 =1+2+2?+---. Thus
SS = (an + aye tagz?+---\(l+2+27+--)
A(z)
l-«
= a9 + (ao +41) 2 + (ao + a1 + a2)e? +--+.
Hence 4@) is the generating function for the sequence (c,), where c, =
Gota+---+ar. of
We see from Theorem 5.1.1 that operations on the terms of sequences
correspond to simpler operations on their generating functions. Thus the
generating function becomes a useful tool in the algebraic manipulations of
sequences.
Example 5.1.3. Express the generating function for each of the fol-
lowing sequences (c,) in closed form (i.e., a form not involving any series):
(i) c = 3r +5 for each r € N*;
(ii) cp = 7? for each r € N*.
Solution. (i) Let a, =r and 6, = 1 for all r. The generating function
for the sequence (a,) is qs, by (5.1.5) and Theorem 5.1.1(iv); while the
generating function for (6,) is -4>, by (5.1.3). Thus, by Theorenf 5.1.1(i),
the generating function for the sequence (c,), where c, = 3r+5 = 3a, +5b,,
is given by wy +7.
(ii) Let a, = r for all r. As in (i), the generating function for the
sequence (a,) is A(z) = qr. Since ¢, = r? = ra,, by Theorem 5.1.1(ix),
the generating function for the sequence (c,) is
yoy. G-2)?+2-2%1-2) 2(1+2)
ote216 Exercise 5
Note that ("), = (7). Show that
(i) (7), 18 the number of integer solutions to the equation
Tt+t2t+-- +t, =r
My
with 0 < 2; < m—1 for each i= 1,2,.
Gi) On = 35
(iii) (2), =, where m > 2;
(iv) (2), = (2) Where r+ 8 = n(m — 1);
() Cr mn =
(vi) the generating function for (Cy )aieita is (1ta2+---+2™-1)";
0 if mis even
(vit) OME D(-1yr (Yin {
1 if mis odd
(vii) nen Der), = nas
3
e: 0 if m is even
(x) DPM (-1)"44(2) 4 =
vim ( sG5m) if mis odd
(%) Cho Ben (eta) = PE) mur Where p,q EN;
(i) Pg = Deol D(C)
(See C. Cooper and R. E. Kennedy, A dice-tossing problem, Cruz Math-
ematicorum, 10 (1984), 134-138.)
29. Given n EN, evaluate the sum
2 r-an(2n—r
Sn =o? ( ae ).
r=0
(Proposed by the Israeli Team at the 31st IMO.)
30. For each r € N", let
a, =1-4-7---(3r-1).
Show that the exponential generating function for the sequence (a,) is
given by (1—3z)-$.Chapter 6. Recurrence Relations 241
6.4. General Linear Recurrence Relations
Let (an) be a given sequence of numbers. A recurrence relation of the form
Cody + C1Gn—1 + +++ + Crdnar = f(n) (6.4.1)
where the c;’s are constants with co,c, # 0,1 G k )ekdna-t
k=0
as required. g
Claim 2. For even n,
n-1
=>) er " enby-iok (6.9.2)
k=0
Proof. Let eye2--- exen+1€k42°**€n-ien (n even) be an oscillating
permutation of Nj, where e41 = n. Again, ez41(= n) splits the per-
mutation into an oscillating permutation of odd length & on the left and
an oscillating permutation of even length n — 1—k on the right, where
k=1,3,5,...n—1:
(c1e2€3- ++ ee-16k) €b-41 (€442€k+3 ***€n—1en)
TH SRN enema
odd even
(left) (right)
Since there are
(i) (wae) ways of choosing k numbers from Nn-1,
(ii) a, ways to form an oscillating permutation of odd length & on the
left, and
(iii) ba_1-% ways to form oscillating permutations of even length n—1—k
on the right,