

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
The principle of inclusion and exclusion, a mathematical concept used to calculate the size of the union of finite sets and intersections between them. The document also includes applications of this principle to find the probability of derangements and surjections in various scenarios. Based on a university lecture in combinatorics (mat 307) and is presented by instructor jacob fox.
Typology: Schemes and Mind Maps
1 / 3
This page cannot be seen from the preview
Don't miss anything!
MAT 307: Combinatorics
Instructor: Jacob Fox
Very often, we need to calculate the number of elements in the union of certain sets. Assuming
that we know the sizes of these sets, and their mutual intersections, the principle of inclusion and
exclusion allows us to do exactly that.
Suppose that you have two sets A, B. The size of the union is certainly at most |A| + |B|. This
way, however, we are counting twice all elements in A ∩ B, the intersection of the two sets. To
correct for this, we subtract |A ∩ B| to obtain the following formula:
In general, the formula gets more complicated because we have to take into account intersections
of multiple sets. The following formula is what we call the principle of inclusion and exclusion.
Lemma 1. For any collection of finite sets A 1 , A 2 ,... , An, we have
∣ ∣ ∣ ∣ ∣
⋃^ n
i=
Ai
∅6=I⊆[n]
|I|+
i∈I
Ai
Writing out the formula more explicitly, we get
|A 1 ∪... An| = |A 1 | +... + |An| − |A 1 ∩ A 2 | −... − |An− 1 ∩ An| + |A 1 ∩ A 2 ∩ A 3 | +...
In other words, we add up the sizes of the sets, subtract intersections of pairs, add intersection of
triples, etc. The proof of this formula is very short and elegant, using the notion of a characteristic
function.
Proof. Assume that A 1 ,... , An ⊆ X. For each set Ai, define the “characteristic function” fi(x)
where fi(x) = 1 if x ∈ Ai and fi(x) = 0 if x /∈ Ai. We consider the following formula:
F (x) =
n ∏
i=
(1 − fi(x)).
Observe that this is the characteristic function of the complement of
⋃n
i=
Ai: it is 1 iff x is not in
any of the sets Ai. Hence,
∑
x∈X
F (x) = |X \
n ⋃
i=
Ai|. (1)
Now we write F (x) differently, by expanding the product into 2
n terms:
F (x) =
n ∏
i=
(1 − fi(x)) =
I⊆[n]
|I|
i∈I
fi(x).
Observe that
i∈I fi(x) is the characteristic function of^
i∈I Ai. Therefore, we get
∑
x∈X
F (x) =
I⊆[n]
|I|
x∈X
i∈I
fi(x) =
I⊆[n]
|I| |
i∈I
Ai|. (2)
By comparing (1) and (2), we see that
n ⋃
i=
Ai| = |X| − |
n ⋃
i=
Ai| =
I⊆[n]
|I| |
i∈I
Ai|.
The first term in the sum here is |
i∈∅ Ai|^ =^ |X|^ by convention (consider how we obtained this
term in the derivation above). Therefore, the lemma follows.
As an application of this principle, consider the following problem. A sequence of n theatergoers
want to pick up their hats on the way out. However, the deranged attendant does not know which
hat belongs to whom and hands them out in a random order. What is the probability that nobody
gets their own hat? More formally, we have a random permutation π : [n] → [n] and we are asking
what is the probability that ∀i; π(i) 6 = i. Such permutations are called derangements.
Theorem 1. The probability that a random permutation π : [n] → [n] is a derangement is ∑n
k=0(−1)
k /k!, which tends to 1 /e = 0. 3678... as n → ∞.
Proof. Let X be the set of all n! permutations, and let Ai denote the set of permutations that fix
element i, i.e.
Ai = {π ∈ X | π(i) = i}.
By simple counting, there are (n − 1)! permutations in Ai, since by fixing i, we still have n − 1
elements to permute. Similarly,
i∈I Ai^ consists of the permutations where all elements of^ I^ are
fixed, hence the number of such permutations is (n − |I|)!. By inclusion-exclusion, the number of
permutations with some fixed point is
∣ ∣ ∣ ∣ ∣
i∈I
Ai
∅6=I⊆[n]
|I|+
i∈I
Ai
∑^ n
k=
k+
n
k
(n − k)!
∑^ n
k=
k+1 n!
k!
Hence, the probability that a random permutation has some fixed point is
n k=1(−1)
k+ /k!. By
taking the complement, the probability that there is no fixed point is 1 −
∑n
k=1(−1)
k+ /k! = ∑n
k=0(−1)
k /k!. In the limit, this tends to the Taylor expansion of e
k=0(−1)
k /k!.