Example 21. There are ve points inside an equilateral triangle of side
length 2. Show that at least two points are within one unit length of each
other.
Example 22. An 80-bit string consists of 45 zeros and 35 ones. Show that
there are at least 2 zeros in

Example 19. A family has 12 children.
1. Show that at least 2 children were born on the same day of the week.
2. Show that at least 2 family members were born in the same month.
3. Assume the children share 4 bedrooms. Show that at least 3 children
sleep

Example 16. Two dice are rolled and the total score is recorded. How
many times must the dice be rolled to ensure that some score is recorded 6
times?
Example 17. In a certain company, pay day is every second Friday. Show
that in some months there are thr

Example 15. How many non-negative integers less than 100000 have a 3,
6 or 9 among their digits?
Solution This is a dicult problem unless approached as an application of
inclusion-exclusion. Note that it can be easier to count integers that do not
have ce

1.8
Pigeonhole principle
This principle has three versions. The rst may appear so trivial as to be
useless. However, it can be used to solve some dicult counting problems.
The third version uses the ceiling function x dened to be the smallest
integer grea

Example 12. You have 6 computer programs that require debugging. How
many dierent ways are there of giving 3 to Anna, 2 to Brett and 1 to Carl?
Example 13. How many 10 letter words (meaningful or otherwise) can be
created using the letters A, A, B, B, C,

2. z = 1: gives 1 n + n . n = 0
1
2
n
(Alternating sign in sum of horizontal terms in Pascals triangle equal
0).
3.
m
m
n
n+1
+ m+1 + . + m = m+1
m
(Diagonal sums in Pascals triangle are thus identied.)
n
(n + 1)
2
(This is a formula for the sum of the rs

Example 14A. Derive Combinatorial Identity 4 by setting m = 1 in Identity 3
Solution: Put m = 1 in Identity 3 to get 1 + 2 + 3 +.+ n = n+1 .
1
1
1
1
2
n
This gives 1 + 2 + . + n = (n + 1)
2
This is a formula for the sum of the rst n positive integers.
101

1.4
Techniques of counting
Recall some basic notation of set theory:
universe: U
subset: A U
element of: a A
union: A B = cfw_x U : x A or x B
intersection: A B = cfw_x U : x A and x B
complement: Ac = U A = cfw_x U : x A
/
#(A) = number of element

1.5
Partitions
Suppose there is a class A of 100 students who are to be divided into 5 lab
groups A1 , A2 , A3 , A4 , A5 of 20 each. If the 5 labs are all to be held at 9.00
am on Monday, then their order does not really matter and the problem is
one of c

Example 7. Use the addition principle to show
for sets: #(A) = #(A B) + #(A B c )
for properties: #(A) = #(A and B) + #(A and B c )
Example 8. How many 8-bit strings begin with either 101 or 111?
number starting with 101 =
number starting with 111 =
num

(c) abcd and badc are two of the permutations of the elements of the set
cfw_a, b, c, d.
To count numbers of subsets we need some functions. For integers n, r with
0 r n we dene:
n-factorial: n! = n (n 1) (n 2) . . . 3 2 1
(n > 0)
0-factorial: 0! = 1
n

The triangular array of numbers below is called Pascals triangle. Each
number is the sum of the two numbers to its left and right in the preceding
row. From property 5 we deduce the following: counting from 0, go to the
nth row, then the k th position in

Chapter 1
Combinatorics
1.1
Reference books
1. I. Anderson, A rst course in combinatorial mathematics, Oxford University Press, 1989.
2. J.A. Anderson, Discrete mathematics with combinatorics, Prentice Hall,
2001.
1.2
Selections and arrangements
We are in

and Mrs Jones, do not wish to be on the committee together?
total number of committees =
number of committees with both Jones =
number of committees with at most one Jones =
Example 4. How many 9-bit strings contain exactly ve 1s and four 0s?
Example 5. C

4.
n
nr
5.
n!
n!
=
=
(n (n r)! (n r)!
r! (n r)!
n
r
=
n
r
is the number of ways of choosing r objects from n objects. Let x
be one of the objects from which r are to be chosen. Then n1 is the
r1
number of ways of choosing r objects including x from the n

5.
n
r
=
n1
r1
+
n1
r
(provided 1 r n 1)
Proofs:
1. Choose the rst element in n ways, choose the second element from
the remaining n 1 in n 1 ways, choose the third element from
the remaining n 2 in n 2 ways, ., choose the nth element from
the remaining 1