Sie sind auf Seite 1von 127

GEK1505: Chapter 2 Counting

Chapter 2 Counting

1 / 127

Overview
1

Geometric series

Arithmetic series

Sets
Union, intersection & complement
Principle of inclusion & exclusion
Examples

Counting principles
Addition principle
Multiplication rinciple

Arrangements & Combinations

Number of routes on rectangular grid

Pigeonhole Principle
Chapter 2 Counting

2 / 127

Geometric series

Definition (Geometric series)


A geometric series is a sum of the form
a + ar + ar 2 + ar 3 + + ar n .

Chapter 2 Counting

3 / 127

Geometric series

Theorem
The value of a geometric series is given by the formula
a + ar + ar 2 + ar 3 + + ar n =

Chapter 2 Counting

a(r n+1 1)
.
r 1

4 / 127

Proof. Let
Sn = a + ar + ar 2 + ar 3 + + ar n .

(1)

rSn = ar + ar 2 + ar 3 + ar 4 + + ar n+1 .

(2)

Then,

Subtracting (1) from (2), we have


rSn Sn = ar n+1 a
a(r n+1 1)
Sn =
.
r 1

Chapter 2 Counting

5 / 127

Geometric series
Example (Tower of Hanoi)
There are three vertical poles A, B, C . Five circular slabs of different radii
and each with a hole in the centre rest on top of each other as shown in
the figure below. What is the minimum number of steps needed to
transfer all the slabs to pole B if at each step no slab is allowed to rest on
top of a smaller slab in the same pole?

Chapter 2 Counting

6 / 127

Geometric series

Solution.
Suppose there are only 2 slabs.
We need minimum number of 3 steps:
Move the top (smallest) slab to pole C ;
Move the bottom (larger) slap to pole B;
Move the smaller slab from pole C to pole B.
Let an be the minimum number of steps required to move a tower of n
slabs. Then
a2 = 3.

Chapter 2 Counting

7 / 127

Geometric series

Suppose there are n slabs.


Let us label them as 1, 2, etc from the top (smallest) slab to the bottom
(largest) slab.
When can we move the n-th slab to pole B?
This happens exactly when the first n 1 forms a tower in pole C . The
(minimum) number steps to achieve this is an1 .

Chapter 2 Counting

8 / 127

Geometric series

It takes an1 steps to move the first n 1 slabs to pole C ;


It takes 1 step to move the n-th slab from pole A to pole B;
It takes another an1 steps to move the n 1 slabs from pole C to
pole A.
Hence,
an = 1 + 2an1 .

Chapter 2 Counting

9 / 127

Geometric series
In our case, n = 5, so
a5 = 1 + 2a4
= 1 + 2(1 + 2a3 )
= 1 + 2 + 22 a3
= 1 + 2 + 22 (1 + 2a2 )
= 1 + 2 + 2 2 + 2 3 a2
= 1 + 2 + 22 + 23 (1 + 2a1 )
= 1 + 2 + 22 + 2 3 + 2 4
1(25 1)
=
21
= 31.

Chapter 2 Counting

10 / 127

Arithmetic series

Chapter 2 Counting

11 / 127

Arithmetic series

The numbers given by T1 , T2 , etc are called the triangular numbers.

T1 = 1
T2 = 1 + 2 = 3
T3 = 1 + 2 + 3 = 6
T4 = 1 + 2 + 3 + 4 = 10

Chapter 2 Counting

12 / 127

Arithmetic series

Theorem
The triangular number Tn is given by
1
Tn = 1 + 2 + 3 + + n = n(n + 1).
2

Chapter 2 Counting

13 / 127

Arithmetic series
Proof.
We rearrange the terms:

Tn = 1 + 2

+ + n 1 + n

Tn = n + n 1 + + 2

+1

Adding them:

2Tn = n(n + 1)
n(n + 1)
Tn =
2

Chapter 2 Counting

14 / 127

Arithmetic series

More generally, an arithmetic series is a sum of the form


a + (a + d) + (a + 2d) + + (a + nd).

The number a is called the first term and the number d is called the
common difference of the arithmetic series.
The triangular number Tn is the arithmetic series with
a = d = 1.

Chapter 2 Counting

15 / 127

Arithmetic series

Theorem
The sum of an arithmetic series is given by
a + (a + d) + (a + 2d) + + (a + nd) =

Chapter 2 Counting

(n + 1)(2a + dn)
.
2

16 / 127

Arithmetic series

Proof.
a + (a + d) + (a + 2d) + + (a + nd)
= (a + + a) + d(1 + 2 + + n)
= (n + 1)a + dTn
n(n + 1)
= (n + 1)a + d
2
(n + 1)(2a + dn)
=
2

Chapter 2 Counting

17 / 127

Arithmetic series
Proof.
Alternatively, we rearrange the terms:

An =

(a)

(a + d)

+ + (a + nd)

An = (a + nd) + (a + (n 1)d) + +

Adding them:

2An = (n + 1)(2a + nd)


(n + 1)(2a + nd)
An =
2

Chapter 2 Counting

18 / 127

Arithmetic series

Example
1 + 3 + 5 + + (2n 1) = n2 .
1 + 4 + 7 + + (3n 2) = 12 n(3n 1).

Chapter 2 Counting

19 / 127

Arithmetic series

Example
Draw n lines in the plane.This will form a number of mutually
non-overlapping region in the plane. What is the maximum number of
such regions that can be formed?

Chapter 2 Counting

20 / 127

Solution.

n
= 0 1 2 3 4 ...
Regions = 1 2 4 7 11 . . .
Plus
1 2 3 4 ...

Chapter 2 Counting

n
?
n

21 / 127

Here is an explanation.
Say when you have 2 lines and want to add a third line. This new third
line intersects the existing lines and is divided into 3 segments. Each
segment slices an existing region into 2 and thus we get 3 addition regions.
Now if you n 1 lines and you want to add the nth line. This new line is
divided into n segments and thus we have n additional regions.

Chapter 2 Counting

22 / 127

In general, for n lines, we get

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

Chapter 2 Counting

23 / 127

Sets

Similar objects are often gathered together for easy reference.


Such a collection is called a set.
Examples:
set of all NUS students
set of positive integers

Chapter 2 Counting

24 / 127

Sets
The items in a set are often referred to as elements or members of the
set.
Sets are often denoted by uppercase letters like A, B, C etc.

Notation for sets


We exhibit members of a set within parentheses, e.g.
S = {a, e, i, o, u} or
S = {x : x is a vowel of the English alphabet}.
We use the notation x S to mean x is a member of S or x belongs
to S.
x 6 S means x is not a member of S.
Chapter 2 Counting

25 / 127

Sets

Definition (Empty set)


The empty set is the set containing no members. This is denoted by .
That is
= {}.
Think of as an empty box.

Chapter 2 Counting

26 / 127

Sets

Definition (Union)
The union of sets A and B is the set whose elements are precisely those
belong to A or B. Symbolically, we denote the union by A B:
A B = {x : x A or x B}.
We can perform the union operation repeatedly to obtain A B C , etc.

Chapter 2 Counting

27 / 127

Sets

Example
If A = {a, b, c} and B = {b, c, d, e}, then
A B = {a, b, c, d, e}.

Chapter 2 Counting

28 / 127

Sets

Definition (Intersection)
The intersection of sets A and B is the set whose elements are precisely
those belong to A and B. Symbolically, we denote the intersection by
A B:
A B = {x : x A and x B}.
We can perform the intersection operation repeatedly to obtain A B C
etc.

Chapter 2 Counting

29 / 127

Sets

Definition
We say that the sets A and B are disjoint if
A B = .

Chapter 2 Counting

30 / 127

Sets
We can use Venn diagrams to visualise the union and intersection of sets:

Chapter 2 Counting

31 / 127

Sets

Theorem (Properties of union & intersection)


A B = B A, A B = B A (Commutative law)
(A B) C = A (B C ) (Associative law)
(A B) C = A (B C ) (Associative law)
A (B C ) = (A B) (A C ) (Distributive law)
A (B C ) = (A B) (A C )

(Distributive law)

A A = A, A A = A (Idempotent laws)
A = A, A =

Chapter 2 Counting

32 / 127

Sets
Example
Give examples of sets A, B, C such that
(A B) C 6= A (B C ).

Solution. Take
A = {1, 2, 3}, B = {2, 5}, C = {3, 5}.
Then
(A B) C = {3, 5}.
A (B C ) = {1, 2, 3, 5}.

Chapter 2 Counting

33 / 127

Sets

Definition (Subset)
If every element of A is also an element of B, then we say that A is a
subset of B.
Symbolically, we write
A B.

Chapter 2 Counting

34 / 127

Sets

Some immediate consequences of the definition of a subset:


For any set A, A A,

A.

For sets A, B,
A A B, A B A.
If A B, then
A B = B, A B = A.

Chapter 2 Counting

35 / 127

Sets

We are often interested in subsets of a fixed reference set called the


universal set.

Definition (Complement)
Suppose S is the given universal set, and A S. Then the complement
of A, denoted by Ac , is the set consisting of all the elements of S which
are not in A. That is
Ac = {x S : x 6 A}.

By definition,
A Ac = S, A Ac = .

Chapter 2 Counting

36 / 127

Sets

Theorem (de Morgans laws)


The following properties hold for sets A, B.
(A B)c = Ac B c .
(A B)c = Ac B c .

Chapter 2 Counting

37 / 127

Principle of Inclusion & Exclusion

Theorem (PIE for 2 sets)


For arbitrary finite sets A, B, C , we have
|A B| = |A| + |B| |A B|.
The principle is obvious by examining the Venn diagram.

Chapter 2 Counting

38 / 127

Principle of Inclusion & Exclusion

Example
At Dunman High School there are
28 students in algebra class,
30 students in biology class, and
8 students in both classes. How many students are in either algebra
or biology class?

Chapter 2 Counting

39 / 127

Principle of Inclusion & Exclusion

Solution. Let
A = set of students in algebra class
B = set of students in biology class
Then
|A B| = |A| + |B| |A B| = 28 + 30 8 = 50.

Chapter 2 Counting

40 / 127

Principle of Inclusion & Exclusion

Theorem (PIE for 3 sets)


For arbitrary finite sets A, B, C , we have
|A B C | = |A| + |B| + |C | |A B| |A C | |B C | + |A B C |.

Chapter 2 Counting

41 / 127

Principle of Inclusion & Exclusion

Proof.

|A B C | = |(A B) C |
= |A B| + |C | |(A B) C |

Chapter 2 Counting

(3)

42 / 127

Principle of Inclusion & Exclusion

Applying PIE for 2 sets, we have

|A B| = |A| + |B| |A B|

(4)

|(A B) C | = |(A C ) (B C )|
= |A C | + |B C | |(A C ) (B C )|
= |A C | + |B C | |(A B C |

(5)

The result follows by substituting (4, 5) into (3).

Chapter 2 Counting

43 / 127

Principle of Inclusion & Exclusion


Example
At Dunman High School there are
55 students in either algebra, biology, or chemistry class
28 students in algebra class
30 students in biology class
24 students in chemistry class
8 students in both algebra and biology
16 students in both biology and chemistry
5 students in both algebra and chemistry
How many students attend all three classes?

Chapter 2 Counting

44 / 127

Principle of Inclusion & Exclusion

Solution. Let
A = set of students in algebra class
B = set of students in biology class
C = set of students in chemistry class
Then
|A B C | = 55
|A| = 28, |B| = 30, |C | = 24
|A B| = 8, |B C | = 16, |A C | = 5.

Chapter 2 Counting

45 / 127

Principle of Inclusion & Exclusion


By PIE,

|A B C | = |A| + |B| + |C | |A B| |A C | |B C | + |A B C |.

|A B C | = |A B C | |A| |B| |C |
+|A B| + |A C | + |B C |
= 55 28 30 24 + 8 + 16 + 5
= 2.
There are 2 students who attend all three classes.

Chapter 2 Counting

46 / 127

Principle of Inclusion & Exclusion

Example (PIE for 4 sets)


For arbitrary sets A, B, C , D, we have

|A B C D| =
|A| + |B| + |C | + |D|
|A B| |A C | |A D| |B C | |B D| |C D|
+|A B C | + |A B D| + |A C D| + |B C D|
|A B C D|.

Chapter 2 Counting

47 / 127

Principle of Inclusion & Exclusion

Solution.
By PIE for 2 sets,
|(A B C ) D| = |A B C | + |D| |(A B C ) D|

By the distributive law,


|(A B C ) D| = |(A D) (B D) (C D)|

Chapter 2 Counting

48 / 127

Principle of Inclusion & Exclusion

Apply the PIE for 3 sets to calculate


|A B C |, |(A D) (B D) (C D)|
and rearrange the terms.

Chapter 2 Counting

49 / 127

PIE: Examples

Example
A pavement was tiled by 80 parallel slabs of tiles. A cat walked along the
pavement and at every fifth tile other than the first) i.e. at tiles numbered
5, 10, 15, ..., it relieved itself.
A while later, another cat came along and did the same thing but only at
every seventh tile (other than the first), i.e. at tiles numbered 7, 14, 21, ...
Later a boy strolled along the pavement, each step covering the
odd-numbered tiles.
How many of the tiles covered by his steps will not have been soiled by
any of the two cats?

Chapter 2 Counting

50 / 127

PIE: Examples

Solution. Consider the following sets:


A = {1, 2, 3, . . . , 80}, B = {5, 10, 15, . . . , 80}
C = {7, 14, 21, . . . , 77}, D = {1, 3, 5, . . . , 79}.
B C = Set of tiles soiled by any of the two cats
(B C )c = Set of ttiles not soiled by any of the two cats
Goal: Find |D (B C )c |.

Chapter 2 Counting

51 / 127

PIE: Examples

Use the fact that for any set X ,


D = (D X ) (D X c ).

Take X = B C . Then
|D (B C )c | = |D| |D (B C )|.
Next, determine |D| and |D (B C )|.

Chapter 2 Counting

52 / 127

PIE: Examples
Clearly, |D| = 40.

|D (B C )| = |(D B) (D C )| (by distributive law)


= |D B| + |D C | |D B C | (by PIE)
= 8+61
= 13.
since
|D B| = |{5, 15, 25, 35, 45, 55, 65, 75}| = 8
|D C | = |{7, 21, 35, 49, 63, 77}| = 6
|D B C | = |{35}| = 1

Chapter 2 Counting

53 / 127

PIE: Examples

Finally,
|D (B C )c | = |D| |D (B C )|
= 40 13
= 27.

Chapter 2 Counting

54 / 127

Addition principle

Addition principle of counting


If a choice from set A1 can be made in n1 ways, and a choice from set A2
can be made in n2 ways, then the number of choices from A1 or A2 is
n1 + n2 .
Necessary condition:

Set A1 and A2 are disjoint.

Chapter 2 Counting

55 / 127

Addition principle

Addition principle of counting extension


If a choice from set Ai can be made in ni ways for i = 1, . . . , m, then the
number of choices from A1 Am is
n1 + + nm .
Necessary condition: The sets A1 , . . ., Am are pairwise/mutually
disjoint, i.e. Ai Aj = for all i =
6 j.

Chapter 2 Counting

56 / 127

Addition principle
Example
Given three sets
A = {a, m, r }
B = {b, d, i, l, u}
C = {c, e, n, t}
How many ways are there to choose one letter from among the set A, B
or C ?
Solution. The three sets are pairwise/mutually disjoint. By the addition
principle, the number of ways is
3 + 5 + 4 = 12.

Chapter 2 Counting

57 / 127

Addition principle

Example
Here are two sets of positive integers:
A = {2, 3, 5, 7, 11, 13}
B = {2, 4, 6, 8, 10, 12}
How many ways are there to choose one integer from A B?
The two sets are NOT disjoint. What modification can we make to the
addition principle to accommodate this case?

Chapter 2 Counting

58 / 127

Multiplication principle

Multiplication principle of counting


If a task involves a sequence of two steps, where the first step can be
completed in n1 ways and the second step can be completed in n2 ways,
then there are
n1 n2
ways to complete the task.
Necessary condition: The ways each step can be completed are
independent of each other.

Chapter 2 Counting

59 / 127

Multiplication principle

Multiplication principle of counting extension


If a task involves a sequence of m steps, where the i-th step can be
completed in ni ways, then there are
n1 nm
ways to complete the task.
Necessary condition: The ways each step can be completed are
independent of each other.

Chapter 2 Counting

60 / 127

Multiplication principle

Example
If a word is defined as a juxtaposition of letters, how many
(i) 2-letter words
(ii) 3-letter words
(iii) k-letter words
can be formed from the English alphabet?

Chapter 2 Counting

61 / 127

Multiplication principle
Solution. Suppose we wish to form a k-letter word, where k 1. There
are
26 ways to choose the 1st letter;
26 ways to choose the 2nd letter;
..
.
26 ways to choose the k-th letter.
Each steps above are independent of each other. By the multiplication
principle, the total number of ways is
26
26} = 26k .
| {z
k times

Chapter 2 Counting

62 / 127

Arrangements in a row
Example
In how many ways can n different objects be arranged in a row?
Solution. We choose objects to place in a row one by one from left to
right:
There are n ways for the first position;
There are n 1 ways for the 2nd position;
..
.
There are 2 ways for the n 1-th position;
There is 1 way for the n-th position.
By multiplication principle, the number of ways is
n! = n (n 1) 2 1.
Chapter 2 Counting

63 / 127

Arrangements in a row
Example
In how many ways can you form a row of 3 different objects from 8
different objects?
Solution. There are
8 choices for the 1st position;
7 choices for the 2nd position;
6 choices for the 3rd position.
The number of ways is
8 7 6 = 336.

Chapter 2 Counting

64 / 127

Arrangements in row

Theorem
Let n Pk be the number of ways of arranging in a row k different objects
taken from n different objects. Then
n

Pk =

n!
.
(n k)!

Chapter 2 Counting

65 / 127

Arrangements in a row

Example
In how many ways can you arrange 3 red, 4 green and 5 blue beads in a
row?
Solution. If all the beads were different, then the number of ways is
(3 + 4 + 5)! = 12!.
Imagine we have such an arrangement.
Crucial observation: Permuting the beads of the same colour will yield
the same arrangement!

Chapter 2 Counting

66 / 127

Arrangements in a row

There are 3! ways to permute the red beads;


There are 4! ways to permute the green beads;
There are 5! ways to permute the blue beads.
By multiplication principle, the number of ways to arrange 3 red, 4 green
and 5 blue beads in a row is
12!
.
3!4!5!

Chapter 2 Counting

67 / 127

Arrangements in a row

Theorem
The number of ways of arranging in a row n1 identical objects of Type 1,
n2 identical objects of Type 2, ..., nk identical objects of Type k is equal to
(n1 + n2 + + nk )!
.
n1 !n2 ! nk !

Chapter 2 Counting

68 / 127

Circular arrangements
Example
In how many ways can you arrange n different objects in a circle?
Solution.
A circular arrangement is considered the same after rotating it.

Chapter 2 Counting

69 / 127

Circular arrangements

There is no first position.


Any object can be used as a point of reference.
Important: Once a reference object is fixed, the order in which the
remaining objects are arranged with respect to this reference object (either
in clockwise or anti-clockwise direction) is now important.

Chapter 2 Counting

70 / 127

Circular arrangements

Suppose the objects are labelled as A1 , A2 , . . ., An .


Fix A1 as the reference object.
Arrange the rest in clockwise direction starting from A1 .

Chapter 2 Counting

71 / 127

Circular arrangements
There are
(n 1) ways to choose the object next (in clockwise direction) to A1 .
(n 2) ways to choose the next object (in clockwise direction).
..
.
2 ways to choose the second last object.
1 way to choose the last object.
Therefore, the total number of ways is
(n 1)! = (n 1) (n 2) 2 1.

Chapter 2 Counting

72 / 127

Circular arrangements

Theorem (Circular arrangements)


The number of ways of arranging n different objects in a circle is
(n 1)!.

Chapter 2 Counting

73 / 127

Circular arrangements

Example
Find the number of ways, without removing any empty seat, that 9 guests
can be seated at a round table with exactly 10 seats?
Solution. The empty seat could be used as the reference object. Then
the number of ways is just
(10 1)! = 9!.

Chapter 2 Counting

74 / 127

Circular arrangements

Example
Find the number of ways, without removing any empty seat, that 8 guests
can be seated at a round table with exactly 10 seats?
Solution. Just imagine, in addition to the existing guests, we have two
different ghosts who will occupy the empty seats. Then the the number of
seatings is
(10 1)! = 9!.

Chapter 2 Counting

75 / 127

Circular arrangements
Now, let us identify the two ghosts. If there were not identical, there are
exactly two circular arrangements with the same positions for these
ghosts! But we want to identify these ghosts as identical since they
correspond to empty seats.

Chapter 2 Counting

76 / 127

Circular arrangements

Therefore, the total number of ways is


9!
9 8 7!
=
= 36 7!.
2
2

Chapter 2 Counting

77 / 127

Combinations

Many counting problems involve counting the number of subsets of a finite


set satisfying certain constraints.
How many gift hampers can be designed to contain 10 out of 15
given different items?
How many 5-person committees can be formed from a group of 8
persons?
Given n different objects, how many ways can we choose k of them?

Chapter 2 Counting

78 / 127

Theorem
Let n Ck denote the number of ways of choosing k objects from a set of n
different objects. Then
n!
n
Ck =
.
k!(n k)!

Chapter 2 Counting

79 / 127

Combinations

Proof. For each such a collection of k objects, we can arrange them in a


row, and there are k! ways to that.
By multiplication principle,
n

Ck k! = n Pk

Thus,
n

Ck =

nP

k!

n!
.
k!(n k)!

Chapter 2 Counting

80 / 127

Combinations

Another notation for n Ck is


 
n
n!
=
k
k!(n k)!
We pronounce this number as
n choose k.

Chapter 2 Counting

81 / 127

Combinations

The numbers kn also called binomial coefficients since they appear in
the binomial expansion of (1 + x)n :

(1 + x)2 = 1 + 2x + x 2
(1 + x)3 = 1 + 3x + 3x 2 + x 3
(1 + x)4 = 1 + 4x + 6x 2 + 6x 3 + x 4
..
.    
 
 
n
n
n 2
n n
n
(1 + x) =
+
x+
x + +
x
0
1
2
n

Chapter 2 Counting

82 / 127

Combinations

Theorem (Simple properties of binomial coefficients)


n
0

n
k


n
0

n
n

nk

n
1

=1

n

n
2

+ +

n
n

= 2n

Proof. The first two are obvious from the definition.


The last one follows from the binomial expansion of (1 + x)n by setting
x = 1.

Chapter 2 Counting

83 / 127

Combinations

Example
How many different 5-member subcommittees can be formed from a
9-member specified committee if the President and Vice-President do not
serve on the same subcommittee?
Solution. There are 3 types of subcommittees:
Type 1: containing President but not Vice President
Type 2: containing Vice President but not President
Type 3: not containing President and Vice President

Chapter 2 Counting

84 / 127

There are

7
4 different subcommittees of Type 1.

7
4 different subcommittees of Type 2.

7
5 different subcommittees of Type 3.
By addition principle, the total number is
     
7
7
7
+
+
= 91.
4
4
5

Chapter 2 Counting

85 / 127

Combinations

Example
An LCD display consists of 10 rows and 10 columns of squares which may
be lighted up.
How many different patterns of lighted display can be obtained if 30
squares are lighted up?
How many of these have at least one lighted square touching the border of
the display?

Chapter 2 Counting

86 / 127

Combinations

There are 100 squares altogether.


If exactly 30 squares are lighted up, there are


100
30
different patterns.

Chapter 2 Counting

87 / 127

Combinations

Suppose none of the 30 squares touch the border. The number of these is

  
88
64
=
.
30
30
Those have at least one lighted square touching the border is

  
100
64

.
30
30

Chapter 2 Counting

88 / 127

Rectangular grid

Example
If you are allowed to go east or north, how many ways can you go from A
to B in the following figure:

Chapter 2 Counting

89 / 127

Rectangular grid
A possible route is given in the following figure in red colour:

Convert this path into a string of integers consisting of 0s and 1s as


follows:
Horizontal step corresponds to 0
Vertical steps corresponds to 1.
Chapter 2 Counting

90 / 127

Rectangular grid
The 01-string corresponds to the path is
0 1 0 0 1 0 1 0 0.
The length of this 01-string is always 9, which is the sum of the
dimensions of the grid.
The dimension of the grid here is 3 6. For this grid, the corresponding
01-string always have
Six 0s
Three 1s

Conversely, any 01-string of length 9 will give a path from A to B


consisting of east or north bound move at each step.
Chapter 2 Counting

91 / 127

Rectangular grid

The required number of different routes is equal to the number of different


01 string of length 9, with six 0 and three 1.
Hence, the number required is given by
9!
.
6!3!

Chapter 2 Counting

92 / 127

Rectangular grid
We label each intersection point on a rectangular grid using coordinate
(i, j) such that i increases from left to right, and j increases from bottom
to top.
The bottom left point is labelled by (0, 0).

Chapter 2 Counting

93 / 127

Rectangular grid

Theorem
On a rectangular grid, the number of routes from (0, 0) to (i, j) moving
easterly or northerly without back-tracking is

 

(i + j)!
i +j
i +j
=
=
.
i!j!
i
j

Chapter 2 Counting

94 / 127

Rectangular grid

More generally,

Theorem
On a rectangular grid, the number of routes from (i, j) to (k, l), where
i k and j l, moving easterly or northerly without back-tracking is

 

k +l i j
k +l i j
((k i) + (l j))!
=
=
.
k i
l j
(k i)!(l j)!

Chapter 2 Counting

95 / 127

Rectangular grid

Example
How many possible bus routes (moving easterly or northerly without
back-tracking) are there from (0, 0) to (8, 8) that pass through (3, 3) or
(5, 5)?

Chapter 2 Counting

96 / 127

Rectangular grid

Solution. Let

A = set of routes from (0, 0) to (8, 8) and passing through (3, 3).

B = set of routes from (0, 0) to (8, 8) and passing through (5, 5)

Aim: Compute |A B|.

Chapter 2 Counting

97 / 127

Rectangular grid

   
6
10
|A| =

= 5040
3
5
   
10
6
|B| =

= 5040
5
3
     
6
4
6
|A B| =

= 2400.
3
2
3

Chapter 2 Counting

98 / 127

Rectangular grid

By PIE,

|A B| = |A| + |B| |A C |
= 5040 + 5040 2400
= 7680.

Chapter 2 Counting

99 / 127

Rectangular grid

Example
How many possible bus routes (moving easterly or northerly without
back-tracking) are there from (0, 0) to (7, 8) that does not pass through
any of the points (3, 3) or (5, 5)?

Chapter 2 Counting

100 / 127

Rectangular grid
Solution.

A = set of routes from (0, 0) to (7, 8) and passing through (3, 3).

B = set of routes from (0, 0) to (7, 8) and passing through (5, 5).

X = set of routes from (0, 0) to (7, 8).


Aim: Compute |X | |A B|.

Chapter 2 Counting

101 / 127

|X | =

|A| =

|B| =

|A B| =

 
15
= 6435
7
   
6
9

= 2520
3
4
   
10
5

= 2520
2
5
     
6
4
5

= 1200
3
2
2

|X | |A B| = |X | |A| |B| + |A B|
= 2595.

Chapter 2 Counting

102 / 127

Pigeonhole Principle

Example
If 3 objects are distributed among 2 pigeon-holes, then there is at least one
pigeon hole that will contain at least two of the distributed objects.

Chapter 2 Counting

103 / 127

Pigeonhole Principle

Theorem (Pigeon-hole Principle (PHP))


Suppose m objects are distributed among n pigeon-holes. If m > n, then
there is at least one pigeon-hole with at least two of the distributed
objects.
Proof. If every pigeon-hole contains at most one of the distributed
objects, then the total number of the distributed objects is at most n,
contradicting the fact that there are more than n objects being
distributed.

Chapter 2 Counting

104 / 127

Pigeonhole Principle

When solving problems using PHP, we need to identify


what are the pigeon-holes
what are the distributed objects

Chapter 2 Counting

105 / 127

Pigeonhole Principle
Example
Jacky takes lunch at the same cafeteria five days a week (Monday to
Friday).
There are 16 different food-stalls.
Within how many weeks will it be certain that Jacky will take his lunch at
least twice from the same food-stall?

Distributed objects

Pigeon-holes

days

food-stalls

Chapter 2 Counting

106 / 127

Pigeonhole Principle

By PHP, a minimum of 17 days guarantees that Jack will order from the
same food-stall on at least two days.
Thus within 4 weeks, it is certain that he will take his lunch at least twice
from the same food-stall.

Chapter 2 Counting

107 / 127

Pigeonhole Principle

Example
If you are at a reception attended by more than 366 guests, you can be
sure that there will be at least two persons with the same birthday.

Distributed objects

Pigeon-holes

guests

birthdays

Chapter 2 Counting

108 / 127

Pigeonhole Principle
Example
A fitness club classifies its members according to the following
characteristics: gender, age, height and weight, for which there are 2, 8, 5
and 5 classes respectively.
If the club has more than 400 members, then there will be at least 2
members with exactly the same characteristics.

Distributed objects

Pigeon-holes

members

characteristics

Total number of characteristics:


2 8 5 5 = 400.
Chapter 2 Counting

109 / 127

Pigeonhole Principle

Example
A dating agency requires each of its clients to answer a questionnaire
consisting of 10 questions with yes/no options only.
There are 525 male and 500 female clients.
Are the following statements true?
(i) There will be two questionnaires forms with identical answers.
(ii) There will be one male and one female whose questionnaires answers
are identical.

Chapter 2 Counting

110 / 127

Pigeonhole Principle

Solution.
(i) Yes

(ii)

Distributed objects

Pigeon-holes

clients (525 + 500 = 1025)

answers (210 = 1024)

No.

It is possible that the identical answers come from both male or both
female clients.

Chapter 2 Counting

111 / 127

Pigeonhole Principle

Theorem (Extended PHP)


If m objects are distributed among n pigeon-holes and m > n, then there
will be one pigeon-hole which contains at least dm/ne objects.
Here, dm/ne denotes the smallest integer m/n.

Chapter 2 Counting

112 / 127

Pigeonhole Principle

Proof.
Let k = dm/ne. Then k 1 < m/n k or nk n < m < nk.
If every pigeon-hole contains less than k objects, then the total number of
objects
m (k 1) + (k 1) + + (k 1) = nk n.
{z
}
|
n

But the rhs is < m, which means m < m, a contradiction.

Chapter 2 Counting

113 / 127

Pigeonhole Principle

Example
The members of a youth club are grouped into age groups according to x:
16 x < 17, 17 x < 18 x < 19, . . . , 29 x < 30.
If the club has 300 members, then by extended PHP, there is at least one
group which has at least
b300/14c + 1 = 22
members.

Chapter 2 Counting

114 / 127

Pigeonhole Principle
Example
Suppose that Singapore is a rhombic-shaped island with the lengths of the
diagonals in the ratio of 2 to 1 (see figure below), and with an area of 680
sq km.
Partition the island into N 2 equal rhombic regions by drawing lines parallel
to the sides of the rhombus respectively in such a way that each side of
the rhombus is divided into N equal segments.
Assume that there are 3.5 million residents in Singapore. Let N = 10.
(i) There is at least one rhombic region with population density of at
least 35000/6.8 residents per sq km.
(ii) In a gathering of more than 100 residents, there will be at least two
persons who stay within 5.2km of each other.
Chapter 2 Counting

115 / 127

Pigeonhole Principle

Let x (in km) be the length of the shorter diagonal of a rhombic region.
Then
N 2 x 2 = 680.
Chapter 2 Counting

116 / 127

Pigeonhole Principle

(i)
Distributed objects

Pigeon-holes

residents (3, 500, 000)

rhombic regions (102 = 100)

By extended PHP, there is at least one region with at least


3500000
= 35000
100
residents in it.

Chapter 2 Counting

117 / 127

Pigeonhole Principle

The area of each region is


x 2 = 680/100 = 6.8 sq km

There is one region with population density


35000
6.8
residents per sq km.

Chapter 2 Counting

118 / 127

Pigeonhole Principle

(ii) By PHP, in a gathering of more than 100 residents, there will at least
two persons who reside in the same region.
The longest diagonal of the region is

2x = 2 6.8 5.2 km.

Chapter 2 Counting

119 / 127

Example
In any group of n people there are at least two persons having the same
number friends. (It is assumed that if a person x is a friend of y then y is
also a friend of x.)

Chapter 2 Counting

120 / 127

Proof.
The number of friends of a person x is an integer k with 0 k n 1.
If there is a person y whose number of friends is n 1, then everyone is a
friend of y , that is, no one has 0 friend.
This means that 0 and n 1 can not be simultaneously the numbers of
friends of some people in the group. The pigeonhole principle tells us that
there are at least two people having the same number of friends.

Chapter 2 Counting

121 / 127

Pigeonhole Principle

Example
Among three given integers, there must be two of them whose sum is even.

Distributed objects

Pigeon-holes

different integers given (3)

parity of integer even or odd (2)

By PHP, there will be two integers with the same parity, and so their sum
must be even.

Chapter 2 Counting

122 / 127

Pigeonhole Principle
Example
Classes are conducted from 8 : 00 am to 5 : 00 pm from Monday to Friday
in one-hour time slots.
You have 25 hours of classes each week.
Which of the following statements is true?
(a) There is one day during which you have at least 5 hours of classes.
(b) There is one day during which you have at least 6 hours of classes.
(c) There are at least 2 days in which you have classes with a common
time slot.
(d) There are at least 3 days in which you have classes with a common
time slot.

Chapter 2 Counting

123 / 127

Pigeonhole Principle

Solution.
Distributed objects

Pigeon-holes

classes (25)

days (5)

(a) True.
(b) False.

Chapter 2 Counting

124 / 127

Pigeonhole Principle

Distributed objects

Pigeon-holes

classes (25)

time slots per day (9)

By extended PHP, there is one time slot with at least


b25/9c + 1 = 3 classes.
(c) True.
(d) True.

Chapter 2 Counting

125 / 127

Pigeonhole Principle

Example
Prove that if seven distinct numbers are selected from {1, 2, . . . , 11}, then
some two of these numbers sum to 12.
Solution. Let
A1 = {1, 11}, B = {2, 10}, C = {3, 9}, D = {4, 8},
E = {5, 7}, F = {6}.

Chapter 2 Counting

126 / 127

Pigeonhole Principle

Distributed objects

Pigeon-holes

the seven distinct number selected

the sets A, B, C , D, E , F

By PHP, two of the seven selected numbers must come from the same set.
This set cannot be F ; so it must be one of the sets A, B, C , D, E . In all
cases, these two numbers sum to 12.

Chapter 2 Counting

127 / 127

Das könnte Ihnen auch gefallen