当前位置:网站首页>[set theory] inclusion exclusion principle (including examples of exclusion principle)
[set theory] inclusion exclusion principle (including examples of exclusion principle)
2022-07-03 04:09:00 【Programmer community】
List of articles
- One 、 Principle of tolerance and exclusion
- Two 、 Principle of tolerance and exclusion Example
One 、 Principle of tolerance and exclusion
A
1
,
A
2
,
⋯
,
A
n
A_1 , A_2 , \cdots , A_n
A1,A2,⋯,An yes
n
n
n A collection of ; be this
n
n
n A collection of Number of elements in union yes :
∣
⋃
i
=
1
n
A
i
∣
=
∑
i
=
1
n
∣
A
i
∣
−
∑
i
<
j
∣
A
i
∩
A
j
∣
+
∑
i
<
j
<
k
∣
A
i
∩
A
j
∩
A
k
∣
−
⋯
+
(
−
1
)
n
−
1
∣
A
1
∩
A
2
∩
⋯
∩
A
n
∣
| \bigcup_{i=1}^{n} A_i | = \sum_{i = 1}^n | A_i | - \sum_{i < j} | A_i \cap A_j | + \sum_{i < j < k} | A_i \cap A_j \cap A_k | - \cdots + ( -1 )^{n - 1} | A_1 \cap A_2 \cap \cdots \cap An |
∣i=1⋃nAi∣=i=1∑n∣Ai∣−i<j∑∣Ai∩Aj∣+i<j<k∑∣Ai∩Aj∩Ak∣−⋯+(−1)n−1∣A1∩A2∩⋯∩An∣
analysis :
n
n
n After the union operation of sets , Element number , Usually use Principle of tolerance and exclusion Calculate ;
∑
i
=
1
n
∣
A
i
∣
\sum_{i = 1}^n | A_i |
∑i=1n∣Ai∣ : In each set Element number Add up , The value is greater than Total elements , Need to be corrected ; ( Coefficient value
(
−
1
)
0
(-1)^0
(−1)0 )
∑
i
<
j
∣
A
i
∩
A
j
∣
\sum_{i < j} | A_i \cap A_j |
∑i<j∣Ai∩Aj∣ : Subtract the number of intersecting elements , This value is less than Total elements , Continue to make corrections ; ( Coefficient value
(
−
1
)
1
(-1)^1
(−1)1 )
∑
i
<
j
<
k
∣
A
i
∩
A
j
∩
A
k
∣
\sum_{i < j < k} | A_i \cap A_j \cap A_k |
∑i<j<k∣Ai∩Aj∩Ak∣ : Add the number of elements intersected by the three sets , The value is greater than Total elements , Continue to make corrections ; ( Coefficient value
(
−
1
)
2
(-1)^2
(−1)2 )
Subtract the number of elements intersected by the four sets , The value is less than Total elements , Continue to make corrections ; ( Coefficient value
(
−
1
)
3
(-1)^3
(−1)3 )
⋮
\vdots
⋮
(
−
1
)
n
−
1
∣
A
1
∩
A
2
∩
⋯
∩
A
n
∣
( -1 )^{n - 1} | A_1 \cap A_2 \cap \cdots \cap An |
(−1)n−1∣A1∩A2∩⋯∩An∣ : add
(
−
1
)
n
−
1
( -1 )^{n - 1}
(−1)n−1 multiply
n
−
1
n-1
n−1 The number of elements intersected by sets ; ( Coefficient value
(
−
1
)
n
−
1
(-1)^{n-1}
(−1)n−1 )
Above Odd sets Number of intersection elements The former coefficient is Positive numbers , Even number of sets Number of intersection elements The former coefficient is negative ;
Two 、 Principle of tolerance and exclusion Example
1
1
1 ~
10000
10000
10000 Between , It is neither the square of an integer , It's not the cube of an integer , Number of ?
The complete :
E
E
E A set is a complete set , yes
1
1
1 To
10000
10000
10000 The natural number of ,
E
E
E The number of sets
∣
E
∣
=
10000
|E| = 10000
∣E∣=10000
The set of numbers corresponding to square
A
A
A :
A
A
A A set is Some number The square of Corresponding Some number aggregate ,
A
=
{
x
∈
E
∣
x
=
k
2
∧
k
∈
Z
}
A = \{ x \in E | x = k^2 \land k \in Z \}
A={ x∈E∣x=k2∧k∈Z} ,
A
A
A The number of set elements is
∣
100
∣
|100|
∣100∣ ;
10
0
2
=
10000
100^2 = 10000
1002=10000 , therefore
A
A
A The elements of the set are
{
0
,
1
,
2
,
⋯
,
100
}
\{0, 1, 2 , \cdots , 100 \}
{ 0,1,2,⋯,100} , The number of elements is
100
100
100 individual ;
1
2
,
2
2
,
3
3
,
⋯
,
10
0
2
1^2 , 2^2 , 3^3, \cdots ,100^2
12,22,33,⋯,1002 All in
1
1
1 To
10000
10000
10000 Between ,
10
1
2
=
10201
101^2 = 10201
1012=10201 More than
10000
10000
10000 了 ;
The set of numbers corresponding to the cube
B
B
B :
B
B
B A set is Some number The cube of Corresponding Some number aggregate ,
B
=
{
x
∈
E
∣
x
=
k
3
∧
k
∈
Z
}
B = \{ x \in E | x = k^3 \land k \in Z \}
B={ x∈E∣x=k3∧k∈Z} ,
A
A
A The number of set elements is
∣
21
∣
|21|
∣21∣ ;
2
1
3
=
9261
21^3 = 9261
213=9261 , therefore
B
B
B The elements of the set are
{
0
,
1
,
2
,
⋯
,
21
}
\{0, 1, 2 , \cdots , 21 \}
{ 0,1,2,⋯,21} , The number of elements is
21
21
21 individual ;
1
3
,
2
3
,
3
3
,
⋯
,
2
1
3
1^3 , 2^3 , 3^3, \cdots ,21^3
13,23,33,⋯,213 All in
1
1
1 To
10000
10000
10000 Between ,
2
2
2
=
10648
22^2 = 10648
222=10648 More than
10000
10000
10000 了 ;
Calculation
A
∩
B
A \cap B
A∩B Intersection of sets
C
C
C : Element number , Is square , It's cubic again , It must be a number to the power of six ,
C
=
{
x
∈
E
∣
x
=
k
6
∧
k
∈
Z
}
C= \{ x \in E | x = k^6 \land k \in Z \}
C={ x∈E∣x=k6∧k∈Z} ,
C
C
C The number of elements in the set is
4
4
4 ;
4
6
=
4096
4^6 = 4096
46=4096 , therefore
C
C
C The elements of the set are
{
1
,
2
,
3
,
4
}
\{1, 2 , 3, 4\}
{ 1,2,3,4} , The number of elements is
4
4
4 individual ;
1
6
,
2
6
,
3
6
,
4
6
1^6 , 2^6 , 3^6, 4^6
16,26,36,46 All in
1
1
1 To
10000
10000
10000 Between ,
5
6
=
15
,
625
5^6 = 15,625
56=15,625 More than
10000
10000
10000 了 ;
The title can be translated into : aggregate
Z
Z
Z in , Neither belong to
A
A
A aggregate , Have not belong to
B
B
B aggregate The number of ;
aggregate
A
A
A And aggregate
B
B
B Union is
A
∪
B
A \cup B
A∪B
The above union Of Absolute complement
∼
(
A
∪
B
)
\sim ( A \cup B )
∼(A∪B) Element number
∣
∼
(
A
∪
B
)
∣
|\sim ( A \cup B ) |
∣∼(A∪B)∣ , It is the result required in the title ;
∣
∼
(
A
∪
B
)
∣
=
∣
E
∣
−
∣
A
∪
B
∣
|\sim ( A \cup B ) | = |E| - |A \cup B|
∣∼(A∪B)∣=∣E∣−∣A∪B∣
In the above formula ,
∣
E
∣
=
10000
|E| = 10000
∣E∣=10000 ,
∣
A
∪
B
∣
|A \cup B|
∣A∪B∣ Value can be used Principle of tolerance and exclusion Calculate ;
∣
A
∪
B
∣
|A \cup B|
∣A∪B∣ The number of elements of the union of two sets , You can add the number of elements of two sets , Then subtract the number of elements of the intersection of two sets ;
∣
A
∪
B
∣
=
∣
A
∣
+
∣
B
∣
−
∣
A
∪
B
∣
=
100
+
21
−
4
=
117
|A \cup B| = |A| + |B| - |A \cup B| = 100 + 21 - 4 = 117
∣A∪B∣=∣A∣+∣B∣−∣A∪B∣=100+21−4=117
Substitute into the general formula :
∣
∼
(
A
∪
B
)
∣
=
∣
E
∣
−
∣
A
∪
B
∣
=
10000
−
117
=
9883
|\sim ( A \cup B ) | = |E| - |A \cup B| = 10000 - 117 = 9883
∣∼(A∪B)∣=∣E∣−∣A∪B∣=10000−117=9883
边栏推荐
- xrandr修改分辨率与刷新率
- 阿洛对自己的思考
- 2022-07-02: what is the output of the following go language code? A: Compilation error; B:Panic; C:NaN。 package main import “fmt“ func main() { var a =
- mysql字段userid逗号分开保存按userid查询
- In Net 6 project using startup cs
- Social phobia of contemporary young people (III)
- What is the correct way to compare ntext columns with constant values- What's the right way to compare an NTEXT column with a constant value?
- [national programming] [software programming - Lecture Video] [zero foundation introduction to practical application]
- Dynamic programming: Longest palindrome substring and subsequence
- Social phobia of contemporary young people (II)
猜你喜欢
2022 mobile crane driver examination registration and mobile crane driver operation examination question bank
pytorch开源吗?
How to download pytorch? Where can I download pytorch?
【毕业季·进击的技术er】职场人的自白
2022-07-02: what is the output of the following go language code? A: Compilation error; B:Panic; C:NaN。 package main import “fmt“ func main() { var a =
JS realizes the animation effect of text and pictures in the visual area
有监督预训练!文本生成又一探索!
Is pytorch difficult to learn? How to learn pytorch well?
Cnopendata China Customs Statistics
[Apple Photo Album push] IMessage group anchor local push
随机推荐
CVPR 2022 | Dalian Institute of technology proposes a self calibration lighting framework for low light level image enhancement of real scenes
学会pytorch能干什么?
Social phobia of contemporary young people (II)
Arlo's thinking about himself
Read a paper_ ChineseBert
Sklearn data preprocessing
2022 electrician (Advanced) examination papers and electrician (Advanced) examination skills
因果AI,下一代可信AI的产业升级新范式?
MPLS setup experiment
leetcode:297. Serialization and deserialization of binary tree
How to download pytorch? Where can I download pytorch?
2022-07-02: what is the output of the following go language code? A: Compilation error; B:Panic; C:NaN。 package main import “fmt“ func main() { var a =
树莓派如何连接WiFi
[national programming] [software programming - Lecture Video] [zero foundation introduction to practical application]
How to connect WiFi with raspberry pie
Which code editor is easy to use? Code editing software recommendation
Wechat applet + Alibaba IOT platform + Hezhou air724ug built with server version system analysis
JS realizes lazy loading of pictures
Xrandr modify resolution and refresh rate
CVPR 2022 | 大連理工提出自校准照明框架,用於現實場景的微光圖像增强