Sie sind auf Seite 1von 20

AAU

Inclusion Exclusion
principle
Getenet Dessie

2014

ACKNOWLEDGEMENT

Firstly, I would like to express my heartful gratitude towards my Advisor


Ato Biadgligne Asmara for his continuous advice in preparing this project.
Secondly, I would like to thank my families and all my friends for their
Indispensible financial and moral support.

THE OBJECTIVE OF THIS PROJECT

a. To exactly count the number of elements in the union of finite


number of sets where the sets are disjoint sets (or where the sets
do not have any element in common).
b. To correctly count the number of elements in the union of finite
number of sets where the sets are not disjoint (or when there is a
common element between sets).
c. To derive a formula for calculating the number of elements in the
union of finite number of sets where the sets are whether disjoint
or not.

CONTENTS
Title

Page

CHAPTER ONE:
Introduction:..5
Basic counting principle:5
The product rule:.5
The sum rule:.6
CHAPTER TWO:
2. The inclusion and exclusion:7
2.1 Number of elements for two non disjoint sets:8
2.2 Proof for the number of elements in the union of three sets:.12
2.3 Theorem (the inclusion and exclusion principle):..14
2.4 Proof of the inclusion and exclusion principle:.15

CHAPTER ONE

INTRODUCTION
Combinatorics is the branch of discrete mathematics that explores
counting, combining and arranging the elements of sets. Enumeration may be
thought of as counting but in a broader sense it is often included with
combination and permutation as one aspect of Combinatorics, with graph
theory being the other aspect. In Combinatorics counting may be a simple
process of adding the number of elements of two disjoint sets, or it may be a
more complex process, as we will see in the principle of Inclusion and
Exclusion.
Combinations are collections of new sets at elements. Permutations are the
arrangement of elements within sets. The field of Combinatorics has practical
applications in computer science, probability
.

Basic counting principle

We will present two basic counting principles, the product rule and the sum
rule. Then we will show how they can be used to solve many different
counting problems problems.
The product rule applies when a procedure is made up of separate tasks.
The product rule
Suppose that a procedure can be broken down in to a sequence of two tasks. If
there are ways to do the first task and for each of these ways of doing the
first task, there are
ways to do the second task, then there are
ways to
do the procedure.
Example: A new company with just two employees, Sanchez and Patel rents a
floor of a building with 12 offices. How many ways are there to assign
different offices to these two employees?
Solution: the procedure of assigning offices to these two employees consists
of assigning an office to Sanchez, which can be done in 12 ways, then assigning
an office to Patel different from the office assigned to Sanchez, which can be
5

done in 11 ways. By the product rule, there are 12.11=132 ways to assign
offices to these two employees.
Example: the chairs of an auditorium are to be labeled with a letter and a
positive integer not exceeding 100. What is the largest number of chairs that
can be labeled differently?
Solution: the procedure of labeling a chair consists of two tasks, namely,
assigning one of the 26 letters and then assigning one of the 100 possible
integers to the seat. The product rule shows that there are 26.100=2600
different ways that a chair can be labeled.Therefor; the largest number of
chairs that can be labeled differently is 2600.

THE SUM RULE


If a task can be done either in ways or in one of ways ,where non of the
set of ways is the same as any of the set of ways, then there are +
ways to do the task.
Example: suppose that either a member of the mathematics department or a
student who is mathematics major is chosen as a representative to a
university committee. How many different choices are there for this
representative of there are 37 members of the mathematics department and
83 mathematics majors and no one is both a member and a student?
Solution: there are 37 ways to choose a member of the mathematics
department and there are 83 ways to choose a student who is mathematics
major. Choosing a member of the mathematics department is never the same
as choosing a student who is mathematics major because no one is both a
department member and a student. By the sum rule, it follows that there are
37+83=120possible ways to pick this representative.

CHAPTER TWO
THE INCLUSION AND EXCLUSION PRINCIPLE
Suppose that a task can be done in or in ways but that some the set of
ways to do the task are the same as some of the other ways to do the
task. In this situation, we cannot use the sum rule to count the number of ways
to do the task. Adding the number of ways to do the tasks in these two ways
leads to an over count, because the ways to do the task in the ways that are
common are counted twice. To correctly count the number of ways to do the
two tasks, we add the number of ways to do it in one way and the number of
ways to do it the other way, and then subtract the number of easy to do the
task in a way that is both among the set of ways and the set of ways.This
technique is called the inclusion and exclusion principle.
The principle of inclusion and exclusion is a way of thinking about combining
sets with overlapping elements. First let as consider two sets, the set of girls in
a class room and the set of boys in a class room .These are disjoint sets. They
share no elements in common; a student could not be a member of both sets.
The Addition principle states that if two sets are disjoint, the size of the union
of both sets equals the number of elements in the second set. This can be
stated as
A =A+B .
In our class room example we will assume that A contains 10 girls and the set
B contains 12 boys.
So,

= 10 + 12 = 22

There are 22 items in the set

Now let us consider two different class room sets. The set of challenge
students and the set of band students. Let A be the set of band students; there
are 8 students in this set. Let B be the set of challenge students ,and there
are 6 students in this set. Can we combine the two sets and use the Addition
principle to count 14 students in the set of in the of ? In this example
7

,the sets are not disjoint . It is quite possible for a challenge student to also be
a band student .We cannot use the Addition principle , but the principle of
Inclusions and Exclusion gives us a strategy .Let us follow a visual
representation to our solution.
It will count all the members of
set A and combine that with all
the members of set B.In
combining these two sets,we are
obviously over counting the total
,since two students belonge to
both sets.To compensate ,we will
subtract the number of students
who are in both set A and set B.We starting by including all elements ,then
exclude elements common to both sets .Putting numbers to the word we have
8+6-2=12 band and challenge students.
Conceptually we have that the number of elements in the union of the two sets
A and B is the sum of the numbers of elements in the sets minus the number of
elements in their intersection.That is

The formula for the number of elements in the union of two sets is useful in
counting problems.
Example: In a discrete mathematics class every student is a major in computer
science or mathematics or both.The number of students having computer
science as a major (possibly along with mathematics ) is 25.The number of
students having mathematics as a major (possibly along with computer
science)is 13 ;and the number of students majoring in both computer science
and mathematics is 8.How many students are in this class?
Solution: let A be the set of students in the class majoring in computer
science and B be the set of students in the class majoring in mathematics.
Then is the set of students in the class who are joint mathematics and
computer science majors. Because every student in the class is majoring in
either computer science or mathematics(or both)it follows that the number of
students in the class is .
8

There for,

25+13-8=30
Therefor,there are 30 students in the class.This computation is illustrated in
figure 1:

=25+13-8=30

AB

| |=25

|A B| =8

| |=1

Figure1:The set of students in a discrete mathematics class.


Example: how many positive integers not exceeding 1000 are divisible by 7
or 11?
Solution: Let A be the set of positive integers not exceeding 1000 that are
divisible 7,and B be the set of positive integers not exceeding 1000 that are
divisible by 11.Then is the set of integers not exceeding 1000 that are
divisible by either 7 or 11 and is the set of integers not exceeding 1000
hat are divisible by both 7 d 11.Among the positive integers not exceeding
1000 there are
integers divisible by 7 and
divisible by 11.Because
7and 11 are relatively prime ,the integers divisible by both 7 and 11 are those

divisible by both 7.11.Consequently,there are

positive integers not

exceeding 1000 that are divisible by both 7 and11.It follows that there are

=
+

=142+90-1
=220
Positive integers not exceeding 1000 that are divisible by either 7 or 11.This
computation is illustrated in figure 2.

=142+90-12
=220

| | = 142

| | = 12

| | = 90

FIGURE2: The set of positive integers not exceeding 1000 that are divisible by
either 7 or 11.
Example3:shows how to find the number of elements in a finite universal set
that are out side the union of sets.

10

Example3:suppose that there are 1807 freshmen at your school .Of these 453
are taking a course in computer science, 567are taking a course in
mathematics, and 299 are taking a course in both computer science and
mathematics. How many are not taking a course either in computer science or
in mathematics?
Solution: To find the number of freshmen who are not taking a course in
either mathematics or computer science , subtract the number that are taking
a course in either of these subjects from the total number of freshmen.
Let A be the set of all freshmen taking a course in computer science and let B
be the set of all freshmen taking a course in mathematics.
It follows that |A|=453,|B|=567,| |=299.
The number of freshmen taking a course in either computer science or
mathematics is :
| | = |A|+|B|+| |
=453+567-299
=721
Consequently, there are 1807-721=1086 freshmen who are not taking a
course in computer science or mathematics.
We will now begin our development of a formula for the number of elements
in the union of a finite number of sets. The formula we will develop is called
the principle of inclusion and exclusion .For concreteness, before we consider
union of n sets, where n is any positive integer ,we will derive a formula for
the number of elements in the union of three sets, A ,B ,and C.
To construct this formula we note that |A|+|B|+|C| counts each element that is
in exactly one of the three sets once,elements that are in exactly two of the
sets twice ,and elements in all three sets three times. This is illustrated in the
first panel in figure 3.

11

a)count of elements
By |A|+|B|+|C|

b)count of elements

c)count of elements by

By |A|+|B|+|C|-|
|-| |-| |

By |A|+|B|+|C|| |-| || |+| |

To remove the over count of elements in more than one of the sets we
subtract the number of elements in the intersections of all pairs of the three
sets .We obtain
+

This expression still counts elements that occur in exactly one of the sets once.
An element that occur in exactly two of the sets is also counted exactly once
,because this element will occur in one of the three intersections of sets taken
two at a time. However, those elements that occur in all three sets will be
counted zero times by this expression, because they occur in all three
intersections of sets taken two at a time. This is illustrated in second panel in
figure 3.
To remedy this under count, we add the number of elements in the
intersections of all three sets. This final expression counts each element once,
whether it is in one, two, or thereof the sets .Thus,
+

This formula is illustrated in the third panel of figure three


Now let us expand our example to three sets that are not disjoint ;band
students, challenge students and strings students.

12

Let A be the set of band students, B be the set of challenge students and C
is the set of strings students.
We can start by adding the members of all
the three sets.
+

= 8 + 6 + 5 = 19

In counting all members of the three sets we


have obviously over counted again.
We will compensate by subtracting out, or
excluding, the members that are in both band and challenge or = 2.
likewise, we will exclude the common members of band and strings, = 2,
and the common members of challenge and strings , = 3.
Consider the overachiever in band, challenges and strings. We have added
him/her in three times as a member of the individual sets, but we have also
subtracted him/her out three times as a common member of all three groups.
We need to this student in, or = 1. We have
8 + 6 + 5 2 2 3 + 1 = 13 Total students.
Stringing together our process we have

Example :A total of 1232 students have taken a course in Spanish, 879 have
taken a course in French, and 114 have taken a course in Russian.
Further,103 have taken a course in both Spanish and French ,23 have taken a
course in both Spanish and Russian ,and 14 have taken a course in both
French and Russian. If 2092 students have taken at least one of Spanish ,and
Russian ,how many
students have taken a course in all three languages?
Solution: let S be the set of students who have taken a course in Spanish, F the
set of students who have taken a course in French and R the set of students
who have taken a course in Russia. Then
S=1232, F=879, R =114

13

SF=103, SR=23, FR=14, and SFR=2092 When we insert


this quantities in to the equation.
SFR=S+F+R-SF-SR-FR+-SFR

|F| = 879

| | = 103

| | = 1232
|

| | = 114

|=23

| | = 114

| = 2092

| =?

fig 4:- The set of students who have taken courses in Spanish , French ,
Russian
2092=1232+879+114-23-103-14+SFR
we now solve for SFR. We ind that SFR=7. Therefore, there are 7
students who have taken courses in Spanish, French and Russian.
we will now state and prove the inclusion and exclusion principle which
tells us how many elements are there in the union of finite number of finite
sets.
Theorem (The Inclusion-Exclusion principle) :-Given n = the number of finite
sets Ai where 1 n ,we can generally state the principle of Inclusion and
Exclusion
as

14

. +(1)

As the principle of inclusion and exclusions is extended to a greater number


of sets ,it remains a process of including everything in all sets ,then excluding
the overlap of items common to sets.
A five set example would include all the individual items in five sets, exclude
the intersection of each pair of sets, include the intersection of each triple of
sets, exclude the intersection of each of each quadruple of sets ,and finally
include the intersection of the quintuple of sets.
The principle of Inclusion and Exclusion can be proved through the use of
combinatorial approach
Let us consider X,an element of set S.X belongs to r subset of S,which we will
call . We do not need to consider any that does not X, as they do not
contribute to the union of sets we are attampting to count .
We want to count X once on the left side of the equation in the union of sets ,so
we need to count X one time on the right side of the equation ,since X is in r
subsets, the first term of the right hand side of the equation is r.The second
term subtracts all of X in the intersection of all paired sets with in r, the third
term adds back in occurrences of X in the intersection of three sets, the fourth
term subtracts occurrences of X in four set intersections.
We can show the number of occurrences for each term as C(r,k) and state this
as:
1=C(r,1)-C(r,2)+C(r,3)-...(1)
1-C(r,1)+C(r,2)-C(r,3+...+(1)

( , )
( , ) = (1 1) = 0

The binomial theorem showing that both sides of the equation are the same.
This confirms we are adding X appropriately when using the principle of
Inclusion and Exclusion.
Let's apply the principle of Inclusion and Exclusion in same typical
situation
15

Our first investigation concerns prime factors


Given that the set of positive integer from 1 to 1000 how many integers are
evenly divisible by a single digit prime number?
To evaluate the size of sets A,B,C and D ,we need to count the factors when
1000 is divided by the prime numbers in question. If we divide 1000 by our
number and truncate any remainder ,we have the quantity we are looking for.
There is an appropriate notation for this, the greatest integer or floor,
function , which return the greatest integer less than the value inside the
half brackets.
If we wanted to know how many times 3 will divide in to 10, then 10 3 =3 is
how we can calculate and show the result.
The principle of inclusion and exclusion gives us the strategy to solve our
problem .We will start by including all members divisible by 2, 3, 5 or 7.But in
doing so we will over count.
For example, the number 30 will appear in the set of numbers divisible by 2,
set of numbers divisible by 3, and the set of numbers divisible by 5.We will
compensate by subtracting the elements appearing in all two set intersections,
then we will add back in the elements that are member of three set
intersections, and finally subtract any four set intersections .We can express
this as:
Let N={1,2,3, 1000}
Let A={ N X is divisible by 2}
Let B={ N X is divisible by 3 }
Let C={ N X is divisible by 5}
Let D={ N X is divisible by 7}

=A+B+C+D-

16

-
+

We will use the process noted above to determine the size of the sets .For the
size of the set intersections, we will consider that an integer is divisible by
both a and b when and only when it is divisible by the LCM (least common
multiple) of a and b.

=500

=142

=71

=28

=14
=

=333,
=

=200

=166

=100

=66

=47

=
=

=33

=23

=9

=4

Placing our values in to our formula we have


= 500 + 333 + 200 + 142 166 100 71 66 47 28
+ 33 + 23 + 14 + 9 4 = 772

So, 772 integers from the set N are divisible by a single digit prime
numbers.
Our next example uses the principle of inclusion and exclusion in a similar
way.
Consider a trio of golden summer evenings at the college world series.The
often dance gate for the three championship college world series game was
75,012.Aurvey showed that 60,834 individuals attend at least one
championship game and 2,578 attend all three. How many fans attend exactly
two games of the championship?
Let A be the set of people who attend game 1.
Let B be the set of people who attend game 2.
Let C be the set of people who attend game 3.
17

The principle of inclusion and exclusion states the union of these three sets ,
that is the number of people who attend at least one game of the series is
equivalent to the sum of A,B,Cless the sum of the individuals who
attend two games plus the people who attend all three games . So
=A+B+C- - +

=60,834 fans attended at least one championship game .

A+B+C=the gate for three games=75,012 fans .

=2,578 fans attended all three games .So,


60,834=75,012-X+2,578 and
X=16,756

So, although we can not say which two games they attended, we do know that
16,756 people attended at least two college world championship games. Of
these 16,756 people who attended at least two games ,2578 attended all
three.So,14,178 fans attended exactly two games.
Example:-how many elements are there in the union of four sets if the sets
have 50,60,70, and 80 elements respectively, each pair of the sets has 5
elements in common ,each triple of the sets has 1,common elements ,and no
element is in all four sets ?
Solution Let A be the first set
Let B be the second set
Let C be the third set
Let D be the fourth set
A=50 , B=60 , C=70, D=80
A =A =A =B =B =C =5
A

=A

=A

=0

using the Inclusion and exclusion principle


18

=1

=A+B+C+ D-

A -A -A -B -B -C +
A

+A

+A

=50+60+70+80-5-5-5-5-5-5+1+1+1+1-0
=234
There fore , there are 234 elements in the union of four sets

19

Reference
1.Discrete mathematics with application ,Rosen,2007
2.Discrete mathematics with example,Simpison,2002
3.The principle of inclusion and exclusion,brilliant

20

Das könnte Ihnen auch gefallen