Freeks/12.book(保存済みの内容) … 編集へ / ファイル一覧へ

ページ 2 / 2 … 1 2 … ← 前のページ


3 #96 Inclusion–exclusion principle forget

We compute the size of a union of finite sets from the sizes of the intersections (inclusion–exclusion principle), first for two sets, then for \(n\) sets.

3.1 Two sets

\(|A \cup B| + |A \cap B| = |A| + |B|\), or in integers, \(|A \cup B| = |A| + |B| - |A \cap B|\). \(B \setminus A\) is finite; \(A \cup B\) splits disjointly into \(A\) and \(B \setminus A\), and \(B\) into \(A \cap B\) and \(B \setminus A\).
\(\operatorname{\#} A , \operatorname{\#} B , \operatorname{\#} ( A \cap B ) \in \mathbb{M} \Longrightarrow \operatorname{\#} ( A \cup B ) \in \mathbb{M} , \operatorname{\#} ( A \cup B ) + \operatorname{\#} ( A \cap B ) = \operatorname{\#} A + \operatorname{\#} B , \operatorname{\#} ( A \cup B ) = ( \operatorname{\#} A + \operatorname{\#} B ) - \operatorname{\#} ( A \cap B )\) \(\blacktriangleleft\) L∪# ,L⊂# ,\(\mathbb{W}.\) ,Axℤ
Preparation for inclusion–exclusion: give the sets \(A_1, \ldots, A_n\) by \(\langle i, x \rangle \in A\) (\(x \in A_i\)). By toggling, for an element \(x\), the smallest index \(j\) containing it in the index set \(I\) (inserting or removing it), we obtain a bijection between the subsets of the indices containing \(x\), as pairs \((I, x)\), with even size and those with odd size.

3.2 Parity and toggling one index

Adding 1 swaps the parity.
Removing one element decreases the size by 1.
Toggling the index \(j\): \(I'\) is what you get from \(I\) when \(j\) is removed if present and inserted if absent.
Toggling one index swaps the parity of the size (Lt3).
The smallest index containing \(x\) (M1) is unique (M2).

3.3 Correspondence between even and odd sizes

For an index set \(I\) and an element \(x\), the pair \((I, x)\) is assigned, by toggling the smallest index containing \(x\), namely \(j\), in \(I\), the pair \((I', x)\) (this correspondence is a function).
From tuples with an even number of indices to those with an odd number (and conversely): the correspondence stays inside \(T\) and swaps the parity of the size.
Toggling is symmetric (toggling \(I'\) at \(j\) returns \(I\)).
This correspondence is a bijection between tuples with an even number of indices and those with an odd number.
Inclusion–exclusion: there are equally many tuples with an even number of indices and with an odd number (the bijection above). Since the tuples of size 0 are equinumerous with \(U\), \(u + (\text{positive even tuples}) = (\text{odd tuples})\). Finiteness follows from the number of subsets being \(2^n\) (the same proof as in Freek2 #52).

3.4 Finiteness

The set of all pairs \((I, x)\), call it \(T\), is a subset of \(\wp(\{1..n\}) \times U\), a finite set of at most \(2^n \cdot u\) elements.
Tfin … \(n \in \mathbb{M} , T = \{ p \mid \exists I , x \, p = \langle I , x \rangle , I \subset 1 \mathinner{\ldotp\ldotp} n , x \in U , \forall i \in I . \langle i , x \rangle \in A \} , \operatorname{\#} U \in \mathbb{M} \Longrightarrow \operatorname{\#} T \in \mathbb{M}\) \(\blacktriangleleft\) ax_s ,L℘# ,Lprod ,L⊂# ,↑s𝕄 ,↑0X ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ

3.5 Tuples of size 0

There are as many tuples \((\emptyset, x)\) with 0 indices as there are elements of \(U\).
K1 … \(T = \{ p \mid \exists I , x \, p = \langle I , x \rangle , I \subset 1 \mathinner{\ldotp\ldotp} n , x \in U , \forall i \in I . \langle i , x \rangle \in A \} , P = \{ p \in T \mid \operatorname{\#} ( \triangleleft p ) = 0 \} \Longrightarrow P \stackrel{\#}= U\) \(\blacktriangleleft\) ax_s ,#0 ,◁. ,pr:0 ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ

3.6 Inclusion–exclusion (relation of sizes)

Let \(E\) be the set of all tuples of even size; removing the tuples of size 0 (equinumerous with \(U\)) leaves \(E_+\).
Hz … \(T = \{ p \mid \exists I , x \, p = \langle I , x \rangle , I \subset 1 \mathinner{\ldotp\ldotp} n , x \in U , \forall i \in I . \langle i , x \rangle \in A \} , E = \{ p \in T \mid \exists k \in \mathbb{M} . k \in 2 \cdot \mathbb{M} , \operatorname{\#} ( \triangleleft p ) = k \} , Y = \{ p \in T \mid \exists k \in \mathbb{M} . k \in 2 \cdot \mathbb{M} , k \neq 0 , \operatorname{\#} ( \triangleleft p ) = k \} , \forall p ( p \in T \Longrightarrow \operatorname{\#} ( \triangleleft p ) \in \mathbb{M} ) \Longrightarrow \forall p ( p \in E \mathop\setminus Y \Longleftrightarrow p \in T , \operatorname{\#} ( \triangleleft p ) = 0 )\) \(\blacktriangleleft\) ⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ
Auxiliary facts: the number of indices of a tuple in \(T\) is a natural number. \(E, E_+\) are subsets of \(T\). If \(E_+ \subset E\) then \(E = (E \setminus E_+) \cup E_+\) (disjoint).
Hc … \(n \in \mathbb{M} , T = \{ p \mid \exists I , x \, p = \langle I , x \rangle , I \subset 1 \mathinner{\ldotp\ldotp} n , x \in U , \forall i \in I . \langle i , x \rangle \in A \} , p \in T \Longrightarrow \operatorname{\#} ( \triangleleft p ) \in \mathbb{M}\) \(\blacktriangleleft\) L⊂# ,◁. ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ
Hs … \(E = \{ p \in T \mid \exists k \in \mathbb{M} . k \in 2 \cdot \mathbb{M} , \operatorname{\#} ( \triangleleft p ) = k \} , Y = \{ p \in T \mid \exists k \in \mathbb{M} . k \in 2 \cdot \mathbb{M} , k \neq 0 , \operatorname{\#} ( \triangleleft p ) = k \} \Longrightarrow Y \subset E\) \(\blacktriangleleft\) \(\mathbb{W}.\)
Hd … \(Y \subset E \Longrightarrow ( E \mathop\setminus Y ) \cup Y = E , ( E \mathop\setminus Y ) \cap Y = \emptyset\) \(\blacktriangleleft\) \(\mathbb{W}.\)

3.7 Inclusion–exclusion principle

Give \(n\) sets \(A_1, \ldots, A_n\) by \(\langle i, x \rangle \in A\) (\(x \in A_i\)), and let \(U = A_1 \cup \cdots \cup A_n\) have \(u\) elements. \(T\) is the set of all tuples \((I, x)\) (\(I \subset \{1, \ldots, n\}\), \(x \in U\), and when \(i \in I\), \(x \in A_i\); \(I = \emptyset\) is included). \(E\) is the set of tuples with \(|I|\) even, \(E_+\) those with \(|I|\) a positive even number, and \(O\) those with \(|I|\) odd.
Then \(u + |E_+| = |O|\) (there are as many tuples of size 0 as elements of \(U\)). Writing \(|E_+| = \sum_{k \text{ positive even}} e(k)\) and \(|O| = \sum_{k \text{ odd}} o(k)\), we get the inclusion–exclusion principle \(u = |O| - |E_+|\). We prove both the subtraction-free form and the integer-subtraction form.
\(n \in \mathbb{M} , U = \{ x \mid \exists i \in 1 \mathinner{\ldotp\ldotp} n . \langle i , x \rangle \in A \} , T = \{ p \mid \exists I , x \, p = \langle I , x \rangle , I \subset 1 \mathinner{\ldotp\ldotp} n , x \in U , \forall i \in I . \langle i , x \rangle \in A \} , \operatorname{\#} U = u , u \in \mathbb{M} , E = \{ p \in T \mid \exists k \in \mathbb{M} . k \in 2 \cdot \mathbb{M} , \operatorname{\#} ( \triangleleft p ) = k \} , Y = \{ p \in T \mid \exists k \in \mathbb{M} . k \in 2 \cdot \mathbb{M} , k \neq 0 , \operatorname{\#} ( \triangleleft p ) = k \} , O = \{ p \in T \mid \exists k \in \mathbb{M} . k \in 2 \cdot \mathbb{M} + 1 , \operatorname{\#} ( \triangleleft p ) = k \} \Longrightarrow u + \operatorname{\#} Y = \operatorname{\#} O , u = \operatorname{\#} O - \operatorname{\#} Y\) \(\blacktriangleleft\) Tfin ,K1 ,Hz ,Hc ,Hs ,Hd ,BIJ ,L∪# ,L⊂# ,L#= ,ax_s ,↑s𝕄 ,↑0X ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ

ページ 2 / 2 … ← 前のページ


イベント 32 件