对称差
对称差 | |
---|---|
术语名称 | 对称差 |
英语名称 | symmetric difference |
别名 | 对称差 |
对称差(symmetric difference)是对两个集合,包含仅属于其中一个集合(属于第一个集合但不属于第二个集合,或属于第二个集合但不属于第一个集合)的元素的新的集合。 推广到多元是属于其中奇数个。
定义
对称差 | |
---|---|
运算名称 | 对称差 |
运算符号 | [math]\displaystyle{ \triangle }[/math] |
Latex | \triangle
|
运算对象 | 集合 |
运算元数 | 2 |
运算结果 | 集合
|
对集合 [math]\displaystyle{ A }[/math] 、 [math]\displaystyle{ B }[/math] ,由所有属于集合 [math]\displaystyle{ A }[/math] 但不属于集合 [math]\displaystyle{ B }[/math] 的元素,或属于集合 [math]\displaystyle{ B }[/math] 但不属于集合 [math]\displaystyle{ A }[/math] 的元素所构成的集合,叫做集合 [math]\displaystyle{ A }[/math] 与集合 [math]\displaystyle{ B }[/math] 的对称差(symmetric difference),记作 [math]\displaystyle{ A \triangle B }[/math] ,有时也记作 [math]\displaystyle{ A \ominus B }[/math]。即: [math]\displaystyle{ A \triangle B = \left\{ x \mid (x \in A \land x \notin B) \lor (x \in B \land x \notin A) \right\} = \left\{ x \mid (x \in A) \oplus (x \in B) \right\} }[/math]。
∆ | |
---|---|
字符 | ∆ |
Unicode码位 | U+2206 Increment[1]
|
Latex命令序列 | \triangle
|
性质
作为布尔代数的运算,对称差可以定义为:[math]\displaystyle{ A \triangle B = (A \cup B) \cap (A \cap B)^\complement = (A \cap B^\complement) \cup (A^\complement \cap B) }[/math]。
- 对称
- 结合性:对于任意集合 [math]\displaystyle{ A }[/math] 、 [math]\displaystyle{ B }[/math] 和 [math]\displaystyle{ C }[/math],有 [math]\displaystyle{ (A \triangle B) \triangle C = A \triangle (B \triangle C) }[/math]。
- 交换性:对于任意集合 [math]\displaystyle{ A }[/math] 和 [math]\displaystyle{ B }[/math],有 [math]\displaystyle{ A \triangle B = B \triangle A }[/math]。
- 特殊值
- [math]\displaystyle{ A \triangle \varnothing = A }[/math]
- 空集是对称差运算的幺元。
- [math]\displaystyle{ A \triangle U = A^\complement }[/math]
- [math]\displaystyle{ A \triangle A = \varnothing }[/math]
- 任意集合是自身在对称差运算下的逆元。
- [math]\displaystyle{ A \triangle B = \varnothing \Leftrightarrow A = B }[/math]
- [math]\displaystyle{ A \triangle \varnothing = A }[/math]
- 包含关系
- [math]\displaystyle{ A \triangle B \subseteq A \cap B }[/math]
- 和交并补的关系
- 对于任意集合 [math]\displaystyle{ A }[/math] 、 [math]\displaystyle{ B }[/math] 和 [math]\displaystyle{ C }[/math],有 [math]\displaystyle{ A \cap (B \triangle C) = (A \triangle B) \cap (A \triangle C) }[/math]。
- 对于任意集合 [math]\displaystyle{ A }[/math] 和 [math]\displaystyle{ B }[/math],有 [math]\displaystyle{ A \triangle B = A^\complement \triangle B^\complement }[/math]。
多元对称差
对集合 [math]\displaystyle{ A_1, A_2, \dots , A_n }[/math] ,由所有属于奇数个集合的元素所构成的集合,叫做这些集合的对称差(symmetric difference),记作 [math]\displaystyle{ A_1 \triangle A_2 \triangle \dots \triangle A_n }[/math]。即 [math]\displaystyle{ A_1 \triangle A_2 \triangle \dots \triangle A_n = \left\{ x \mid \sum_{i=1}^n \boldsymbol{1}_{A_i}(x) \equiv 1\pmod 2 \right\} }[/math]。
- ↑ 有别名 Laplace Operator 、 Forward Difference 、 Symmetric Difference (in Set Theory)。