Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
For Dummies
Vita Smid
December 2, 2009
Denition (Discrete Interval). [n] := {1, 2, 3, . . . , n}
Theorem (Inclusion-Exclusion Principle). Let A
1
, A
2
, . . . , A
n
be nite sets. Then
n
_
i=1
A
i
J[n]
J=
(1)
|J|1
iJ
A
i
1
_
i=1
A
i
= |A
1
| (1)
J[1]
J=
(1)
|J|1
iJ
A
i
= (1)
0
i{1}
A
i
= |A
1
| (2)
For the induction step, let us suppose the theorem holds for n 1.
n
_
i=1
A
i
_
n1
_
i=1
A
i
_
A
n
= (3)
We can use the formula |X Y | = |X| +|Y | |X Y |.
=
n1
_
i=1
A
i
+|A
n
|
_
n1
_
i=1
A
i
_
A
n
= (4)
Intersection of unions can be rewritten as a union of intersections.
=
n1
_
i=1
A
i
+|A
n
|
n1
_
i=1
(A
i
A
n
)
= (5)
Let us dene the substitution B
i
:= A
i
A
n
.
=
n1
_
i=1
A
i
+|A
n
|
n1
_
i=1
B
i
= (6)
We can now use the induction hypothesis on both
A
i
and
B
i
.
=
J[n1]
J=
(1)
|J|1
iJ
A
i
+|A
n
|
K[n1]
K=
(1)
|K|1
iK
B
i
= (7)
http://ze.phyr.us
1
The expression (1)
(1)
|K|1
|
B
i
| is equivalent to
(1)(1)
|K|1
|
B
i
| =
(1)
|K|
|
B
i
|.
=
J[n1]
J=
(1)
|J|1
iJ
A
i
+|A
n
| +
K[n1]
K=
(1)
|K|
iK
B
i
(8)
Since K = , we can revert the substitution:
iK
B
i
=
iK
(A
i
A
n
) =
_
iK
A
i
_
A
n
=
iK{n}
A
i
(8) now becomes
J[n1]
J=
(1)
|J|1
iJ
A
i
+|A
n
| +
K[n1]
K=
(1)
|K|
iK{n}
A
i
(9)
Let us substitute K {n} with J. The expression |K| thus becomes |J| 1 (with K dened as a
subset of [n 1], K cannot contain n and thus |K {n}| = |K| + 1).
To replace the expression i K {n} with i J, we must impose several conditions on J as the
summation index:
J = (the same condition that was imposed on K),
J [n] n J (n must be contained in every J, since J replaces K {n}),
J = {n} (K {n} = {n}, since K = and n K [n 1]).
(9) now becomes
J[n1]
J=
(1)
|J|1
iJ
A
i
+|A
n
| +
J[n]
nJ
J=,{n}
(1)
|J|1
iJ
A
i
(10)
The Inclusion-Exclusion Principle can be used on A
n
alone (we have already shown that the theorem
holds for one set):
J{n}
J=
(1)
|J|1
iJ
A
i
= (1)
|{n}|1
i{n}
A
i
= |A
n
|
(10) now becomes
J[n1]
J=
(1)
|J|1
iJ
A
i
J{n}
J=
(1)
|J|1
iJ
A
i
J[n]
nJ
J=,{n}
(1)
|J|1
iJ
A
i
= (11)
For better readability, let us dene
P
1
:= P([n 1]) \ {}
P
2
:= P({n}) \ {} = {{n}}
P
3
:= P([n]) \ P([n 1]) \ {, {n}}
and rewrite (11) in this way:
=
JP
1
(1)
|J|1
iJ
A
i
JP
2
(1)
|J|1
iJ
A
i
JP
3
(1)
|J|1
iJ
A
i
= (12)
2
Since the three sums consist of the same terms, we can combine them into one. As the sets P
1
, P
2
, P
3
are disjoint, the summation condition now becomes
J (P
1
P
2
P
3
) = (P([n 1]) \ {}) {{n}} (P([n]) \ P([n 1]) \ {, {n}}) =
= (P([n 1]) {{n}} (P([n]) \ P([n 1]) \ {{n}}) \ {} = P([n]) \ {}
Finally, we can replace the logical condition J P([n])\{} by the equivalent statement J [n], J = .
The resulting formula is an instance of the Inclusion-Exclusion Theorem for n sets:
=
J[n]
J=
(1)
|J|1
iJ
A
i
(13)
Remark. It can be easily seen that every possible value of J is covered exactly once by the new summation condition
(J [n], J = ):
J [n], J =
8
>
>
>
<
>
>
>
:
n J ( J [n 1])
n J
(
J = {n} ( J {n})
J = {n} ( J [n], n J, J = {n})
3