Home

inclusiveexclusive

Inclusiveexclusive, often written as inclusive-exclusion or inclusion-exclusion, refers to a fundamental counting principle used to determine the size of the union of overlapping sets. It corrects for overcounting elements that appear in more than one set by alternating additions and subtractions of intersections.

For two finite sets A and B, the principle states that the size of their union is

A common probabilistic form is P(A ∪ B) = P(A) + P(B) − P(A ∩ B); the principle generalizes to more

Typical examples involve counting integers up to a limit that satisfy multiple divisibility conditions, or determining

|A
∪
B|
=
|A|
+
|B|
−
|A
∩
B|.
For
three
sets
A,
B,
and
C,
the
formula
extends
to
|A
∪
B
∪
C|
=
|A|
+
|B|
+
|C|
−
|A
∩
B|
−
|A
∩
C|
−
|B
∩
C|
+
|A
∩
B
∩
C|,
and
in
general,
for
n
sets
A1,
A2,
...,
An,
the
union
size
is
the
alternating
sum
of
the
cardinalities
of
all
intersections
of
these
sets.
events,
preserving
the
same
alternating
pattern.
The
method
is
widely
used
in
combinatorics,
probability,
statistics,
and
computer
science—for
example,
in
counting
problems
where
categories
overlap,
in
Venn
diagram
analysis,
and
in
database
query
optimization.
the
number
of
students
who
are
enrolled
in
at
least
one
of
several
courses
when
enrollments
overlap.
While
the
principle
applies
cleanly
to
finite
sets,
extensions
to
infinite
collections
often
require
measure
theory
to
handle
convergence
and
to
avoid
paradoxes
associated
with
infinite
cardinalities.
Inclusiveexclusive
is
a
foundational
tool
for
precise
enumeration
in
the
presence
of
overlap.