Sie sind auf Seite 1von 12

Raffles Institution

H3 Mathematics 9810
Year 6 2012
___________________________________________________

Chapter 2
The Principle of Inclusion and Exclusion


PRE-REQUISITES

The Addition Principle and the Multiplication Principle
Properties of sets, which include


CONTENT

1 Introduction
2 The Principle of Inclusion and Exclusion
3 General Statement of the Principle of Inclusion and Exclusion
4 Exercise



1 INTRODUCTION

In its simplest form, the Addition Princip




In the above statement, A and B are
no elements in common. Can we find


2 THE PRINCIPLE OF INCLUSION AND EXCLUSION

2.1 Union of 2 finite sets

In counting the elements in
doing so, any element in A
exact count of B A , the number




Identity (2.1) is a simplest form of a principle called the Principle of Inclusion and
Exclusion (PIE), which is a very useful and powerful tool in enumeration.
If A and B are disjoint finite sets, then
Raffles Institution
H3 Mathematics 9810
___________________________________________________
________________________________________
Chapter 2 The Principle of Inclusion and Exclusion
The Principle of Inclusion and Exclusion
The Addition Principle and the Multiplication Principle
Properties of sets, which include ( )
_____________
A B A B = and ( ) ( A B C A B A C =

of Inclusion and Exclusion
General Statement of the Principle of Inclusion and Exclusion
In its simplest form, the Addition Principle (AP) may be expressed in terms of sets as follows:
are assumed to be disjoint, written = B A , i.e.,
Can we find B A if A and B are not disjoint?
THE PRINCIPLE OF INCLUSION AND EXCLUSION
ents in B A , we may first count those in A and then those in
B A (if there is) is counted exactly twice. Thus, to get the
, the number B A should be deducted. It follows that:
(2.1)
1) is a simplest form of a principle called the Principle of Inclusion and
Exclusion (PIE), which is a very useful and powerful tool in enumeration.
are disjoint finite sets, then B A B A + =
B A B A B A + =
___________________________________________________________
_______________________________
Chapter 2 The Principle of Inclusion and Exclusion
Page 1 of 12
) ( ) A B C A B A C =
may be expressed in terms of sets as follows:
, i.e., A and B have
and then those in B. In
(if there is) is counted exactly twice. Thus, to get the
should be deducted. It follows that:
1) is a simplest form of a principle called the Principle of Inclusion and
Exclusion (PIE), which is a very useful and powerful tool in enumeration.
Raffles Institution H3 Mathematics 9810 Year 6 2012
____________________________________________________

_________________________________________
Chapter 2 The Principle of Inclusion and Exclusion
Page 2 of 12

Example 1
Find the number of integers from the set { } 1000 , 2, , 1 which are divisible by 3 or 5.

Solution
The integers which we are looking for are 3, 5, 6, 9, 10, 12, 15, , 999, 1000. How many are
there?

Let us try to present the solution more formally. We define the following sets:
{ } 1000 , 2, 1, = S ,
{ } | is divisible by 3 A x S x = , and
{ } | is divisible by 5 B x S x = .
Our task is to evaluate B A as B A is the set of numbers in S which are divisible by 3 or 5.


A = , B = and

B A =


where

r , for any real number r, denotes the greatest integer that is smaller than or equal to r.

Hence, by (2.1), we have

.


Example 2
Find the number of positive divisors of at least one of the numbers 5400 and 18000.

Solution
Let A =

and
B =

.

Our task is to evaluate B A . To apply (2.1), we need to count A , B and B A .

Observe that
2 3 3
5 3 2 5400 = , and
3 2 4
5 3 2 18000 = .
Thus, A = , and B =

B A is , and so it is the set of positive divisors of
.
To solve for B A , we need to find .
Since GCD{ } 18000 , 5400 = .
It follows that B A = .

Hence, by (2.1), we have

.

In general, for any two natural
numbers n, k with k n, the
number of integers in the set
{1, 2, , n} which are divisible
by k can be expressed as
(

k
n
.
Raffles Institution H3 Mathematics 9810 Year 6 2012
____________________________________________________

_________________________________________
Chapter 2 The Principle of Inclusion and Exclusion
Page 3 of 12
2.2 Union of 3 finite sets

Formula (2.1) provides an expression for B A .
We shall now apply it to derive an expression for
C B A where A, B and C are any three finite
sets.

Observe that
C B A = ( ) C B A
= ( ) C B A C B A +
= ( ) ( ) C A B A C B A +
= ( ) ( ) A B C B C A B A C A B A C ( + + ( +


= A B C A B A C B C A B C + + + + ( +

That is,

(2.2)


Example 3
The figure below shows a 4 by 8 rectangular grid with two specified corners p and q and three
specified segments uv, wx and yz.









Find in the grid
(i) the number of shortest p-q routes;
(ii) the number of shortest p-q routes which pass through wx;
(iii) the number of shortest p-q routes which pass through at least one of the segments uv, wx
and yz; (i.e. passes thru uv, wx or yz)
(iv) the number of shortest p-q routes which do not pass through any of the segments uv, wx
and yz;
Solution
(i) An example of a shortest route is






( ) C B A C B C A B A C B A C B A + + + + + =
q
p

u v
w x
y z






Raffles Institution H3 Mathematics 9810 Year 6 2012
____________________________________________________

_________________________________________
Chapter 2 The Principle of Inclusion and Exclusion
Page 4 of 12


Each shortest route corresponds to a permutation of


So the number of shortest p-q routes in the grid is given by

.


(ii)









As shown above, a shortest p-q route passing through wx consists of a shortest p-w route
(in a 2 by 3 grid), the segment wx and a shortest x-q route (in a 2 by 4 grid).
Thus, the number of shortest p-q routes passing through wx is given by



(iii) Let A (resp. B and C) be the set of shortest p-q routes which pass through uv (resp. wx
and yz). The desired answer would be C B A , which can be found using (2.2).
A =

, B = (from (ii)), C =



Next, let us compute B A , C A and C B . Observe that B A is the set of
shortest p-q routes passing through both uv and wx. Any such shortest p-q route consists
of a shortest p-u route, the route uvwx and a shortest x-q route. Thus,
A B =

.
Likewise, B C =
And each route in C A consists of a shortest p-u route, the segment uv, a shortest v-y
route, the segment yz and a shortest z-q route, which gives
A C = .

Finally, we evaluate C B A . Each route in C B A is a p-q route consisting of a
shortest p-u route, the route uvwxyz and a shortest z-q route. Thus,
A B C =
By (2.2), C B A =
(iv) Let S be the set of shortest p-q routes in the grid.
Then the problem is to evaluate ( ) C B A S \ , which is equal to ( ) C B A S .
By part (i), we have S = and by (iii), C B A = .
Thus, the desired answer is .




p
q
w
x
Raffles Institution H3 Mathematics 9810 Year 6 2012
____________________________________________________

_________________________________________
Chapter 2 The Principle of Inclusion and Exclusion
Page 5 of 12


2.3 A Useful Result of (2.2)
Consider ( ) C B A S \ =
__ __________
C B A = ( )
___ __________
C B A
=
__ ______
C B A
=
__ __ __
C B A
It follows that
__ __ __
C B A = ( ) C B A S \ = ( ) C B A S .
Thus, by (2.2), we obtain
__ __ __
C B A = ( ) ( ) C B A C B C A B A C B A S + + + + + (2.3)



Now, let us consider the problems of counting the number of mappings and the number of 1-1
mappings. Let X = {1, 2, 3} and Y = {1, 2, 3, 4, 5}.

How many mappings are there from X to Y?
There are three elements in X, and each of them can be mapped to one of the five elements in Y.
Thus the number of mappings from X to Y is given by
3
5 5 5 5 = .

How many 1-1 mappings are there from X to Y?
The element 1 in X can be mapped to one of the five elements in Y (5 choices). The element 2
in X can be mapped to one of the remaining four elements in Y (4 choices; excluding the image
of 1). Finally, the element 3 in X can be mapped to one of the remaining three elements in Y
(3 choices; excluding the images of 1 and 2). Thus, the number of 1-1 mappings from X to Y
is given by 3 4 5 or
5
3
P .

Indeed, in general, we have:

Suppose X = {1, 2, ,m} and Y = {1, 2, , n}, where , m n
+
. Then

(i) the number of mappings from X to Y is given by
m
n ;

(ii) the number of 1-1 mappings from X to Y is given by
m
n
P where n m .


What can be said about the number of onto mappings from X to Y ?

A mapping from X to Y is onto if every element in Y is an image of some element in X .
Or: A mapping from X to Y is onto if the range (or image set) of the mapping is Y .

For the mapping f defined as follows

f :
f : 2 , x x
+ +


f is onto.
Raffles Institution H3 Mathematics 9810 Year 6 2012
____________________________________________________

_________________________________________
Chapter 2 The Principle of Inclusion and Exclusion
Page 6 of 12


For the mapping g defined as

2
g :
g : 3, x x
+


g is not onto since 1
+
, but there is no x with ( ) g 1 x = .


It is interesting to note that this problem is not as straightforward as those of counting the
numbers of mappings and 1-1 mappings. In the following example, we shall see how identity
(2.3) is used to tackle this more difficult problem.


Example 4
Let X = {1, 2, 3, 4, 5} and Y = {1, 2, 3}. Find the number of onto mappings from X to Y .

Solution
Let S be the set of mappings from X to Y . We shall now introduce three subsets A, B, C of S as
follows:
Let A be the set of mappings from X to Y \{1},
B be the set of mappings from X to Y \{2}, and
C be the set of mappings from X to Y \{3}.
What do the sets
__
A ,
__
B and
__
C represent?
Well,
__
A is the set of mappings from X to Y which ,
__
B is the set of mappings from X to Y which , and
__
C is the set of mappings from X to Y which

It follows that
__ __ __
C B A is the set of mappings from X to Y which ;
that is,
__ __ __
C B A is the set of onto mappings from X to Y. Thus, our task here is to evaluate
__ __ __
C B A .

Since S is the set of mappings from {1, 2, 3, 4, 5} to {1, 2, 3},
5
3 = S .
Since A is the set of mappings from {1, 2, 3, 4, 5} to {2, 3},
5
2 = A . Likewise,
5
2 = = C B .

As B A is the set of mappings from {1, 2, 3, 4, 5} to {3},
5
1 = B A .
Similarly, 1 = = C B C A .
Finally, observe that C B A is the set of mappings from X to Y\{1, 2, 3} ( ) = . Thus,
= C B A and so 0 = C B A .
Now, by (2.3), we have
__ __ __
C B A = ( ) ( ) 0 1 1 1 2 2 2 3
5 5 5 5
+ + + + + = 150. [Apply A B C S A B C = ]
Raffles Institution H3 Mathematics 9810 Year 6 2012
____________________________________________________

_________________________________________
Chapter 2 The Principle of Inclusion and Exclusion
Page 7 of 12


We have seen in the above how Addition Principle can be generalised to (2.1), and in turn (2.1)
can be extended to (2.2); and moreover, we have derived an equivalent form (2.3) of (2.2). In the
next section, we shall introduce a more general form of (PIE) which deals with any n subsets,
where 2 n , and we shall see how it can be applied to solve some interesting problems.


3 GENERAL STATEMENT OF THE PRINCIPLE OF INCLUSION AND
EXCLUSION

Suppose that four finite sets
1
A ,
2
A ,
3
A and
4
A are given. By applying (2.1), (2.2) and some
basic laws for sets, we have

4 3 2 1
A A A A
= ( )
4 3 2 1
A A A A
= ( )
4 3 2 1 4 3 2 1
A A A A A A A A + (by (2.1))
= ( ) ( ) ( )
4 3 4 2 4 1 4 3 2 1
A A A A A A A A A A +
= ( )
3 2 1 3 2 3 1 2 1 3 2 1
A A A A A A A A A A A A + + +
+ (
4 3 4 2 4 1 4
A A A A A A A + +
4 3 2 4 3 1 4 2 1
A A A A A A A A A
+ )
4 3 2 1
A A A A (by (2.2))
That is

4 3 2 1
A A A A
= ( )
4 3 2 1
A A A A + + +
( )
4 3 4 2 3 2 4 1 3 1 2 1
A A A A A A A A A A A A + + + + + (2.4)
( )
4 3 2 4 3 1 4 2 1 3 2 1
A A A A A A A A A A A A + + + +

4 3 2 1
A A A A .


Now, let us look at the identities (2.1), (2.2) and (2.4) carefully and make some observations on
the pattern of the terms on the right-hand sides of the identities involving
1 2 n
A A A ,

For the sum of the terms within the first grouping , we have:
n Sum Number of terms in the sum
2
2 1
A A + 2 =
|
|

\
|
1
2

3
3 2 1
A A A + + 3 =
|
|

\
|
1
3

4
4 3 2 1
A A A A + + + 4 =
|
|

\
|
1
4


Raffles Institution H3 Mathematics 9810 Year 6 2012
____________________________________________________

_________________________________________
Chapter 2 The Principle of Inclusion and Exclusion
Page 8 of 12

For the sum of terms within the second grouping, we have:

n Sum Number of terms in the sum
2
2 1
A A 1 =
|
|

\
|
2
2

3
3 2 3 1 2 1
A A A A A A + + 3 =
|
|

\
|
2
3

4
4 1 3 1 2 1
A A A A A A + +
4 3 4 2 3 2
A A A A A A + + +
6 =
|
|

\
|
2
4


For the sum of terms within the third grouping, we have:

n Sum Number of terms in the sum
2 none 0
3
3 2 1
A A A 1 =
|
|

\
|
3
3

4
4 2 1 3 2 1
A A A A A A +
4 3 2 4 3 1
A A A A A A + +
4 =
|
|

\
|
3
4


We also notice that the groupings alternate in sign, beginning with a (+) sign.

Suppose now that we are given n finite sets:
1
A ,
2
A , ,
n
A . By generalizing the above
observations, what identity would you expect for
n
A A A
2 1
?

The first grouping should be the sum of
|
|

\
|
1
n
= n terms, each involving a single set:
n
A A A + + +
2 1
;
in abbreviation,

=
n
i
i
A
1
.

The second grouping should be the sum of
|
|

\
|
2
n
terms, each involving the intersection of two
sets:
n n
A A A A A A + + +
1 3 1 2 1
;
in abbreviation,

< j i
j i
A A .

Raffles Institution H3 Mathematics 9810 Year 6 2012
____________________________________________________

_________________________________________
Chapter 2 The Principle of Inclusion and Exclusion
Page 9 of 12

The third grouping should be the sum of
|
|

\
|
3
n
terms, each involving the intersection of three sets:

n n n
A A A A A A A A A + + +
1 2 4 2 1 3 2 1
;
in abbreviation,

< < k j i
k j i
A A A .

Likewise, the fourth grouping should be the sum of
|
|

\
|
4
n
terms, each involving the intersection
of four sets;

< < < l k j i
l k j i
A A A A ;
and so on.

Bearing in mind that the groupings alternate in sign, beginning with a + sign, one would expect
that the following holds:



n
A A A
2 1
=
=
n
i
i
A
1

< j i
j i
A A
( )
n
n
k j i
k j i
A A A A A A + +
+
< <

2 1
1
1 (2.5)


Indeed, it can be proved (for instance, by mathematical induction) that (2.5) holds for any n
finite sets
1
A ,
2
A , ,
n
A ; and (2.5) is regarded as the general statement for the Principle of
Inclusion and Exclusion.


Example 5
How many ways are there to arrange n ( ) 2 married couples in a row so that at least one couple
is sitting together with their own spouses?

Solution
Denote the n couples by
1
H
1
W ,
2
H
2
W , ,
n
H
n
W . Thus, when n = 4 for example, the
following arrangements are possible:


4 1 2 3 3 4 1 2
W W H H W H H W ,
4 1 1 3 4 2 2 4
H H W H W W H H .

Solving the above problem by dividing it into cases such as exactly one couple are sitting
together with their own spouses, exactly two couples are sitting together with their own spouses,
and so on would be very complicated. Let us try to apply (2.5).

For each i = 1, 2, , n, let
i
A be the set of arrangements of the n couples such that
i
H and
i
W
are adjacent. The problem is thus to enumerate
n
A A A
2 1
.
To apply (2.5), we compute each grouping on its right-hand side.
Raffles Institution H3 Mathematics 9810 Year 6 2012
____________________________________________________

_________________________________________
Chapter 2 The Principle of Inclusion and Exclusion
Page 10 of 12

To compute
=
n
i
i
A
1
, we first consider
1
A .
1
A is the set of arrangements of n couples such that
1
H and
1
W are adjacent. This is the same as arranging the 2n 1 objects:
( )
n n
W H W H W H , , , ,
2 2 1 1
in a row where
1 1
W H can be permuted in two ways within a unit:
1 1
W H and
1 1
H W . Thus,
1
A = ( )! 1 2 2 n

Similarly,
i
A = ( )! 1 2 2 n for each i = 1, 2, , n. Thus,
=
n
i
i
A
1
= ( )! 1 2 2
1

|
|

\
|
n
n


To compute
< j i
j i
A A , we first consider
2 1
A A .
2 1
A A is the set of arrangements of the
n couples such that
1
H and
1
W are adjacent and
2
H and
2
W are adjacent. This is the same as
arranging the 2n 2 objects: ( ) ( )
n n
W H W H W H , , ,
2 2 1 1
in a row where both
1 1
W H and
2 2
W H
can be permuted within themselves. Thus,
2 1
A A = ( )! 2 2 2
2
n

Similarly, for n j i < 1 ,
j i
A A = ( )! 2 2 2
2
n .
Thus,
< j i
j i
A A = ( )! 2 2 2
2
2

|
|

\
|
n
n

By a similar argument,

< < k j i
k j i
A A A = ( )! 3 2 2
3
3

|
|

\
|
n
n
,
and by the General Principle of Inclusion and Exclusion,
n
A A A
2 1

=
=
n
i
i
A
1
( )
1
1 2
1
n
i j i j k n
i j i j k
A A A A A A A A
+
< < <
+ +


= ( ) ( )
|
|

\
|

=
+
n
r
r r
r n
r
n
1
1
! 2 2 1 .


In general, for any n ( ) 2 subsets
1
A ,
2
A , ,
n
A of S, one can show that (2.3) can be
extended to the following:

__ __
2
__
1 n
A A A
=
n
A A A S
2 1
(2.6)
= S

=
n
i
i
A
1
+
< j i
j i
A A ( )
n
n
k j i
k j i
A A A A A A + +
< <

2 1
1 .



Raffles Institution H3 Mathematics 9810 Year 6 2012
____________________________________________________

_________________________________________
Chapter 2 The Principle of Inclusion and Exclusion
Page 11 of 12

Example 6
How many ways are there to distribute 8 distinct fruits to 4 boys such that no boy goes back
empty-handed?
Solution
Let Ai denote the event that boy i i = 1, 2, 3, 4.
Then required answer =



4 EXERCISE

1. Find the number of integers from the set {300, 301, , 1000} which are multiples of 6
or 9.

2. How many positive integers n are there such that n is a divisor of at least one of the
numbers
40
10 ,
30
20 ? (Putnam 1983)

3. A group of students took examinations in Chemistry, Mathematics and Physics. Among
them, 12 passed Chemistry, 15 Mathematics and 10 Physics; 8 passed both Chemistry
and Mathematics, 5 both Chemistry and Physics, and 6 both Mathematics and Physics.
There were 20 students who passed at least one of the three subjects. Find the number of
students who passed all three subjects.

4. Find the number of integers from the set {1, 2, , 1000} which are
(i) divisible by at least one of 2, 3 and 5;
(ii) divisible by none of 2, 3, and 5.

5. The following figure shows a 5 by 8 rectangular grid with two specified corners p and q
and three specified segments ab, cd and ef.







Find in the grid
(i) the number of shortest p-q routes;
(ii) the number of shortest p-q routes that pass through at least one of the segments
ab, cd and ef;
(iii) the number of shortest p-q routes that do not pass through any of the segments
ab, cd and ef.

6. Let S be the set of 3-digit numbers abc such that a, b, c {1, 2, , 9} and a, b, c are
pairwise distinct. (Thus, 489 S but 313 S and 507 S.) Find the number of
members abc in S such that 3 a , 5 b and 7 c .

q
a b
c
d
e
f
p
Raffles Institution H3 Mathematics 9810 Year 6 2012
____________________________________________________

_________________________________________
Chapter 2 The Principle of Inclusion and Exclusion
Page 12 of 12

7. A 5-digit ternary number is a number
5 4 3 2 1
x x x x x where
i
x = 0, 1 or 2 for each i = 1, 2,
, 5. Thus, 00000, 01001, 21022, 11002, etc are 5-digit ternary numbers. Find the
number of 5-digit ternary numbers in which each of the 0, 1 and 2 appears at least
once.

8. Two scouts
1
x ,
2
x from school X, three scouts
1
y ,
2
y ,
3
y from school Y and four
scouts
1
z ,
2
z ,
3
z ,
4
z from school Z get together in a meeting. In how many ways can
they be arranged in a row if not all scouts from the same school are allowed to form a
single block in the row? (For instance,
4 1 2 2 3 1 2 3 1
z z y x y y z z x is allowed but
2 3 3 1 2 2 1 4 1
z z y x x y y z z and
2 1 2 2 1 3 1 3 4
z z x y y y x z z are not allowed.)

9. In a shop, five different postcards are on sale. A customer wishes to send postcards to
eight of his friends.
Use the principle of inclusion and exclusion to show that the number of ways in which
he can send a postcard to each of his eight friends, buying at least one of each of the five
types of cards, is
8 8 8 8 8
1
4
5
2
3
5
3
2
5
4
1
5
5
|
|

\
|
+
|
|

\
|

|
|

\
|
+
|
|

\
|
.
10. Each of ten ladies checks her hat and umbrella in a cloakroom and the attendant gives
each lady back a hat and an umbrella at random. Show that the number of ways this can
be done so that no lady gets back both of her possessions is
( ) ( ) { }
|
|

\
|

=
10
0
2
! 10
10
1
r
r
r
r


11. Show that the number of onto mappings from
m
to
n
, where 1 n m , is given by
( ) ( )
|
|

\
|

=
n
r
m r
r n
r
n
0
1 .
12. [2009 A Level]
A girl has four pairs of shoes. Each day, for seven days, she chooses a pair of shoes to
wear that day.
(i) In how many ways can she do this
(a) if there are no restrictions on her choices, [1]
(b) if she never wears the same pair on consecutive days, [2]
(c) if she uses at most two pairs of shoes? [3]
(ii) Use the method of inclusion and exclusion to show that the number of ways she
can choose pairs of shoes if she uses each pair at least once is
7 7 7 7
4 4 4
4 3 2 1
1 2 3
| | | | | |
+
| | |
\ \ \
. [4]
(iii) With reference to choosing pairs of shoes, what is represented by
4 4 4
4 3 2 1
1 2 3
n n n n
| | | | | |
+
| | |
\ \ \

Hence state the value of this expression for 1 4 n . < [2]

(iv) Simplify ( ) ( )
0
1
n
i n
i
n
n i
i
=
| |

|
\

. [2]

Das könnte Ihnen auch gefallen