Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Inclusion-Exclusion Principle: Set Unions and Probability of Derangements, Schemes and Mind Maps of Combinatorics

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

2021/2022

Uploaded on 09/27/2022

ananya
ananya 🇺🇸

4.4

(17)

251 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
MAT 307: Combinatorics
Lecture 4: Principle of inclusion and exclusion
Instructor: Jacob Fox
1 Principle of inclusion and exclusion
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 AB, the intersection of the two sets. To
correct for this, we subtract |AB|to obtain the following formula:
|AB|=|A|+|B|−|AB|.
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 A1, A2, . . . , An, we have
¯
¯
¯
¯
¯
n
[
i=1
Ai¯
¯
¯
¯
¯
=X
∅6=I[n]
(1)|I|+1 ¯
¯
¯
¯
¯\
iI
Ai¯
¯
¯
¯
¯
.
Writing out the formula more explicitly, we get
|A1. . . An|=|A1|+. . . +|An|−|A1A2| ... |An1An|+|A1A2A3|+. . .
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 A1, . . . , AnX. For each set Ai, define the “characteristic function” fi(x)
where fi(x) = 1 if xAiand fi(x) = 0 if x /Ai. We consider the following formula:
F(x) =
n
Y
i=1
(1 fi(x)).
Observe that this is the characteristic function of the complement of Sn
i=1 Ai: it is 1 iff xis not in
any of the sets Ai. Hence,
X
xX
F(x) = |X\
n
[
i=1
Ai|.(1)
Now we write F(x) differently, by expanding the product into 2nterms:
F(x) =
n
Y
i=1
(1 fi(x)) = X
I[n]
(1)|I|Y
iI
fi(x).
1
pf3

Partial preview of the text

Download Inclusion-Exclusion Principle: Set Unions and Probability of Derangements and more Schemes and Mind Maps Combinatorics in PDF only on Docsity!

MAT 307: Combinatorics

Lecture 4: Principle of inclusion and exclusion

Instructor: Jacob Fox

1 Principle of inclusion and exclusion

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:

|A ∪ B| = |A| + |B| − |A ∩ B|.

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

|X \

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.

2 The number of derangements

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

− 1

k=0(−1)

k /k!.