3-4. 排容原理

Principle of Inclusion and Exclusion (PIE)

U U : universal set, a1 a_1 , a2 a_2 , ..., an a_n : 性質, Ai A_i = { xU x \in U | x x 滿足 ai a_i }, N N (ai a_i ) = Ai |A_i| , N N (ai¯ \bar{a_i} ) = Ai¯ |\bar{A_i}|
N \Rightarrow N (ai¯aj¯ \bar{a_i} \bar{a_j} ) = Ai¯Aj¯ |\bar{A_i} \cap \bar{A_j}| = U |U| - [N N (ai a_i ) + N N (aj a_j )] + N N (aiaj a_i \cap a_j )
N \Rightarrow N (ai¯aj¯ak¯ \bar{a_i} \bar{a_j} \bar{a_k} ) = Ai¯Aj¯Ak¯ |\bar{A_i} \cap \bar{A_j} \cap \bar{A_k}| = U |U| - [N N (ai a_i ) + N N (aj a_j ) + N N (ak a_k )] + [N N (aiaj a_i \cap a_j ) + N N (aiak a_i \cap a_k ) + N N (ajak a_j \cap a_k )] - N N (aiajak a_i a_j a_k )
\Rightarrow \quad \vdots
N \Rightarrow N (a1¯a2¯ \bar{a_1} \bar{a_2} ... ak¯ \bar{a_k} ) = U \color{red}{|U|} - i=1nN(ai) \color{orange}{\displaystyle\sum_{i=1}^n N(a_i)} + 1i<jnN(aiaj) \color{green}{\displaystyle\sum_{1 \le i < j \le n} N(a_i a_j)} - 1i<j<knN(aiajak) \color{blue}{\displaystyle\sum_{1 \le i < j < k \le n} N(a_i a_j a_k)} + ... + (1)nN(a1a2...an) \color{purple}{(-1)^n N(a_1 a_2 ... a_n)}
= S0 \color{red}{S_0} - S1 \color{orange}{S_1} + S2 \color{green}{S_2} - S3 \color{blue}{S_3} + ... + (1)nSn \color{purple}{(-1)^n S_n} , 其中 Sr S_r (nr) \dbinom{n}{r} 項之和

排容原理文氏圖,只看 U U 當下性質

Euler's Totient Function

nZ+ n \in Z^+ , n n = P1e1P2e2...Pkek P^{e_1}_1 P^{e_2}_2 ... P^{e_k}_k n n 質因數分解,則 ϕ \phi (n n ) = n n (1 1 - 1P1 \dfrac{1}{P_1} )(1 1 - 1P2 \dfrac{1}{P_2} )...(1 1 - 1Pk \dfrac{1}{P_k} )

proof: k k = 3 3

U U = { 1 1 , 2 2 , ..., n n }, 令 ai a_i Pi P_i 之倍數, i i = 1 1 , 2 2 , 3 3 , ϕ \phi (n n ) = N N (a1¯a2¯a3¯ \bar{a_1} \bar{a_2} \bar{a_3} ) = S0 S_0 - S1 S_1 + S2 S_2 - S3 S_3
= n n - [nP1 \dfrac{n}{P_1} + nP2 \dfrac{n}{P_2} + nP3 \dfrac{n}{P_3} ] + [nP1P2 \dfrac{n}{P_1 P_2} + nP1P3 \dfrac{n}{P_1 P_3} + nP2P3 \dfrac{n}{P_2 P_3} ] - nP1P2P3 \dfrac{n}{P_1 P_2 P_3}
= n n [1 1 - (1P1 \dfrac{1}{P_1} + 1P2 \dfrac{1}{P_2} + 1P3 \dfrac{1}{P_3} ) + (1P1P2 \dfrac{1}{P_1 P_2} + 1P1P3 \dfrac{1}{P_1 P_3} + 1P2P3 \dfrac{1}{P_2 P_3} ) - 1P1P2P3 \dfrac{1}{P_1 P_2 P_3} ]
= nP1P2P3 \dfrac{n}{P_1 P_2 P_3} [P1P2P3 P_1 P_2 P_3 - (P1P2 P_1 P_2 + P1P3 P_1 P_3 + P2P3 P_2 P_3 ) + (P1 P_1 + P2 P_2 + P3 P_3 ) - 1 1 ]
= nP1P2P3 \dfrac{n}{P_1 P_2 P_3} (P1 P_1 - 1 1 )(P2 P_2 - 1 1 )(P3 P_3 - 1 1 ) = n n (P11P1 \dfrac{P_1 - 1}{P_1} )(P21P2 \dfrac{P_2 - 1}{P_2} )(P31P3 \dfrac{P_3 - 1}{P_3} ) = n n (1 1 - 1P1 \dfrac{1}{P_1} )(1 1 - 1P2 \dfrac{1}{P_2} )(1 1 - 1P3 \dfrac{1}{P_3} )

Theorem of Onto Function Amount

A A , B B : sets, A |A| = m, B |B| = n, mn m \ge n , 則 f f : AB A \rightarrow B onto 個數: onto onto (m m , n n ) = i=0n \displaystyle\sum_{i=0}^n (1 -1 )i(ni) ^i \dbinom{n}{i} (n n - i i )m ^m

m m 個相異球放入 n n 相異箱子,不允許空箱之方法數

proof:

U U = { f f | f f : AB A \rightarrow B } U \Rightarrow |U| = nm n^m , 令 ai a_i 表示 U U 中函數滿足值域不含 bi b_i 之條件(i i 個箱子為空), i i = 1 1 , ..., n n
onto \Rightarrow onto (m m , n n ) = N N (a1¯a2¯ \bar{a_1} \bar{a_2} ... an¯ \bar{a_n} ) = S0 S_0 - S1 S_1 + S2 S_2 - S3 S_3 + ... + (1 -1 )nSn ^n S_n
= (n0)nm {\color{red}{\dbinom{n}{0}}} n^m - (n1) \dbinom{n}{1} (n n - 1 1 )m ^m + (n2) \dbinom{n}{2} (n n - 2 2 )m ^m - (n3) \dbinom{n}{3} (n n - 3 3 )m ^m + ... + (1 -1 )n(nn) ^n \dbinom{n}{n} (n n - n n )m ^m
= i=0n \displaystyle\sum_{i=0}^n (1 -1 )i(ni) ^i \dbinom{n}{i} (n n - i i )m ^m

(1 -1 )n(nn) ^n \dbinom{n}{n} (n n - n n )m ^m = 0 0

Stirling Number of The Second Kind

m m , nZ n \in Z , m>n>1 m \gt n \gt 1
S S (m m , n n ) = onto(m,n)n! \dfrac{onto(m, n)}{n!} = i=0n(1)i(ni)(ni)mn! \dfrac{\displaystyle\sum_{i=0}^n (-1)^i \dbinom{n}{i} (n - i)^m}{n!}
稱為第二種 Stirling 數(Stirling number of the second kind)

  • m m < n n 時,S S (m m , n n ) = 0 0

m m 個相異球放入 n n 相同箱子,不允許空箱之方法數

m \rightarrow m 個相異球放入 n n 相同箱子,允許空箱之方法數?

S S (m m , n n ) + S S (m m , n n - 1 1 ) + ... + S S (m m , 1 1 )

  • S S (m m , n n ): 0 0 個空箱
  • S S (m m , n n - 1 1 ): 1 1 個空箱
    ...
  • S S (m m , 1 1 ): n n - 1 1 個空箱

Theorem of S(m, n)

m m , nN n \in N , m>n>2 m \gt n \gt 2 , S S (m m + 1 1 , n n ) = S S (m m , n n - 1 1 ) + nS n S (m m , n n )

proof:

S S (m m + 1 1 , n n ): m m + 1 1 相異物分成恰 n n 箱,固定一物 A A

  1. A A 所在的箱子只有 A A : S S (m m , n n - 1 1 )
  2. A A 所在的箱子不只有 A A : nS n S (m m , n n ) \rightarrow 先放A A 之外的 m m 個相異物入 n n ,再從其中任一箱放入 A A

Table of S(m, n)

nm \dfrac{n \rightarrow}{m \downarrow} 1 2 3 4 5 6
1 1
2 1 1
3 1 3 1
4 1 7 6 1
5 1 15 25 10 1
6 1 31 90 65 15 1

Example Example :
\quad onto onto (6 6 , 3 3 ) + onto onto (6 6 , 3 3 ) = ?
solution solution :
\quad 90 90 (3! 3! ) + 65 65 (4! 4! )

Copyright© saberLiou all rights reserved.            last updated at 2019-10-07 17:41:34

results matching ""

    No results matching ""